StopPumpRoutine.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. using Aitex.Core.RT.Routine;
  2. using Aitex.RT.Properties;
  3. using Aitex.Triton160.RT.Device;
  4. namespace Aitex.Triton160.RT.Routine.PM
  5. {
  6. public class StopPumpRoutine : CommonRoutine
  7. {
  8. private enum RoutineStep
  9. {
  10. CheckRF,
  11. CheckGasFlow,
  12. ClosePumpValve1,
  13. ClosePumpValve2,
  14. End,
  15. };
  16. public StopPumpRoutine(string module, string name)
  17. {
  18. Module = module;
  19. Name = name;
  20. Display = Resources.StopPumpRoutine_StopPumpRoutine_StopPump;
  21. bUINotify = true;
  22. }
  23. public bool Initialize()
  24. {
  25. InitCommon();
  26. return true;
  27. }
  28. public void Terminate()
  29. {
  30. }
  31. public Result Start(params object[] objs)
  32. {
  33. Reset();
  34. UpdateSCValue();
  35. return Result.RUN;
  36. }
  37. public Result Monitor()
  38. {
  39. try
  40. {
  41. CheckRfOff((int)RoutineStep.CheckRF, Resources.StopPumpRoutine_Monitor_CheckIfTheRfIsOn);
  42. CheckGasFlowStopped((int)RoutineStep.CheckGasFlow, Resources.StopPumpRoutine_Monitor_CheckIfTheGasStoppedFlowing);
  43. CloseValve((int)RoutineStep.ClosePumpValve2, Resources.StopPumpRoutine_Monitor_ClosePumpValve, DeviceModel.ValveChamberPumping, valveOpenCloseTimeout, Notify, Stop);
  44. End((int)RoutineStep.End, Resources.StopPumpRoutine_Monitor_StopPumpingCompleted, Notify, Stop);
  45. }
  46. catch (RoutineBreakException)
  47. {
  48. return Result.RUN;
  49. }
  50. catch (RoutineFaildException)
  51. {
  52. return Result.FAIL;
  53. }
  54. return Result.DONE;
  55. }
  56. }
  57. }