PMAllMfcVerificationRoutine.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. using Aitex.Core.RT.Routine;
  2. using VirgoRT.Devices;
  3. namespace VirgoRT.Modules.PMs
  4. {
  5. class PMAllMfcVerificationRoutine : PMRoutineBase
  6. {
  7. enum RoutineStep
  8. {
  9. MFC1,
  10. MFC2,
  11. MFC3,
  12. MFC4
  13. }
  14. private PumpDownRoutine _pumpdownRoutine;
  15. private string[] _normalMfc;
  16. private bool[] _isCheckMfcs;
  17. private float _normalMfcFlow;
  18. private PMMfcVerificationRoutine mfc1;
  19. private PMMfcVerificationRoutine mfc2;
  20. private PMMfcVerificationRoutine mfc3;
  21. private PMMfcVerificationRoutine mfc4;
  22. public PMAllMfcVerificationRoutine(JetPM chamber, PumpDownRoutine pumpDownRoutine) : base(chamber)
  23. {
  24. Name = "All MFC Verification";
  25. bUINotify = true;
  26. _pumpdownRoutine = pumpDownRoutine;
  27. }
  28. internal void Init(string[] normalMfc, bool[] IsCheckMfc)
  29. {
  30. _normalMfc = normalMfc;
  31. _normalMfcFlow = 200;
  32. _isCheckMfcs = IsCheckMfc;
  33. }
  34. public Result Start(params object[] objs)
  35. {
  36. Reset();
  37. mfc1 = null;
  38. mfc2 = null;
  39. mfc3 = null;
  40. mfc4 = null;
  41. if (_isCheckMfcs[0])
  42. {
  43. mfc1 = new PMMfcVerificationRoutine(_chamber, _pumpdownRoutine);
  44. mfc1.Init(_normalMfc[0], _normalMfcFlow, 10);
  45. }
  46. if (_isCheckMfcs[1])
  47. {
  48. mfc2 = new PMMfcVerificationRoutine(_chamber, _pumpdownRoutine);
  49. mfc2.Init(_normalMfc[1], _normalMfcFlow, 10);
  50. }
  51. if (_isCheckMfcs[2])
  52. {
  53. mfc3 = new PMMfcVerificationRoutine(_chamber, _pumpdownRoutine);
  54. mfc3.Init(_normalMfc[2], _normalMfcFlow, 10);
  55. }
  56. if (_isCheckMfcs[3])
  57. {
  58. mfc4 = new PMMfcVerificationRoutine(_chamber, _pumpdownRoutine);
  59. mfc4.Init(_normalMfc[3], _normalMfcFlow, 10);
  60. }
  61. return Result.RUN;
  62. }
  63. public Result Monitor()
  64. {
  65. try
  66. {
  67. if (mfc1 != null)
  68. ExecuteRoutine((int)RoutineStep.MFC1, mfc1);
  69. if (mfc2 != null)
  70. ExecuteRoutine((int)RoutineStep.MFC2, mfc2);
  71. if (mfc3 != null)
  72. ExecuteRoutine((int)RoutineStep.MFC3, mfc3);
  73. if (mfc4 != null)
  74. ExecuteRoutine((int)RoutineStep.MFC4, mfc4);
  75. }
  76. catch (RoutineBreakException)
  77. {
  78. return Result.RUN;
  79. }
  80. catch (RoutineFaildException)
  81. {
  82. _chamber.StopAllGases();
  83. _chamber.SetValveOnOff(ValveType.PROCESS, false);
  84. return Result.FAIL;
  85. }
  86. return Result.DONE;
  87. }
  88. public new void Abort()
  89. {
  90. _chamber.StopAllGases();
  91. _chamber.SetValveOnOff(ValveType.PROCESS, false);
  92. }
  93. }
  94. }