LoadLockVentRoutine.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using Aitex.Core.RT.Routine;
  2. using Aitex.Core.RT.SCCore;
  3. using Venus_RT.Devices;
  4. using MECF.Framework.Common.Routine;
  5. using Venus_Core;
  6. namespace Venus_RT.Modules.PMs
  7. {
  8. class LoadLockVentRoutine : PMRoutineBase, IRoutine
  9. {
  10. private enum VentStep
  11. {
  12. kCloseValves,
  13. kVent,
  14. kOverVent,
  15. kCloseVentValves,
  16. }
  17. private int _overVentTime = 2000;
  18. private int _checkATMTimeout = 90000;
  19. private int _ATMPressureLL = 720000;
  20. public LoadLockVentRoutine(JetPM chamber) : base(chamber)
  21. {
  22. Name = "Loadlock Vent";
  23. }
  24. public RState Start(params object[] objs)
  25. {
  26. if (CheckLidLoadLock()&&
  27. CheckSlitDoor()&&
  28. CheckATMLoadLock())
  29. {
  30. Reset();
  31. _chamber.CloseValves();
  32. _checkATMTimeout = SC.GetValue<int>($"{Module}.CheckATMTimeout") * 1000;
  33. _overVentTime = SC.GetValue<int>($"{Module}.OverVentTime");
  34. return Runner.Start(Module, Name);
  35. }
  36. return RState.Failed;
  37. }
  38. public RState Monitor()
  39. {
  40. Runner.Delay((int)VentStep.kCloseValves, _delay_1s)
  41. .Run((int)VentStep.kVent, HOFs.WrapAction(_chamber.OpenValve, ValveType.LoadlockVent, true), () => { return _chamber.LoadlockPressure >= _ATMPressureLL; }, _checkATMTimeout)
  42. .Delay((int)VentStep.kOverVent, _overVentTime)
  43. .End((int)VentStep.kCloseVentValves, HOFs.WrapAction(_chamber.OpenValve, ValveType.LoadlockVent, false), _delay_1s);
  44. return Runner.Status;
  45. }
  46. public void Abort()
  47. {
  48. CloseAllValves();
  49. }
  50. public bool CheckATMLoadLock()
  51. {
  52. if (_chamber.IsATMLoadlock)
  53. {
  54. this.Stop("LoadLock 是ATM状态");
  55. return false;
  56. }
  57. return true;
  58. }
  59. }
  60. }