StartTurboPumpRoutine.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 StartTurboPumpRoutine : PMRoutineBase, IRoutine
  9. {
  10. private enum TurboPumpStep
  11. {
  12. kStart,
  13. kEnd,
  14. }
  15. private readonly int FORELINE_PRESSURE_THRESHOLD = 500;
  16. private readonly int START_TURBO_PUMP_TIMEOUT = 30000;
  17. public StartTurboPumpRoutine(JetPMBase chamber) : base(chamber)
  18. {
  19. Name = "Start TurboPump";
  20. }
  21. public RState Start(params object[] objs)
  22. {
  23. if (_chamber.IsTurboPumpRunning)
  24. {
  25. Stop("Turbo Pump 已经运行");
  26. return RState.Failed;
  27. }
  28. if(!_chamber.IsPumpRunning)
  29. {
  30. Stop("干泵没有启动, 请先启动干泵");
  31. return RState.Failed;
  32. }
  33. if(_chamber.ForelinePressure >= FORELINE_PRESSURE_THRESHOLD)
  34. {
  35. Stop($"Foreline:{_chamber.ForelinePressure} 压力太高, 不能启动 Turbo Pump");
  36. return RState.Failed;
  37. }
  38. Reset();
  39. _chamber.OpenValve(ValveType.FastPump, false);
  40. if (_chamber.ChamberType != JetChamber.VenusDE)
  41. {
  42. _chamber.OpenValve(ValveType.SoftPump, false);
  43. }
  44. _chamber.TurnTurboPump(true);
  45. return Runner.Start(Module, Name);
  46. }
  47. public RState Monitor()
  48. {
  49. Runner.Wait(TurboPumpStep.kStart, () => { return _chamber.IsTurboPumpRunning; }, START_TURBO_PUMP_TIMEOUT)
  50. .End(TurboPumpStep.kEnd, NullFun, _delay_50ms);
  51. return Runner.Status;
  52. }
  53. public void Abort()
  54. {
  55. _chamber.CloseValves();
  56. _chamber.TurnTurboPump(false);
  57. }
  58. }
  59. }