StartDryPumpRoutine.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 StartDryPumpRoutine : PMRoutineBase, IRoutine
  9. {
  10. private enum DryPumpStep
  11. {
  12. kCheckForeLine,
  13. kEnd,
  14. }
  15. private double _chamberForelinePressureThreshold;
  16. private int _chamberForelinePressureTimeout;
  17. public StartDryPumpRoutine(JetPMBase chamber) : base(chamber)
  18. {
  19. Name = "Start DryPump";
  20. }
  21. public RState Start(params object[] objs)
  22. {
  23. if (_chamber.IsPumpRunning)
  24. {
  25. Stop("泵已经运行");
  26. return RState.Failed;
  27. }
  28. Reset();
  29. _chamber.OpenValve(ValveType.FastPump, false);
  30. _chamber.OpenValve(ValveType.SoftPump, false);
  31. _chamberForelinePressureThreshold = SC.GetValue<double>($"{Module}.DryPump.ChamberForelinePressureThreshold");
  32. _chamberForelinePressureTimeout = SC.GetValue<int>($"{Module}.DryPump.ChamberForelinePressureTimeout");
  33. _chamber.TurnDryPump(true);
  34. return Runner.Start(Module, Name);
  35. }
  36. public RState Monitor()
  37. {
  38. Runner.Wait(DryPumpStep.kCheckForeLine, () => { return _chamber.ForelinePressure < _chamberForelinePressureThreshold; }, _chamberForelinePressureTimeout*1000)
  39. .End(DryPumpStep.kEnd, NullFun, _delay_50ms);
  40. return Runner.Status;
  41. }
  42. public void Abort()
  43. {
  44. _chamber.CloseValves();
  45. _chamber.TurnDryPump(false);
  46. }
  47. }
  48. }