PMRoutineBase.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. using System.Diagnostics;
  2. using Venus_RT.Devices;
  3. using Aitex.Core.RT.Log;
  4. using MECF.Framework.Common.Equipment;
  5. using MECF.Framework.Common.Routine;
  6. namespace Venus_RT.Modules.PMs
  7. {
  8. class PMRoutineBase
  9. {
  10. public ModuleName Module { get; set; }
  11. public string Name { get; set; }
  12. protected readonly JetPM _chamber;
  13. protected Stopwatch _timer = new Stopwatch();
  14. protected RoutineRunner Runner = new RoutineRunner();
  15. public PMRoutineBase(JetPM chamber)
  16. {
  17. Module = chamber.Module;
  18. _chamber = chamber;
  19. Runner.Reset();
  20. }
  21. protected void Notify(string message)
  22. {
  23. LOG.Write(eEvent.RoutineNotify, Module, Name, message);
  24. }
  25. protected void Stop(string failReason)
  26. {
  27. LOG.Write(eEvent.RoutineFailed, Module, Name, failReason);
  28. }
  29. public bool CheckLid()
  30. {
  31. if (!_chamber.IsLidClosed)
  32. {
  33. this.Stop("Chamber 盖子必须关");
  34. return false;
  35. }
  36. return true;
  37. }
  38. public bool CheckLidLoadLock()
  39. {
  40. if (!_chamber.IsLidLoadlockClosed)
  41. {
  42. this.Stop("LoadLock 盖子必须关");
  43. return false;
  44. }
  45. return true;
  46. }
  47. protected bool CheckSlitDoor()
  48. {
  49. if (!_chamber.IsSlitDoorClosed)
  50. {
  51. Stop("传送门必须关");
  52. return false;
  53. }
  54. return true;
  55. }
  56. protected bool CheckDryPump()
  57. {
  58. if (!_chamber.IsPumpRunning)
  59. {
  60. Stop("泵没有启动");
  61. return false;
  62. }
  63. if (_chamber.HasPumpError)
  64. {
  65. Stop("泵状态有错误");
  66. return false;
  67. }
  68. return true;
  69. }
  70. protected bool CheckCDA()
  71. {
  72. if (!_chamber.IsCDA_OK)
  73. {
  74. Stop("CDA 压力信号不正确");
  75. return false;
  76. }
  77. return true;
  78. }
  79. protected bool CloseAllValve()
  80. {
  81. Notify("关闭所有的阀门");
  82. _chamber.CloseValves();
  83. return true;
  84. }
  85. protected bool TurnValve(ValveType vlv, bool bOpen)
  86. {
  87. _chamber.OpenValve(vlv, bOpen);
  88. Notify($"{(bOpen ? "打开" : "关闭")} {vlv} 阀");
  89. return true;
  90. }
  91. protected bool CheckValve(ValveType vlv, bool bOpen)
  92. {
  93. return true;
  94. }
  95. }
  96. }