PMRoutineBase.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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.IsLidLoadlockClosed)
  27. {
  28. this.Stop("LoadLock 盖子必须关");
  29. return false;
  30. }
  31. return true;
  32. }
  33. protected bool CheckSlitDoor()
  34. {
  35. if (!_chamber.IsSlitDoorClosed)
  36. {
  37. Stop("传送门必须关");
  38. return false;
  39. }
  40. return true;
  41. }
  42. protected bool CheckDryPump()
  43. {
  44. if (!_chamber.IsPumpRunning)
  45. {
  46. Stop("干泵没有启动");
  47. return false;
  48. }
  49. if (_chamber.HasPumpError)
  50. {
  51. Stop("干泵状态有错误");
  52. return false;
  53. }
  54. return true;
  55. }
  56. protected bool CheckTurboPump()
  57. {
  58. if (!_chamber.IsTurboPumpRunning)
  59. {
  60. Stop("分子泵没有启动");
  61. return false;
  62. }
  63. if (_chamber.HasTurboPumpError)
  64. {
  65. Stop("分子泵状态有错误");
  66. return false;
  67. }
  68. return true;
  69. }
  70. protected bool CheckCDA()
  71. {
  72. if (!_chamber.IsCDA_OK)
  73. {
  74. Stop("CDA 压力信号不正确");
  75. return false;
  76. }
  77. return true;
  78. }
  79. public bool CheckATM()
  80. {
  81. if (_chamber.IsATM)
  82. {
  83. this.Stop("Chamber 是ATM状态");
  84. return false;
  85. }
  86. return true;
  87. }
  88. protected bool CloseAllValves()
  89. {
  90. Notify("关闭所有的阀门");
  91. _chamber.CloseValves();
  92. return true;
  93. }
  94. protected bool TurnValve(ValveType vlv, bool bOpen)
  95. {
  96. _chamber.OpenValve(vlv, bOpen);
  97. Notify($"{(bOpen ? "打开" : "关闭")} {vlv} 阀");
  98. return true;
  99. }
  100. protected bool CheckValve(ValveType vlv, bool bOpen)
  101. {
  102. if (vlv == ValveType.FastPump)
  103. return _chamber.IsFastPumpOpened == bOpen;
  104. else if (vlv == ValveType.SoftPump)
  105. return _chamber.IsSoftPumpOpened == bOpen;
  106. return true;
  107. }
  108. protected bool SetCoolantTemp(double target, double offset)
  109. {
  110. if (!_chamber.CheckChillerStatus())
  111. {
  112. Stop("Chiller status error");
  113. return false;
  114. }
  115. if (_chamber.CoolantOutletTempFB > target)
  116. {
  117. Notify($"水冷当前温度{_chamber.CoolantOutletTempFB} ℃, 大于目标 {target.ToString()} ℃");
  118. }
  119. _chamber.HeatChiller(ChillerType.Chiller,target, offset);
  120. Notify($"检查水冷温度值,当前温度{_chamber.CoolantOutletTempFB} ℃, 目标 {target.ToString()} ℃");
  121. return true;
  122. }
  123. protected bool CheckCoolantTemp(double target, double tolerance)
  124. {
  125. return Math.Abs(_chamber.CoolantOutletTempFB - target) <= tolerance;
  126. }
  127. }
  128. }