Process.cs 95 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963
  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. Notify("End");
  691. return Result.DONE;
  692. }
  693. case RecipeRunningState.Error:
  694. {
  695. return Result.DONE;
  696. }
  697. default:
  698. break;
  699. }
  700. }
  701. catch (Exception ex)
  702. {
  703. LOG.Write(ex);
  704. return Result.FAIL;
  705. }
  706. }
  707. MonitorRecipeRunInfo();
  708. return Result.RUN;
  709. }
  710. private void MonitorRecipeRunInfo()
  711. {
  712. PMModule.IsHolded = _state == RecipeRunningState.Paused;
  713. double elapseTime;
  714. double totalElapseTime;
  715. double holdTotalElapseTime;
  716. var step = 0;
  717. if (IsSubReciep)
  718. {
  719. if (PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps != null)
  720. {
  721. if (_stepTimer.IsIdle())
  722. {
  723. elapseTime = (_curStepElpasedTimeBeforePaused / 1000) < 1 ? 0 : _curStepElpasedTimeBeforePaused / 1000;
  724. }
  725. else
  726. {
  727. elapseTime = ((_curStepElpasedTimeBeforePaused + _stepTimer.GetElapseTime()) / 1000) < 1 ? 0 : (_curStepElpasedTimeBeforePaused + _stepTimer.GetElapseTime()) / 1000;
  728. }
  729. if (elapseTime > PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].StepTime)
  730. elapseTime = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].StepTime;
  731. totalElapseTime = _totalElpasedTime + elapseTime > PMModule.RecipeRunningInfo.TotalTime ? PMModule.RecipeRunningInfo.TotalTime : _totalElpasedTime + elapseTime;
  732. if (_holdTimer.IsIdle())
  733. {
  734. holdTotalElapseTime = _holdTimeElpasedTime / 1000;
  735. }
  736. else
  737. {
  738. holdTotalElapseTime = (_holdTimeElpasedTime + _holdTimer.GetElapseTime()) / 1000;
  739. }
  740. PMModule.RecipeRunningInfo.StepElapseTime = elapseTime;
  741. PMModule.RecipeRunningInfo.TotalElapseTime = totalElapseTime;
  742. PMModule.RecipeRunningInfo.HoldTime = holdTotalElapseTime;
  743. PMModule.RecipeRunningInfo.StepTime = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].StepTime;
  744. PMModule.RecipeRunningInfo.RecipeName = $"Sub/{PMModule.RecipeRunningInfo.Head.SubRecipe}-{PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeTableInfo}-{PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].StepName}";
  745. PMModule.RecipeRunningInfo.ExecRecipeType = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].RecipeType;
  746. PMModule.RecipeRunningInfo.SubRecipeCurrentLoopCount = PMModule.RecipeRunningInfo.SubRecipeLoopCount - PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeLoopCount + 1;
  747. PMModule.RecipeRunningInfo.SubRecipeName = PMModule.RecipeRunningInfo.Head.SubRecipe;
  748. PMModule.RecipeRunningInfo.SubRecipeTable = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeTableInfo;
  749. step = _currentSubRecipeStepNumber;
  750. if (_state == RecipeRunningState.Paused)
  751. {
  752. //pause之后,当前step执行完,显示的step要保持hold住的这一步的
  753. step--;
  754. if (step < 0)
  755. step = 0;
  756. }
  757. PMModule.RecipeRunningInfo.StepNumber = step + 1; //CurStepNum start from 0
  758. PMModule.RecipeRunningInfo.StepName = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[step].StepName;
  759. if (PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[step].IsLoopEndStep)
  760. PMModule.RecipeRunningInfo.NextStepName = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps.Count > PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].LoopStartStep ?
  761. PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[step].LoopStartStep].StepName : "";
  762. else
  763. {
  764. if (PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps.Count > step + 1)
  765. {
  766. PMModule.RecipeRunningInfo.NextStepName = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[step + 1].StepName;
  767. }
  768. else
  769. {
  770. if (PMModule.RecipeRunningInfo.SubRecipeCurrentLoopCount < PMModule.RecipeRunningInfo.SubRecipeLoopCount)
  771. {
  772. //sub 下一个循环
  773. PMModule.RecipeRunningInfo.NextStepName = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[0].StepName;
  774. }
  775. else
  776. {
  777. //sub执行结束
  778. if (PMModule.RecipeRunningInfo.RecipeStepList.Count > _currentStepNumber)
  779. {
  780. PMModule.RecipeRunningInfo.NextStepName = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].StepName;
  781. }
  782. }
  783. }
  784. }
  785. if (PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].StepName.ToLower() == "standby")
  786. {
  787. PMModule.StringProcessFlowState = PMModule.ProcessFlowState.Standby.ToString();
  788. }
  789. else
  790. {
  791. PMModule.StringProcessFlowState = PMModule.ProcessFlowState.Run.ToString();
  792. }
  793. }
  794. return;
  795. }
  796. if (_stepTimer.IsIdle())
  797. {
  798. elapseTime = (_curStepElpasedTimeBeforePaused / 1000) < 1 ? 0 : _curStepElpasedTimeBeforePaused / 1000;
  799. }
  800. else
  801. {
  802. elapseTime = ((_curStepElpasedTimeBeforePaused + _stepTimer.GetElapseTime()) / 1000) < 1 ? 0 : (_curStepElpasedTimeBeforePaused + _stepTimer.GetElapseTime()) / 1000;
  803. }
  804. if (elapseTime > PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].StepTime)
  805. elapseTime = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].StepTime;
  806. totalElapseTime = _totalElpasedTime + elapseTime > PMModule.RecipeRunningInfo.TotalTime ? PMModule.RecipeRunningInfo.TotalTime : _totalElpasedTime + elapseTime;
  807. if (_holdTimer.IsIdle())
  808. {
  809. holdTotalElapseTime = _holdTimeElpasedTime / 1000;
  810. }
  811. else
  812. {
  813. holdTotalElapseTime = (_holdTimeElpasedTime + _holdTimer.GetElapseTime()) / 1000;
  814. }
  815. PMModule.RecipeRunningInfo.StepElapseTime = elapseTime;
  816. PMModule.RecipeRunningInfo.TotalElapseTime = totalElapseTime;
  817. PMModule.RecipeRunningInfo.HoldTime = holdTotalElapseTime;
  818. PMModule.RecipeRunningInfo.StepTime = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].StepTime;
  819. PMModule.RecipeRunningInfo.RecipeName = PMModule.RecipeRunningInfo.MainRecipeName;
  820. PMModule.RecipeRunningInfo.ExecRecipeType = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].RecipeType;
  821. if (_state == RecipeRunningState.RecipeCompleted)
  822. {
  823. PMModule.RecipeRunningInfo.HoldTime = 0;
  824. }
  825. step = _currentStepNumber;
  826. if (_state == RecipeRunningState.Paused)
  827. {
  828. //pause之后,当前step执行完,显示的step要保持hold住的这一步的
  829. step--;
  830. if (step < 0)
  831. step = 0;
  832. }
  833. if (PMModule.RecipeRunningInfo.RecipeStepList[0].StepName.ToLower() == "standby")
  834. {
  835. PMModule.RecipeRunningInfo.StepNumber = step; //CurStepNum start from 0
  836. }
  837. else
  838. {
  839. PMModule.RecipeRunningInfo.StepNumber = step + 1; //CurStepNum start from 0
  840. }
  841. PMModule.RecipeRunningInfo.StepName = PMModule.RecipeRunningInfo.RecipeStepList[_showStepNo].StepName;
  842. if (PMModule.RecipeRunningInfo.RecipeStepList[step].IsLoopEndStep)
  843. PMModule.RecipeRunningInfo.NextStepName = PMModule.RecipeRunningInfo.RecipeStepList.Count > PMModule.RecipeRunningInfo.RecipeStepList[step].LoopStartStep ? PMModule.RecipeRunningInfo.RecipeStepList[PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].LoopStartStep].StepName : "";
  844. else
  845. PMModule.RecipeRunningInfo.NextStepName = PMModule.RecipeRunningInfo.RecipeStepList.Count > step + 1 ? PMModule.RecipeRunningInfo.RecipeStepList[step + 1].StepName : "";
  846. if (PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].StepName.ToLower() == "standby")
  847. {
  848. PMModule.StringProcessFlowState = PMModule.ProcessFlowState.Standby.ToString();
  849. }
  850. else if (PMModule.RecipeRunningInfo.RecipeStepList.Count - 1 == _currentStepNumber)
  851. {
  852. PMModule.StringProcessFlowState = PMModule.ProcessFlowState.End.ToString();
  853. }
  854. else
  855. {
  856. PMModule.StringProcessFlowState = PMModule.ProcessFlowState.Run.ToString();
  857. }
  858. }
  859. private void MonitorRecipeAlaramAction()
  860. {
  861. if (_state != RecipeRunningState.TimeWait && _state != RecipeRunningState.ConditionWait)
  862. return;
  863. if (_alarmNames.Count == 0)
  864. return;
  865. int group = -1, temp = 0;
  866. string iAlarmConditionTable = "1:";
  867. if (IsSubReciep)
  868. {
  869. for (int i = 0; i < _alarmNames.Count; i++)
  870. {
  871. iAlarmConditionTable = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].AlarmConditionTable;
  872. temp = (int)Singleton<EventManager>.Instance.AlarmDic[iAlarmConditionTable.ToString()][_alarmNames[i]].Group;
  873. if (!PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].AlarmActionSets.ContainsKey(temp))
  874. continue;
  875. var type = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].AlarmActionSets[temp].ProcessingType;
  876. if (temp >= group && (group == -1 || type != "Ignore Alarm"))
  877. group = temp;
  878. }
  879. }
  880. else
  881. {
  882. for (int i = 0; i < _alarmNames.Count; i++)
  883. {
  884. iAlarmConditionTable = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].AlarmConditionTable;
  885. temp = (int)Singleton<EventManager>.Instance.AlarmDic[iAlarmConditionTable.ToString()][_alarmNames[i]].Group;
  886. if (!PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].AlarmActionSets.ContainsKey(temp))
  887. continue;
  888. var type = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].AlarmActionSets[temp].ProcessingType;
  889. if (temp >= group && (group == -1 || type != "Ignore Alarm"))
  890. group = temp;
  891. }
  892. }
  893. _alarmNames.Clear();
  894. if (group == -1)
  895. return;
  896. string alarmAction = "", alarmDetails = "";
  897. List<RecipeStep> abortRecipes = new List<RecipeStep>();
  898. if (IsSubReciep)
  899. {
  900. alarmAction = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].AlarmActionSets[group].ProcessingType;
  901. alarmDetails = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].AlarmActionSets[group].ProcessingDetails;
  902. abortRecipes = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps[_currentSubRecipeStepNumber].AlarmActionSets[group].AbortRecipeStepList;
  903. }
  904. else
  905. {
  906. alarmAction = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].AlarmActionSets[group].ProcessingType;
  907. alarmDetails = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].AlarmActionSets[group].ProcessingDetails;
  908. abortRecipes = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].AlarmActionSets[group].AbortRecipeStepList;
  909. }
  910. switch (alarmAction)
  911. {
  912. case "Jump Abort Recipe":
  913. alarmDetails = alarmDetails.Replace("Abort Recipe/", string.Empty);
  914. Abort();
  915. _alarmAction = RecipeAlaramAction.JumpAbortRecipe;
  916. break;
  917. case "Jump Step":
  918. alarmDetails = alarmDetails.Replace("Jump Step/", string.Empty);
  919. _jumpStepNumber = PMModule.RecipeRunningInfo.RecipeStepList.FindIndex(x => x.StepName == alarmDetails);
  920. _alarmAction = RecipeAlaramAction.JumpStep;
  921. _state = RecipeRunningState.StepCompleted;
  922. break;
  923. case "Jump Step(Cancel Call Loop)":
  924. alarmDetails = alarmDetails.Replace("Jump Step(Cancel Call Loop)/", string.Empty);
  925. _jumpStepNumber = PMModule.RecipeRunningInfo.RecipeStepList.FindIndex(x => x.StepName == alarmDetails);
  926. _alarmAction = RecipeAlaramAction.JumpStepCancelCallLoop;
  927. IsJumpStepCancelCallLoop = true;
  928. _state = RecipeRunningState.StepCompleted;
  929. break;
  930. case "Abort":
  931. IsExecuteAbort = true;
  932. break;
  933. case "Hold":
  934. PMModule.IsPaused = true;
  935. ContinueAction = RecipeContinueMode.None;
  936. _alarmAction = RecipeAlaramAction.Hold;
  937. break;
  938. case "Ignore Alarm":
  939. _alarmAction = RecipeAlaramAction.IgnoreAlaram;
  940. break;
  941. default:
  942. _alarmAction = RecipeAlaramAction.IgnoreAlaram;
  943. break;
  944. }
  945. }
  946. private void MonitorRecipePause()
  947. {
  948. if (_state != RecipeRunningState.TimeWait && _state != RecipeRunningState.ConditionWait)
  949. return;
  950. //if (PMModule.IsPaused)
  951. //{
  952. // _state = RecipeRunningState.Paused;
  953. //}
  954. }
  955. public override void Abort()
  956. {
  957. //PMModule.AbortRecipe();//暂时这么做
  958. PMModule.RecipeRunningInfo.IsLooping = false;
  959. PMModule.RecipeRunningInfo.LoopCountCurrent = 0;
  960. PMModule.RecipeRunningInfo.LoopCountSet = 0;
  961. IsExecuteAbort = true;
  962. IsSubReciep = false;
  963. PMModule.IsPaused = false;
  964. PMModule.IsHeaterProfile = false;
  965. PMModule.IsHeaterProfileSuccess = false;
  966. if (!_holdTimer.IsIdle())
  967. {
  968. _holdTimeElpasedTime += _holdTimer.GetElapseTime();
  969. _holdTimer.Stop();
  970. }
  971. CurrentLoopCount = 0;
  972. CurrentAbortRecipeLoopCount = 0;
  973. CurrentSubRecipeLoopCount = 0;
  974. _state = RecipeRunningState.RecipeCompleted;//暂时这么做
  975. //更新步次结束时间
  976. var step = IsSubReciep ? _currentSubRecipeStepNumber + 1 : _currentStepNumber;
  977. _dbCallback.RecipeStepEnd(PMModule.RecipeRunningInfo.InnerId.ToString(), step, _fdc.DataList, SC.GetStringValue("PM1.TempCorrection"), SC.GetStringValue("PM1.Heater.PID"));
  978. return;//暂时这么做
  979. //_totalElpasedTime = 0;
  980. PMModule.RecipeRunningInfo.BeginTime = DateTime.Now;
  981. double total = 0;
  982. for (int i = 0; i < PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].AbortRecipeSteps.Count; i++)
  983. {
  984. total += PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].AbortRecipeSteps[i].StepTime;
  985. }
  986. PMModule.RecipeRunningInfo.TotalTime = _totalElpasedTime + total;
  987. ResetTrig();
  988. //PMModule.ResetToleranceAlarm();
  989. //PMModule.ResetToleranceAlarmChecker();
  990. PMModule.ExecuteAbortRecipeWarning.Set($"from recipe name:{PMModule.RecipeRunningInfo.RecipeName} step:{_currentStepNumber} start execute abort recipe.");
  991. _state = RecipeRunningState.ExecStep;
  992. }
  993. public void UpdateProcessDataPJid(string pjId)
  994. {
  995. _dbCallback.RecipeUpdatePjId(PMModule.RecipeRunningInfo.InnerId.ToString(), pjId);
  996. }
  997. public void ExitProcess()
  998. {
  999. if (_state == RecipeRunningState.RecipeCompleted)
  1000. {
  1001. PMModule.StringProcessFlowState = PMModule.ProcessFlowState.Standby.ToString();
  1002. _faCallback.RecipeComplete(PMModule.Module, PMModule.RecipeRunningInfo.RecipeName);
  1003. _dbCallback.RecipeComplete(PMModule.RecipeRunningInfo.InnerId.ToString());
  1004. _fdc.Stop();
  1005. }
  1006. else
  1007. {
  1008. if (PMModule.IsExcuteIdleRecipe)
  1009. {
  1010. _faCallback.RecipeComplete(PMModule.Module, PMModule.RecipeRunningInfo.RecipeName);
  1011. _dbCallback.RecipeComplete(PMModule.RecipeRunningInfo.InnerId.ToString());
  1012. _fdc.Stop();
  1013. }
  1014. else
  1015. {
  1016. _faCallback.RecipeFailed(PMModule.Module, PMModule.RecipeRunningInfo.RecipeName);
  1017. _dbCallback.RecipeFailed(PMModule.RecipeRunningInfo.InnerId.ToString());
  1018. _fdc.Stop();
  1019. };
  1020. }
  1021. }
  1022. public void PauseRecipe()
  1023. {
  1024. PMModule.IsPaused = true;
  1025. ContinueAction = RecipeContinueMode.None;
  1026. }
  1027. public void ContinueRecipe()
  1028. {
  1029. PMModule.IsPaused = false;
  1030. ContinueAction = RecipeContinueMode.StepContinue;
  1031. var step = IsSubReciep ? _currentSubRecipeStepNumber + 1 : _currentStepNumber;
  1032. }
  1033. public void SkipCurrentRecipeStep()
  1034. {
  1035. if (_state == RecipeRunningState.ConditionWait || _state == RecipeRunningState.TimeWait || _state == RecipeRunningState.Paused)
  1036. {
  1037. _state = RecipeRunningState.StepCompleted;
  1038. _loopEnd = true;
  1039. PMModule.RecipeRunningInfo.IsLooping = false;
  1040. PMModule.RecipeRunningInfo.LoopCountCurrent = 0;
  1041. PMModule.RecipeRunningInfo.LoopCountSet = 0;
  1042. PMModule.IsPaused = false;
  1043. if (!_holdTimer.IsIdle())
  1044. {
  1045. _holdTimeElpasedTime += _holdTimer.GetElapseTime();
  1046. _holdTimer.Stop();
  1047. }
  1048. }
  1049. if (IsSubReciep)
  1050. {
  1051. ResetLoop(PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps, _currentSubRecipeStepNumber);
  1052. }
  1053. else
  1054. {
  1055. ResetLoop(PMModule.RecipeRunningInfo.RecipeStepList, _currentStepNumber);
  1056. }
  1057. }
  1058. private void ResetLoop(List<RecipeStep> checkRecipeSeps, int currentStepNumber)
  1059. {
  1060. if (checkRecipeSeps == null)
  1061. return;
  1062. var hasLoopStart = false;
  1063. for (int i = currentStepNumber; i >= 0; i--)
  1064. {
  1065. if (checkRecipeSeps[i].IsLoopStartStep)
  1066. {
  1067. hasLoopStart = true;
  1068. break;
  1069. }
  1070. if (checkRecipeSeps[i].IsLoopEndStep)
  1071. {
  1072. hasLoopStart = false;//前面有end,说明没有循环
  1073. break;
  1074. }
  1075. }
  1076. if (hasLoopStart)
  1077. {
  1078. for (int i = currentStepNumber; i < checkRecipeSeps.Count; i++)
  1079. {
  1080. if (checkRecipeSeps[i].IsLoopStartStep)
  1081. {
  1082. break;//没有循环
  1083. }
  1084. if (checkRecipeSeps[i].IsLoopEndStep)
  1085. {
  1086. checkRecipeSeps[i].IsLoopEndStep = false;//跳出skip step之间的循环
  1087. break;
  1088. }
  1089. }
  1090. }
  1091. }
  1092. public void LeakCheckRetry()
  1093. {
  1094. JumpCurrentRecipeStep(_currentStepNumber - 1, PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber - 1].StepName);
  1095. }
  1096. public void JumpCurrentRecipeStep(int stepNumber, string stepName, bool isAlarmConditionCall = false)
  1097. {
  1098. PMModule.StopLeakCheckTimer();
  1099. LOG.Write($"Jump to step stepNumber={stepNumber} stepName={stepName}, currentStepNumber={_currentStepNumber}");
  1100. if (_state == RecipeRunningState.ConditionWait || _state == RecipeRunningState.TimeWait ||
  1101. _state == RecipeRunningState.Paused || _state == RecipeRunningState.ExecStep)
  1102. {
  1103. _loopEnd = true;
  1104. PMModule.RecipeRunningInfo.IsLooping = false;
  1105. PMModule.RecipeRunningInfo.LoopCountCurrent = 0;
  1106. PMModule.RecipeRunningInfo.LoopCountSet = 0;
  1107. CurrentLoopCount = 0;
  1108. CurrentAbortRecipeLoopCount = 0;
  1109. CurrentSubRecipeLoopCount = 0;
  1110. IsSubReciep = false;
  1111. if (IsSubReciep)
  1112. {
  1113. _faCallback.RecipeStepEnd(PMModule.Module, PMModule.RecipeRunningInfo.RecipeName, _currentSubRecipeStepNumber + 1);
  1114. _dbCallback.RecipeStepEnd(PMModule.RecipeRunningInfo.InnerId.ToString(), _currentSubRecipeStepNumber + 1, _fdc.DataList, SC.GetStringValue("PM1.TempCorrection"), SC.GetStringValue("PM1.Heater.PID"));
  1115. ResetLoop(PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].SubRecipeSteps, _currentSubRecipeStepNumber);
  1116. }
  1117. else
  1118. {
  1119. _faCallback.RecipeStepEnd(PMModule.Module, PMModule.RecipeRunningInfo.RecipeName, _currentStepNumber);
  1120. _dbCallback.RecipeStepEnd(PMModule.RecipeRunningInfo.InnerId.ToString(), _currentStepNumber, _fdc.DataList, SC.GetStringValue("PM1.TempCorrection"), SC.GetStringValue("PM1.Heater.PID"));
  1121. ResetLoop(PMModule.RecipeRunningInfo.RecipeStepList, _currentStepNumber);
  1122. }
  1123. if (_callSubSteps != null)
  1124. {
  1125. foreach (var key in _callSubSteps.Keys)
  1126. {
  1127. if (PMModule.RecipeRunningInfo.RecipeStepList.Count > key)
  1128. {
  1129. PMModule.RecipeRunningInfo.RecipeStepList[key].IsCallSubStep = _callSubSteps[key].Item1;
  1130. PMModule.RecipeRunningInfo.RecipeStepList[key].SubRecipeLoopCount = _callSubSteps[key].Item2;
  1131. }
  1132. }
  1133. _currentSubRecipeStepNumber = CurSubRecipeStepTotalLoopCount = 0;
  1134. }
  1135. _isJumpStep = true;
  1136. _currentStepNumber = stepNumber - 1;
  1137. if (_currentStepNumber < 0)
  1138. _currentStepNumber = 0;
  1139. _totalElpasedTime = RefreshElpasedTime();
  1140. _state = RecipeRunningState.StepCompleted;
  1141. PMModule.IsPaused = false;
  1142. if (!_holdTimer.IsIdle())
  1143. {
  1144. _holdTimeElpasedTime += _holdTimer.GetElapseTime();
  1145. _holdTimer.Stop();
  1146. }
  1147. }
  1148. }
  1149. private double RefreshElpasedTime()
  1150. {
  1151. double total = 0;
  1152. try
  1153. {
  1154. for (int i = 0; i < _currentStepNumber; i++)
  1155. {
  1156. if (!PMModule.RecipeRunningInfo.RecipeStepList[i].IsJumpStep)
  1157. {
  1158. if (PMModule.RecipeRunningInfo.RecipeStepList[i].IsLoopEndStep)
  1159. {
  1160. int iLoopStartStep = PMModule.RecipeRunningInfo.RecipeStepList[i].LoopStartStep;
  1161. for (int j = 0; j < PMModule.RecipeRunningInfo.RecipeStepList[i].LoopCount; j++)
  1162. {
  1163. for (int m = iLoopStartStep; m <= i; m++)
  1164. {
  1165. if (PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeSteps != null && PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeSteps.Count > _currentSubRecipeStepNumber)
  1166. {
  1167. total += SubRecipeCalTotalTime(i) * PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeLoopCount;
  1168. }
  1169. total += PMModule.RecipeRunningInfo.RecipeStepList[m].StepTime;
  1170. }
  1171. }
  1172. }
  1173. else
  1174. {
  1175. if (PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeSteps != null &&
  1176. PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeSteps.Count > _currentSubRecipeStepNumber)
  1177. {
  1178. total += SubRecipeCalTotalTime(i) * PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeLoopCount;
  1179. }
  1180. total += PMModule.RecipeRunningInfo.RecipeStepList[i].StepTime;
  1181. }
  1182. }
  1183. }
  1184. }
  1185. catch (Exception ex)
  1186. {
  1187. LOG.Write(ex);
  1188. return -1;
  1189. }
  1190. return (int)total;
  1191. }
  1192. public void RespondAlarm(string name)
  1193. {
  1194. if (!_alarmNames.Contains(name))
  1195. _alarmNames.Add(name);
  1196. }
  1197. protected int CalcRecipeTime()
  1198. {
  1199. double total = 0;
  1200. int iStart = PMModule.IsJobProcess ? 1 : 0;
  1201. try
  1202. {
  1203. for (int i = iStart; i < PMModule.RecipeRunningInfo.RecipeStepList.Count; i++)
  1204. //for (int i = PMModule.RecipeRunningInfo.RecipeStepList.Count - 1; i <= iStart; i--)
  1205. {
  1206. if (!PMModule.RecipeRunningInfo.RecipeStepList[i].IsJumpStep)
  1207. {
  1208. if (PMModule.RecipeRunningInfo.RecipeStepList[i].IsLoopEndStep)
  1209. {
  1210. int iLoopStartStep = PMModule.RecipeRunningInfo.RecipeStepList[i].LoopStartStep;
  1211. total += PMModule.RecipeRunningInfo.RecipeStepList[i].StepTime;
  1212. for (int j = 0; j < PMModule.RecipeRunningInfo.RecipeStepList[i].LoopCount - 1; j++)
  1213. {
  1214. for (int m = iLoopStartStep; m <= i; m++)
  1215. {
  1216. if (PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeSteps != null && PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeSteps.Count > _currentSubRecipeStepNumber)
  1217. {
  1218. total += SubRecipeCalTotalTime(i) * PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeLoopCount;
  1219. }
  1220. total += PMModule.RecipeRunningInfo.RecipeStepList[m].StepTime;
  1221. }
  1222. }
  1223. }
  1224. else
  1225. {
  1226. if (PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeSteps != null && PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeSteps.Count > _currentSubRecipeStepNumber)
  1227. {
  1228. total += SubRecipeCalTotalTime(i) * PMModule.RecipeRunningInfo.RecipeStepList[i].SubRecipeLoopCount;
  1229. }
  1230. total += PMModule.RecipeRunningInfo.RecipeStepList[i].StepTime;
  1231. }
  1232. }
  1233. else
  1234. {
  1235. i = PMModule.RecipeRunningInfo.RecipeStepList[i].JumpStepNo - 1;// -1是因为i++
  1236. }
  1237. if (i < PMModule.RecipeRunningInfo.RecipeStepList.Count - 1)
  1238. {
  1239. _remainTimeExcludeEnd = total;//获取除最后一步外的process时间,End步会cooling
  1240. }
  1241. }
  1242. }
  1243. catch (Exception ex)
  1244. {
  1245. LOG.Write(ex);
  1246. return -1;
  1247. }
  1248. return (int)total;
  1249. }
  1250. private int AbortRecipeCalTotalTime()
  1251. {
  1252. double total = 0;
  1253. List<RecipeStep> abortRecipeSteps;
  1254. abortRecipeSteps = PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].AbortRecipeSteps;
  1255. try
  1256. {
  1257. for (int i = 0; i < abortRecipeSteps.Count; i++)
  1258. {
  1259. if (!abortRecipeSteps[i].IsJumpStep)
  1260. {
  1261. if (abortRecipeSteps[i].IsLoopStartStep)
  1262. {
  1263. int iLoopEndStep = 0;
  1264. for (int j = 0; j < abortRecipeSteps[i].LoopCount; j++)
  1265. {
  1266. for (int m = i; m < abortRecipeSteps.Count; m++)
  1267. {
  1268. total += abortRecipeSteps[m].StepTime;
  1269. if (abortRecipeSteps[m].IsLoopEndStep)
  1270. {
  1271. iLoopEndStep = m;
  1272. break;
  1273. }
  1274. }
  1275. }
  1276. i = iLoopEndStep;
  1277. }
  1278. else
  1279. {
  1280. total += abortRecipeSteps[i].StepTime;
  1281. }
  1282. }
  1283. else
  1284. {
  1285. i = abortRecipeSteps[i].JumpStepNo - 1;// -1是因为i++
  1286. }
  1287. }
  1288. }
  1289. catch (Exception ex)
  1290. {
  1291. LOG.Write(ex);
  1292. return -1;
  1293. }
  1294. return (int)total;
  1295. }
  1296. public void SetContinue(string continueMode)
  1297. {
  1298. switch (continueMode)
  1299. {
  1300. case "Step continue":
  1301. ContinueAction = RecipeContinueMode.StepContinue;
  1302. break;
  1303. case "Step restart":
  1304. ContinueAction = RecipeContinueMode.StepRestart;
  1305. break;
  1306. case "Next step":
  1307. ContinueAction = RecipeContinueMode.NextStep;
  1308. break;
  1309. case "Recipe restart":
  1310. ContinueAction = RecipeContinueMode.RecipeRestart;
  1311. break;
  1312. case "Recipe complete":
  1313. ContinueAction = RecipeContinueMode.RecipeCompleted;
  1314. break;
  1315. case "Wafer return and job stop":
  1316. ContinueAction = RecipeContinueMode.WaferReturnAndJobStop;
  1317. break;
  1318. }
  1319. PMModule.ResetToleranceChecker();
  1320. }
  1321. private double SubRecipeCalTotalTime(int currentStepNumber)
  1322. {
  1323. double total = 0;
  1324. for (int k = _currentSubRecipeStepNumber; k < PMModule.RecipeRunningInfo.RecipeStepList[currentStepNumber].SubRecipeSteps.Count; k++)
  1325. {
  1326. if (!PMModule.RecipeRunningInfo.RecipeStepList[currentStepNumber].SubRecipeSteps[k].IsJumpStep)
  1327. {
  1328. if (PMModule.RecipeRunningInfo.RecipeStepList[currentStepNumber].SubRecipeSteps[k].IsLoopEndStep)
  1329. {
  1330. int iSystemLoopStartStep = PMModule.RecipeRunningInfo.RecipeStepList[currentStepNumber].SubRecipeSteps[k].LoopStartStep;
  1331. total += PMModule.RecipeRunningInfo.RecipeStepList[currentStepNumber].SubRecipeSteps[k].StepTime;
  1332. for (int n = 0; n < PMModule.RecipeRunningInfo.RecipeStepList[currentStepNumber].SubRecipeSteps[k].LoopCount - 1; n++)
  1333. {
  1334. for (int l = iSystemLoopStartStep; l <= k; l++)
  1335. {
  1336. total += PMModule.RecipeRunningInfo.RecipeStepList[currentStepNumber].SubRecipeSteps[l].StepTime;
  1337. }
  1338. }
  1339. }
  1340. else
  1341. {
  1342. total += PMModule.RecipeRunningInfo.RecipeStepList[currentStepNumber].SubRecipeSteps[k].StepTime;
  1343. }
  1344. }
  1345. else
  1346. {
  1347. k = PMModule.RecipeRunningInfo.RecipeStepList[currentStepNumber].SubRecipeSteps[k].JumpStepNo - 1;// -1是因为k++
  1348. }
  1349. }
  1350. return total;
  1351. }
  1352. private void SubRecipeLoopEndCheck(List<RecipeStep> recipeSteps)
  1353. {
  1354. if (_alarmAction == RecipeAlaramAction.JumpStep || _alarmAction == RecipeAlaramAction.JumpStepCancelCallLoop)
  1355. {
  1356. _currentSubRecipeStepNumber = _jumpStepNumber;
  1357. _alarmAction = RecipeAlaramAction.None;
  1358. _alarmNames.Clear();
  1359. return;
  1360. }
  1361. if (recipeSteps[_currentSubRecipeStepNumber].IsLoopEndStep)
  1362. {
  1363. if (IsJumpStepCancelCallLoop)
  1364. {
  1365. _currentSubRecipeStepNumber++;
  1366. IsJumpStepCancelCallLoop = false;
  1367. return;
  1368. }
  1369. //重新读取循环的设定次数
  1370. CurSubRecipeStepTotalLoopCount = recipeSteps[_currentSubRecipeStepNumber].LoopCount;
  1371. if (CurrentSubRecipeLoopCount >= CurSubRecipeStepTotalLoopCount)
  1372. {
  1373. CurrentSubRecipeLoopCount = CurSubRecipeStepTotalLoopCount = 0;
  1374. _currentSubRecipeStepNumber++;
  1375. PMModule.RecipeRunningInfo.IsLooping = false;
  1376. PMModule.RecipeRunningInfo.LoopCountCurrent = 0;
  1377. PMModule.RecipeRunningInfo.LoopCountSet = 0;
  1378. }
  1379. else
  1380. {
  1381. _currentSubRecipeStepNumber = recipeSteps[_currentSubRecipeStepNumber].LoopStartStep;
  1382. }
  1383. }
  1384. else
  1385. {
  1386. _currentSubRecipeStepNumber++;
  1387. }
  1388. }
  1389. private void RecipeLoopEndCheck(List<RecipeStep> recipeSteps)
  1390. {
  1391. if (_alarmAction == RecipeAlaramAction.JumpStep || _alarmAction == RecipeAlaramAction.JumpStepCancelCallLoop)
  1392. {
  1393. _currentStepNumber = _jumpStepNumber;
  1394. _alarmAction = RecipeAlaramAction.None;
  1395. _alarmNames.Clear();
  1396. return;
  1397. }
  1398. if (recipeSteps[_currentStepNumber].IsLoopEndStep)
  1399. {
  1400. if (IsJumpStepCancelCallLoop)
  1401. {
  1402. _currentStepNumber++;
  1403. IsJumpStepCancelCallLoop = false;
  1404. return;
  1405. }
  1406. //重新读取循环的设定次数
  1407. CurStepTotalLoopCount = recipeSteps[_currentStepNumber].LoopCount;
  1408. if (CurrentLoopCount >= CurStepTotalLoopCount)
  1409. {
  1410. CurrentLoopCount = CurStepTotalLoopCount = 0;
  1411. _currentStepNumber++;
  1412. PMModule.RecipeRunningInfo.IsLooping = false;
  1413. PMModule.RecipeRunningInfo.LoopCountCurrent = 0;
  1414. PMModule.RecipeRunningInfo.LoopCountSet = 0;
  1415. }
  1416. else
  1417. {
  1418. _currentStepNumber = recipeSteps[_currentStepNumber].LoopStartStep;
  1419. }
  1420. }
  1421. else
  1422. {
  1423. _currentStepNumber++;
  1424. }
  1425. }
  1426. private void CheckTolerance()
  1427. {
  1428. //foreach (var key in _trigMfcToleranceAlarms.Keys)
  1429. //{
  1430. // if (PMModule.GasMFCs.ContainsKey(key) && _trigMfcToleranceWarnings.ContainsKey(key))
  1431. // {
  1432. // _trigMfcToleranceAlarms[key].CLK = PMModule.GasMFCs[key].CheckToleranceAlarm();
  1433. // if (_trigMfcToleranceAlarms[key].Q)
  1434. // PMModule.GasMFCs[key].SetToleranceAlarm();
  1435. // _trigMfcToleranceWarnings[key].CLK = PMModule.GasMFCs[key].CheckToleranceWarning();
  1436. // if (_trigMfcToleranceWarnings[key].Q && !_trigMfcToleranceAlarms[key].Q)
  1437. // PMModule.GasMFCs[key].SetToleranceWarning();
  1438. // }
  1439. //}
  1440. //_trigHeaterBottomToleranceAlarm.CLK = PMModule.CheckHeaterBottomToleranceAlaram();
  1441. //if (_trigHeaterBottomToleranceAlarm.Q)
  1442. // PMModule.SetHeaterBottomToleranceAlaram();
  1443. //_trigHeaterBottomToleranceWarning.CLK = PMModule.CheckHeaterBottomToleranceWarning();
  1444. //if (_trigHeaterBottomToleranceWarning.Q && !_trigHeaterBottomToleranceAlarm.Q)
  1445. // PMModule.SetHeaterBottomToleranceWarning();
  1446. //_trigHeaterCenterBottomToleranceAlarm.CLK = PMModule.CheckHeaterCenterBottomToleranceAlaram();
  1447. //if (_trigHeaterCenterBottomToleranceAlarm.Q)
  1448. // PMModule.SetHeaterCenterBottomToleranceAlaram();
  1449. //_trigHeaterCenterBottomToleranceWarning.CLK = PMModule.CheckHeaterCenterBottomToleranceWarning();
  1450. //if (_trigHeaterCenterBottomToleranceWarning.Q && !_trigHeaterCenterBottomToleranceAlarm.Q)
  1451. // PMModule.SetHeaterCenterBottomToleranceWarning();
  1452. //_trigHeaterCenterToleranceAlarm.CLK = PMModule.CheckHeaterCenterToleranceAlaram();
  1453. //if (_trigHeaterCenterToleranceAlarm.Q)
  1454. // PMModule.SetHeaterCenterToleranceAlaram();
  1455. //_trigHeaterCenterToleranceWarning.CLK = PMModule.CheckHeaterCenterToleranceWarning();
  1456. //if (_trigHeaterCenterToleranceWarning.Q && !_trigHeaterCenterToleranceAlarm.Q)
  1457. // PMModule.SetHeaterCenterToleranceWarning();
  1458. //_trigHeaterCenterTopToleranceAlarm.CLK = PMModule.CheckHeaterCenterTopToleranceAlaram();
  1459. //if (_trigHeaterCenterTopToleranceAlarm.Q)
  1460. // PMModule.SetHeaterCenterTopToleranceAlaram();
  1461. //_trigHeaterCenterTopToleranceWarning.CLK = PMModule.CheckHeaterCenterTopToleranceWarning();
  1462. //if (_trigHeaterCenterTopToleranceWarning.Q && !_trigHeaterCenterTopToleranceAlarm.Q)
  1463. // PMModule.SetHeaterCenterTopToleranceWarning();
  1464. //_trigHeaterTopToleranceAlarm.CLK = PMModule.CheckHeaterTopToleranceAlaram();
  1465. //if (_trigHeaterTopToleranceAlarm.Q)
  1466. // PMModule.SetHeaterTopToleranceAlaram();
  1467. //_trigHeaterTopToleranceWarning.CLK = PMModule.CheckHeaterTopToleranceWarning();
  1468. //if (_trigHeaterTopToleranceWarning.Q && !_trigHeaterTopToleranceAlarm.Q)
  1469. // PMModule.SetHeaterTopToleranceWarning();
  1470. //_trigPressureToleranceAlarm.CLK = PMModule.CheckPressureToleranceAlaram();
  1471. //if (_trigPressureToleranceAlarm.Q)
  1472. // PMModule.SetPressureToleranceAlaram();
  1473. //_trigPressureToleranceWarning.CLK = PMModule.CheckPressureToleranceWarning();
  1474. //if (_trigPressureToleranceWarning.Q && !_trigPressureToleranceAlarm.Q)
  1475. // PMModule.SetPressureToleranceWarning();
  1476. }
  1477. private void ResetTrig()
  1478. {
  1479. PMModule.ResetAlarmCondition();
  1480. foreach (var key in _trigMfcToleranceAlarms.Keys)
  1481. {
  1482. if (_trigMfcToleranceWarnings.ContainsKey(key))
  1483. {
  1484. _trigMfcToleranceAlarms[key].RST = true;
  1485. _trigMfcToleranceWarnings[key].RST = true;
  1486. }
  1487. }
  1488. _trigHeaterBottomToleranceAlarm.RST = true;
  1489. _trigHeaterBottomToleranceWarning.RST = true;
  1490. _trigHeaterCenterBottomToleranceAlarm.RST = true;
  1491. _trigHeaterCenterBottomToleranceWarning.RST = true;
  1492. _trigHeaterCenterToleranceAlarm.RST = true;
  1493. _trigHeaterCenterToleranceWarning.RST = true;
  1494. _trigHeaterCenterTopToleranceAlarm.RST = true;
  1495. _trigHeaterCenterTopToleranceWarning.RST = true;
  1496. _trigHeaterTopToleranceAlarm.RST = true;
  1497. _trigHeaterTopToleranceWarning.RST = true;
  1498. _trigPressureToleranceAlarm.RST = true;
  1499. _trigPressureToleranceWarning.RST = true;
  1500. _trigInputSignalTimeOutAlarm.RST = true;
  1501. _trigTemperatureConvergenceTimeOutAlarm.RST = true;
  1502. _trigReachTempTimeOutAlarm.RST = true;
  1503. _trigPressureConvergenceTimeOutAlarm.RST = true;
  1504. _trigReachPressureTimeOutAlarm.RST = true;
  1505. _trigAutoProfileTimeOutAlarm.RST = true;
  1506. _trigHeaterProfileFinish.RST = true;
  1507. _trigLeakCheckFinish.RST = true;
  1508. _trigBoatWaitCondition.RST = true;
  1509. _trigAPCWaitCondition.RST = true;
  1510. _trigAUXWaitCondition.RST = true;
  1511. _trigHeaterWaitCondition.RST = true;
  1512. _trigMFCWaitCondition.RST = true;
  1513. _infoHeaterProfileFinish = "";
  1514. _infoAUXWaitCondition = "";
  1515. _infoHeaterWaitCondition = "";
  1516. _infoMFCWaitCondition = "";
  1517. }
  1518. private int GetDBRecipeType(string recipeTypeName)
  1519. {
  1520. if (string.IsNullOrEmpty(recipeTypeName))
  1521. return (int)RecipeTypeEnum.none;
  1522. if (Enum.TryParse<RecipeTypeEnum>(recipeTypeName, true, out var result))
  1523. return (int)result;
  1524. return (int)RecipeTypeEnum.none;
  1525. }
  1526. private void RecipeExec(string type, List<RecipeStep> curSteps, int currentStepNumber, double curStepElpasedTimeBeforePaused, int otherRecipeStartStepNumber = 0)
  1527. {
  1528. var reason = "";
  1529. _stepTimer.Start(curSteps[currentStepNumber].StepTime * 1000 - curStepElpasedTimeBeforePaused);
  1530. _showStepNo = currentStepNumber;
  1531. Notify($"{type} running step {currentStepNumber + 1}:{curSteps[currentStepNumber].StepName}");
  1532. var stopwatch = new Stopwatch();
  1533. stopwatch.Start();
  1534. //执行工艺程序命令
  1535. foreach (var recipeCmd in curSteps[currentStepNumber].RecipeCommands.Keys)
  1536. {
  1537. if (!OP.CanDoOperation($"{_doModule}.{recipeCmd}", out reason, curSteps[currentStepNumber].RecipeCommands[recipeCmd]))
  1538. {
  1539. if (!OP.CanDoOperation($"{Module}.{recipeCmd}", out reason, curSteps[currentStepNumber].RecipeCommands[recipeCmd]))
  1540. {
  1541. if (!OP.CanDoOperation($"{ModuleName.System}.{recipeCmd}", out reason, curSteps[currentStepNumber].RecipeCommands[recipeCmd]))
  1542. {
  1543. PMModule.CheckCanDoOperationAlarm.Set($"Can not execute {recipeCmd}, {reason}");
  1544. return;
  1545. }
  1546. else
  1547. {
  1548. OP.DoOperation($"{ModuleName.System}.{recipeCmd}", out string reason1, 0, curSteps[currentStepNumber].RecipeCommands[recipeCmd]);
  1549. }
  1550. }
  1551. else
  1552. {
  1553. OP.DoOperation($"{Module}.{recipeCmd}", out string reason1, 0, curSteps[currentStepNumber].RecipeCommands[recipeCmd]);
  1554. }
  1555. }
  1556. else
  1557. {
  1558. OP.DoOperation($"{_doModule}.{recipeCmd}", out string reason1, 0, curSteps[currentStepNumber].RecipeCommands[recipeCmd]);
  1559. }
  1560. }
  1561. LOG.Write($"step exec time {stopwatch.ElapsedMilliseconds}");
  1562. if (curSteps[currentStepNumber].EndBy == EnumEndByCondition.ByTime && !PMModule.IsBoatMoveToLoadPosition)
  1563. _state = RecipeRunningState.TimeWait;
  1564. else
  1565. _state = RecipeRunningState.ConditionWait;
  1566. _faCallback.RecipeStepStart(PMModule.Module, PMModule.RecipeRunningInfo.RecipeName, otherRecipeStartStepNumber != 0 ? otherRecipeStartStepNumber : currentStepNumber);
  1567. if (type == "Sub recipe")
  1568. _dbCallback.RecipeStepStart(PMModule.RecipeRunningInfo.InnerId.ToString(), _currentStepNumber, PMModule.RecipeRunningInfo.RecipeStepList.Count > _currentStepNumber ? PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].StepName : "",
  1569. PMModule.RecipeRunningInfo.RecipeStepList.Count > _currentStepNumber ? (float)PMModule.RecipeRunningInfo.RecipeStepList[_currentStepNumber].StepTime : 0,
  1570. $"{(otherRecipeStartStepNumber != 0 ? otherRecipeStartStepNumber : currentStepNumber)}", curSteps[currentStepNumber].StepName, (float)curSteps[currentStepNumber].StepTime,
  1571. $"{PMModule.RecipeRunningInfo.SubRecipeCurrentLoopCount}/{PMModule.RecipeRunningInfo.SubRecipeLoopCount}");
  1572. else
  1573. _dbCallback.RecipeStepStart(PMModule.RecipeRunningInfo.InnerId.ToString(), otherRecipeStartStepNumber != 0 ? otherRecipeStartStepNumber : currentStepNumber,
  1574. curSteps[currentStepNumber].StepName, (float)curSteps[currentStepNumber].StepTime, "", "", 0, "");
  1575. _fdc.Start(curSteps[currentStepNumber].RecipeCommands);
  1576. }
  1577. public void FACallBack(string triggerModule, string recipeAction, string module, string recipeName, string recipeStep, string jumpStpeId = "", string otherRecipeName = "")
  1578. {
  1579. if (triggerModule == ConstantsCommon.AlarmConditionTrigger)
  1580. {
  1581. switch (recipeAction)
  1582. {
  1583. case UniversalEvents.AlarmConditionTriggerReset:
  1584. _faCallback.AlarmConditionTriggerReset(module, recipeName, recipeStep, otherRecipeName);
  1585. break;
  1586. case UniversalEvents.AlarmConditionTriggerEnd:
  1587. _faCallback.AlarmConditionTriggerEnd(module, recipeName, recipeStep);
  1588. break;
  1589. case UniversalEvents.AlarmConditionTriggerHold:
  1590. _faCallback.AlarmConditionTriggerHold(module, recipeName, recipeStep);
  1591. break;
  1592. case UniversalEvents.AlarmConditionTriggerJumpStep:
  1593. _faCallback.AlarmConditionTriggerJumpStep(module, recipeName, recipeStep, jumpStpeId);
  1594. break;
  1595. case UniversalEvents.AlarmConditionTriggerCallAlarmRecipe:
  1596. _faCallback.AlarmConditionTriggerCallAlarmRecipe(module, recipeName, recipeStep, otherRecipeName);
  1597. break;
  1598. case UniversalEvents.AlarmConditionTriggerCallAbortRecipe:
  1599. _faCallback.AlarmConditionTriggerCallAbortRecipe(module, recipeName, recipeStep, otherRecipeName);
  1600. break;
  1601. }
  1602. Task.Delay(1000).ContinueWith(x =>
  1603. {
  1604. _faCallback.RecipeAbnormalEnd(module, recipeName, recipeStep);
  1605. });
  1606. }
  1607. else if (triggerModule == ConstantsCommon.LeakCheckTrigger)
  1608. {
  1609. switch (recipeAction)
  1610. {
  1611. case UniversalEvents.LeakCheckTriggerReset:
  1612. _faCallback.LeakCheckTriggerReset(module, recipeName, recipeStep, otherRecipeName);
  1613. break;
  1614. case UniversalEvents.LeakCheckTriggerEnd:
  1615. _faCallback.LeakCheckTriggerEnd(module, recipeName, recipeStep);
  1616. break;
  1617. case UniversalEvents.LeakCheckTriggerHold:
  1618. _faCallback.LeakCheckTriggerHold(module, recipeName, recipeStep);
  1619. break;
  1620. case UniversalEvents.LeakCheckTriggerJumpStep:
  1621. _faCallback.LeakCheckTriggerJumpStep(module, recipeName, recipeStep, jumpStpeId);
  1622. break;
  1623. case UniversalEvents.LeakCheckTriggerCallAlarmRecipe:
  1624. _faCallback.LeakCheckTriggerCallAlarmRecipe(module, recipeName, recipeStep, otherRecipeName);
  1625. break;
  1626. case UniversalEvents.LeakCheckTriggerCallAbortRecipe:
  1627. _faCallback.LeakCheckTriggerCallAbortRecipe(module, recipeName, recipeStep, otherRecipeName);
  1628. break;
  1629. }
  1630. Task.Delay(1000).ContinueWith(x =>
  1631. {
  1632. _faCallback.RecipeAbnormalEnd(module, recipeName, recipeStep);
  1633. });
  1634. }
  1635. else if (triggerModule == ConstantsCommon.ManualTrigger)
  1636. {
  1637. switch (recipeAction)
  1638. {
  1639. case UniversalEvents.ManualTriggerRecipeHold:
  1640. _faCallback.ManualTriggerRecipeHold(module, recipeName, recipeStep);
  1641. break;
  1642. case UniversalEvents.ManualTriggerRecipeRelease:
  1643. _faCallback.ManualTriggerRecipeRelease(module, recipeName, recipeStep);
  1644. break;
  1645. case UniversalEvents.ManualTriggerRecipeSkip:
  1646. _faCallback.ManualTriggerRecipeSkip(module, recipeName, recipeStep);
  1647. break;
  1648. case UniversalEvents.ManualTriggerRecipeJump:
  1649. _faCallback.ManualTriggerRecipeJump(module, recipeName, recipeStep, jumpStpeId);
  1650. break;
  1651. case UniversalEvents.ManualTriggerRecipeAbort:
  1652. _faCallback.ManualTriggerRecipeAbort(module, recipeName, recipeStep, otherRecipeName);
  1653. break;
  1654. }
  1655. Task.Delay(1000).ContinueWith(x =>
  1656. {
  1657. _faCallback.RecipeAbnormalEnd(module, recipeName, recipeStep);
  1658. });
  1659. }
  1660. else if (triggerModule == ConstantsCommon.RecipeTrigger)
  1661. {
  1662. switch (recipeAction)
  1663. {
  1664. case UniversalEvents.RecipeTriggerReset:
  1665. _faCallback.RecipeTriggerReset(module, recipeName, recipeStep, otherRecipeName);
  1666. break;
  1667. case UniversalEvents.RecipeTriggerEnd:
  1668. _faCallback.RecipeTriggerEnd(module, recipeName, recipeStep);
  1669. break;
  1670. case UniversalEvents.RecipeTriggerHold:
  1671. _faCallback.RecipeTriggerHold(module, recipeName, recipeStep);
  1672. break;
  1673. case UniversalEvents.RecipeTriggerLeakCheck:
  1674. _faCallback.RecipeTriggerLeakCheck(module, recipeName, recipeStep);
  1675. break;
  1676. case UniversalEvents.RecipeTriggerJumpStep:
  1677. _faCallback.RecipeTriggerJumpStep(module, recipeName, recipeStep, otherRecipeName);
  1678. break;
  1679. case UniversalEvents.RecipeTriggerCallSubRecipe:
  1680. _faCallback.RecipeTriggerCallSubRecipe(module, recipeName, recipeStep, otherRecipeName);
  1681. break;
  1682. }
  1683. }
  1684. }
  1685. }
  1686. }