PMRoutineBase.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. using System.Diagnostics;
  2. using Venus_RT.Devices;
  3. using System;
  4. using Venus_Core;
  5. using Aitex.Core.RT.Routine;
  6. namespace Venus_RT.Modules.PMs
  7. {
  8. class PMRoutineBase : ModuleRoutineBase
  9. {
  10. protected readonly JetPMBase _chamber;
  11. public PMRoutineBase(JetPMBase chamber) : base(chamber.Module)
  12. {
  13. _chamber = chamber;
  14. }
  15. public bool CheckLid()
  16. {
  17. if (!_chamber.IsLidClosed)
  18. {
  19. this.Stop("Chamber 盖子必须关");
  20. return false;
  21. }
  22. return true;
  23. }
  24. public bool CheckLidLoadLock()
  25. {
  26. if (_chamber.ChamberType == JetChamber.VenusSE || _chamber.ChamberType == JetChamber.VenusDE)
  27. return true;
  28. if (!_chamber.IsLidLoadlockClosed)
  29. {
  30. this.Stop("LoadLock 盖子必须关");
  31. return false;
  32. }
  33. return true;
  34. }
  35. protected bool CheckSlitDoor()
  36. {
  37. if (!_chamber.IsSlitDoorClosed)
  38. {
  39. Stop("传送门必须关");
  40. return false;
  41. }
  42. return true;
  43. }
  44. protected bool CheckDryPump()
  45. {
  46. if (!_chamber.IsPumpRunning)
  47. {
  48. Stop("干泵没有启动");
  49. return false;
  50. }
  51. if (_chamber.HasPumpError)
  52. {
  53. Stop("干泵状态有错误");
  54. return false;
  55. }
  56. return true;
  57. }
  58. protected bool CheckTurboPump()
  59. {
  60. if (!_chamber.IsTurboPumpRunning)
  61. {
  62. Stop("分子泵没有启动");
  63. return false;
  64. }
  65. if (_chamber.HasTurboPumpError)
  66. {
  67. Stop("分子泵状态有错误");
  68. return false;
  69. }
  70. return true;
  71. }
  72. protected bool CheckCDA()
  73. {
  74. if (!_chamber.IsCDA_OK)
  75. {
  76. Stop("CDA 压力信号不正确");
  77. return false;
  78. }
  79. return true;
  80. }
  81. public bool CheckATM()
  82. {
  83. if (_chamber.IsATM)
  84. {
  85. this.Stop("Chamber 是ATM状态");
  86. return false;
  87. }
  88. return true;
  89. }
  90. protected bool CloseAllValves(int? delayTime = null)
  91. {
  92. Notify("关闭所有的阀门");
  93. _chamber.CloseValves(delayTime);
  94. return true;
  95. }
  96. protected bool TurnValve(ValveType vlv, bool bOpen)
  97. {
  98. _chamber.OpenValve(vlv, bOpen);
  99. Notify($"{(bOpen ? "打开" : "关闭")} {vlv} 阀");
  100. return true;
  101. }
  102. protected bool CheckValve(ValveType vlv, bool bOpen)
  103. {
  104. if (vlv == ValveType.FastPump)
  105. return _chamber.IsFastPumpOpened == bOpen;
  106. else if (vlv == ValveType.SoftPump)
  107. return _chamber.IsSoftPumpOpened == bOpen;
  108. return true;
  109. }
  110. protected bool SetCoolantTemp(double target, double offset)
  111. {
  112. if (!_chamber.CheckChillerStatus())
  113. {
  114. Stop("Chiller status error");
  115. return false;
  116. }
  117. if (_chamber.CoolantOutletTempFB > target)
  118. {
  119. Notify($"水冷当前温度{_chamber.CoolantOutletTempFB} ℃, 大于目标 {target.ToString()} ℃");
  120. }
  121. _chamber.HeatChiller(ChillerType.Chiller,target, offset);
  122. Notify($"检查水冷温度值,当前温度{_chamber.CoolantOutletTempFB} ℃, 目标 {target.ToString()} ℃");
  123. return true;
  124. }
  125. protected bool CheckCoolantTemp(double target, double tolerance)
  126. {
  127. return Math.Abs(_chamber.CoolantOutletTempFB - target) <= tolerance;
  128. }
  129. }
  130. }