PostProcess.cs 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. using System;
  2. using System.Collections.Generic;
  3. using Aitex.Core.Equipment.SusceptorDefine;
  4. using Aitex.Core.RT.Event;
  5. using Aitex.Core.RT.Log;
  6. using Aitex.Core.RT.Routine;
  7. using Aitex.Core.RT.SCCore;
  8. using MECF.Framework.Common.DBCore;
  9. using Virgo_DRT.Devices;
  10. namespace Virgo_DRT.Modules.PMs
  11. {
  12. class PostProcessRoutine : PMRoutineBase
  13. {
  14. private enum PostProcessSequence
  15. {
  16. DelayForTest,
  17. RFPowerOff,
  18. StopGasFlow,
  19. CloseAllValves,
  20. ClosePumpValve,
  21. DelayWaitValve,
  22. Loop,
  23. Pump,
  24. PumpDelay,
  25. Vent,
  26. VentDelay,
  27. EndLoop,
  28. ClosePurgeValve,
  29. SetLiftPin,
  30. VentEndToPrecision,
  31. SetLiftPinAfterVent,
  32. VentEndCloseVentValve,
  33. End,
  34. };
  35. private RecipeHead head;
  36. private int _purgeCycleCount;
  37. private int _purgeVentPressure;
  38. private int _purgePumpPressure;
  39. private int _purgeVentTimeLimit;
  40. private int _purgePumpTimeLimit;
  41. private int _purgeVentStableTime;
  42. private int _purgePumpStableTime;
  43. private int _ventTime;
  44. //private int _ventTimeLimit;
  45. private readonly RfPowerRoutine _rfPowerRoutine;
  46. private readonly VentRoutine _ventRoutine;
  47. //---------------------------------Properties------------------------------------
  48. //
  49. public string RecipeName { get; private set; }
  50. public string RecipeContext { get; private set; }
  51. private bool PurgeActive
  52. {
  53. get
  54. {
  55. if (head != null)
  56. {
  57. if (!string.IsNullOrEmpty(head.PurgeActive))
  58. {
  59. return Convert.ToBoolean(head.PurgeActive);
  60. }
  61. }
  62. return true;
  63. }
  64. }
  65. public bool PinStateAfterVent
  66. {
  67. get
  68. {
  69. if (head != null)
  70. {
  71. if (!string.IsNullOrEmpty(head.PinStateAfterVent))
  72. {
  73. return head.PinStateAfterVent == "Up" ? true : false;
  74. }
  75. }
  76. return false;
  77. }
  78. }
  79. //--------------------------------Constructor------------------------------------
  80. //
  81. public PostProcessRoutine(JetPM chamber, VentRoutine _vRoutine) : base(chamber)
  82. {
  83. Name = "PostProcess";
  84. _rfPowerRoutine = new RfPowerRoutine(_chamber, false);
  85. _ventRoutine = _vRoutine;
  86. }
  87. public void Terminate()
  88. {
  89. }
  90. public Result Start(params object[] objs)
  91. {
  92. try
  93. {
  94. Reset();
  95. //this.UpdateSCValue();
  96. RecipeName = (string)objs[0];
  97. RecipeContext = (string)objs[1];
  98. List<RecipeStep> recipeSteps;
  99. if (!Recipe.Parse(RecipeContext, out head, out recipeSteps))
  100. {
  101. return Result.FAIL;
  102. }
  103. _purgeCycleCount = (int)SC.GetValue<double>($"{_chamber.Module}.Purge.PurgeCycleCount");
  104. _purgeVentPressure = (int)SC.GetValue<double>($"{_chamber.Module}.Purge.PurgeVentPressure");
  105. _purgePumpPressure = (int)SC.GetValue<double>($"{_chamber.Module}.Purge.PurgePumpPressure");
  106. _purgeVentTimeLimit = (int)SC.GetValue<double>($"{_chamber.Module}.Purge.PurgeVentTimeLimit");
  107. _purgePumpTimeLimit = (int)SC.GetValue<double>($"{_chamber.Module}.Purge.PurgePumpTimeLimit");
  108. _purgeVentStableTime = (int)SC.GetValue<double>($"{_chamber.Module}.Purge.PurgeVentStableTime");
  109. _purgePumpStableTime = (int)SC.GetValue<double>($"{_chamber.Module}.Purge.PurgePumpStableTime");
  110. _ventTime = (int)SC.GetValue<double>($"{_chamber.Module}.VentTime");
  111. //_ventTimeLimit = (int)SC.GetSC<double>(SCName.System_VentTimeLimit).Value;
  112. }
  113. catch (Exception ex)
  114. {
  115. LOG.Write(ex, "Post process Start has exception");
  116. return Result.FAIL;
  117. }
  118. Notify("开始");
  119. return Result.RUN;
  120. }
  121. public Result Monitor()
  122. {
  123. try
  124. {
  125. if (SC.GetValue<bool>("System.IsSimulatorMode"))
  126. {
  127. TimeDelay((int)PostProcessSequence.DelayForTest, 10);
  128. }
  129. ExecuteRoutine((int)PostProcessSequence.RFPowerOff, _rfPowerRoutine);
  130. CloseAllValve((int)PostProcessSequence.CloseAllValves, 1);
  131. if (PurgeActive)
  132. {
  133. StartLoop((int)PostProcessSequence.Loop, "", _purgeCycleCount, Notify, Stop);
  134. CyclePump((int)PostProcessSequence.Pump, _purgePumpPressure, _purgePumpTimeLimit, true);
  135. TimeDelay((int)PostProcessSequence.PumpDelay, _purgePumpStableTime);
  136. CycleVent((int)PostProcessSequence.Vent, _purgeVentPressure, _purgeVentTimeLimit, true);
  137. TimeDelay((int)PostProcessSequence.VentDelay, _purgeVentStableTime);
  138. EndLoop((int)PostProcessSequence.EndLoop, Notify, Stop);
  139. }
  140. SetLiftPinUpDown((int)PostProcessSequence.SetLiftPin, false, 5000);
  141. ExecuteRoutine((int)PostProcessSequence.VentEndToPrecision, _ventRoutine);
  142. SetLiftPinUpDown((int)PostProcessSequence.SetLiftPinAfterVent, PinStateAfterVent, 5000);
  143. CloseValve((int)PostProcessSequence.VentEndCloseVentValve, valveOpenCloseTimeout);
  144. End((int)PostProcessSequence.End);
  145. }
  146. catch (RoutineBreakException)
  147. {
  148. return Result.RUN;
  149. }
  150. catch (RoutineFaildException)
  151. {
  152. Notify("出错");
  153. return Result.FAIL;
  154. }
  155. catch (Exception ex)
  156. {
  157. Stop(ex.Message);
  158. return Result.FAIL;
  159. }
  160. Notify("结束");
  161. return Result.DONE;
  162. }
  163. public void Exit()
  164. {
  165. _chamber.BuzzerBlinking(SC.GetValue<double>("System.BuzzerBlinkingTime"));
  166. ProcessDataRecorder.End(RecipeRunGuid.ToString(), SusceptorStatus.Processed.ToString());
  167. //update processing end time
  168. //Singleton<ProcessRecorder>.Instance.EndRecipeProcess(Singleton<PMEntity>.Instance.CurrentRunningJob.RecipeRunId, SusceptorStatus.Processed);
  169. }
  170. }
  171. }