Vent.cs 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. //using Aitex.Core.RT.Routine;
  2. //using Aitex.Core.RT.SCCore;
  3. //using Venus_RT.Devices;
  4. //using MECF.Framework.Common.Equipment;
  5. //using Venus_Core;
  6. //using System.Runtime.InteropServices.WindowsRuntime;
  7. //namespace Venus_RT.Modules.TM
  8. //{
  9. // class MFVentRoutine : ModuleRoutineBase, IRoutine
  10. // {
  11. // private enum VentStep
  12. // {
  13. // Venting,
  14. // OpenSoftVent,
  15. // SwitchFastVent,
  16. // PrepareOverVent,
  17. // CloseVentValves,
  18. // Delay,
  19. // CloseExhaustValve,
  20. // PrepareCooling,
  21. // StartCooling,
  22. // Cooling,
  23. // End,
  24. // }
  25. // private int _ventingTimeout;
  26. // private int _SoftVentEndPressure;
  27. // private readonly JetTM _JetTM;
  28. // private int _ventTimeDelay = 1;
  29. // private bool _needCooling = false;
  30. // private double _coolingMFCFlow = 0;
  31. // private bool _skipRepeatVent = false;
  32. // private int _exhaustValveWaitDelayTime;
  33. // private int _overVentFlow;
  34. // public MFVentRoutine(JetTM jetTM, ModuleName mod) : base(mod)
  35. // {
  36. // _JetTM = jetTM;
  37. // Name = "Vent ";
  38. // }
  39. // public RState Start(params object[] objs)
  40. // {
  41. // bool isLoadLock = (ModuleHelper.IsLoadLock(Module));
  42. // if (objs.Length > 0 && isLoadLock)
  43. // {
  44. // _needCooling = (bool)objs[0];
  45. // _coolingMFCFlow = SC.GetValue<double>($"{Module}.Cooling.MFCFlow");
  46. // }
  47. // _skipRepeatVent = false;
  48. // if (isLoadLock && !_needCooling && IsPressureReady())
  49. // _skipRepeatVent = true; ;
  50. // _JetTM.TurnSoftPumpValve(Module, false);
  51. // _JetTM.TurnFastPumpValve(Module, false);
  52. // _JetTM.TurnPurgeValve(Module, false);
  53. // if (_JetTM.CheckLidClosed(Module) &&
  54. // _JetTM.CheckPumpValveClosed(Module) &&
  55. // _JetTM.CheckPurgeValveClosed(Module))
  56. // {
  57. // Reset();
  58. // _ventingTimeout = SC.GetValue<int>($"{Module}.VentingTimeout") * 1000;
  59. // _SoftVentEndPressure = SC.GetValue<int>($"{Module}.SoftVentEndPressure");
  60. // _ventTimeDelay = SC.GetValue<int>($"{Module}.OverVentTime");
  61. // _exhaustValveWaitDelayTime = SC.GetValue<int>($"{Module}.ExhaustValveOffDelayTime");
  62. // _overVentFlow = SC.GetValue<int>($"{Module}.OverVentFlow");
  63. // return Runner.Start(Module, Name);
  64. // }
  65. // return RState.Failed;
  66. // }
  67. // public RState Monitor()
  68. // {
  69. // if (_skipRepeatVent)
  70. // {
  71. // Notify($" pressure: {_JetTM.GetModulePressure(Module)} is ready, skip the the venting routine.");
  72. // CloseVentValve();
  73. // CloseExhaustValve();
  74. // return RState.End;
  75. // }
  76. // if (_needCooling)
  77. // {
  78. // Runner.Run(VentStep.OpenSoftVent, OpenSoftVentValve, IsSoftVentEnd)
  79. // .Run(VentStep.SwitchFastVent, SwitchFastVentValve, IsPressureReady, _ventingTimeout)
  80. // .Delay(VentStep.Delay, _ventTimeDelay)
  81. // .Run(VentStep.CloseVentValves, CloseVentValve, _delay_1s)
  82. // .RunIf(VentStep.PrepareCooling, _needCooling, StopVent)
  83. // .RunIf(VentStep.StartCooling, _needCooling, StartCooling, 3600000)
  84. // .End(VentStep.CloseExhaustValve, CloseExhaustValve);
  85. // }
  86. // else
  87. // {
  88. // Runner.Run(VentStep.OpenSoftVent, OpenSoftVentValve, IsSoftVentEnd)
  89. // .Run(VentStep.SwitchFastVent, SwitchFastVentValve, IsPressureReady, _ventingTimeout)
  90. // .Run(VentStep.PrepareOverVent, PrepareOverVent)
  91. // .Delay(VentStep.Delay, _ventTimeDelay)
  92. // .Run(VentStep.CloseExhaustValve, CloseExhaustValve, _exhaustValveWaitDelayTime)
  93. // .End(VentStep.CloseVentValves, CloseVentValve);
  94. // }
  95. // return Runner.Status;
  96. // }
  97. // private bool OpenSoftVentValve()
  98. // {
  99. // _JetTM.TurnN2Valve(true);
  100. // _JetTM.TurnPurgeValve(Module, true);
  101. // switch (Module)
  102. // {
  103. // case ModuleName.LLA:
  104. // _JetTM.SetLLAFlow(2000);
  105. // break;
  106. // case ModuleName.LLB:
  107. // _JetTM.SetLLBFlow(2000);
  108. // break;
  109. // case ModuleName.TM:
  110. // _JetTM.SetTMFlow(100);
  111. // break;
  112. // }
  113. // return true;
  114. // }
  115. // private bool PrepareOverVent()
  116. // {
  117. // _JetTM.TurnVentValve(Module, false);
  118. // _JetTM.TurnN2Valve(true);
  119. // _JetTM.TurnPurgeValve(Module, true);
  120. // switch (Module)
  121. // {
  122. // case ModuleName.LLA:
  123. // _JetTM.SetLLAFlow(_overVentFlow);
  124. // break;
  125. // case ModuleName.LLB:
  126. // _JetTM.SetLLBFlow(_overVentFlow);
  127. // break;
  128. // case ModuleName.TM:
  129. // _JetTM.SetTMFlow(100);
  130. // break;
  131. // }
  132. // _JetTM.TurnExhaustValve(Module, true);
  133. // return true;
  134. // }
  135. // private bool CloseExhaustValve()
  136. // {
  137. // _JetTM.TurnExhaustValve(Module, false);
  138. // return true;
  139. // }
  140. // private bool IsSoftVentEnd()
  141. // {
  142. // return _JetTM.GetModulePressure(Module) > _SoftVentEndPressure;
  143. // }
  144. // private bool SwitchFastVentValve()
  145. // {
  146. // switch (Module)
  147. // {
  148. // case ModuleName.LLA:
  149. // _JetTM.SetLLAFlow(0);
  150. // break;
  151. // case ModuleName.LLB:
  152. // _JetTM.SetLLBFlow(0);
  153. // break;
  154. // case ModuleName.TM:
  155. // _JetTM.SetTMFlow(0);
  156. // break;
  157. // }
  158. // _JetTM.TurnPurgeValve(Module, false);
  159. // //_JetTM.TurnExhaustValve(Module, true);
  160. // _JetTM.TurnVentValve(Module, true);
  161. // return true;
  162. // }
  163. // private bool CloseVentValve()
  164. // {
  165. // switch (Module)
  166. // {
  167. // case ModuleName.LLA:
  168. // _JetTM.SetLLAFlow(0);
  169. // break;
  170. // case ModuleName.LLB:
  171. // _JetTM.SetLLBFlow(0);
  172. // break;
  173. // case ModuleName.TM:
  174. // _JetTM.SetTMFlow(0);
  175. // break;
  176. // }
  177. // _JetTM.TurnPurgeValve(Module, false);
  178. // //_JetTM.TurnExhaustValve(Module, false);
  179. // _JetTM.TurnVentValve(Module, false);
  180. // return true;
  181. // }
  182. // private bool StopVent()
  183. // {
  184. // _JetTM.TurnVentValve(Module, false);
  185. // _JetTM.TurnExhaustValve(Module, false);
  186. // return true;
  187. // }
  188. // private bool StartCooling()
  189. // {
  190. // _JetTM.TurnPurgeValve(Module, true);
  191. // _JetTM.TurnExhaustValve(Module, true);
  192. // if (Module == ModuleName.LLA)
  193. // {
  194. // _JetTM.SetLLAFlow(_coolingMFCFlow);
  195. // }
  196. // else if (Module == ModuleName.LLB)
  197. // {
  198. // _JetTM.SetLLBFlow(_coolingMFCFlow);
  199. // }
  200. // return true;
  201. // }
  202. // private bool IsPressureReady()
  203. // {
  204. // return _JetTM.IsModuleATM(Module);
  205. // }
  206. // public void Abort()
  207. // {
  208. // CloseVentValve();
  209. // if (_needCooling)
  210. // {
  211. // if (Module == ModuleName.LLA)
  212. // {
  213. // _JetTM.SetLLAFlow(0);
  214. // }
  215. // else if (Module == ModuleName.LLB)
  216. // {
  217. // _JetTM.SetLLBFlow(0);
  218. // }
  219. // _JetTM.TurnPurgeValve(Module, false);
  220. // _JetTM.TurnExhaustValve(Module, false);
  221. // Notify("Cooling done");
  222. // }
  223. // }
  224. // }
  225. //}