PostProcess.cs 7.3 KB

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