PMProcessRoutine.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  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. if (state != RState.Running)
  350. return state;
  351. //if (_bLoopMode == true)
  352. //{
  353. //}
  354. if (_currentRecipe.Steps[_currentStep].CycleStart)
  355. {
  356. if (!_bLoopMode)
  357. {
  358. _bLoopMode = true;
  359. _loopStartStep = _currentStep;
  360. _loopCounter = _currentRecipe.Steps[_currentStep].CycleNumber - 1;
  361. currentRecipeResult.RecipeAllCounters = _currentRecipe.Steps[_currentStep].CycleNumber;
  362. currentRecipeResult.RecipeCurrentCounter = _loopCounter == 0 ? 0 : 1;
  363. _processHelper.isLoop = true;
  364. _processHelper.loopsteps = _currentRecipe.Steps[_currentStep].CycleNumber;
  365. }
  366. else
  367. {
  368. _processHelper.currentStepIndex += 1;
  369. }
  370. }
  371. return RState.Running;
  372. }
  373. private bool startRecipe(Recipe _recipe)
  374. {
  375. _currentRecipe = _recipe;
  376. if (_currentRecipe != null)
  377. {
  378. _currentStep = 0;
  379. CurrentRunningRecipe = _currentRecipe.Header.Name;
  380. RecipeId = Guid.NewGuid().ToString();
  381. RecipeStartTime = DateTime.Now;
  382. Recipetime.Restart();
  383. Notify($"Recipe:{CurrentRunningRecipe} start");
  384. _chamber.EPDRecipeStart(CurrentRunningRecipe);
  385. return StartNewStep() == RState.Running;
  386. }
  387. else { return false; }
  388. }
  389. private bool StartProcessRecipe()
  390. {
  391. return startRecipe(ProcessRecipe);
  392. }
  393. private bool StartChuckRecipe()
  394. {
  395. return startRecipe(ChuckRecipe);
  396. }
  397. private bool StartDechuckRecipe()
  398. {
  399. return startRecipe(DechuckRecipe);
  400. }
  401. private bool StartCleanRecipe()
  402. {
  403. return startRecipe(CleanRecipe);
  404. }
  405. private bool CheckRecipeDone()
  406. {
  407. var step = _currentRecipe.Steps[_currentStep];
  408. currentRecipeResult.RecipeStepCount = _currentRecipe.Steps.Count;
  409. currentRecipeResult.RecipeName = _currentRecipe.Header.Name;
  410. currentRecipeResult.RecipeType = _currentRecipe.Header.Type.ToString();
  411. currentRecipeResult.RecipeStepNumber = step.StepNo;
  412. currentRecipeResult.RecipeStepType = step.Type.ToString();
  413. currentRecipeResult.RecipeStepDescription = string.IsNullOrEmpty(step.Description) ? "" : step.Description;
  414. currentRecipeResult.RecipeStepSetTime = step.Time;
  415. currentRecipeResult.RecipeType = _currentRecipe.Header.Type.ToString();
  416. currentRecipeResult.RecipeStepDuringTime = new System.TimeSpan(0, 0, System.Convert.ToInt32(_stepTime.ElapsedMilliseconds / 1000));
  417. var result = step.Run();
  418. if (result == RState.Failed)
  419. {
  420. RecipeDone("Fail");
  421. UpdateWaferStatus(false);
  422. Runner.Stop($"Recipe:{CurrentRunningRecipe}, Step:{_currentStep + 1} Failed");
  423. EV.PostAlarmLog(Module.ToString(), $"Recipe:{CurrentRunningRecipe}, Step:{_currentStep + 1} Failed");
  424. return true;
  425. }
  426. else if (result == RState.End || isMaualEndStep == true)
  427. {
  428. if (_currentRecipe.Steps.Count > _currentStep + 1 && _currentRecipe.Steps[_currentStep + 1].Type != StepType.OverEtch)
  429. {
  430. _currentRecipe.Steps[_currentStep].End();
  431. }
  432. if (_currentRecipe.Steps[_currentStep].CycleEnd)
  433. {
  434. if (_loopCounter > 0)
  435. {
  436. _loopCounter--;
  437. currentRecipeResult.RecipeCurrentCounter += 1;
  438. _currentStep = _loopStartStep;
  439. return StartNewStep() != RState.Running;
  440. }
  441. else
  442. {
  443. _bLoopMode = false;
  444. _loopStartStep = 0;
  445. //_processHelper.loopStep(false, 0, 0);
  446. _processHelper.isLoop = false;
  447. _processHelper.loopsteps = 0;
  448. _processHelper.currentStepIndex = 0;
  449. }
  450. }
  451. if (_currentStep < _currentRecipe.Steps.Count - 1 || isMaualEndStep == true)
  452. {
  453. result = RState.End;
  454. isMaualEndStep = false;
  455. _currentStep++;
  456. LOG.Write(eEvent.INFO_PROCESS, Module, $"Recipe:{CurrentRunningRecipe} Step{_currentStep} End");
  457. return StartNewStep() != RState.Running;
  458. }
  459. else
  460. {
  461. LOG.Write(eEvent.INFO_PROCESS, Module, $"Recipe:{CurrentRunningRecipe} Step{_currentStep+1} End");
  462. Notify($"Recipe:{CurrentRunningRecipe} finished");
  463. //FaEvent.FaPostInfo(Module.ToString(), $"Recipe:{CurrentRunningRecipe} finished");
  464. UpdateWaferStatus();
  465. //if (_currentRecipe.Header.Type == RecipeType.Process)
  466. //{
  467. // processRecipe = (Recipe)SerializeHelper.Instance.Clone(_currentRecipe);
  468. //}
  469. _chamber.EPDRecipeStop();
  470. RecipeDone("Success");
  471. return true;
  472. }
  473. }
  474. return false;
  475. }
  476. public void RecipeDone(string result)
  477. {
  478. Recipetime.Stop();
  479. WaferInfo waferInfo = WaferManager.Instance.GetWafer(ModuleHelper.Converter(Module.ToString()), 0);
  480. if (!waferInfo.IsEmpty)
  481. {
  482. WaferId = waferInfo.InnerId.ToString();
  483. SlotID = waferInfo.OriginSlot.ToString();
  484. //LotID = waferInfo.ProcessJob == null || string.IsNullOrEmpty(waferInfo.ProcessJob.ControlJobName) ? "" : waferInfo.ProcessJob.ControlJobName;
  485. }
  486. RecipeEndTime = RecipeStartTime + Recipetime.Elapsed;
  487. switch (_currentRecipe.Header.Type)
  488. {
  489. case RecipeType.Clean:
  490. ProcessDataRecorder.RecordPrecess(RecipeId, RecipeStartTime, RecipeEndTime, _currentRecipe.Header.Name, result, "", _chamber.Name, "", "", _currentRecipe.Header.Type.ToString());
  491. break;
  492. case RecipeType.Chuck:
  493. case RecipeType.DeChuck:
  494. case RecipeType.Process:
  495. ProcessDataRecorder.RecordPrecess(RecipeId, RecipeStartTime, RecipeEndTime, _currentRecipe.Header.Name, result, WaferId, _chamber.Name, LotID, SlotID, _currentRecipe.Header.Type.ToString());
  496. break;
  497. }
  498. }
  499. private bool ProcessDone()
  500. {
  501. _currentRecipe.Steps[_currentStep].End();
  502. RecipeFileManager.Instance.SaveAsRecipe2(Module.ToString(), _currentRecipe.Header.Type.ToString(), _currentRecipe.Header.Name, RecipeUnity.RecipeToString(_currentRecipe));
  503. _stepTime.Stop();
  504. WaferManager.Instance.UpdateWaferProcessStatus(Module, 0, EnumWaferProcessStatus.Idle);
  505. WaferManager.Instance.UpdateWaferProcessStatus(Module, 0, EnumWaferProcessStatus.Completed);
  506. CloseAllValves(500);
  507. _chamber.GeneratorSetpower(0);
  508. _chamber.GeneratorBiasSetpower(0);
  509. _chamber.GeneratorBiasPowerOn(false);
  510. _chamber.GeneratorPowerOn(false);
  511. _chamber.OpenValve(ValveType.TurboPumpPumping, true);
  512. _chamber.OpenValve(ValveType.TurboPumpPurge, true);
  513. _chamber.OpenValve(ValveType.Guage, true);
  514. _chamber.SetPVPostion(1000);
  515. if ((_jetChamber == JetChamber.Venus || _chamber.ChamberType == JetChamber.VenusSE )&& _chamber.IsHVOn == true)
  516. {
  517. _chamber.OnOffSetESCHV(false);
  518. }
  519. return true;
  520. }
  521. private void UpdateWaferStatus(bool bDone = true)
  522. {
  523. if (bDone == false)
  524. {
  525. WaferManager.Instance.UpdateWaferProcessStatus(Module, 0, EnumWaferProcessStatus.Failed);
  526. if (_currentRecipe.Header.Type == RecipeType.Chuck)
  527. {
  528. // set wafer chucked flag even if the chuck recipe failed.
  529. WaferManager.Instance.UpdateWaferChuckStatus(Module, 0, EnumWaferChuckStatus.Chucked);
  530. }
  531. }
  532. switch (_currentRecipe.Header.Type)
  533. {
  534. case RecipeType.Process:
  535. break;
  536. case RecipeType.Chuck:
  537. WaferManager.Instance.UpdateWaferChuckStatus(Module, 0, EnumWaferChuckStatus.Chucked);
  538. break;
  539. case RecipeType.DeChuck:
  540. WaferManager.Instance.UpdateWaferProcessStatus(Module, 0, EnumWaferProcessStatus.Completed);
  541. WaferManager.Instance.UpdateWaferChuckStatus(Module, 0, EnumWaferChuckStatus.Dechucked);
  542. break;
  543. }
  544. }
  545. public async void Abort()
  546. {
  547. if (_currentRecipe != null)
  548. {
  549. RecipeDone("Abort");
  550. }
  551. _chamber.GeneratorBiasPowerOn(false);
  552. _chamber.GeneratorPowerOn(false);
  553. CloseAllValves();
  554. _chamber.OpenValve(ValveType.TurboPumpPumping, true);
  555. _chamber.OpenValve(ValveType.TurboPumpPurge, true);
  556. if (_chamber.ChamberType == JetChamber.Venus|| _chamber.ChamberType == JetChamber.VenusSE)
  557. {
  558. await Task.Delay(3000);
  559. _chamber.OnOffSetESCHV(false);
  560. }
  561. }
  562. }
  563. }