BoosterPumpDisableRoutine.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using Aitex.Core.RT.Routine;
  2. using MECF.Framework.Common.Routine;
  3. using PunkHPX8_Core;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace PunkHPX8_RT.Devices.VpwMain
  10. {
  11. public class BoosterPumpDisableRoutine : RoutineBase, IRoutine
  12. {
  13. private enum PumpDisableStep
  14. {
  15. PumpDisable,
  16. Delay,
  17. PumpValveClose,
  18. End
  19. }
  20. #region 内部变量
  21. VpwMainDevice _device;
  22. #endregion
  23. /// <summary>
  24. /// 构造函数
  25. /// </summary>
  26. /// <param name="module"></param>
  27. public BoosterPumpDisableRoutine(string module, VpwMainDevice device) : base(module)
  28. {
  29. _device = device;
  30. }
  31. /// <summary>
  32. /// 中止
  33. /// </summary>
  34. public void Abort()
  35. {
  36. Runner.Stop("Manual Abort");
  37. }
  38. /// <summary>
  39. /// 监控
  40. /// </summary>
  41. /// <returns></returns>
  42. public RState Monitor()
  43. {
  44. Runner.Run(PumpDisableStep.PumpDisable, _device.BoosterPumpDisable, 500)
  45. .Delay(PumpDisableStep.Delay, 500)
  46. .Run(PumpDisableStep.PumpValveClose, _device.DiwProcessOff, 500)
  47. .End(PumpDisableStep.End, NullFun, _delay_1ms);
  48. return Runner.Status;
  49. }
  50. /// <summary>
  51. /// 启动
  52. /// </summary>
  53. /// <param name="objs"></param>
  54. /// <returns></returns>
  55. public RState Start(params object[] objs)
  56. {
  57. return Runner.Start(Module, "Pump Disable");
  58. }
  59. }
  60. }