Process.cs 95 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964
  1. using Aitex.Core.Common;
  2. using Aitex.Core.RT.Event;
  3. using Aitex.Core.RT.Log;
  4. using Aitex.Core.RT.OperationCenter;
  5. using Aitex.Core.RT.Routine;
  6. using Aitex.Core.RT.SCCore;
  7. using Aitex.Core.Util;
  8. using MECF.Framework.Common.DBCore;
  9. using MECF.Framework.Common.Equipment;
  10. using MECF.Framework.Common.Alarms;
  11. using MECF.Framework.Common.Event;
  12. using MECF.Framework.Common.SubstrateTrackings;
  13. using System;
  14. using System.Collections.Generic;
  15. using FurnaceRT.Equipments.PMs.Routines;
  16. using System.Diagnostics;
  17. using MECF.Framework.Common.DataCenter;
  18. using System.Runtime.Remoting.Metadata.W3cXsd2001;
  19. using FurnaceRT.Equipments.Systems;
  20. using MECF.Framework.Common.CommonData.EnumData;
  21. using MECF.Framework.Common.FAServices;
  22. using System.Threading.Tasks;
  23. using DocumentFormat.OpenXml.Drawing.Charts;
  24. using MECF.Framework.Common.Device;
  25. using Aitex.Core.Common.DeviceData;
  26. using Aitex.Sorter.Common;
  27. using MECF.Framework.FA.Core.FAControl;
  28. namespace FurnaceRT.Equipments.PMs.RecipeExecutions
  29. {
  30. public enum RecipeContinueMode
  31. {
  32. None,
  33. WaferReturnAndJobStop,
  34. RecipeCompleted,
  35. StepContinue,
  36. StepRestart,
  37. RecipeRestart,
  38. NextStep,
  39. }
  40. public class Process : PMBaseRoutine
  41. {
  42. enum RecipeRunningState
  43. {
  44. Error,
  45. RecipeCompleted,
  46. ExecStep,
  47. TimeWait,
  48. ConditionWait,
  49. StepCompleted,
  50. Paused,
  51. }
  52. enum RecipeAlaramAction
  53. {
  54. None,
  55. JumpAbortRecipe,
  56. JumpStep,
  57. JumpStepCancelCallLoop,
  58. Abort,
  59. Hold,
  60. IgnoreAlaram,
  61. }
  62. private object _recipeLocker = new object();
  63. private RecipeRunningState _state = RecipeRunningState.ExecStep;
  64. private RecipeRunningState _pausedState = RecipeRunningState.ExecStep;
  65. private double _curStepElpasedTimeBeforePaused;
  66. private double _holdTimeElpasedTime;
  67. private double _waferTimeElpasedTimeBeforPaused;
  68. //Add by SSH,20250930,判断recipe是否执行结束,给job使用
  69. public bool IsRecipeCompleted { get { return _state == RecipeRunningState.RecipeCompleted || _state == RecipeRunningState.Error; } }
  70. private double _totalElpasedTime;
  71. public RecipeContinueMode ContinueAction { get; set; }
  72. public DateTime _recipeStartTime
  73. {
  74. get;
  75. private set;
  76. }
  77. public string CurrentRecipeContent { get; private set; }
  78. public int _currentStepNumber;
  79. private int _currentSubRecipeStepNumber;
  80. private bool _loopEnd;
  81. public int CurStepTotalLoopCount
  82. {
  83. get;
  84. private set;
  85. }
  86. public int CurSubRecipeStepTotalLoopCount
  87. {
  88. get;
  89. private set;
  90. }
  91. public double CurStepTotalTime
  92. {
  93. get
  94. {
  95. if (PMModule.RecipeRunningInfo.RecipeStepList == null || PMModule.RecipeRunningInfo.RecipeStepList.Count == 0 || _state == RecipeRunningState.RecipeCompleted || _state == RecipeRunningState.Error)
  96. return 0;
  97. return PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].StepTime * 1000;
  98. }
  99. }
  100. public string FDCRecipeStep { get; set; }
  101. public int CurrentLoopCount
  102. {
  103. get;
  104. private set;
  105. }
  106. public int CurrentAbortRecipeLoopCount
  107. {
  108. get;
  109. private set;
  110. }
  111. public int CurrentSubRecipeLoopCount
  112. {
  113. get;
  114. private set;
  115. }
  116. public bool IsExecuteAbort
  117. {
  118. get;
  119. private set;
  120. }
  121. public bool IsSubReciep
  122. {
  123. get;
  124. private set;
  125. }
  126. public int AlarmConditionJumpStep { get; set; } = -1;
  127. private DeviceTimer _stepTimer = new DeviceTimer();
  128. private DeviceTimer _holdTimer = new DeviceTimer();
  129. private RecipeFACallback _faCallback;
  130. private RecipeDBCallback _dbCallback;
  131. private Fdc _fdc;
  132. private ModuleName _doModule = ModuleName.PM1;
  133. private bool IsJumpStepCancelCallLoop;
  134. private int _jumpStepNumber;
  135. private int _showStepNo;
  136. private int _subRecipeStartStepNumber;
  137. private RecipeAlaramAction _alarmAction = RecipeAlaramAction.None;
  138. public List<string> _alarmNames
  139. {
  140. private set;
  141. get;
  142. }
  143. private R_TRIG _trigHeaterBottomToleranceAlarm = new R_TRIG();
  144. private R_TRIG _trigHeaterBottomToleranceWarning = new R_TRIG();
  145. private R_TRIG _trigHeaterCenterBottomToleranceAlarm = new R_TRIG();
  146. private R_TRIG _trigHeaterCenterBottomToleranceWarning = new R_TRIG();
  147. private R_TRIG _trigHeaterCenterToleranceAlarm = new R_TRIG();
  148. private R_TRIG _trigHeaterCenterToleranceWarning = new R_TRIG();
  149. private R_TRIG _trigHeaterCenterTopToleranceAlarm = new R_TRIG();
  150. private R_TRIG _trigHeaterCenterTopToleranceWarning = new R_TRIG();
  151. private R_TRIG _trigHeaterTopToleranceAlarm = new R_TRIG();
  152. private R_TRIG _trigHeaterTopToleranceWarning = new R_TRIG();
  153. private R_TRIG _trigPressureToleranceAlarm = new R_TRIG();
  154. private R_TRIG _trigPressureToleranceWarning = new R_TRIG();
  155. private R_TRIG _trigInputSignalTimeOutAlarm = new R_TRIG();
  156. private R_TRIG _trigTemperatureConvergenceTimeOutAlarm = new R_TRIG();
  157. private R_TRIG _trigReachTempTimeOutAlarm = new R_TRIG();
  158. private R_TRIG _trigPressureConvergenceTimeOutAlarm = new R_TRIG();
  159. private R_TRIG _trigReachPressureTimeOutAlarm = new R_TRIG();
  160. private R_TRIG _trigAutoProfileTimeOutAlarm = new R_TRIG();
  161. private Dictionary<string, R_TRIG> _trigMfcToleranceAlarms;
  162. private Dictionary<string, R_TRIG> _trigMfcToleranceWarnings;
  163. private R_TRIG _trigBoatMoveToLoadPositionTimeout = new R_TRIG();
  164. private R_TRIG _trigHeaterProfileFinish = new R_TRIG();
  165. private R_TRIG _trigLeakCheckFinish = new R_TRIG();
  166. private R_TRIG _trigBoatWaitCondition = new R_TRIG();
  167. private R_TRIG _trigAPCWaitCondition = new R_TRIG();
  168. private R_TRIG _trigAUXWaitCondition = new R_TRIG();
  169. private R_TRIG _trigHeaterWaitCondition = new R_TRIG();
  170. private R_TRIG _trigMFCWaitCondition = new R_TRIG();
  171. private string _infoHeaterProfileFinish = "";
  172. private string _infoAUXWaitCondition = "";
  173. private string _infoHeaterWaitCondition = "";
  174. private string _infoMFCWaitCondition = "";
  175. private Dictionary<int, Tuple<bool, int>> _callSubSteps = new Dictionary<int, Tuple<bool, int>>();
  176. private bool _isJumpStep = false;
  177. private double _remainTimeExcludeEnd = 0;
  178. public Process(ModuleName module, PMModule pm) : base(module, pm)
  179. {
  180. Module = module.ToString();
  181. Name = "Process";
  182. _trigMfcToleranceAlarms = new Dictionary<string, R_TRIG>()
  183. {
  184. {"MFC61", new R_TRIG() },
  185. {"MFC13", new R_TRIG() },
  186. {"MFC14", new R_TRIG() },
  187. {"MFC15", new R_TRIG() },
  188. {"MFC16", new R_TRIG() },
  189. {"MFC24", new R_TRIG() },
  190. {"MFC25", new R_TRIG() },
  191. {"MFC26", new R_TRIG() },
  192. {"MFC34", new R_TRIG() },
  193. {"MFC35", new R_TRIG() },
  194. {"MFC36", new R_TRIG() },
  195. {"MFC90", new R_TRIG() },
  196. {"MFC91", new R_TRIG() },
  197. {"MFC84", new R_TRIG() },
  198. };
  199. _trigMfcToleranceWarnings = new Dictionary<string, R_TRIG>()
  200. {
  201. {"MFC61", new R_TRIG() },
  202. {"MFC13", new R_TRIG() },
  203. {"MFC14", new R_TRIG() },
  204. {"MFC15", new R_TRIG() },
  205. {"MFC16", new R_TRIG() },
  206. {"MFC24", new R_TRIG() },
  207. {"MFC25", new R_TRIG() },
  208. {"MFC26", new R_TRIG() },
  209. {"MFC34", new R_TRIG() },
  210. {"MFC35", new R_TRIG() },
  211. {"MFC36", new R_TRIG() },
  212. {"MFC90", new R_TRIG() },
  213. {"MFC91", new R_TRIG() },
  214. {"MFC84", new R_TRIG() },
  215. };
  216. _faCallback = new RecipeFACallback();
  217. _dbCallback = new RecipeDBCallback();
  218. _fdc = new Fdc(Module);
  219. }
  220. public override Result Start(params object[] param)
  221. {
  222. CurStepTotalLoopCount = 0;
  223. _currentSubRecipeStepNumber = CurSubRecipeStepTotalLoopCount = 0;
  224. if (AlarmConditionJumpStep > 0)
  225. _currentStepNumber = AlarmConditionJumpStep;
  226. else
  227. _currentStepNumber = PMModule.IsJobProcess ? 1 : 0; // 如果是从Job Process开始,从1开始,跳过standby step
  228. AlarmConditionJumpStep = -1;
  229. PMModule.RecipeRunningInfo.InnerId = Guid.NewGuid();
  230. PMModule.RecipeRunningInfo.BeginTime = DateTime.Now;
  231. PMModule.RecipeRunningInfo.TotalTime = CalcRecipeTime();
  232. if (PMModule.RecipeRunningInfo.TotalTime < 0)
  233. return Result.FAIL;
  234. PMModule.RecipeRunningInfo.RemainTimeExcludeEndStep = _remainTimeExcludeEnd;
  235. IsSubReciep = false;
  236. IsExecuteAbort = false;
  237. IsJumpStepCancelCallLoop = false;
  238. PMModule.IsPaused = false;
  239. PMModule.IsHeaterProfile = false;
  240. PMModule.IsHeaterProfileSuccess = false;
  241. PMModule.IsMainRecipeComplete = false;
  242. _loopEnd = false;
  243. _isJumpStep = false;
  244. _curStepElpasedTimeBeforePaused = 0;
  245. _waferTimeElpasedTimeBeforPaused = 0;
  246. _totalElpasedTime = 0;
  247. _holdTimeElpasedTime = 0;
  248. _jumpStepNumber = 0;
  249. _showStepNo = 0;
  250. _state = RecipeRunningState.ExecStep;
  251. _alarmAction = RecipeAlaramAction.None;
  252. _alarmNames = new List<string>();
  253. _subRecipeStartStepNumber = 1;
  254. _callSubSteps.Clear();
  255. PMModule.InitAlarmCondition(PMModule.RecipeRunningInfo.Head.AlarmCondition);
  256. PMModule.InitLeakCheck(PMModule.RecipeRunningInfo.Head.LeakCheck);
  257. PMModule.InitN2PurgeMode(PMModule.RecipeRunningInfo.Head.N2PurgeModeStr);
  258. ResetTrig();
  259. Notify($"Start");
  260. _faCallback.RecipeStart(PMModule.Module, PMModule.RecipeRunningInfo.RecipeName);
  261. _dbCallback.RecipeStart(PMModule.Module, 0, PMModule.RecipeRunningInfo.InnerId.ToString(), PMModule.RecipeRunningInfo.RecipeName, GetDBRecipeType(PMModule.RecipeRunningInfo.ExecRecipeType), (int)PMModule.RecipeExecEntryEnumValue);
  262. _dbCallback.RecipeUpdateStatus(PMModule.RecipeRunningInfo.InnerId.ToString(), "InProcess");
  263. _fdc.Reset();
  264. WaferManager.Instance.UpdateWaferProcessStatus(ModuleHelper.Converter(Module), 0, EnumWaferProcessStatus.InProcess);
  265. PMModule.ResetFDCRecipeStepName();
  266. PMModule.HeaterEnable(true);
  267. #region 把pj_id更新到process表
  268. //从原来退出process挪到此处写入,是为了避免多个job手动abort掉当前job,而recipe继续执行导致的pj_id更新错误
  269. var firstPjId = Singleton<EquipmentManager>.Instance.GetFirstPJId();
  270. UpdateProcessDataPJid(firstPjId);
  271. #endregion
  272. PMModule.RecipeExecEntryEnumValue = RecipeExecEntryEnum.None;
  273. return Result.RUN;
  274. }
  275. public override Result Monitor()
  276. {
  277. if (!PMModule.CheckEnableRunProcess(out string reason))
  278. {
  279. PMModule.CheckEnableRunProcessAlarm.Set(reason);
  280. return Result.FAIL;
  281. }
  282. //MonitorRecipeAlaramAction();
  283. //if (IsExecuteAbort)
  284. // return Result.DONE;
  285. MonitorRecipePause();
  286. CheckTolerance();
  287. List<RecipeStep> curSteps;
  288. if ((IsSubReciep || PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].IsCallSubStep) && !_isJumpStep)
  289. {
  290. curSteps = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps;
  291. if (!_callSubSteps.ContainsKey(_currentStepNumber))
  292. _callSubSteps.Add(_currentStepNumber, Tuple.Create(false, 0));
  293. if (PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].IsCallSubStep)
  294. _callSubSteps[_currentStepNumber] = Tuple.Create(true, PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeLoopCount);
  295. if (!IsSubReciep)
  296. {
  297. PMModule.RecipeRunningInfo.SubRecipeCurrentLoopCount = 1;
  298. PMModule.RecipeRunningInfo.SubRecipeLoopCount = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeLoopCount;
  299. PMModule.RecipeRunningInfo.SubRecipeTable = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeTableInfo;
  300. _faCallback.RecipeTriggerCallSubRecipe(Module, PMModule.RecipeRunningInfo.RecipeName, PMModule.RecipeRunningInfo.StepNumber.ToString(), PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeTableInfo);
  301. }
  302. PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].IsCallSubStep = false;
  303. IsSubReciep = true;
  304. }
  305. else
  306. {
  307. PMModule.RecipeRunningInfo.SubRecipeTable = string.Empty;
  308. curSteps = PMModule.RecipeRunningInfo.RecipeStepList;
  309. PMModule.RecipeRunningInfo.SubRecipeLoopCount = 0;
  310. }
  311. lock (_recipeLocker)
  312. {
  313. try
  314. {
  315. switch (_state)
  316. {
  317. case RecipeRunningState.ExecStep:
  318. {
  319. PMModule.IsWait = false;
  320. _loopEnd = false;
  321. if (!_holdTimer.IsIdle())
  322. {
  323. _holdTimeElpasedTime += _holdTimer.GetElapseTime();
  324. _holdTimer.Stop();
  325. }
  326. PMModule.ResetToleranceChecker();
  327. _curStepElpasedTimeBeforePaused = 0;
  328. ContinueAction = RecipeContinueMode.None;
  329. if (IsSubReciep)
  330. {
  331. if (curSteps[_currentSubRecipeStepNumber].IsLoopStartStep)
  332. {
  333. CurrentSubRecipeLoopCount++;
  334. PMModule.RecipeRunningInfo.IsLooping = true;
  335. PMModule.RecipeRunningInfo.LoopCountCurrent = CurrentSubRecipeLoopCount - 1;//即使不循环,本身也有一次。本身的一次不算,所以减1
  336. PMModule.RecipeRunningInfo.LoopCountSet = curSteps[_currentSubRecipeStepNumber].LoopCount - 1;//即使不循环,本身也有一次。本身的一次不算,所以减1
  337. }
  338. if (curSteps[_currentSubRecipeStepNumber].IsJumpStep)
  339. {
  340. _faCallback.RecipeTriggerJumpStep(Module, PMModule.RecipeRunningInfo.RecipeName, _currentStepNumber.ToString(), curSteps[_currentStepNumber].JumpStepNo.ToString());
  341. _currentSubRecipeStepNumber = curSteps[_currentSubRecipeStepNumber].JumpStepNo;
  342. }
  343. PMModule.SetFDCRecipeStepName(IsSubReciep, curSteps[_currentSubRecipeStepNumber].StepName, (_currentSubRecipeStepNumber + 1).ToString());
  344. RecipeExec("Sub recipe", curSteps, _currentSubRecipeStepNumber, _curStepElpasedTimeBeforePaused, _currentSubRecipeStepNumber + 1);
  345. }
  346. else
  347. {
  348. if (curSteps[_currentStepNumber].IsLoopStartStep)
  349. {
  350. CurrentLoopCount++;
  351. PMModule.RecipeRunningInfo.IsLooping = true;
  352. PMModule.RecipeRunningInfo.LoopCountCurrent = CurrentLoopCount - 1;//即使不循环,本身也有一次。本身的一次不算,所以减1
  353. PMModule.RecipeRunningInfo.LoopCountSet = curSteps[_currentStepNumber].LoopCount - 1;//即使不循环,本身也有一次。本身的一次不算,所以减1
  354. }
  355. if (curSteps[_currentStepNumber].IsJumpStep)
  356. {
  357. _faCallback.RecipeTriggerJumpStep(Module, PMModule.RecipeRunningInfo.RecipeName, _currentStepNumber.ToString(), curSteps[_currentStepNumber].JumpStepNo.ToString());
  358. curSteps[_currentStepNumber].IsJumpStep = false;//只执行一次
  359. _currentStepNumber = curSteps[_currentStepNumber].JumpStepNo;
  360. }
  361. PMModule.SetFDCRecipeStepName(IsSubReciep, curSteps[_currentStepNumber].StepName, _currentStepNumber.ToString());
  362. RecipeExec("Main recipe", curSteps, _currentStepNumber, _curStepElpasedTimeBeforePaused);
  363. }
  364. }
  365. break;
  366. case RecipeRunningState.TimeWait:
  367. //if (PMModule.IsPaused)
  368. //{
  369. // _state = RecipeRunningState.Paused;
  370. // break;
  371. //}
  372. var leakCheck = PMModule.CheckLeakCheckFinish();
  373. _trigLeakCheckFinish.CLK = !leakCheck;
  374. if (_trigLeakCheckFinish.Q)
  375. LOG.Write($"Wait condition:leak check");
  376. if (_stepTimer.IsTimeout())
  377. {
  378. var heaterProfile = PMModule.CheckHeaterProfileFinish(out reason);
  379. _trigHeaterProfileFinish.CLK = !heaterProfile || _infoHeaterProfileFinish != reason;
  380. if (_trigHeaterProfileFinish.Q)
  381. LOG.Write($"Wait condition:heater profile--{reason}");
  382. _infoHeaterProfileFinish = reason;
  383. var boatWaitCondition = PMModule.CheckBoatWaitCondition(out reason);
  384. _trigBoatWaitCondition.CLK = !boatWaitCondition;
  385. if (_trigBoatWaitCondition.Q)
  386. LOG.Write($"Wait condition:boat--{reason}");
  387. var apcWaitCondition = PMModule.CheckAPCWaitCondition(out reason);
  388. _trigAPCWaitCondition.CLK = !apcWaitCondition;
  389. if (_trigAPCWaitCondition.Q)
  390. LOG.Write($"Wait condition:APC--{reason}");
  391. var auxWaitCondition = PMModule.CheckAUXWaitCondition(out reason);
  392. _trigAUXWaitCondition.CLK = !auxWaitCondition || _infoAUXWaitCondition != reason;
  393. if (_trigAUXWaitCondition.Q)
  394. LOG.Write($"Wait condition:heater profile--{reason}");
  395. _infoAUXWaitCondition = reason;
  396. var heaterWaitCondition = PMModule.CheckHeaterWaitCondition(out reason);
  397. _trigHeaterWaitCondition.CLK = !heaterWaitCondition || _infoHeaterWaitCondition != reason;
  398. if (_trigHeaterWaitCondition.Q)
  399. LOG.Write($"Wait condition:heater--{reason}");
  400. _infoHeaterWaitCondition = reason;
  401. var mfcWaitCondition = PMModule.CheckMFCWaitCondition(out reason);
  402. _trigMFCWaitCondition.CLK = !mfcWaitCondition || _infoMFCWaitCondition != reason;
  403. if (_trigMFCWaitCondition.Q)
  404. LOG.Write($"Wait condition:MFC--{reason}");
  405. _infoMFCWaitCondition = reason;
  406. if (heaterProfile &&
  407. leakCheck &&
  408. boatWaitCondition &&
  409. apcWaitCondition &&
  410. auxWaitCondition &&
  411. heaterWaitCondition &&
  412. mfcWaitCondition)
  413. {
  414. _state = RecipeRunningState.StepCompleted;
  415. }
  416. else
  417. {
  418. PMModule.IsWait = true;
  419. }
  420. }
  421. else
  422. {
  423. PMModule.CheckHeaterProfileFinish(out reason);
  424. PMModule.CheckBoatWaitCondition(out reason);
  425. PMModule.CheckAPCWaitCondition(out reason);
  426. PMModule.CheckAUXWaitCondition(out reason);
  427. PMModule.CheckHeaterWaitCondition(out reason);
  428. PMModule.CheckMFCWaitCondition(out reason);
  429. }
  430. break;
  431. case RecipeRunningState.ConditionWait:
  432. {
  433. if (!PMModule.CheckBoatState() && !PMModule.IsBoatMoveToLoadPosition)
  434. break;
  435. var heaterProfile = PMModule.CheckHeaterProfileFinish(out reason);
  436. _trigHeaterProfileFinish.CLK = !heaterProfile || _infoHeaterProfileFinish != reason;
  437. if (_trigHeaterProfileFinish.Q)
  438. LOG.Write($"Wait condition:heater profile--{reason}");
  439. _infoHeaterProfileFinish = reason;
  440. leakCheck = PMModule.CheckLeakCheckFinish();
  441. _trigLeakCheckFinish.CLK = !leakCheck;
  442. if (_trigLeakCheckFinish.Q)
  443. LOG.Write($"Wait condition:leak check");
  444. var boatWaitCondition = PMModule.CheckBoatWaitCondition(out reason);
  445. _trigBoatWaitCondition.CLK = !boatWaitCondition;
  446. if (_trigBoatWaitCondition.Q)
  447. LOG.Write($"Wait condition:boat--{reason}");
  448. var apcWaitCondition = PMModule.CheckAPCWaitCondition(out reason);
  449. _trigAPCWaitCondition.CLK = !apcWaitCondition;
  450. if (_trigAPCWaitCondition.Q)
  451. LOG.Write($"Wait condition:APC--{reason}");
  452. var auxWaitCondition = PMModule.CheckAUXWaitCondition(out reason);
  453. _trigAUXWaitCondition.CLK = !auxWaitCondition || _infoAUXWaitCondition != reason;
  454. if (_trigAUXWaitCondition.Q)
  455. LOG.Write($"Wait condition:heater profile--{reason}");
  456. _infoAUXWaitCondition = reason;
  457. var heaterWaitCondition = PMModule.CheckHeaterWaitCondition(out reason);
  458. _trigHeaterWaitCondition.CLK = !heaterWaitCondition || _infoHeaterWaitCondition != reason;
  459. if (_trigHeaterWaitCondition.Q)
  460. LOG.Write($"Wait condition:heater--{reason}");
  461. _infoHeaterWaitCondition = reason;
  462. var mfcWaitCondition = PMModule.CheckMFCWaitCondition(out reason);
  463. _trigMFCWaitCondition.CLK = !mfcWaitCondition || _infoMFCWaitCondition != reason;
  464. if (_trigMFCWaitCondition.Q)
  465. LOG.Write($"Wait condition:MFC--{reason}");
  466. _infoMFCWaitCondition = reason;
  467. if (heaterProfile &&
  468. leakCheck &&
  469. boatWaitCondition &&
  470. apcWaitCondition &&
  471. auxWaitCondition &&
  472. heaterWaitCondition &&
  473. mfcWaitCondition)
  474. {
  475. _state = RecipeRunningState.StepCompleted;
  476. }
  477. if (_stepTimer.IsTimeout())
  478. {
  479. if (PMModule.IsBoatMoveToLoadPosition)
  480. {
  481. _trigBoatMoveToLoadPositionTimeout.CLK = !boatWaitCondition;
  482. if (_trigBoatMoveToLoadPositionTimeout.Q)
  483. PMModule.BoatMoveToLoadPositionTimeoutWarning.Set();
  484. }
  485. //_trigInputSignalTimeOutAlarm.CLK = !PMModule.CheckExternalSensorCondition();
  486. //if (_trigInputSignalTimeOutAlarm.Q)
  487. // PMModule.InputSignalTimeOutAlarm.Set();
  488. //_trigTemperatureConvergenceTimeOutAlarm.CLK = !PMModule.CheckTempStabilizeCondition();
  489. //if (_trigTemperatureConvergenceTimeOutAlarm.Q)
  490. // PMModule.TemperatureConvergenceTimeOutAlarm.Set();
  491. //_trigReachTempTimeOutAlarm.CLK = !PMModule.CheckReachTempCondition();
  492. //if (_trigReachTempTimeOutAlarm.Q)
  493. // PMModule.TemperatureConvergenceTimeOutAlarm.Set("Reach temp condition timeout");
  494. //_trigPressureConvergenceTimeOutAlarm.CLK = !PMModule.CheckPressureStablilizeCondition();
  495. //if (_trigPressureConvergenceTimeOutAlarm.Q)
  496. // PMModule.PressureConvergenceTimeOutAlarm.Set();
  497. //_trigReachPressureTimeOutAlarm.CLK = !PMModule.CheckReachPressureCondition();
  498. //if (_trigReachPressureTimeOutAlarm.Q)
  499. // PMModule.PressureConvergenceTimeOutAlarm.Set("Reach pressure condition timeout");
  500. //_trigAutoProfileTimeOutAlarm.CLK = !PMModule.CheckFinishAutoProfileCondition();
  501. //if (_trigAutoProfileTimeOutAlarm.Q)
  502. // PMModule.AutoProfileTimeOutAlarm.Set();
  503. //_state = RecipeRunningState.StepCompleted;
  504. }
  505. else
  506. {
  507. _trigBoatMoveToLoadPositionTimeout.RST = true;
  508. }
  509. }
  510. break;
  511. case RecipeRunningState.Paused:
  512. if (!_stepTimer.IsIdle())
  513. {
  514. _curStepElpasedTimeBeforePaused += _stepTimer.GetElapseTime();
  515. _stepTimer.Stop();
  516. }
  517. if (_holdTimer.IsIdle())
  518. _holdTimer.Start(0);
  519. switch (ContinueAction)
  520. {
  521. case RecipeContinueMode.None:
  522. break;
  523. case RecipeContinueMode.StepContinue:
  524. if (!_holdTimer.IsIdle())
  525. {
  526. _holdTimeElpasedTime += _holdTimer.GetElapseTime();
  527. _holdTimer.Stop();
  528. }
  529. _state = RecipeRunningState.ExecStep;
  530. _stepTimer.Stop();
  531. break;
  532. }
  533. break;
  534. case RecipeRunningState.StepCompleted:
  535. {
  536. ResetTrig();
  537. //CloseAllValve();
  538. _curStepElpasedTimeBeforePaused = 0;
  539. var stepName = "";
  540. var stepTime = (float)_stepTimer.GetElapseTime() / 1000;//sec
  541. var thickness = 0.0f;
  542. if (IsSubReciep)
  543. {
  544. stepName = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].StepName;
  545. float.TryParse(PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].FilmThickFormula, out thickness);
  546. //放在前面,stepnumber后面会被更新
  547. if (!_isJumpStep)
  548. {
  549. _faCallback.RecipeStepEnd(PMModule.Module, PMModule.RecipeRunningInfo.RecipeName, _currentSubRecipeStepNumber + 1);
  550. _dbCallback.RecipeStepEnd(PMModule.RecipeRunningInfo.InnerId.ToString(), _currentSubRecipeStepNumber + 1, _fdc.DataList, SC.GetStringValue("PM1.TempCorrection"), SC.GetStringValue("PM1.Heater.PID"));
  551. }
  552. _fdc.Stop();
  553. _totalElpasedTime += curSteps[_currentSubRecipeStepNumber].StepTime;
  554. _subRecipeStartStepNumber++;
  555. if (_loopEnd)
  556. {
  557. _currentSubRecipeStepNumber++;
  558. CurrentSubRecipeLoopCount = 0;
  559. PMModule.RecipeRunningInfo.IsLooping = false;
  560. PMModule.RecipeRunningInfo.LoopCountCurrent = 0;
  561. PMModule.RecipeRunningInfo.LoopCountSet = 0;
  562. }
  563. else
  564. {
  565. SubRecipeLoopEndCheck(curSteps);
  566. }
  567. if (_currentSubRecipeStepNumber >= curSteps.Count)
  568. {
  569. PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeLoopCount--;
  570. if (PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeLoopCount > 0)
  571. {
  572. IsSubReciep = true;
  573. }
  574. else
  575. {
  576. IsSubReciep = false;
  577. }
  578. _currentSubRecipeStepNumber = 0;
  579. CurrentSubRecipeLoopCount = 0;
  580. //// sub recipe执行完后,检查下是否在main recipe的loop内
  581. //RecipeLoopEndCheck();
  582. //if (_currentStepNumber >= PMModule.RecipeRunningInfo.RecipeStepList.Count)
  583. //{
  584. // _currentStepNumber = PMModule.RecipeRunningInfo.RecipeStepList.Count - 1;
  585. // _state = RecipeRunningState.RecipeCompleted;
  586. //}
  587. }
  588. _state = RecipeRunningState.ExecStep;
  589. _stepTimer.Stop();
  590. }
  591. else
  592. {
  593. stepName = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].StepName;
  594. float.TryParse(PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].FilmThickFormula, out thickness);
  595. //放在前面,stepnumber后面会被更新
  596. if (!_isJumpStep)
  597. {
  598. _faCallback.RecipeStepEnd(PMModule.Module, PMModule.RecipeRunningInfo.RecipeName, _currentStepNumber);
  599. _dbCallback.RecipeStepEnd(PMModule.RecipeRunningInfo.InnerId.ToString(), _currentStepNumber, _fdc.DataList, SC.GetStringValue("PM1.TempCorrection"), SC.GetStringValue("PM1.Heater.PID"));
  600. }
  601. _fdc.Stop();
  602. if (_currentStepNumber >= 0 && !IsSubReciep)
  603. {
  604. _totalElpasedTime += PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].StepTime;
  605. }
  606. if (IsSubReciep)
  607. IsSubReciep = false;
  608. if (_loopEnd)
  609. {
  610. _currentStepNumber++;
  611. CurrentLoopCount = 0;
  612. CurrentAbortRecipeLoopCount = 0;
  613. CurrentSubRecipeLoopCount = 0;
  614. PMModule.RecipeRunningInfo.IsLooping = false;
  615. PMModule.RecipeRunningInfo.LoopCountCurrent = 0;
  616. PMModule.RecipeRunningInfo.LoopCountSet = 0;
  617. }
  618. else
  619. {
  620. RecipeLoopEndCheck(PMModule.RecipeRunningInfo.RecipeStepList);
  621. }
  622. if (_currentStepNumber >= PMModule.RecipeRunningInfo.RecipeStepList.Count - 1)
  623. {
  624. for (int i = 0; i < SC.GetValue<int>($"Boat.SlotCount"); i++)
  625. {
  626. if (!WaferManager.Instance.CheckHasWafer(ModuleHelper.Converter(Module), i))
  627. continue;
  628. var wafer = WaferManager.Instance.GetWafer(ModuleHelper.Converter(Module), i);
  629. if (wafer.ProcessState == EnumWaferProcessStatus.Completed ||
  630. wafer.ProcessState == EnumWaferProcessStatus.Idle)
  631. continue;
  632. WaferManager.Instance.UpdateWaferProcessStatus(ModuleHelper.Converter(Module), i, EnumWaferProcessStatus.Completed);
  633. }
  634. PMModule.IsMainRecipeComplete = true;
  635. }
  636. if (_currentStepNumber >= PMModule.RecipeRunningInfo.RecipeStepList.Count)
  637. {
  638. _currentStepNumber = PMModule.RecipeRunningInfo.RecipeStepList.Count - 1;
  639. _state = RecipeRunningState.RecipeCompleted;
  640. }
  641. else
  642. {
  643. _state = RecipeRunningState.ExecStep;
  644. _stepTimer.Stop();
  645. }
  646. }
  647. if (!_isJumpStep)
  648. {
  649. var wafers = WaferManager.Instance.GetWafers(ModuleHelper.Converter(Module));
  650. for (int i = 0; i < wafers.Length; i++)
  651. {
  652. if (WaferManager.Instance.CheckNoWafer(ModuleHelper.Converter(Module), i))
  653. continue;
  654. var useCount = wafers[i].UseCount;
  655. var useTime = wafers[i].UseTime + (float)stepTime;
  656. var useThick = wafers[i].UseThick + thickness;
  657. WaferManager.Instance.UpdateWaferStatistics(ModuleHelper.Converter(Module), i, useCount, (float)Math.Round(useTime, 1), useThick);
  658. }
  659. PMModule.UpdateRecipeThickness(PMModule.RecipeRunningInfo.RecipeName, thickness);
  660. PMModule.UpdateRecipeStepFre(stepName);
  661. PMModule.UpdateRecipeStepRunTime(stepName, Math.Round(stepTime, 1));
  662. PMModule.UpdateRecipeStepGroupThickness(stepName, thickness);
  663. PMModule.UpdateBoatTotalThickness(thickness);
  664. }
  665. }
  666. _isJumpStep = false;
  667. if (PMModule.IsPaused)
  668. {
  669. _state = RecipeRunningState.Paused;
  670. var step = IsSubReciep ? _currentSubRecipeStepNumber + 1 : _currentStepNumber;
  671. break;
  672. }
  673. break;
  674. case RecipeRunningState.RecipeCompleted:
  675. {
  676. var wafers = WaferManager.Instance.GetWafers(ModuleHelper.Converter(Module));
  677. for (int i = 0; i < wafers.Length; i++)
  678. {
  679. if (WaferManager.Instance.CheckNoWafer(ModuleHelper.Converter(Module), i))
  680. continue;
  681. var useCount = wafers[i].UseCount + 1;
  682. var useTime = wafers[i].UseTime;
  683. var useThick = wafers[i].UseThick;
  684. WaferManager.Instance.UpdateWaferStatistics(ModuleHelper.Converter(Module), i, useCount, (float)Math.Round(useTime, 1), useThick);
  685. }
  686. PMModule.UpdateSEDWafer(WaferManager.Instance.GetAllWafers());
  687. if (PMModule.IsHeaterProfile && !PMModule.IsHeaterProfileSuccess)
  688. EV.PostWarningLog(PMModule.Module, "Auto profile failed");
  689. PMModule.UpdateRecipeFre(PMModule.RecipeRunningInfo.RecipeName);
  690. PMModule.ResetFDCRecipeStepName();
  691. Notify("End");
  692. return Result.DONE;
  693. }
  694. case RecipeRunningState.Error:
  695. {
  696. return Result.DONE;
  697. }
  698. default:
  699. break;
  700. }
  701. }
  702. catch (Exception ex)
  703. {
  704. LOG.Write(ex);
  705. return Result.FAIL;
  706. }
  707. }
  708. MonitorRecipeRunInfo();
  709. return Result.RUN;
  710. }
  711. private void MonitorRecipeRunInfo()
  712. {
  713. PMModule.IsHolded = _state == RecipeRunningState.Paused;
  714. double elapseTime;
  715. double totalElapseTime;
  716. double holdTotalElapseTime;
  717. var step = 0;
  718. if (IsSubReciep)
  719. {
  720. if (PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps != null)
  721. {
  722. if (_stepTimer.IsIdle())
  723. {
  724. elapseTime = (_curStepElpasedTimeBeforePaused / 1000) < 1 ? 0 : _curStepElpasedTimeBeforePaused / 1000;
  725. }
  726. else
  727. {
  728. elapseTime = ((_curStepElpasedTimeBeforePaused + _stepTimer.GetElapseTime()) / 1000) < 1 ? 0 : (_curStepElpasedTimeBeforePaused + _stepTimer.GetElapseTime()) / 1000;
  729. }
  730. if (elapseTime > PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].StepTime)
  731. elapseTime = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].StepTime;
  732. totalElapseTime = _totalElpasedTime + elapseTime > PMModule.RecipeRunningInfo.TotalTime ? PMModule.RecipeRunningInfo.TotalTime : _totalElpasedTime + elapseTime;
  733. if (_holdTimer.IsIdle())
  734. {
  735. holdTotalElapseTime = _holdTimeElpasedTime / 1000;
  736. }
  737. else
  738. {
  739. holdTotalElapseTime = (_holdTimeElpasedTime + _holdTimer.GetElapseTime()) / 1000;
  740. }
  741. PMModule.RecipeRunningInfo.StepElapseTime = elapseTime;
  742. PMModule.RecipeRunningInfo.TotalElapseTime = totalElapseTime;
  743. PMModule.RecipeRunningInfo.HoldTime = holdTotalElapseTime;
  744. PMModule.RecipeRunningInfo.StepTime = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].StepTime;
  745. PMModule.RecipeRunningInfo.RecipeName = $"Sub/{PMModule.RecipeRunningInfo.Head.SubRecipe}-{PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeTableInfo}-{PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].StepName}";
  746. PMModule.RecipeRunningInfo.ExecRecipeType = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].RecipeType;
  747. PMModule.RecipeRunningInfo.SubRecipeCurrentLoopCount = PMModule.RecipeRunningInfo.SubRecipeLoopCount - PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeLoopCount + 1;
  748. PMModule.RecipeRunningInfo.SubRecipeName = PMModule.RecipeRunningInfo.Head.SubRecipe;
  749. PMModule.RecipeRunningInfo.SubRecipeTable = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeTableInfo;
  750. step = _currentSubRecipeStepNumber;
  751. if (_state == RecipeRunningState.Paused)
  752. {
  753. //pause之后,当前step执行完,显示的step要保持hold住的这一步的
  754. step--;
  755. if (step < 0)
  756. step = 0;
  757. }
  758. PMModule.RecipeRunningInfo.StepNumber = step + 1; //CurStepNum start from 0
  759. PMModule.RecipeRunningInfo.StepName = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[step].StepName;
  760. if (PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[step].IsLoopEndStep)
  761. PMModule.RecipeRunningInfo.NextStepName = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps.Count > PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].LoopStartStep ?
  762. PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[step].LoopStartStep].StepName : "";
  763. else
  764. {
  765. if (PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps.Count > step + 1)
  766. {
  767. PMModule.RecipeRunningInfo.NextStepName = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[step + 1].StepName;
  768. }
  769. else
  770. {
  771. if (PMModule.RecipeRunningInfo.SubRecipeCurrentLoopCount < PMModule.RecipeRunningInfo.SubRecipeLoopCount)
  772. {
  773. //sub 下一个循环
  774. PMModule.RecipeRunningInfo.NextStepName = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[0].StepName;
  775. }
  776. else
  777. {
  778. //sub执行结束
  779. if (PMModule.RecipeRunningInfo.RecipeStepList.Count > _currentStepNumber)
  780. {
  781. PMModule.RecipeRunningInfo.NextStepName = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].StepName;
  782. }
  783. }
  784. }
  785. }
  786. if (PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].StepName.ToLower() == "standby")
  787. {
  788. PMModule.StringProcessFlowState = PMModule.ProcessFlowState.Standby.ToString();
  789. }
  790. else
  791. {
  792. PMModule.StringProcessFlowState = PMModule.ProcessFlowState.Run.ToString();
  793. }
  794. }
  795. return;
  796. }
  797. if (_stepTimer.IsIdle())
  798. {
  799. elapseTime = (_curStepElpasedTimeBeforePaused / 1000) < 1 ? 0 : _curStepElpasedTimeBeforePaused / 1000;
  800. }
  801. else
  802. {
  803. elapseTime = ((_curStepElpasedTimeBeforePaused + _stepTimer.GetElapseTime()) / 1000) < 1 ? 0 : (_curStepElpasedTimeBeforePaused + _stepTimer.GetElapseTime()) / 1000;
  804. }
  805. if (elapseTime > PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].StepTime)
  806. elapseTime = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].StepTime;
  807. totalElapseTime = _totalElpasedTime + elapseTime > PMModule.RecipeRunningInfo.TotalTime ? PMModule.RecipeRunningInfo.TotalTime : _totalElpasedTime + elapseTime;
  808. if (_holdTimer.IsIdle())
  809. {
  810. holdTotalElapseTime = _holdTimeElpasedTime / 1000;
  811. }
  812. else
  813. {
  814. holdTotalElapseTime = (_holdTimeElpasedTime + _holdTimer.GetElapseTime()) / 1000;
  815. }
  816. PMModule.RecipeRunningInfo.StepElapseTime = elapseTime;
  817. PMModule.RecipeRunningInfo.TotalElapseTime = totalElapseTime;
  818. PMModule.RecipeRunningInfo.HoldTime = holdTotalElapseTime;
  819. PMModule.RecipeRunningInfo.StepTime = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].StepTime;
  820. PMModule.RecipeRunningInfo.RecipeName = PMModule.RecipeRunningInfo.MainRecipeName;
  821. PMModule.RecipeRunningInfo.ExecRecipeType = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].RecipeType;
  822. if (_state == RecipeRunningState.RecipeCompleted)
  823. {
  824. PMModule.RecipeRunningInfo.HoldTime = 0;
  825. }
  826. step = _currentStepNumber;
  827. if (_state == RecipeRunningState.Paused)
  828. {
  829. //pause之后,当前step执行完,显示的step要保持hold住的这一步的
  830. step--;
  831. if (step < 0)
  832. step = 0;
  833. }
  834. if (PMModule.RecipeRunningInfo.RecipeStepList[0].StepName.ToLower() == "standby")
  835. {
  836. PMModule.RecipeRunningInfo.StepNumber = step; //CurStepNum start from 0
  837. }
  838. else
  839. {
  840. PMModule.RecipeRunningInfo.StepNumber = step + 1; //CurStepNum start from 0
  841. }
  842. PMModule.RecipeRunningInfo.StepName = PMModule.RecipeRunningInfo.RecipeStepList[_showStepNo].StepName;
  843. if (PMModule.RecipeRunningInfo.RecipeStepList[step].IsLoopEndStep)
  844. PMModule.RecipeRunningInfo.NextStepName = PMModule.RecipeRunningInfo.RecipeStepList.Count > PMModule.RecipeRunningInfo.RecipeStepList[step].LoopStartStep ? PMModule.RecipeRunningInfo.RecipeStepList[PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].LoopStartStep].StepName : "";
  845. else
  846. PMModule.RecipeRunningInfo.NextStepName = PMModule.RecipeRunningInfo.RecipeStepList.Count > step + 1 ? PMModule.RecipeRunningInfo.RecipeStepList[step + 1].StepName : "";
  847. if (PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].StepName.ToLower() == "standby")
  848. {
  849. PMModule.StringProcessFlowState = PMModule.ProcessFlowState.Standby.ToString();
  850. }
  851. else if (PMModule.RecipeRunningInfo.RecipeStepList.Count - 1 == _currentStepNumber)
  852. {
  853. PMModule.StringProcessFlowState = PMModule.ProcessFlowState.End.ToString();
  854. }
  855. else
  856. {
  857. PMModule.StringProcessFlowState = PMModule.ProcessFlowState.Run.ToString();
  858. }
  859. }
  860. private void MonitorRecipeAlaramAction()
  861. {
  862. if (_state != RecipeRunningState.TimeWait && _state != RecipeRunningState.ConditionWait)
  863. return;
  864. if (_alarmNames.Count == 0)
  865. return;
  866. int group = -1, temp = 0;
  867. string iAlarmConditionTable = "1:";
  868. if (IsSubReciep)
  869. {
  870. for (int i = 0; i < _alarmNames.Count; i++)
  871. {
  872. iAlarmConditionTable = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].AlarmConditionTable;
  873. temp = (int)Singleton<EventManager>.Instance.AlarmDic[iAlarmConditionTable.ToString()][_alarmNames[i]].Group;
  874. if (!PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].AlarmActionSets.ContainsKey(temp))
  875. continue;
  876. var type = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].AlarmActionSets[temp].ProcessingType;
  877. if (temp >= group && (group == -1 || type != "Ignore Alarm"))
  878. group = temp;
  879. }
  880. }
  881. else
  882. {
  883. for (int i = 0; i < _alarmNames.Count; i++)
  884. {
  885. iAlarmConditionTable = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].AlarmConditionTable;
  886. temp = (int)Singleton<EventManager>.Instance.AlarmDic[iAlarmConditionTable.ToString()][_alarmNames[i]].Group;
  887. if (!PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].AlarmActionSets.ContainsKey(temp))
  888. continue;
  889. var type = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].AlarmActionSets[temp].ProcessingType;
  890. if (temp >= group && (group == -1 || type != "Ignore Alarm"))
  891. group = temp;
  892. }
  893. }
  894. _alarmNames.Clear();
  895. if (group == -1)
  896. return;
  897. string alarmAction = "", alarmDetails = "";
  898. List<RecipeStep> abortRecipes = new List<RecipeStep>();
  899. if (IsSubReciep)
  900. {
  901. alarmAction = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].AlarmActionSets[group].ProcessingType;
  902. alarmDetails = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].AlarmActionSets[group].ProcessingDetails;
  903. abortRecipes = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].AlarmActionSets[group].AbortRecipeStepList;
  904. }
  905. else
  906. {
  907. alarmAction = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].AlarmActionSets[group].ProcessingType;
  908. alarmDetails = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].AlarmActionSets[group].ProcessingDetails;
  909. abortRecipes = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].AlarmActionSets[group].AbortRecipeStepList;
  910. }
  911. switch (alarmAction)
  912. {
  913. case "Jump Abort Recipe":
  914. alarmDetails = alarmDetails.Replace("Abort Recipe/", string.Empty);
  915. Abort();
  916. _alarmAction = RecipeAlaramAction.JumpAbortRecipe;
  917. break;
  918. case "Jump Step":
  919. alarmDetails = alarmDetails.Replace("Jump Step/", string.Empty);
  920. _jumpStepNumber = PMModule.RecipeRunningInfo.RecipeStepList.FindIndex(x => x.StepName == alarmDetails);
  921. _alarmAction = RecipeAlaramAction.JumpStep;
  922. _state = RecipeRunningState.StepCompleted;
  923. break;
  924. case "Jump Step(Cancel Call Loop)":
  925. alarmDetails = alarmDetails.Replace("Jump Step(Cancel Call Loop)/", string.Empty);
  926. _jumpStepNumber = PMModule.RecipeRunningInfo.RecipeStepList.FindIndex(x => x.StepName == alarmDetails);
  927. _alarmAction = RecipeAlaramAction.JumpStepCancelCallLoop;
  928. IsJumpStepCancelCallLoop = true;
  929. _state = RecipeRunningState.StepCompleted;
  930. break;
  931. case "Abort":
  932. IsExecuteAbort = true;
  933. break;
  934. case "Hold":
  935. PMModule.IsPaused = true;
  936. ContinueAction = RecipeContinueMode.None;
  937. _alarmAction = RecipeAlaramAction.Hold;
  938. break;
  939. case "Ignore Alarm":
  940. _alarmAction = RecipeAlaramAction.IgnoreAlaram;
  941. break;
  942. default:
  943. _alarmAction = RecipeAlaramAction.IgnoreAlaram;
  944. break;
  945. }
  946. }
  947. private void MonitorRecipePause()
  948. {
  949. if (_state != RecipeRunningState.TimeWait && _state != RecipeRunningState.ConditionWait)
  950. return;
  951. //if (PMModule.IsPaused)
  952. //{
  953. // _state = RecipeRunningState.Paused;
  954. //}
  955. }
  956. public override void Abort()
  957. {
  958. //PMModule.AbortRecipe();//暂时这么做
  959. PMModule.RecipeRunningInfo.IsLooping = false;
  960. PMModule.RecipeRunningInfo.LoopCountCurrent = 0;
  961. PMModule.RecipeRunningInfo.LoopCountSet = 0;
  962. IsExecuteAbort = true;
  963. IsSubReciep = false;
  964. PMModule.IsPaused = false;
  965. PMModule.IsHeaterProfile = false;
  966. PMModule.IsHeaterProfileSuccess = false;
  967. if (!_holdTimer.IsIdle())
  968. {
  969. _holdTimeElpasedTime += _holdTimer.GetElapseTime();
  970. _holdTimer.Stop();
  971. }
  972. CurrentLoopCount = 0;
  973. CurrentAbortRecipeLoopCount = 0;
  974. CurrentSubRecipeLoopCount = 0;
  975. _state = RecipeRunningState.RecipeCompleted;//暂时这么做
  976. //更新步次结束时间
  977. var step = IsSubReciep ? _currentSubRecipeStepNumber + 1 : _currentStepNumber;
  978. _dbCallback.RecipeStepEnd(PMModule.RecipeRunningInfo.InnerId.ToString(), step, _fdc.DataList, SC.GetStringValue("PM1.TempCorrection"), SC.GetStringValue("PM1.Heater.PID"));
  979. return;//暂时这么做
  980. //_totalElpasedTime = 0;
  981. PMModule.RecipeRunningInfo.BeginTime = DateTime.Now;
  982. double total = 0;
  983. for (int i = 0; i < PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].AbortRecipeSteps.Count; i++)
  984. {
  985. total += PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].AbortRecipeSteps[i].StepTime;
  986. }
  987. PMModule.RecipeRunningInfo.TotalTime = _totalElpasedTime + total;
  988. ResetTrig();
  989. //PMModule.ResetToleranceAlarm();
  990. //PMModule.ResetToleranceAlarmChecker();
  991. PMModule.ExecuteAbortRecipeWarning.Set($"from recipe name:{PMModule.RecipeRunningInfo.RecipeName} step:{_currentStepNumber} start execute abort recipe.");
  992. _state = RecipeRunningState.ExecStep;
  993. }
  994. public void UpdateProcessDataPJid(string pjId)
  995. {
  996. _dbCallback.RecipeUpdatePjId(PMModule.RecipeRunningInfo.InnerId.ToString(), pjId);
  997. }
  998. public void ExitProcess()
  999. {
  1000. if (_state == RecipeRunningState.RecipeCompleted)
  1001. {
  1002. PMModule.StringProcessFlowState = PMModule.ProcessFlowState.Standby.ToString();
  1003. _faCallback.RecipeComplete(PMModule.Module, PMModule.RecipeRunningInfo.RecipeName);
  1004. _dbCallback.RecipeComplete(PMModule.RecipeRunningInfo.InnerId.ToString());
  1005. _fdc.Stop();
  1006. }
  1007. else
  1008. {
  1009. if (PMModule.IsExcuteIdleRecipe)
  1010. {
  1011. _faCallback.RecipeComplete(PMModule.Module, PMModule.RecipeRunningInfo.RecipeName);
  1012. _dbCallback.RecipeComplete(PMModule.RecipeRunningInfo.InnerId.ToString());
  1013. _fdc.Stop();
  1014. }
  1015. else
  1016. {
  1017. _faCallback.RecipeFailed(PMModule.Module, PMModule.RecipeRunningInfo.RecipeName);
  1018. _dbCallback.RecipeFailed(PMModule.RecipeRunningInfo.InnerId.ToString());
  1019. _fdc.Stop();
  1020. };
  1021. }
  1022. }
  1023. public void PauseRecipe()
  1024. {
  1025. PMModule.IsPaused = true;
  1026. ContinueAction = RecipeContinueMode.None;
  1027. }
  1028. public void ContinueRecipe()
  1029. {
  1030. PMModule.IsPaused = false;
  1031. ContinueAction = RecipeContinueMode.StepContinue;
  1032. var step = IsSubReciep ? _currentSubRecipeStepNumber + 1 : _currentStepNumber;
  1033. }
  1034. public void SkipCurrentRecipeStep()
  1035. {
  1036. if (_state == RecipeRunningState.ConditionWait || _state == RecipeRunningState.TimeWait || _state == RecipeRunningState.Paused)
  1037. {
  1038. _state = RecipeRunningState.StepCompleted;
  1039. _loopEnd = true;
  1040. PMModule.RecipeRunningInfo.IsLooping = false;
  1041. PMModule.RecipeRunningInfo.LoopCountCurrent = 0;
  1042. PMModule.RecipeRunningInfo.LoopCountSet = 0;
  1043. PMModule.IsPaused = false;
  1044. if (!_holdTimer.IsIdle())
  1045. {
  1046. _holdTimeElpasedTime += _holdTimer.GetElapseTime();
  1047. _holdTimer.Stop();
  1048. }
  1049. }
  1050. if (IsSubReciep)
  1051. {
  1052. ResetLoop(PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps, _currentSubRecipeStepNumber);
  1053. }
  1054. else
  1055. {
  1056. ResetLoop(PMModule.RecipeRunningInfo.RecipeStepList, _currentStepNumber);
  1057. }
  1058. }
  1059. private void ResetLoop(List<RecipeStep> checkRecipeSeps, int currentStepNumber)
  1060. {
  1061. if (checkRecipeSeps == null)
  1062. return;
  1063. var hasLoopStart = false;
  1064. for (int i = currentStepNumber; i >= 0; i--)
  1065. {
  1066. if (checkRecipeSeps[i].IsLoopStartStep)
  1067. {
  1068. hasLoopStart = true;
  1069. break;
  1070. }
  1071. if (checkRecipeSeps[i].IsLoopEndStep)
  1072. {
  1073. hasLoopStart = false;//前面有end,说明没有循环
  1074. break;
  1075. }
  1076. }
  1077. if (hasLoopStart)
  1078. {
  1079. for (int i = currentStepNumber; i < checkRecipeSeps.Count; i++)
  1080. {
  1081. if (checkRecipeSeps[i].IsLoopStartStep)
  1082. {
  1083. break;//没有循环
  1084. }
  1085. if (checkRecipeSeps[i].IsLoopEndStep)
  1086. {
  1087. checkRecipeSeps[i].IsLoopEndStep = false;//跳出skip step之间的循环
  1088. break;
  1089. }
  1090. }
  1091. }
  1092. }
  1093. public void LeakCheckRetry()
  1094. {
  1095. JumpCurrentRecipeStep(_currentStepNumber - 1, PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber - 1].StepName);
  1096. }
  1097. public void JumpCurrentRecipeStep(int stepNumber, string stepName, bool isAlarmConditionCall = false)
  1098. {
  1099. PMModule.StopLeakCheckTimer();
  1100. LOG.Write($"Jump to step stepNumber={stepNumber} stepName={stepName}, currentStepNumber={_currentStepNumber}");
  1101. if (_state == RecipeRunningState.ConditionWait || _state == RecipeRunningState.TimeWait ||
  1102. _state == RecipeRunningState.Paused || _state == RecipeRunningState.ExecStep)
  1103. {
  1104. _loopEnd = true;
  1105. PMModule.RecipeRunningInfo.IsLooping = false;
  1106. PMModule.RecipeRunningInfo.LoopCountCurrent = 0;
  1107. PMModule.RecipeRunningInfo.LoopCountSet = 0;
  1108. CurrentLoopCount = 0;
  1109. CurrentAbortRecipeLoopCount = 0;
  1110. CurrentSubRecipeLoopCount = 0;
  1111. IsSubReciep = false;
  1112. if (IsSubReciep)
  1113. {
  1114. _faCallback.RecipeStepEnd(PMModule.Module, PMModule.RecipeRunningInfo.RecipeName, _currentSubRecipeStepNumber + 1);
  1115. _dbCallback.RecipeStepEnd(PMModule.RecipeRunningInfo.InnerId.ToString(), _currentSubRecipeStepNumber + 1, _fdc.DataList, SC.GetStringValue("PM1.TempCorrection"), SC.GetStringValue("PM1.Heater.PID"));
  1116. ResetLoop(PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps, _currentSubRecipeStepNumber);
  1117. }
  1118. else
  1119. {
  1120. _faCallback.RecipeStepEnd(PMModule.Module, PMModule.RecipeRunningInfo.RecipeName, _currentStepNumber);
  1121. _dbCallback.RecipeStepEnd(PMModule.RecipeRunningInfo.InnerId.ToString(), _currentStepNumber, _fdc.DataList, SC.GetStringValue("PM1.TempCorrection"), SC.GetStringValue("PM1.Heater.PID"));
  1122. ResetLoop(PMModule.RecipeRunningInfo.RecipeStepList, _currentStepNumber);
  1123. }
  1124. if (_callSubSteps != null)
  1125. {
  1126. foreach (var key in _callSubSteps.Keys)
  1127. {
  1128. if (PMModule.RecipeRunningInfo.RecipeStepList.Count > key)
  1129. {
  1130. PMModule.RecipeRunningInfo.RecipeStepList[key].IsCallSubStep = _callSubSteps[key].Item1;
  1131. PMModule.RecipeRunningInfo.RecipeStepList[key].SubRecipeLoopCount = _callSubSteps[key].Item2;
  1132. }
  1133. }
  1134. _currentSubRecipeStepNumber = CurSubRecipeStepTotalLoopCount = 0;
  1135. }
  1136. _isJumpStep = true;
  1137. _currentStepNumber = stepNumber - 1;
  1138. if (_currentStepNumber < 0)
  1139. _currentStepNumber = 0;
  1140. _totalElpasedTime = RefreshElpasedTime();
  1141. _state = RecipeRunningState.StepCompleted;
  1142. PMModule.IsPaused = false;
  1143. if (!_holdTimer.IsIdle())
  1144. {
  1145. _holdTimeElpasedTime += _holdTimer.GetElapseTime();
  1146. _holdTimer.Stop();
  1147. }
  1148. }
  1149. }
  1150. private double RefreshElpasedTime()
  1151. {
  1152. double total = 0;
  1153. try
  1154. {
  1155. for (int i = 0; i < _currentStepNumber; i++)
  1156. {
  1157. if (!PMModule.RecipeRunningInfo.RecipeStepList[i].IsJumpStep)
  1158. {
  1159. if (PMModule.RecipeRunningInfo.RecipeStepList[i].IsLoopEndStep)
  1160. {
  1161. int iLoopStartStep = PMModule.RecipeRunningInfo.RecipeStepList[i].LoopStartStep;
  1162. for (int j = 0; j < PMModule.RecipeRunningInfo.RecipeStepList[i].LoopCount; j++)
  1163. {
  1164. for (int m = iLoopStartStep; m <= i; m++)
  1165. {
  1166. if (PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeSteps != null && PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeSteps.Count > _currentSubRecipeStepNumber)
  1167. {
  1168. total += SubRecipeCalTotalTime(i) * PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeLoopCount;
  1169. }
  1170. total += PMModule.RecipeRunningInfo.RecipeStepList[m].StepTime;
  1171. }
  1172. }
  1173. }
  1174. else
  1175. {
  1176. if (PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeSteps != null &&
  1177. PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeSteps.Count > _currentSubRecipeStepNumber)
  1178. {
  1179. total += SubRecipeCalTotalTime(i) * PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeLoopCount;
  1180. }
  1181. total += PMModule.RecipeRunningInfo.RecipeStepList[i].StepTime;
  1182. }
  1183. }
  1184. }
  1185. }
  1186. catch (Exception ex)
  1187. {
  1188. LOG.Write(ex);
  1189. return -1;
  1190. }
  1191. return (int)total;
  1192. }
  1193. public void RespondAlarm(string name)
  1194. {
  1195. if (!_alarmNames.Contains(name))
  1196. _alarmNames.Add(name);
  1197. }
  1198. protected int CalcRecipeTime()
  1199. {
  1200. double total = 0;
  1201. int iStart = PMModule.IsJobProcess ? 1 : 0;
  1202. try
  1203. {
  1204. for (int i = iStart; i < PMModule.RecipeRunningInfo.RecipeStepList.Count; i++)
  1205. //for (int i = PMModule.RecipeRunningInfo.RecipeStepList.Count - 1; i <= iStart; i--)
  1206. {
  1207. if (!PMModule.RecipeRunningInfo.RecipeStepList[i].IsJumpStep)
  1208. {
  1209. if (PMModule.RecipeRunningInfo.RecipeStepList[i].IsLoopEndStep)
  1210. {
  1211. int iLoopStartStep = PMModule.RecipeRunningInfo.RecipeStepList[i].LoopStartStep;
  1212. total += PMModule.RecipeRunningInfo.RecipeStepList[i].StepTime;
  1213. for (int j = 0; j < PMModule.RecipeRunningInfo.RecipeStepList[i].LoopCount - 1; j++)
  1214. {
  1215. for (int m = iLoopStartStep; m <= i; m++)
  1216. {
  1217. if (PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeSteps != null && PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeSteps.Count > _currentSubRecipeStepNumber)
  1218. {
  1219. total += SubRecipeCalTotalTime(i) * PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeLoopCount;
  1220. }
  1221. total += PMModule.RecipeRunningInfo.RecipeStepList[m].StepTime;
  1222. }
  1223. }
  1224. }
  1225. else
  1226. {
  1227. if (PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeSteps != null && PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeSteps.Count > _currentSubRecipeStepNumber)
  1228. {
  1229. total += SubRecipeCalTotalTime(i) * PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeLoopCount;
  1230. }
  1231. total += PMModule.RecipeRunningInfo.RecipeStepList[i].StepTime;
  1232. }
  1233. }
  1234. else
  1235. {
  1236. i = PMModule.RecipeRunningInfo.RecipeStepList[i].JumpStepNo - 1;// -1是因为i++
  1237. }
  1238. if (i < PMModule.RecipeRunningInfo.RecipeStepList.Count - 1)
  1239. {
  1240. _remainTimeExcludeEnd = total;//获取除最后一步外的process时间,End步会cooling
  1241. }
  1242. }
  1243. }
  1244. catch (Exception ex)
  1245. {
  1246. LOG.Write(ex);
  1247. return -1;
  1248. }
  1249. return (int)total;
  1250. }
  1251. private int AbortRecipeCalTotalTime()
  1252. {
  1253. double total = 0;
  1254. List<RecipeStep> abortRecipeSteps;
  1255. abortRecipeSteps = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].AbortRecipeSteps;
  1256. try
  1257. {
  1258. for (int i = 0; i < abortRecipeSteps.Count; i++)
  1259. {
  1260. if (!abortRecipeSteps[i].IsJumpStep)
  1261. {
  1262. if (abortRecipeSteps[i].IsLoopStartStep)
  1263. {
  1264. int iLoopEndStep = 0;
  1265. for (int j = 0; j < abortRecipeSteps[i].LoopCount; j++)
  1266. {
  1267. for (int m = i; m < abortRecipeSteps.Count; m++)
  1268. {
  1269. total += abortRecipeSteps[m].StepTime;
  1270. if (abortRecipeSteps[m].IsLoopEndStep)
  1271. {
  1272. iLoopEndStep = m;
  1273. break;
  1274. }
  1275. }
  1276. }
  1277. i = iLoopEndStep;
  1278. }
  1279. else
  1280. {
  1281. total += abortRecipeSteps[i].StepTime;
  1282. }
  1283. }
  1284. else
  1285. {
  1286. i = abortRecipeSteps[i].JumpStepNo - 1;// -1是因为i++
  1287. }
  1288. }
  1289. }
  1290. catch (Exception ex)
  1291. {
  1292. LOG.Write(ex);
  1293. return -1;
  1294. }
  1295. return (int)total;
  1296. }
  1297. public void SetContinue(string continueMode)
  1298. {
  1299. switch (continueMode)
  1300. {
  1301. case "Step continue":
  1302. ContinueAction = RecipeContinueMode.StepContinue;
  1303. break;
  1304. case "Step restart":
  1305. ContinueAction = RecipeContinueMode.StepRestart;
  1306. break;
  1307. case "Next step":
  1308. ContinueAction = RecipeContinueMode.NextStep;
  1309. break;
  1310. case "Recipe restart":
  1311. ContinueAction = RecipeContinueMode.RecipeRestart;
  1312. break;
  1313. case "Recipe complete":
  1314. ContinueAction = RecipeContinueMode.RecipeCompleted;
  1315. break;
  1316. case "Wafer return and job stop":
  1317. ContinueAction = RecipeContinueMode.WaferReturnAndJobStop;
  1318. break;
  1319. }
  1320. PMModule.ResetToleranceChecker();
  1321. }
  1322. private double SubRecipeCalTotalTime(int currentStepNumber)
  1323. {
  1324. double total = 0;
  1325. for (int k = _currentSubRecipeStepNumber; k < PMModule.RecipeRunningInfo.RecipeStepList[currentStepNumber].SubRecipeSteps.Count; k++)
  1326. {
  1327. if (!PMModule.RecipeRunningInfo.RecipeStepList[currentStepNumber].SubRecipeSteps[k].IsJumpStep)
  1328. {
  1329. if (PMModule.RecipeRunningInfo.RecipeStepList[currentStepNumber].SubRecipeSteps[k].IsLoopEndStep)
  1330. {
  1331. int iSystemLoopStartStep = PMModule.RecipeRunningInfo.RecipeStepList[currentStepNumber].SubRecipeSteps[k].LoopStartStep;
  1332. total += PMModule.RecipeRunningInfo.RecipeStepList[currentStepNumber].SubRecipeSteps[k].StepTime;
  1333. for (int n = 0; n < PMModule.RecipeRunningInfo.RecipeStepList[currentStepNumber].SubRecipeSteps[k].LoopCount - 1; n++)
  1334. {
  1335. for (int l = iSystemLoopStartStep; l <= k; l++)
  1336. {
  1337. total += PMModule.RecipeRunningInfo.RecipeStepList[currentStepNumber].SubRecipeSteps[l].StepTime;
  1338. }
  1339. }
  1340. }
  1341. else
  1342. {
  1343. total += PMModule.RecipeRunningInfo.RecipeStepList[currentStepNumber].SubRecipeSteps[k].StepTime;
  1344. }
  1345. }
  1346. else
  1347. {
  1348. k = PMModule.RecipeRunningInfo.RecipeStepList[currentStepNumber].SubRecipeSteps[k].JumpStepNo - 1;// -1是因为k++
  1349. }
  1350. }
  1351. return total;
  1352. }
  1353. private void SubRecipeLoopEndCheck(List<RecipeStep> recipeSteps)
  1354. {
  1355. if (_alarmAction == RecipeAlaramAction.JumpStep || _alarmAction == RecipeAlaramAction.JumpStepCancelCallLoop)
  1356. {
  1357. _currentSubRecipeStepNumber = _jumpStepNumber;
  1358. _alarmAction = RecipeAlaramAction.None;
  1359. _alarmNames.Clear();
  1360. return;
  1361. }
  1362. if (recipeSteps[_currentSubRecipeStepNumber].IsLoopEndStep)
  1363. {
  1364. if (IsJumpStepCancelCallLoop)
  1365. {
  1366. _currentSubRecipeStepNumber++;
  1367. IsJumpStepCancelCallLoop = false;
  1368. return;
  1369. }
  1370. //重新读取循环的设定次数
  1371. CurSubRecipeStepTotalLoopCount = recipeSteps[_currentSubRecipeStepNumber].LoopCount;
  1372. if (CurrentSubRecipeLoopCount >= CurSubRecipeStepTotalLoopCount)
  1373. {
  1374. CurrentSubRecipeLoopCount = CurSubRecipeStepTotalLoopCount = 0;
  1375. _currentSubRecipeStepNumber++;
  1376. PMModule.RecipeRunningInfo.IsLooping = false;
  1377. PMModule.RecipeRunningInfo.LoopCountCurrent = 0;
  1378. PMModule.RecipeRunningInfo.LoopCountSet = 0;
  1379. }
  1380. else
  1381. {
  1382. _currentSubRecipeStepNumber = recipeSteps[_currentSubRecipeStepNumber].LoopStartStep;
  1383. }
  1384. }
  1385. else
  1386. {
  1387. _currentSubRecipeStepNumber++;
  1388. }
  1389. }
  1390. private void RecipeLoopEndCheck(List<RecipeStep> recipeSteps)
  1391. {
  1392. if (_alarmAction == RecipeAlaramAction.JumpStep || _alarmAction == RecipeAlaramAction.JumpStepCancelCallLoop)
  1393. {
  1394. _currentStepNumber = _jumpStepNumber;
  1395. _alarmAction = RecipeAlaramAction.None;
  1396. _alarmNames.Clear();
  1397. return;
  1398. }
  1399. if (recipeSteps[_currentStepNumber].IsLoopEndStep)
  1400. {
  1401. if (IsJumpStepCancelCallLoop)
  1402. {
  1403. _currentStepNumber++;
  1404. IsJumpStepCancelCallLoop = false;
  1405. return;
  1406. }
  1407. //重新读取循环的设定次数
  1408. CurStepTotalLoopCount = recipeSteps[_currentStepNumber].LoopCount;
  1409. if (CurrentLoopCount >= CurStepTotalLoopCount)
  1410. {
  1411. CurrentLoopCount = CurStepTotalLoopCount = 0;
  1412. _currentStepNumber++;
  1413. PMModule.RecipeRunningInfo.IsLooping = false;
  1414. PMModule.RecipeRunningInfo.LoopCountCurrent = 0;
  1415. PMModule.RecipeRunningInfo.LoopCountSet = 0;
  1416. }
  1417. else
  1418. {
  1419. _currentStepNumber = recipeSteps[_currentStepNumber].LoopStartStep;
  1420. }
  1421. }
  1422. else
  1423. {
  1424. _currentStepNumber++;
  1425. }
  1426. }
  1427. private void CheckTolerance()
  1428. {
  1429. //foreach (var key in _trigMfcToleranceAlarms.Keys)
  1430. //{
  1431. // if (PMModule.GasMFCs.ContainsKey(key) && _trigMfcToleranceWarnings.ContainsKey(key))
  1432. // {
  1433. // _trigMfcToleranceAlarms[key].CLK = PMModule.GasMFCs[key].CheckToleranceAlarm();
  1434. // if (_trigMfcToleranceAlarms[key].Q)
  1435. // PMModule.GasMFCs[key].SetToleranceAlarm();
  1436. // _trigMfcToleranceWarnings[key].CLK = PMModule.GasMFCs[key].CheckToleranceWarning();
  1437. // if (_trigMfcToleranceWarnings[key].Q && !_trigMfcToleranceAlarms[key].Q)
  1438. // PMModule.GasMFCs[key].SetToleranceWarning();
  1439. // }
  1440. //}
  1441. //_trigHeaterBottomToleranceAlarm.CLK = PMModule.CheckHeaterBottomToleranceAlaram();
  1442. //if (_trigHeaterBottomToleranceAlarm.Q)
  1443. // PMModule.SetHeaterBottomToleranceAlaram();
  1444. //_trigHeaterBottomToleranceWarning.CLK = PMModule.CheckHeaterBottomToleranceWarning();
  1445. //if (_trigHeaterBottomToleranceWarning.Q && !_trigHeaterBottomToleranceAlarm.Q)
  1446. // PMModule.SetHeaterBottomToleranceWarning();
  1447. //_trigHeaterCenterBottomToleranceAlarm.CLK = PMModule.CheckHeaterCenterBottomToleranceAlaram();
  1448. //if (_trigHeaterCenterBottomToleranceAlarm.Q)
  1449. // PMModule.SetHeaterCenterBottomToleranceAlaram();
  1450. //_trigHeaterCenterBottomToleranceWarning.CLK = PMModule.CheckHeaterCenterBottomToleranceWarning();
  1451. //if (_trigHeaterCenterBottomToleranceWarning.Q && !_trigHeaterCenterBottomToleranceAlarm.Q)
  1452. // PMModule.SetHeaterCenterBottomToleranceWarning();
  1453. //_trigHeaterCenterToleranceAlarm.CLK = PMModule.CheckHeaterCenterToleranceAlaram();
  1454. //if (_trigHeaterCenterToleranceAlarm.Q)
  1455. // PMModule.SetHeaterCenterToleranceAlaram();
  1456. //_trigHeaterCenterToleranceWarning.CLK = PMModule.CheckHeaterCenterToleranceWarning();
  1457. //if (_trigHeaterCenterToleranceWarning.Q && !_trigHeaterCenterToleranceAlarm.Q)
  1458. // PMModule.SetHeaterCenterToleranceWarning();
  1459. //_trigHeaterCenterTopToleranceAlarm.CLK = PMModule.CheckHeaterCenterTopToleranceAlaram();
  1460. //if (_trigHeaterCenterTopToleranceAlarm.Q)
  1461. // PMModule.SetHeaterCenterTopToleranceAlaram();
  1462. //_trigHeaterCenterTopToleranceWarning.CLK = PMModule.CheckHeaterCenterTopToleranceWarning();
  1463. //if (_trigHeaterCenterTopToleranceWarning.Q && !_trigHeaterCenterTopToleranceAlarm.Q)
  1464. // PMModule.SetHeaterCenterTopToleranceWarning();
  1465. //_trigHeaterTopToleranceAlarm.CLK = PMModule.CheckHeaterTopToleranceAlaram();
  1466. //if (_trigHeaterTopToleranceAlarm.Q)
  1467. // PMModule.SetHeaterTopToleranceAlaram();
  1468. //_trigHeaterTopToleranceWarning.CLK = PMModule.CheckHeaterTopToleranceWarning();
  1469. //if (_trigHeaterTopToleranceWarning.Q && !_trigHeaterTopToleranceAlarm.Q)
  1470. // PMModule.SetHeaterTopToleranceWarning();
  1471. //_trigPressureToleranceAlarm.CLK = PMModule.CheckPressureToleranceAlaram();
  1472. //if (_trigPressureToleranceAlarm.Q)
  1473. // PMModule.SetPressureToleranceAlaram();
  1474. //_trigPressureToleranceWarning.CLK = PMModule.CheckPressureToleranceWarning();
  1475. //if (_trigPressureToleranceWarning.Q && !_trigPressureToleranceAlarm.Q)
  1476. // PMModule.SetPressureToleranceWarning();
  1477. }
  1478. private void ResetTrig()
  1479. {
  1480. PMModule.ResetAlarmCondition();
  1481. foreach (var key in _trigMfcToleranceAlarms.Keys)
  1482. {
  1483. if (_trigMfcToleranceWarnings.ContainsKey(key))
  1484. {
  1485. _trigMfcToleranceAlarms[key].RST = true;
  1486. _trigMfcToleranceWarnings[key].RST = true;
  1487. }
  1488. }
  1489. _trigHeaterBottomToleranceAlarm.RST = true;
  1490. _trigHeaterBottomToleranceWarning.RST = true;
  1491. _trigHeaterCenterBottomToleranceAlarm.RST = true;
  1492. _trigHeaterCenterBottomToleranceWarning.RST = true;
  1493. _trigHeaterCenterToleranceAlarm.RST = true;
  1494. _trigHeaterCenterToleranceWarning.RST = true;
  1495. _trigHeaterCenterTopToleranceAlarm.RST = true;
  1496. _trigHeaterCenterTopToleranceWarning.RST = true;
  1497. _trigHeaterTopToleranceAlarm.RST = true;
  1498. _trigHeaterTopToleranceWarning.RST = true;
  1499. _trigPressureToleranceAlarm.RST = true;
  1500. _trigPressureToleranceWarning.RST = true;
  1501. _trigInputSignalTimeOutAlarm.RST = true;
  1502. _trigTemperatureConvergenceTimeOutAlarm.RST = true;
  1503. _trigReachTempTimeOutAlarm.RST = true;
  1504. _trigPressureConvergenceTimeOutAlarm.RST = true;
  1505. _trigReachPressureTimeOutAlarm.RST = true;
  1506. _trigAutoProfileTimeOutAlarm.RST = true;
  1507. _trigHeaterProfileFinish.RST = true;
  1508. _trigLeakCheckFinish.RST = true;
  1509. _trigBoatWaitCondition.RST = true;
  1510. _trigAPCWaitCondition.RST = true;
  1511. _trigAUXWaitCondition.RST = true;
  1512. _trigHeaterWaitCondition.RST = true;
  1513. _trigMFCWaitCondition.RST = true;
  1514. _infoHeaterProfileFinish = "";
  1515. _infoAUXWaitCondition = "";
  1516. _infoHeaterWaitCondition = "";
  1517. _infoMFCWaitCondition = "";
  1518. }
  1519. private int GetDBRecipeType(string recipeTypeName)
  1520. {
  1521. if (string.IsNullOrEmpty(recipeTypeName))
  1522. return (int)RecipeTypeEnum.none;
  1523. if (Enum.TryParse<RecipeTypeEnum>(recipeTypeName, true, out var result))
  1524. return (int)result;
  1525. return (int)RecipeTypeEnum.none;
  1526. }
  1527. private void RecipeExec(string type, List<RecipeStep> curSteps, int currentStepNumber, double curStepElpasedTimeBeforePaused, int otherRecipeStartStepNumber = 0)
  1528. {
  1529. var reason = "";
  1530. _stepTimer.Start(curSteps[currentStepNumber].StepTime * 1000 - curStepElpasedTimeBeforePaused);
  1531. _showStepNo = currentStepNumber;
  1532. Notify($"{type} running step {currentStepNumber + 1}:{curSteps[currentStepNumber].StepName}");
  1533. var stopwatch = new Stopwatch();
  1534. stopwatch.Start();
  1535. //执行工艺程序命令
  1536. foreach (var recipeCmd in curSteps[currentStepNumber].RecipeCommands.Keys)
  1537. {
  1538. if (!OP.CanDoOperation($"{_doModule}.{recipeCmd}", out reason, curSteps[currentStepNumber].RecipeCommands[recipeCmd]))
  1539. {
  1540. if (!OP.CanDoOperation($"{Module}.{recipeCmd}", out reason, curSteps[currentStepNumber].RecipeCommands[recipeCmd]))
  1541. {
  1542. if (!OP.CanDoOperation($"{ModuleName.System}.{recipeCmd}", out reason, curSteps[currentStepNumber].RecipeCommands[recipeCmd]))
  1543. {
  1544. PMModule.CheckCanDoOperationAlarm.Set($"Can not execute {recipeCmd}, {reason}");
  1545. return;
  1546. }
  1547. else
  1548. {
  1549. OP.DoOperation($"{ModuleName.System}.{recipeCmd}", out string reason1, 0, curSteps[currentStepNumber].RecipeCommands[recipeCmd]);
  1550. }
  1551. }
  1552. else
  1553. {
  1554. OP.DoOperation($"{Module}.{recipeCmd}", out string reason1, 0, curSteps[currentStepNumber].RecipeCommands[recipeCmd]);
  1555. }
  1556. }
  1557. else
  1558. {
  1559. OP.DoOperation($"{_doModule}.{recipeCmd}", out string reason1, 0, curSteps[currentStepNumber].RecipeCommands[recipeCmd]);
  1560. }
  1561. }
  1562. LOG.Write($"step exec time {stopwatch.ElapsedMilliseconds}");
  1563. if (curSteps[currentStepNumber].EndBy == EnumEndByCondition.ByTime && !PMModule.IsBoatMoveToLoadPosition)
  1564. _state = RecipeRunningState.TimeWait;
  1565. else
  1566. _state = RecipeRunningState.ConditionWait;
  1567. _faCallback.RecipeStepStart(PMModule.Module, PMModule.RecipeRunningInfo.RecipeName, otherRecipeStartStepNumber != 0 ? otherRecipeStartStepNumber : currentStepNumber);
  1568. if (type == "Sub recipe")
  1569. _dbCallback.RecipeStepStart(PMModule.RecipeRunningInfo.InnerId.ToString(), _currentStepNumber, PMModule.RecipeRunningInfo.RecipeStepList.Count > _currentStepNumber ? PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].StepName : "",
  1570. PMModule.RecipeRunningInfo.RecipeStepList.Count > _currentStepNumber ? (float)PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].StepTime : 0,
  1571. $"{(otherRecipeStartStepNumber != 0 ? otherRecipeStartStepNumber : currentStepNumber)}", curSteps[currentStepNumber].StepName, (float)curSteps[currentStepNumber].StepTime,
  1572. $"{PMModule.RecipeRunningInfo.SubRecipeCurrentLoopCount}/{PMModule.RecipeRunningInfo.SubRecipeLoopCount}");
  1573. else
  1574. _dbCallback.RecipeStepStart(PMModule.RecipeRunningInfo.InnerId.ToString(), otherRecipeStartStepNumber != 0 ? otherRecipeStartStepNumber : currentStepNumber,
  1575. curSteps[currentStepNumber].StepName, (float)curSteps[currentStepNumber].StepTime, "", "", 0, "");
  1576. _fdc.Start(curSteps[currentStepNumber].RecipeCommands);
  1577. }
  1578. public void FACallBack(string triggerModule, string recipeAction, string module, string recipeName, string recipeStep, string jumpStpeId = "", string otherRecipeName = "")
  1579. {
  1580. if (triggerModule == ConstantsCommon.AlarmConditionTrigger)
  1581. {
  1582. switch (recipeAction)
  1583. {
  1584. case UniversalEvents.AlarmConditionTriggerReset:
  1585. _faCallback.AlarmConditionTriggerReset(module, recipeName, recipeStep, otherRecipeName);
  1586. break;
  1587. case UniversalEvents.AlarmConditionTriggerEnd:
  1588. _faCallback.AlarmConditionTriggerEnd(module, recipeName, recipeStep);
  1589. break;
  1590. case UniversalEvents.AlarmConditionTriggerHold:
  1591. _faCallback.AlarmConditionTriggerHold(module, recipeName, recipeStep);
  1592. break;
  1593. case UniversalEvents.AlarmConditionTriggerJumpStep:
  1594. _faCallback.AlarmConditionTriggerJumpStep(module, recipeName, recipeStep, jumpStpeId);
  1595. break;
  1596. case UniversalEvents.AlarmConditionTriggerCallAlarmRecipe:
  1597. _faCallback.AlarmConditionTriggerCallAlarmRecipe(module, recipeName, recipeStep, otherRecipeName);
  1598. break;
  1599. case UniversalEvents.AlarmConditionTriggerCallAbortRecipe:
  1600. _faCallback.AlarmConditionTriggerCallAbortRecipe(module, recipeName, recipeStep, otherRecipeName);
  1601. break;
  1602. }
  1603. Task.Delay(1000).ContinueWith(x =>
  1604. {
  1605. PMModule.RecipeAbnormalEnd(module, recipeName, recipeStep, recipeAction);
  1606. });
  1607. }
  1608. else if (triggerModule == ConstantsCommon.LeakCheckTrigger)
  1609. {
  1610. switch (recipeAction)
  1611. {
  1612. case UniversalEvents.LeakCheckTriggerReset:
  1613. _faCallback.LeakCheckTriggerReset(module, recipeName, recipeStep, otherRecipeName);
  1614. break;
  1615. case UniversalEvents.LeakCheckTriggerEnd:
  1616. _faCallback.LeakCheckTriggerEnd(module, recipeName, recipeStep);
  1617. break;
  1618. case UniversalEvents.LeakCheckTriggerHold:
  1619. _faCallback.LeakCheckTriggerHold(module, recipeName, recipeStep);
  1620. break;
  1621. case UniversalEvents.LeakCheckTriggerJumpStep:
  1622. _faCallback.LeakCheckTriggerJumpStep(module, recipeName, recipeStep, jumpStpeId);
  1623. break;
  1624. case UniversalEvents.LeakCheckTriggerCallAlarmRecipe:
  1625. _faCallback.LeakCheckTriggerCallAlarmRecipe(module, recipeName, recipeStep, otherRecipeName);
  1626. break;
  1627. case UniversalEvents.LeakCheckTriggerCallAbortRecipe:
  1628. _faCallback.LeakCheckTriggerCallAbortRecipe(module, recipeName, recipeStep, otherRecipeName);
  1629. break;
  1630. }
  1631. Task.Delay(1000).ContinueWith(x =>
  1632. {
  1633. PMModule.RecipeAbnormalEnd(module, recipeName, recipeStep, recipeAction);
  1634. });
  1635. }
  1636. else if (triggerModule == ConstantsCommon.ManualTrigger)
  1637. {
  1638. switch (recipeAction)
  1639. {
  1640. case UniversalEvents.ManualTriggerRecipeHold:
  1641. _faCallback.ManualTriggerRecipeHold(module, recipeName, recipeStep);
  1642. break;
  1643. case UniversalEvents.ManualTriggerRecipeRelease:
  1644. _faCallback.ManualTriggerRecipeRelease(module, recipeName, recipeStep);
  1645. break;
  1646. case UniversalEvents.ManualTriggerRecipeSkip:
  1647. _faCallback.ManualTriggerRecipeSkip(module, recipeName, recipeStep);
  1648. break;
  1649. case UniversalEvents.ManualTriggerRecipeJump:
  1650. _faCallback.ManualTriggerRecipeJump(module, recipeName, recipeStep, jumpStpeId);
  1651. break;
  1652. case UniversalEvents.ManualTriggerRecipeAbort:
  1653. _faCallback.ManualTriggerRecipeAbort(module, recipeName, recipeStep, otherRecipeName);
  1654. break;
  1655. }
  1656. Task.Delay(1000).ContinueWith(x =>
  1657. {
  1658. PMModule.RecipeAbnormalEnd(module, recipeName, recipeStep, recipeAction);
  1659. });
  1660. }
  1661. else if (triggerModule == ConstantsCommon.RecipeTrigger)
  1662. {
  1663. switch (recipeAction)
  1664. {
  1665. case UniversalEvents.RecipeTriggerReset:
  1666. _faCallback.RecipeTriggerReset(module, recipeName, recipeStep, otherRecipeName);
  1667. break;
  1668. case UniversalEvents.RecipeTriggerEnd:
  1669. _faCallback.RecipeTriggerEnd(module, recipeName, recipeStep);
  1670. break;
  1671. case UniversalEvents.RecipeTriggerHold:
  1672. _faCallback.RecipeTriggerHold(module, recipeName, recipeStep);
  1673. break;
  1674. case UniversalEvents.RecipeTriggerLeakCheck:
  1675. _faCallback.RecipeTriggerLeakCheck(module, recipeName, recipeStep);
  1676. break;
  1677. case UniversalEvents.RecipeTriggerJumpStep:
  1678. _faCallback.RecipeTriggerJumpStep(module, recipeName, recipeStep, otherRecipeName);
  1679. break;
  1680. case UniversalEvents.RecipeTriggerCallSubRecipe:
  1681. _faCallback.RecipeTriggerCallSubRecipe(module, recipeName, recipeStep, otherRecipeName);
  1682. break;
  1683. }
  1684. }
  1685. }
  1686. }
  1687. }