PMProcessRoutine.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. using System;
  2. using System.Collections.Generic;
  3. using Aitex.Core.RT.Routine;
  4. using Aitex.Core.RT.SCCore;
  5. using Aitex.Core.Common;
  6. using Aitex.Core.RT.RecipeCenter;
  7. using Venus_RT.Devices;
  8. using MECF.Framework.Common.Equipment;
  9. using MECF.Framework.Common.SubstrateTrackings;
  10. using Venus_Core;
  11. using System.Diagnostics;
  12. using MECF.Framework.Common.DBCore;
  13. using System.Threading.Tasks;
  14. using Aitex.Core.RT.Event;
  15. using Aitex.Core.RT.Log;
  16. namespace Venus_RT.Modules.PMs
  17. {
  18. class PMProcessRoutine : PMRoutineBase, IRoutine
  19. {
  20. private enum ProcessStep
  21. {
  22. PreparePressure,
  23. PrepareTemperature,
  24. RunChuckRecipe,
  25. RunProcessRecipe,
  26. RunDechuckRecipe,
  27. RunCleanRecipe,
  28. End,
  29. }
  30. public string CurrentRunningRecipe { get; set; }
  31. public string ProcessRecipeName { get; set; }
  32. public string ChuckRecipeName { get; set; }
  33. public string DechuckRecipeName { get; set; }
  34. public string CleanRecipeName { get; set; }
  35. public RecipeHead ProcessRecipeHead { get; set; }
  36. public DateTime RecipeStartTime { get; private set; }
  37. public DateTime RecipeEndTime { get; private set; }
  38. public string WaferId { get; set; }
  39. public string SlotID { get; set; }
  40. public string LotID { get; set; }
  41. public string RecipeId { get; set; }
  42. //public bool CurrentRecipeType { get; set; }
  43. //int Timeall;
  44. private Stopwatch Recipetime = new Stopwatch();
  45. private readonly PumpDownRoutine _pumpDownRoutine;
  46. private readonly ProcessHelper _processHelper;
  47. private bool _withWafer = true;
  48. //private bool _needPumpDown = false;
  49. public Recipe _currentRecipe = null;
  50. private int _currentStep = 0;
  51. private List<Recipe> Recipelist = new List<Recipe>();
  52. private double _tolerance;
  53. private double _OffsetTemp = 0.0f;
  54. private bool _bLoopMode = false;
  55. private int _loopStartStep = 0;
  56. private int _loopCounter = 0;
  57. private int _recipeRunningMode = 0;
  58. private Stopwatch _stepTime = new Stopwatch();
  59. public RecipeResult currentRecipeResult;
  60. public bool isMaualEndStep;
  61. private RecipeFACallback _faCallback;
  62. private JetChamber _jetChamber;
  63. private RecipeType _recipeType;
  64. private Recipe ProcessRecipe;
  65. private Recipe ChuckRecipe;
  66. private Recipe DechuckRecipe;
  67. private Recipe CleanRecipe;
  68. private bool needprocess;
  69. private bool needdechuck;
  70. private bool needchuck;
  71. private bool needclean;
  72. private double BaseTemperature
  73. {
  74. get
  75. {
  76. if (ProcessRecipeHead != null)
  77. {
  78. if (!string.IsNullOrEmpty(ProcessRecipeHead.Temperature))
  79. {
  80. double setpoint = Convert.ToDouble(ProcessRecipeHead.Temperature);
  81. if (setpoint > 0 && setpoint < 600)
  82. return setpoint;
  83. }
  84. }
  85. return 0;
  86. }
  87. }
  88. private double BasePressure
  89. {
  90. get
  91. {
  92. if (ProcessRecipeHead != null)
  93. {
  94. if (!string.IsNullOrEmpty(ProcessRecipeHead.BasePressure))
  95. {
  96. double setpoint = Convert.ToDouble(ProcessRecipeHead.BasePressure);
  97. if (setpoint > 0 && setpoint < 750000)
  98. return setpoint;
  99. }
  100. }
  101. return SC.GetValue<int>($"{Module}.Pump.PumpBasePressure");
  102. }
  103. }
  104. public double EstimatedTotalLeftTime
  105. {
  106. get;
  107. private set;
  108. }
  109. public PMProcessRoutine(JetPMBase chamber, PumpDownRoutine pdRoutine) : base(chamber)
  110. {
  111. Name = "Process";
  112. _pumpDownRoutine = pdRoutine;
  113. _processHelper = new ProcessHelper(chamber);
  114. _faCallback = new RecipeFACallback();
  115. _jetChamber = (JetChamber)SC.GetValue<int>($"{chamber.Module}.ChamberType");
  116. }
  117. private bool AssignFuns(Recipe recipe)
  118. {
  119. foreach (var step in recipe.Steps)
  120. {
  121. if (_processHelper.LoadStepFuns(step) == false)
  122. return false;
  123. foreach (ProcessUnitBase unit in step.LstUnit)
  124. {
  125. if (_processHelper.LoadMethods(unit) == false)
  126. {
  127. Stop($"Cannot find the process routine for unit:{unit.GetType()}");
  128. return false;
  129. }
  130. }
  131. }
  132. return true;
  133. }
  134. public RState Start(params object[] objs)
  135. {
  136. needprocess = false;
  137. needchuck = false;
  138. needclean = false;
  139. needdechuck = false;
  140. Recipelist.Clear();
  141. string recipeName = (string)objs[0];
  142. if (objs.Length >= 2)
  143. {
  144. _recipeType = (RecipeType)Enum.Parse(typeof(RecipeType), objs[2].ToString());
  145. if (_recipeType == RecipeType.Clean)
  146. {
  147. _withWafer = false;
  148. }
  149. else
  150. {
  151. _withWafer = true;
  152. }
  153. }
  154. if (objs.Length >= 4)
  155. {
  156. LotID = objs[3].ToString();
  157. }
  158. else
  159. {
  160. LotID = "";
  161. }
  162. if (_withWafer && WaferManager.Instance.CheckNoWafer(Module, 0))
  163. {
  164. Stop($"can not run process, no wafer at {Module}");
  165. EV.PostAlarmLog(Module.ToString(), $"can not run process, no wafer at {Module}");
  166. return RState.Failed;
  167. }
  168. else if (!_withWafer && WaferManager.Instance.CheckHasWafer(Module, 0))
  169. {
  170. Stop($"can not run clean recipe{recipeName}, a wafer at {Module}");
  171. EV.PostAlarmLog(Module.ToString(), $"can not run clean recipe, a wafer at {Module}");
  172. return RState.Failed;
  173. }
  174. if (!_chamber.IsRFGInterlockOn)
  175. {
  176. Stop("射频电源 Interlock条件不满足");
  177. EV.PostAlarmLog(Module.ToString(), "射频电源 Interlock条件不满足");
  178. return RState.Failed;
  179. }
  180. if (!CheckSlitDoor() || !CheckDryPump() || !CheckTurboPump())
  181. {
  182. return RState.Failed;
  183. }
  184. currentRecipeResult = new RecipeResult();
  185. currentRecipeResult.RecipeName = recipeName;
  186. string recipeContent = RecipeFileManager.Instance.LoadRecipe(_chamber.Name, recipeName, false, objs[2].ToString());
  187. Recipe recipe = Recipe.Load(recipeContent);
  188. if (recipeName != recipe.Header.Name)
  189. {
  190. Stop($"Recipe内部名{recipe.Header.Name}与外部名{recipeName}不一致,请确认Recipe来源");
  191. return RState.Failed;
  192. }
  193. if (_jetChamber != recipe.Header.ChamberType)
  194. {
  195. Stop($"不可以在{_jetChamber}腔体跑{recipe.Header.ChamberType}类型的Recipe,请确认Recipe来源");
  196. return RState.Failed;
  197. }
  198. currentRecipeResult.RecipeStepCount = recipe.Steps.Count;
  199. if (recipe == null)
  200. {
  201. Stop($"Load Recipe:{recipeName} failed");
  202. EV.PostAlarmLog(Module.ToString(), $"Load Recipe:{recipeName} failed");
  203. return RState.Failed;
  204. }
  205. _recipeRunningMode = SC.GetValue<int>($"{Module}.RecipeRunningMode");
  206. _processHelper.m_RecipeHead = recipe.Header;
  207. switch (recipe.Header.Type)
  208. {
  209. case RecipeType.Process:
  210. if (_recipeRunningMode == 1 && recipe.Header.ChuckRecipe != null && !string.IsNullOrEmpty(recipe.Header.ChuckRecipe))
  211. {
  212. string chuckcontent = RecipeFileManager.Instance.LoadRecipe(_chamber.Name, recipe.Header.ChuckRecipe, false, RecipeType.Chuck.ToString());
  213. ChuckRecipe = Recipe.Load(chuckcontent);
  214. if (ChuckRecipe != null)
  215. {
  216. ChuckRecipeName = recipe.Header.ChuckRecipe;
  217. needchuck = true;
  218. Recipelist.Add(ChuckRecipe);
  219. }
  220. }
  221. needprocess = true;
  222. ProcessRecipeHead = recipe.Header;
  223. ProcessRecipe = recipe;
  224. ProcessRecipeName = recipeName;
  225. Recipelist.Add(recipe);
  226. if (_recipeRunningMode == 1 && recipe.Header.DechuckRecipe != null && !string.IsNullOrEmpty(recipe.Header.DechuckRecipe))
  227. {
  228. string dechuckcontent = RecipeFileManager.Instance.LoadRecipe(_chamber.Name, recipe.Header.DechuckRecipe, false, RecipeType.DeChuck.ToString());
  229. DechuckRecipe = Recipe.Load(dechuckcontent);
  230. if (DechuckRecipe != null)
  231. {
  232. DechuckRecipeName = recipe.Header.DechuckRecipe;
  233. needdechuck = true;
  234. Recipelist.Add(DechuckRecipe);
  235. }
  236. }
  237. break;
  238. case RecipeType.Chuck:
  239. ChuckRecipeName = recipeName;
  240. ChuckRecipe = recipe;
  241. Recipelist.Add(ChuckRecipe);
  242. needchuck = true;
  243. break;
  244. case RecipeType.DeChuck:
  245. DechuckRecipeName = recipeName;
  246. Recipelist.Add(DechuckRecipe);
  247. DechuckRecipe = recipe;
  248. needdechuck = true;
  249. break;
  250. case RecipeType.Clean:
  251. CleanRecipe = recipe;
  252. CleanRecipeName = recipeName;
  253. Recipelist.Add(CleanRecipe);
  254. needclean = true;
  255. break;
  256. }
  257. foreach (Recipe rcp in Recipelist)
  258. {
  259. if (AssignFuns(rcp) == false)
  260. {
  261. Stop($"Associate process alogrithm with recipe:{rcp.Header.Name} failed");
  262. EV.PostAlarmLog(Module.ToString(), $"Associate process alogrithm with recipe:{rcp.Header.Name} failed");
  263. return RState.Failed;
  264. }
  265. }
  266. _bLoopMode = false;
  267. _loopStartStep = 0;
  268. _loopCounter = 0;
  269. _processHelper.isLoop = false;
  270. _processHelper.loopsteps = 0;
  271. _processHelper.currentStepIndex = 0;
  272. if (_jetChamber == JetChamber.Venus)
  273. {
  274. _tolerance = SC.GetValue<double>($"System.MaxTemperatureToleranceToTarget");
  275. _OffsetTemp = SC.GetValue<double>($"{Module}.Chiller.ChillerTemperatureOffset");
  276. }
  277. _faCallback.RecipeStart(_chamber.Module.ToString(), recipeName);
  278. WaferManager.Instance.UpdateWaferProcessStatus(Module, 0, EnumWaferProcessStatus.InProcess);
  279. return Runner.Start(Module, Name);
  280. }
  281. public RState Monitor()
  282. {
  283. Runner
  284. .Run(ProcessStep.PreparePressure, PreparePressure, IsPressureReady)
  285. .Run(ProcessStep.PrepareTemperature, PrepareTemp, IsTempReady)
  286. .RunIf(ProcessStep.RunChuckRecipe, needchuck, StartChuckRecipe, CheckRecipeDone, 5 * 60 * 60 * 1000)
  287. .RunIf(ProcessStep.RunProcessRecipe, needprocess, StartProcessRecipe, CheckRecipeDone, 5 * 60 * 60 * 1000)
  288. .RunIf(ProcessStep.RunDechuckRecipe, needdechuck, StartDechuckRecipe, CheckRecipeDone, 5 * 60 * 60 * 1000)
  289. .RunIf(ProcessStep.RunCleanRecipe, needclean, StartCleanRecipe, CheckRecipeDone, 5 * 60 * 60 * 1000)
  290. .End(ProcessStep.End, ProcessDone, _delay_1s);
  291. return Runner.Status;
  292. }
  293. private bool PreparePressure()
  294. {
  295. //2023/09/02 tps remove
  296. //if (_chamber.ChamberPressure < 5 && _chamber.ProcessPressure < BasePressure)
  297. //{
  298. // _needPumpDown = false;
  299. // return true;
  300. //}
  301. //_needPumpDown = true;
  302. return _pumpDownRoutine.Start(BasePressure) == RState.Running;
  303. }
  304. private bool IsPressureReady()
  305. {
  306. //if (_needPumpDown == false)
  307. // return true;
  308. var status = _pumpDownRoutine.Monitor();
  309. if (status == RState.End)
  310. {
  311. return true;
  312. }
  313. else if (status == RState.Failed || status == RState.Timeout)
  314. {
  315. Runner.Stop($"Pump down to {BasePressure} failed.");
  316. EV.PostAlarmLog(Module.ToString(), $"Pump down to {BasePressure} failed.");
  317. return true;
  318. }
  319. return false;
  320. }
  321. private bool PrepareTemp()
  322. {
  323. if (_jetChamber == JetChamber.Venus)
  324. {
  325. return SetCoolantTemp(BaseTemperature, _OffsetTemp);
  326. }
  327. else
  328. {
  329. return true;
  330. }
  331. }
  332. private bool IsTempReady()
  333. {
  334. if (_jetChamber == JetChamber.Venus)
  335. {
  336. return CheckCoolantTemp(BaseTemperature, _tolerance);
  337. }
  338. else
  339. {
  340. return true;
  341. }
  342. }
  343. public RState StartNewStep()
  344. {
  345. ProcessDataRecorder.StepStart(RecipeId, _currentRecipe.Steps[_currentStep].StepNo, $"{Module}:{_currentRecipe.Header.Name}:{_currentRecipe.Steps[_currentStep].Description}", _currentRecipe.Steps[_currentStep].Time);
  346. _stepTime.Restart();
  347. var state = _currentRecipe.Steps[_currentStep].Start();
  348. LOG.Write(eEvent.INFO_PROCESS, Module, $"Recipe:{CurrentRunningRecipe} Step{_currentStep+1} Start");
  349. _faCallback.RecipeStepStart(Module.ToString(), CurrentRunningRecipe, _currentStep);
  350. if (state != RState.Running)
  351. return state;
  352. //if (_bLoopMode == true)
  353. //{
  354. //}
  355. if (_currentRecipe.Steps[_currentStep].CycleStart)
  356. {
  357. if (!_bLoopMode)
  358. {
  359. _bLoopMode = true;
  360. _loopStartStep = _currentStep;
  361. _loopCounter = _currentRecipe.Steps[_currentStep].CycleNumber - 1;
  362. currentRecipeResult.RecipeAllCounters = _currentRecipe.Steps[_currentStep].CycleNumber;
  363. currentRecipeResult.RecipeCurrentCounter = _loopCounter == 0 ? 0 : 1;
  364. _processHelper.isLoop = true;
  365. _processHelper.loopsteps = _currentRecipe.Steps[_currentStep].CycleNumber;
  366. }
  367. else
  368. {
  369. _processHelper.currentStepIndex += 1;
  370. }
  371. }
  372. return RState.Running;
  373. }
  374. private bool startRecipe(Recipe _recipe)
  375. {
  376. _currentRecipe = _recipe;
  377. if (_currentRecipe != null)
  378. {
  379. _currentStep = 0;
  380. CurrentRunningRecipe = _currentRecipe.Header.Name;
  381. RecipeId = Guid.NewGuid().ToString();
  382. RecipeStartTime = DateTime.Now;
  383. Recipetime.Restart();
  384. Notify($"Recipe:{CurrentRunningRecipe} start");
  385. _chamber.EPDRecipeStart(CurrentRunningRecipe);
  386. return StartNewStep() == RState.Running;
  387. }
  388. else { return false; }
  389. }
  390. private bool StartProcessRecipe()
  391. {
  392. return startRecipe(ProcessRecipe);
  393. }
  394. private bool StartChuckRecipe()
  395. {
  396. return startRecipe(ChuckRecipe);
  397. }
  398. private bool StartDechuckRecipe()
  399. {
  400. return startRecipe(DechuckRecipe);
  401. }
  402. private bool StartCleanRecipe()
  403. {
  404. return startRecipe(CleanRecipe);
  405. }
  406. private bool CheckRecipeDone()
  407. {
  408. var step = _currentRecipe.Steps[_currentStep];
  409. currentRecipeResult.RecipeStepCount = _currentRecipe.Steps.Count;
  410. currentRecipeResult.RecipeName = _currentRecipe.Header.Name;
  411. currentRecipeResult.RecipeType = _currentRecipe.Header.Type.ToString();
  412. currentRecipeResult.RecipeStepNumber = step.StepNo;
  413. currentRecipeResult.RecipeStepType = step.Type.ToString();
  414. currentRecipeResult.RecipeStepDescription = string.IsNullOrEmpty(step.Description) ? "" : step.Description;
  415. currentRecipeResult.RecipeStepSetTime = step.Time;
  416. currentRecipeResult.RecipeType = _currentRecipe.Header.Type.ToString();
  417. currentRecipeResult.RecipeStepDuringTime = new System.TimeSpan(0, 0, System.Convert.ToInt32(_stepTime.ElapsedMilliseconds / 1000));
  418. var result = step.Run();
  419. if (result == RState.Failed)
  420. {
  421. RecipeDone("Fail");
  422. UpdateWaferStatus(false);
  423. Runner.Stop($"Recipe:{CurrentRunningRecipe}, Step:{_currentStep + 1} Failed");
  424. EV.PostAlarmLog(Module.ToString(), $"Recipe:{CurrentRunningRecipe}, Step:{_currentStep + 1} Failed");
  425. _faCallback.RecipeFailed(Module.ToString(), CurrentRunningRecipe);
  426. return true;
  427. }
  428. else if (result == RState.End || isMaualEndStep == true)
  429. {
  430. if (_currentRecipe.Steps.Count > _currentStep + 1 && _currentRecipe.Steps[_currentStep + 1].Type != StepType.OverEtch)
  431. {
  432. _currentRecipe.Steps[_currentStep].End();
  433. }
  434. if (_currentRecipe.Steps[_currentStep].CycleEnd)
  435. {
  436. if (_loopCounter > 0)
  437. {
  438. _loopCounter--;
  439. currentRecipeResult.RecipeCurrentCounter += 1;
  440. _currentStep = _loopStartStep;
  441. return StartNewStep() != RState.Running;
  442. }
  443. else
  444. {
  445. _bLoopMode = false;
  446. _loopStartStep = 0;
  447. //_processHelper.loopStep(false, 0, 0);
  448. _processHelper.isLoop = false;
  449. _processHelper.loopsteps = 0;
  450. _processHelper.currentStepIndex = 0;
  451. }
  452. }
  453. if (_currentStep < _currentRecipe.Steps.Count - 1 || isMaualEndStep == true)
  454. {
  455. result = RState.End;
  456. isMaualEndStep = false;
  457. _currentStep++;
  458. LOG.Write(eEvent.INFO_PROCESS, Module, $"Recipe:{CurrentRunningRecipe} Step{_currentStep} End");
  459. _faCallback.RecipeStepEnd(Module.ToString(), CurrentRunningRecipe, _currentStep);
  460. return StartNewStep() != RState.Running;
  461. }
  462. else
  463. {
  464. LOG.Write(eEvent.INFO_PROCESS, Module, $"Recipe:{CurrentRunningRecipe} Step{_currentStep+1} End");
  465. Notify($"Recipe:{CurrentRunningRecipe} finished");
  466. //FaEvent.FaPostInfo(Module.ToString(), $"Recipe:{CurrentRunningRecipe} finished");
  467. UpdateWaferStatus();
  468. //if (_currentRecipe.Header.Type == RecipeType.Process)
  469. //{
  470. // processRecipe = (Recipe)SerializeHelper.Instance.Clone(_currentRecipe);
  471. //}
  472. _chamber.EPDRecipeStop();
  473. RecipeDone("Success");
  474. return true;
  475. }
  476. }
  477. return false;
  478. }
  479. public void RecipeDone(string result)
  480. {
  481. Recipetime.Stop();
  482. WaferInfo waferInfo = WaferManager.Instance.GetWafer(ModuleHelper.Converter(Module.ToString()), 0);
  483. if (!waferInfo.IsEmpty)
  484. {
  485. WaferId = waferInfo.InnerId.ToString();
  486. SlotID = waferInfo.OriginSlot.ToString();
  487. //LotID = waferInfo.ProcessJob == null || string.IsNullOrEmpty(waferInfo.ProcessJob.ControlJobName) ? "" : waferInfo.ProcessJob.ControlJobName;
  488. }
  489. RecipeEndTime = RecipeStartTime + Recipetime.Elapsed;
  490. switch (_currentRecipe.Header.Type)
  491. {
  492. case RecipeType.Clean:
  493. ProcessDataRecorder.RecordPrecess(RecipeId, RecipeStartTime, RecipeEndTime, _currentRecipe.Header.Name, result, "", _chamber.Name, "", "", _currentRecipe.Header.Type.ToString());
  494. break;
  495. case RecipeType.Chuck:
  496. case RecipeType.DeChuck:
  497. case RecipeType.Process:
  498. ProcessDataRecorder.RecordPrecess(RecipeId, RecipeStartTime, RecipeEndTime, _currentRecipe.Header.Name, result, WaferId, _chamber.Name, LotID, SlotID, _currentRecipe.Header.Type.ToString());
  499. break;
  500. }
  501. }
  502. private bool ProcessDone()
  503. {
  504. _currentRecipe.Steps[_currentStep].End();
  505. _faCallback.RecipeComplete(Module.ToString(), CurrentRunningRecipe);
  506. RecipeFileManager.Instance.SaveAsRecipe2(Module.ToString(), _currentRecipe.Header.Type.ToString(), _currentRecipe.Header.Name, RecipeUnity.RecipeToString(_currentRecipe));
  507. _stepTime.Stop();
  508. WaferManager.Instance.UpdateWaferProcessStatus(Module, 0, EnumWaferProcessStatus.Idle);
  509. WaferManager.Instance.UpdateWaferProcessStatus(Module, 0, EnumWaferProcessStatus.Completed);
  510. CloseAllValves(500);
  511. _chamber.GeneratorSetpower(0);
  512. _chamber.GeneratorBiasSetpower(0);
  513. _chamber.GeneratorBiasPowerOn(false);
  514. _chamber.GeneratorPowerOn(false);
  515. _chamber.OpenValve(ValveType.TurboPumpPumping, true);
  516. _chamber.OpenValve(ValveType.TurboPumpPurge, true);
  517. _chamber.OpenValve(ValveType.Guage, true);
  518. _chamber.SetPVPostion(1000);
  519. if ((_jetChamber == JetChamber.Venus || _chamber.ChamberType == JetChamber.VenusSE )&& _chamber.IsHVOn == true)
  520. {
  521. _chamber.OnOffSetESCHV(false);
  522. }
  523. return true;
  524. }
  525. private void UpdateWaferStatus(bool bDone = true)
  526. {
  527. if (bDone == false)
  528. {
  529. WaferManager.Instance.UpdateWaferProcessStatus(Module, 0, EnumWaferProcessStatus.Failed);
  530. if (_currentRecipe.Header.Type == RecipeType.Chuck)
  531. {
  532. // set wafer chucked flag even if the chuck recipe failed.
  533. WaferManager.Instance.UpdateWaferChuckStatus(Module, 0, EnumWaferChuckStatus.Chucked);
  534. }
  535. }
  536. switch (_currentRecipe.Header.Type)
  537. {
  538. case RecipeType.Process:
  539. break;
  540. case RecipeType.Chuck:
  541. WaferManager.Instance.UpdateWaferChuckStatus(Module, 0, EnumWaferChuckStatus.Chucked);
  542. break;
  543. case RecipeType.DeChuck:
  544. WaferManager.Instance.UpdateWaferProcessStatus(Module, 0, EnumWaferProcessStatus.Completed);
  545. WaferManager.Instance.UpdateWaferChuckStatus(Module, 0, EnumWaferChuckStatus.Dechucked);
  546. break;
  547. }
  548. }
  549. public async void Abort()
  550. {
  551. if (_currentRecipe != null)
  552. {
  553. RecipeDone("Abort");
  554. }
  555. _chamber.GeneratorBiasPowerOn(false);
  556. _chamber.GeneratorPowerOn(false);
  557. CloseAllValves();
  558. _chamber.OpenValve(ValveType.TurboPumpPumping, true);
  559. _chamber.OpenValve(ValveType.TurboPumpPurge, true);
  560. if (_chamber.ChamberType == JetChamber.Venus|| _chamber.ChamberType == JetChamber.VenusSE)
  561. {
  562. await Task.Delay(3000);
  563. _chamber.OnOffSetESCHV(false);
  564. }
  565. }
  566. }
  567. }