PMProcessRoutine.cs 25 KB

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