PMEntity.cs 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684
  1. using System;
  2. using System.Collections.Generic;
  3. using Aitex.Core.Common;
  4. using Aitex.Core.RT.DataCenter;
  5. using Aitex.Core.RT.Device;
  6. using Aitex.Core.RT.Event;
  7. using Aitex.Core.RT.Fsm;
  8. using Aitex.Core.RT.OperationCenter;
  9. using Aitex.Core.RT.SCCore;
  10. using Aitex.Core.Util;
  11. using Aitex.Sorter.Common;
  12. using MECF.Framework.Common.Equipment;
  13. using MECF.Framework.Common.Schedulers;
  14. using MECF.Framework.Common.SubstrateTrackings;
  15. using Venus_Core;
  16. using Venus_RT.Devices;
  17. using Aitex.Core.RT.Log;
  18. using Aitex.Core.UI.DeviceControl;
  19. using MECF.Framework.Common.DataCenter;
  20. namespace Venus_RT.Modules.PMs
  21. {
  22. public class RecipeRunningInfo
  23. {
  24. public Guid InnerId { get; set; }
  25. public RecipeHead Head { get; set; }
  26. public List<RecipeStep> RecipeStepList { get; set; }
  27. public string RecipeName { get; set; }
  28. public DateTime BeginTime { get; set; }
  29. public DateTime EndTime { get; set; }
  30. public int StepNumber { get; set; }
  31. public string StepName { get; set; }
  32. public double StepTime { get; set; }
  33. public double StepElapseTime { get; set; }
  34. public double TotalTime { get; set; }
  35. public double TotalElapseTime { get; set; }
  36. }
  37. public class PMEntity : Entity, IModuleEntity
  38. {
  39. public enum PMStatus
  40. {
  41. Not_Ready,
  42. Ready_For_Pick,
  43. Ready_For_Place,
  44. Exchange_Ready,
  45. }
  46. public enum MSG
  47. {
  48. Home,
  49. Transfer,
  50. PrepareTransfer,
  51. PostTransfer,
  52. Reset,
  53. Abort,
  54. Error,
  55. LaunchPump,
  56. LaunchTurboPump,
  57. Pump,
  58. Vent,
  59. PumpLoadLock,
  60. VentLoadLock,
  61. PurgeLoadLock,
  62. LoadLockLeakCheck,
  63. CyclePurge,
  64. GasLinePurge,
  65. Heat,
  66. TransferHandoff,
  67. StartTransfer,
  68. LeakCheck,
  69. GasLeakCheck,
  70. MoveLiftPin,
  71. MoveGuidePin,
  72. PartialPressure,
  73. VATPerformance,
  74. LLPlace,
  75. LLPick,
  76. Process,
  77. RunRecipe,
  78. PostProcess,
  79. RecipeSkipStep,
  80. RecipeUpdate,
  81. RecipeResume,
  82. RecipePause,
  83. RecipeAbort,
  84. PreProcess,
  85. AutoMode,
  86. ManualMode,
  87. LockLid,
  88. Clean,
  89. Online,
  90. Offline,
  91. GasFlow,
  92. StopGasFlow,
  93. RfPower,
  94. MFCVerification,
  95. // exchange wafer with TM
  96. PreparePick,
  97. PreparePlace,
  98. LiftUpWafer,
  99. DropDownWafer,
  100. PickReady,
  101. PlaceReady,
  102. MaxMsg
  103. }
  104. private readonly JetPMBase _chamber;
  105. public ModuleName Module { get; }
  106. public PMStatus Status { get; private set; }
  107. private StatsDataItem _statProcessedWafer;
  108. private StatsDataItemRFAndPump _statRfOnTime;
  109. private StatsDataItemRFAndPump _statBiasRfOnTime;
  110. private StatsDataItemRFAndPump _statPumpOnTime;
  111. private readonly PMHomeRoutine _home;
  112. private readonly StartDryPumpRoutine _startDryPumpRoutine;
  113. private readonly StartTurboPumpRoutine _startTurboPumpRoutine;
  114. private readonly VentRoutine _ventRoutine;
  115. private readonly VenusVentRoutine _venusVentRoutine;
  116. private readonly PumpDownRoutine _pumpRoutine;
  117. //private readonly LoadLockVentRoutine _ventLoadLockRoutine;
  118. //private readonly LoadLockPumpRoutine _pumpLoadLockRoutine;
  119. //private readonly LoadLockPurgeRoutine _purgeLoadLockRoutine;
  120. //private readonly LoadLockLeakCheckRoutine _loadLockLeakCheckRoutine;
  121. private readonly PMPurgeRoutine _purgeRoutine;
  122. private readonly PMGaslinePurgeRoutine _gaslinePurgeRoutine;
  123. private readonly PMLeakCheckRoutine _leakCheckRoutine;
  124. private readonly GasBoxLeakCheckRoutine _gasBoxLeakCheckRoutine;
  125. //private readonly LLPlaceRoutine _llPlaceRoutine;
  126. //private readonly LLPickRoutine _llPickRoutine;
  127. private readonly PMProcessRoutine _processRoutine;
  128. private readonly GasFlowRoutine _gasFlowRoutine;
  129. private readonly RFPowerSwitchRoutine _rfPowerRoutine;
  130. private readonly PMGasVerificationRoutine _gasVerificationRoutine;
  131. private readonly PMPartialPressureRoutine _pmPartialPressureRoutine;
  132. private readonly PMVATPerformanceRoutine _pmVATPerformanceRoutine;
  133. //private readonly PMHeatRoutine _pmHeatRoutine;
  134. private AutoFlag _AutoMode;
  135. private bool _isOnline = false;
  136. //private bool _isAlarm;
  137. //private DateTime _pumpStartTime;
  138. //private TimeSpan _pumpElapsedTime;
  139. //private DateTime _rfStartTime;
  140. //private DateTime _tcStartTime;
  141. //private TimeSpan _rfElapsedTime;
  142. //private TimeSpan _tcElapsedTime;
  143. //private MovementPosition _goalLiftPin;
  144. //private ushort _ActivatedActionID;
  145. //private Stopwatch _LifpinSleepTimer;
  146. private bool startControlPressureFlag = true;
  147. //private bool stopControlPressureFlag = false;
  148. private int _controlPressureSetPoint = 90;
  149. private int _controlFlowSetPoint = 90;
  150. public JetChamber ChamberType => _chamber.ChamberType;
  151. public bool IsIdle
  152. {
  153. get { return fsm.State == (int)PMState.Idle; }
  154. }
  155. public bool IsError
  156. {
  157. get { return fsm.State == (int)PMState.Error; }
  158. }
  159. public bool IsInit
  160. {
  161. get { return fsm.State == (int)PMState.Init; }
  162. }
  163. public bool IsBusy
  164. {
  165. get { return !IsInit && !IsError && !IsIdle; }
  166. }
  167. public bool IsProcessing
  168. {
  169. get { return fsm.State == (int)PMState.PreProcess || fsm.State == (int)PMState.Processing || fsm.State == (int)PMState.PostProcess; }
  170. }
  171. public bool IsOnline
  172. {
  173. get { return _isOnline; }
  174. }
  175. public bool IsInclude
  176. {
  177. get;
  178. private set;
  179. } = true;
  180. private Dictionary<string, int> _dictRecipeTime = new Dictionary<string, int>();
  181. public override int TimeToReady
  182. {
  183. get
  184. {
  185. switch ((PMState)fsm.State)
  186. {
  187. case PMState.Processing:
  188. case PMState.Clean:
  189. if (Singleton<RouteManager>.Instance.IsAutoMode && IsOnline)
  190. {
  191. if (_dictRecipeTime.ContainsKey(_processRoutine.currentRecipeResult.RecipeName))
  192. {
  193. return Math.Max(_dictRecipeTime[_processRoutine.currentRecipeResult.RecipeName] - fsm.ElapsedTime, 0);
  194. }
  195. }
  196. break;
  197. }
  198. return int.MaxValue;
  199. }
  200. }
  201. public bool IsAutoMode => _AutoMode == AutoFlag.Auto;
  202. public bool IsSlitDoorOpen => _chamber.CheckSlitDoorOpen();
  203. public bool IsSlitDoorClose => _chamber.CheckSlitDoorClose();
  204. public bool LiftPinIsDown => _chamber.LiftPinIsDown;
  205. public bool LiftPinIsUp => _chamber.LiftPinIsUp;
  206. public double ChamberPressure => _chamber.ChamberPressure;
  207. public double ProcessPressure => _chamber.ProcessPressure;
  208. public bool IsVac => _chamber.IsVAC;
  209. public bool IsAtm => _chamber.IsATM;
  210. public float ChamberTemperature => _chamber.ChamberTemperature;
  211. public bool Check(int msg, out string reason, object[] objs)
  212. {
  213. reason = "";
  214. return true;
  215. }
  216. //
  217. private bool CheckToPostMessage(int msg, params object[] args)
  218. {
  219. if (!fsm.FindTransition(fsm.State, msg))
  220. {
  221. EV.PostWarningLog(Module.ToString(), eEvent.WARN_State, $"{Module} is in {(PMState)fsm.State} state,can not do {(MSG)msg}");
  222. return false;
  223. }
  224. fsm.PostMsg(msg, args);
  225. return true;
  226. }
  227. public int Invoke(string function, params object[] args)
  228. {
  229. switch (function)
  230. {
  231. case "Home":
  232. CheckToPostMessage((int)MSG.Home);
  233. return (int)MSG.Home;
  234. }
  235. return (int)FSM_MSG.NONE;
  236. }
  237. public bool CheckAcked(int msg)
  238. {
  239. return fsm.CheckExecuted(msg);
  240. }
  241. public void ResetRecipeTime()
  242. {
  243. _dictRecipeTime.Clear();
  244. }
  245. public bool IsPrepareTransferReady(ModuleName robot, EnumTransferType type, int slot, Hand blade)
  246. {
  247. //if (type == EnumTransferType.Pick)
  248. //{
  249. // return _chamber.CheckEnableTransfer(type, WaferManager.Instance.GetWafer(_chamber.Module, 0).Size);
  250. //}
  251. //else if (type == EnumTransferType.Place)
  252. //{
  253. // return _chamber.CheckEnableTransfer(type, WaferManager.Instance.GetWafer(robot, (int)blade).Size);
  254. //}
  255. return false;
  256. }
  257. public int InvokePrepareTransfer(ModuleName robot, EnumTransferType type, int slot)
  258. {
  259. if (CheckToPostMessage((int)MSG.PrepareTransfer, type.ToString()))
  260. return (int)MSG.PrepareTransfer;
  261. return (int)FSM_MSG.NONE;
  262. }
  263. public int InvokePrepareTransfer(ModuleName robot, EnumTransferType type, int slot, float temp)
  264. {
  265. if (CheckToPostMessage((int)MSG.PrepareTransfer, type.ToString(), temp))
  266. return (int)MSG.PrepareTransfer;
  267. return (int)FSM_MSG.NONE;
  268. }
  269. public int InvokePrepareTransfer(ModuleName robot, EnumTransferType type, int slot, float temp, WaferSize size)
  270. {
  271. if (CheckToPostMessage((int)MSG.PrepareTransfer, type.ToString(), temp, size))
  272. return (int)MSG.PrepareTransfer;
  273. return (int)FSM_MSG.NONE;
  274. }
  275. public int InvokePostTransfer(ModuleName robot, EnumTransferType type, int slot)
  276. {
  277. if (CheckToPostMessage((int)MSG.PostTransfer, type.ToString()))
  278. return (int)MSG.PostTransfer;
  279. return (int)FSM_MSG.NONE;
  280. }
  281. public int InvokeClean(string recipeName, string waferID, RecipeType recipeType)
  282. {
  283. if (CheckToPostMessage((int)MSG.Clean, recipeName, waferID, recipeType))
  284. {
  285. return (int)MSG.Clean;
  286. }
  287. return (int)FSM_MSG.NONE;
  288. }
  289. public int InvokeProcess(string recipeName, string waferID, RecipeType recipeType)
  290. {
  291. if (CheckToPostMessage((int)MSG.RunRecipe, recipeName, waferID, recipeType))
  292. return (int)MSG.RunRecipe;
  293. return (int)FSM_MSG.NONE;
  294. }
  295. public int InvokePreHeat(float temperature)
  296. {
  297. if (CheckToPostMessage((int)MSG.Heat, (double)temperature))
  298. return (int)MSG.Heat;
  299. return (int)FSM_MSG.NONE;
  300. }
  301. public void InvokeReset()
  302. {
  303. PostMsg((int)MSG.Reset);
  304. }
  305. public void SetAuto()
  306. {
  307. this._AutoMode = AutoFlag.Auto;
  308. }
  309. private bool FnSetManual(object[] param)
  310. {
  311. if (fsm.State == (int)PMState.PreProcess || fsm.State == (int)PMState.Processing || fsm.State == (int)PMState.PostProcess)
  312. {
  313. EV.PostWarningLog(Module.ToString(), $"{Module} is in {(PMState)fsm.State},can not do SetAutoMode");
  314. return false;
  315. }
  316. this._AutoMode = AutoFlag.Manual;
  317. if (IsOnline)
  318. {
  319. EV.PostWarningLog(Module.ToString(), $"{Module} is online,change to offline due to the chamber change to manual mode");
  320. this._isOnline = false;
  321. }
  322. return true;
  323. }
  324. private bool FnSetInclude()
  325. {
  326. if (IsOnline == true)
  327. {
  328. LOG.Write(eEvent.WARN_PM, Module, $"{Module} is online,can not set Include");
  329. return false;
  330. }
  331. IsInclude = true;
  332. LOG.Write(eEvent.INFO_PM, Module, $"{Module} Set Include Success");
  333. return true;
  334. }
  335. private bool FnSetExclude()
  336. {
  337. if (IsOnline == true)
  338. {
  339. LOG.Write(eEvent.WARN_PM, Module, $"{Module} is online,can not set Exclude");
  340. return false;
  341. }
  342. IsInclude = false;
  343. LOG.Write(eEvent.INFO_PM, Module, $"{Module} Set Exclude Success");
  344. return true;
  345. }
  346. private bool FnSetOnline(object[] param)
  347. {
  348. //if (!IsAutoMode)
  349. //{
  350. // EV.PostWarningLog(Module.ToString(), $"{Module} in manual mode,can not set online.");
  351. // return false;
  352. //}
  353. if (!IsInclude)
  354. {
  355. LOG.Write(eEvent.WARN_PM, Module, $"{Module} is excluded,can not be put online");
  356. return false;
  357. }
  358. if (!_chamber.CheckSlitDoorClose())
  359. {
  360. EV.PostWarningLog(Module.ToString(), $"{Module} slit door is open,can not set online.");
  361. return false;
  362. }
  363. this._isOnline = true;
  364. return true;
  365. }
  366. private bool FnSetOffline(object[] param)
  367. {
  368. this._isOnline = false;
  369. return true;
  370. }
  371. public PMEntity(ModuleName module)
  372. {
  373. Module = module;
  374. _chamber = DEVICE.GetDevice<JetPMBase>(Module.ToString());
  375. _home = new PMHomeRoutine(_chamber);
  376. _startDryPumpRoutine = new StartDryPumpRoutine(_chamber);
  377. _startTurboPumpRoutine = new StartTurboPumpRoutine(_chamber);
  378. _ventRoutine = new VentRoutine(_chamber);
  379. _venusVentRoutine = new VenusVentRoutine(_chamber);
  380. _pumpRoutine = new PumpDownRoutine(_chamber);
  381. //_ventLoadLockRoutine = new LoadLockVentRoutine(_chamber);
  382. //_pumpLoadLockRoutine = new LoadLockPumpRoutine(_chamber);
  383. //_purgeLoadLockRoutine = new LoadLockPurgeRoutine(_chamber);
  384. //_loadLockLeakCheckRoutine = new LoadLockLeakCheckRoutine(_chamber);
  385. _purgeRoutine = new PMPurgeRoutine(_chamber);
  386. _gaslinePurgeRoutine = new PMGaslinePurgeRoutine(_chamber);
  387. _leakCheckRoutine = new PMLeakCheckRoutine(_chamber);
  388. _gasBoxLeakCheckRoutine = new GasBoxLeakCheckRoutine(_chamber);
  389. //_llPlaceRoutine = new LLPlaceRoutine(_chamber);
  390. //_llPickRoutine = new LLPickRoutine(_chamber, _ventLoadLockRoutine);
  391. _processRoutine = new PMProcessRoutine(_chamber, _pumpRoutine);
  392. _gasFlowRoutine = new GasFlowRoutine(_chamber);
  393. _rfPowerRoutine = new RFPowerSwitchRoutine(_chamber, true);
  394. _gasVerificationRoutine = new PMGasVerificationRoutine(_chamber, _pumpRoutine);
  395. _pmPartialPressureRoutine = new PMPartialPressureRoutine(_chamber);
  396. _pmVATPerformanceRoutine = new PMVATPerformanceRoutine(_chamber);
  397. //_pmControlPressureRoutine = new PMControlPressureRoutine(_chamber);
  398. //_pmHeatRoutine = new PMHeatRoutine(_chamber);
  399. fsm = new StateMachine<PMEntity>(Module.ToString(), (int)PMState.Init, 50);
  400. //Idle
  401. EnterExitTransition((int)PMState.Idle, FnIdle, (int)FSM_MSG.NONE, null);
  402. EnterExitTransition<PMState, FSM_MSG>(PMState.Error, fEnterError, FSM_MSG.NONE, null);
  403. EnterExitTransition<PMState, FSM_MSG>(PMState.ReadyForPick, fnEnterPickReady, FSM_MSG.NONE, fnExitPickReady);
  404. EnterExitTransition<PMState, FSM_MSG>(PMState.ReadyForPlace, fnEnterPlaceReady, FSM_MSG.NONE, fnExitPlaceReady);
  405. EnterExitTransition<PMState, FSM_MSG>(PMState.DropDownReady, fnEnterDropDownReady, FSM_MSG.NONE, fnExitDropDownReady);
  406. EnterExitTransition<PMState, FSM_MSG>(PMState.LiftUpReady, fnEnterLiftUpReady, FSM_MSG.NONE, fnExitLiftUpReady);
  407. //Home
  408. //EnterExitTransition((int)PMState.Homing, FnEnterHome, (int)FSM_MSG.NONE, FnExitHome);
  409. AnyStateTransition(MSG.Error, FnError, PMState.Error);
  410. AnyStateTransition(MSG.Online, FnSetOnline, FSM_STATE.SAME);
  411. AnyStateTransition(MSG.Offline, FnSetOffline, FSM_STATE.SAME);
  412. AnyStateTransition(FSM_MSG.ALARM, FnAlarm, PMState.Error);
  413. Transition(PMState.Init, FSM_MSG.TIMER, FnTimeout, PMState.Init);
  414. Transition(PMState.Init, MSG.Home, FnStartHome, PMState.Homing);
  415. Transition(PMState.Error, MSG.Home, FnStartHome, PMState.Homing);
  416. Transition(PMState.Idle, MSG.Home, FnStartHome, PMState.Homing);
  417. Transition(PMState.Homing, MSG.Home, FnStartHome, PMState.Homing);
  418. Transition(PMState.Homing, FSM_MSG.TIMER, FnMonitorHome, PMState.Idle);
  419. Transition(PMState.Homing, MSG.Abort, FnAbortHome, PMState.Idle);
  420. Transition(PMState.Idle, FSM_MSG.TIMER, FnIdleTimeout, PMState.Idle);
  421. Transition(PMState.Error, FSM_MSG.TIMER, FnErrorTimeout, PMState.Error);
  422. //Launch DryPump sequence
  423. Transition(PMState.Idle, MSG.LaunchPump, FnLaunchPump, PMState.LaunchingPump);
  424. Transition(PMState.LaunchingPump, FSM_MSG.TIMER, FnLaunchPumpTimeout, PMState.Idle);
  425. Transition(PMState.LaunchingPump, MSG.Abort, FnAbortStartPumping, PMState.Idle);
  426. //Launch TurboPump sequence
  427. Transition(PMState.Idle, MSG.LaunchTurboPump, FnLaunchTurboPump, PMState.LaunchingTurboPump);
  428. Transition(PMState.LaunchingTurboPump, FSM_MSG.TIMER, FnLaunchTurboPumpTimeout, PMState.Idle);
  429. Transition(PMState.LaunchingTurboPump, MSG.Abort, FnAbortStartTurboPumping, PMState.Idle);
  430. //vent sequence
  431. Transition(PMState.Idle, MSG.Vent, FnStartVent, PMState.Venting);
  432. Transition(PMState.Pumping, MSG.Vent, FnVentToPumping, PMState.Venting);
  433. Transition(PMState.Venting, FSM_MSG.TIMER, FnVentTimeout, PMState.Idle);
  434. Transition(PMState.Venting, MSG.Abort, FnAbortVent, PMState.Idle);
  435. //Pump sequence
  436. Transition(PMState.Idle, MSG.Pump, FnStartPumpDown, PMState.Pumping);
  437. Transition(PMState.Venting, MSG.Pump, FnVentToPumping, PMState.Pumping);
  438. Transition(PMState.Pumping, FSM_MSG.TIMER, FnPumpDownTimeout, PMState.Idle);
  439. Transition(PMState.Pumping, MSG.Abort, FnAbortPumping, PMState.Idle);
  440. //Pump Loadlock sequence
  441. //Transition(PMState.Idle, MSG.PumpLoadLock, FnStartPumpDownLoadLock, PMState.PumpingLoadLock);
  442. //Transition(PMState.VentingLoadLock, MSG.PumpLoadLock, FnVentLoadLockToPumpingLoadLock, PMState.PumpingLoadLock);
  443. //Transition(PMState.PumpingLoadLock, FSM_MSG.TIMER, FnPumpDownLoadLockTimeout, PMState.Idle);
  444. //Transition(PMState.PumpingLoadLock, MSG.Abort, FnAbortPumpingLoadLock, PMState.Idle);
  445. //Vent Loadlock sequence
  446. //Transition(PMState.Idle, MSG.VentLoadLock, FnStartVentLoadlock, PMState.VentingLoadLock);
  447. //Transition(PMState.PumpingLoadLock, MSG.VentLoadLock, FnPumpingLoadLockToVentLoadLock, PMState.VentingLoadLock);
  448. //Transition(PMState.VentingLoadLock, FSM_MSG.TIMER, FnVentLoadLockTimeout, PMState.Idle);
  449. //Transition(PMState.VentingLoadLock, MSG.Abort, FnAbortVentLoadLock, PMState.Idle);
  450. // Purge LoadLock sequence
  451. //Transition(PMState.Idle, MSG.PurgeLoadLock, FnStartPurgeLoadlock, PMState.PurgingLoadLock);
  452. //Transition(PMState.PurgingLoadLock, FSM_MSG.TIMER, FnPurgeLoadLockTimeout, PMState.Idle);
  453. //Transition(PMState.PurgingLoadLock, MSG.Abort, FnAbortPurgeLoadLock, PMState.Idle);
  454. //LoadLock Leak check sequence
  455. //Transition(PMState.Idle, MSG.LoadLockLeakCheck, FnStartLoadLockLeakCheck, PMState.LoadLockLeakCheck);
  456. //Transition(PMState.LoadLockLeakCheck, FSM_MSG.TIMER, FnLoadLockLeakCheckTimeout, PMState.Idle);
  457. //Transition(PMState.LoadLockLeakCheck, MSG.Abort, FnAbortLoadLockLeakCheck, PMState.Idle);
  458. // PM Purge sequence
  459. Transition(PMState.Idle, MSG.CyclePurge, FnStartPurge, PMState.Purging);
  460. Transition(PMState.Purging, FSM_MSG.TIMER, FnPurgeTimeout, PMState.Idle);
  461. Transition(PMState.Purging, MSG.Abort, FnAbortPurge, PMState.Idle);
  462. // PM GasLine Purge sequence
  463. Transition(PMState.Idle, MSG.GasLinePurge, FnStartGasLinePurge, PMState.GasLinePurge);
  464. Transition(PMState.GasLinePurge, FSM_MSG.TIMER, FnGasLinePurgeTimeout, PMState.Idle);
  465. Transition(PMState.GasLinePurge, MSG.Abort, FnAbortGasLinePurge, PMState.Idle);
  466. //PM Leak check sequence
  467. Transition(PMState.Idle, MSG.LeakCheck, FnStartPMLeakCheck, PMState.LeakCheck);
  468. Transition(PMState.LeakCheck, FSM_MSG.TIMER, FnPMLeakCheckTimeout, PMState.Idle);
  469. Transition(PMState.LeakCheck, MSG.Abort, FnAbortPMLeakCheck, PMState.Idle);
  470. //PM GasBox Leak check sequence
  471. Transition(PMState.Idle, MSG.GasLeakCheck, FnStartGasBoxLeakCheck, PMState.GasBoxLeakCheck);
  472. Transition(PMState.GasBoxLeakCheck, FSM_MSG.TIMER, FnGasBoxLeakCheckTimeout, PMState.Idle);
  473. Transition(PMState.GasBoxLeakCheck, MSG.Abort, FnAbortGasBoxLeakCheck, PMState.Idle);
  474. // PlaceWafer from LoadLock Arm sequence
  475. //Transition(PMState.Idle, MSG.LLPlace, FnStartLLPlace, PMState.LLPlacing);
  476. //Transition(PMState.LLPlacing, FSM_MSG.TIMER, FnLLPlaceTimeout, PMState.Idle);
  477. //Transition(PMState.LLPlacing, MSG.Abort, FnAbortLLPlace, PMState.Idle);
  478. // PickWafer to LoadLock Arm sequence
  479. //Transition(PMState.Idle, MSG.LLPick, FnStartLLPick, PMState.LLPicking);
  480. //Transition(PMState.LLPicking, FSM_MSG.TIMER, FnLLPickTimeout, PMState.Idle);
  481. //Transition(PMState.LLPicking, MSG.Abort, FnAbortLLPick, PMState.Idle);
  482. // Process
  483. Transition(PMState.Idle, MSG.RunRecipe, FnRunRecipe, PMState.Processing);
  484. Transition(PMState.Processing, FSM_MSG.TIMER, FnProcessTimeout, PMState.Idle);
  485. Transition(PMState.Processing, MSG.Abort, FnAbortProcess, PMState.Idle);
  486. // Clean
  487. Transition(PMState.Idle, MSG.Clean, FnRunRecipe, PMState.Clean);
  488. Transition(PMState.Clean, FSM_MSG.TIMER, FnProcessTimeout, PMState.Idle);
  489. Transition(PMState.Clean, MSG.Abort, FnAbortProcess, PMState.Idle);
  490. // Gas Flow sequence
  491. Transition(PMState.Idle, MSG.GasFlow, FnStartGasFlow, PMState.GasFlowing);
  492. Transition(PMState.GasFlowing, MSG.GasFlow, FnAbortGasFlow, PMState.Idle);
  493. Transition(PMState.GasFlowing, FSM_MSG.TIMER, FnGasFlowTimeout, PMState.Idle);
  494. Transition(PMState.GasFlowing, MSG.StopGasFlow, FnStopGasFlow, PMState.Idle);
  495. Transition(PMState.GasFlowing, MSG.Abort, FnAbortGasFlow, PMState.Idle);
  496. //RF Power sequence
  497. Transition(PMState.Idle, MSG.RfPower, FnStartRfPower, PMState.RfPowering);
  498. Transition(PMState.GasFlowing, MSG.RfPower, FnStartRfPower, PMState.RfPowering);
  499. Transition(PMState.RfPowering, FSM_MSG.TIMER, FnRfPowerTimeout, PMState.Idle);
  500. Transition(PMState.RfPowering, MSG.Abort, FnAbortRfPower, PMState.Idle);
  501. //MFC verification
  502. Transition(PMState.Idle, MSG.MFCVerification, FnStartMFCVerification, PMState.MFCVerification);
  503. Transition(PMState.MFCVerification, FSM_MSG.TIMER, FnMFCVerificationTimeout, PMState.Idle);
  504. Transition(PMState.MFCVerification, MSG.Abort, FnAbortMFCVerification, PMState.Idle);
  505. //////////////////////// Exchange Wafer with TM ///////////////////////////////////////////////////////
  506. // Pick Wafer from PM
  507. Transition(PMState.Idle, MSG.PreparePick, FnStartPreparePick, PMState.PreparePick);
  508. Transition(PMState.PreparePick, MSG.Abort, FnAbortPreparePick, PMState.Idle);
  509. Transition(PMState.PreparePick, FSM_MSG.TIMER, FnPreparePickTimeout, PMState.ReadyForPick);
  510. Transition(PMState.PreparePick, MSG.PreparePick, null, PMState.PreparePick);
  511. Transition(PMState.ReadyForPick, MSG.Abort, FnAbortPick, PMState.Idle);
  512. Transition(PMState.ReadyForPick, MSG.DropDownWafer, FnStartDropDownWafer, PMState.DropDownWafer);
  513. Transition(PMState.ReadyForPick, MSG.PreparePick, null, PMState.ReadyForPick);
  514. Transition(PMState.DropDownWafer, FSM_MSG.TIMER, FnDropDownTimeout, PMState.DropDownReady);
  515. Transition(PMState.DropDownReady, MSG.PickReady, FnStartFinishPick, PMState.FinishPick);
  516. Transition(PMState.ReadyForPick, MSG.PickReady, FnStartFinishPick, PMState.FinishPick);
  517. Transition(PMState.FinishPick, FSM_MSG.TIMER, FnFinishPickTimeout, PMState.Idle);
  518. // Place Wafer to PM
  519. Transition(PMState.Idle, MSG.PreparePlace, FnStartPreparePlace, PMState.PreparePlace);
  520. //Transition(PMState.Heating, MSG.PreparePlace, FnStartPreparePlace, PMState.PreparePlace);
  521. Transition(PMState.PreparePlace, MSG.Abort, FnAbortPreparePlace, PMState.Idle);
  522. Transition(PMState.PreparePlace, FSM_MSG.TIMER, FnPreparePlaceTimeout, PMState.ReadyForPlace);
  523. Transition(PMState.PreparePlace, MSG.PreparePlace, null, PMState.PreparePlace);
  524. Transition(PMState.ReadyForPlace, MSG.LiftUpWafer, FnStartLiftUpWafer, PMState.LiftUpWafer);
  525. Transition(PMState.LiftUpWafer, FSM_MSG.TIMER, FnLiftUpTimeout, PMState.LiftUpReady);
  526. Transition(PMState.LiftUpReady, MSG.PlaceReady, FnStartFinishPlace, PMState.FinishPlace);
  527. Transition(PMState.ReadyForPlace, MSG.PlaceReady, FnStartFinishPlace, PMState.FinishPlace);
  528. Transition(PMState.PreparePlace, MSG.Abort, FnAortPlace, PMState.Idle);
  529. Transition(PMState.ReadyForPlace, MSG.Abort, FnAortPlace, PMState.Idle);
  530. Transition(PMState.ReadyForPlace, MSG.PreparePlace, null, PMState.ReadyForPlace);
  531. Transition(PMState.LiftUpReady, MSG.Abort, FnAortPlace, PMState.Idle);
  532. Transition(PMState.FinishPlace, FSM_MSG.TIMER, FnFinishPlaceTimeout, PMState.Idle);
  533. // Swap Wafer With PM
  534. Transition(PMState.DropDownReady, MSG.PreparePlace, FnStartSwapPlace, PMState.PreparePlace);
  535. Transition(PMState.ReadyForPick, MSG.PreparePlace, FnStartPreparePlace, PMState.PreparePlace);
  536. Transition(PMState.Idle, MSG.PartialPressure, FnStartPartialPressure, PMState.PartialPressureTesting);
  537. Transition(PMState.PartialPressureTesting, FSM_MSG.TIMER, FnPartialPressureTimeout, PMState.Idle);
  538. Transition(PMState.PartialPressureTesting, MSG.Abort, FnAbortPartialPressure, PMState.Idle);
  539. Transition(PMState.Idle, MSG.VATPerformance, FnStartVATPerformance, PMState.VATPerformanceTesting);
  540. Transition(PMState.VATPerformanceTesting, FSM_MSG.TIMER, FnVATPerformanceTimeout, PMState.Idle);
  541. Transition(PMState.VATPerformanceTesting, MSG.Abort, FnAbortVATPerformance, PMState.Idle);
  542. //Transition(PMState.Idle, MSG.Heat, FnStartHeat, PMState.Heating);
  543. AnyStateTransition(FSM_MSG.TIMER, FnControlPressure, FSM_STATE.SAME);
  544. Running = true;
  545. WaferManager.Instance.SubscribeLocation(Module, 1);
  546. }
  547. protected override bool Init()
  548. {
  549. DATA.Subscribe($"{Module}.FsmState", () => (((PMState)fsm.State)), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  550. DATA.Subscribe($"{Module}.FsmPrevState", () => (((PMState)fsm.PrevState).ToString()), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  551. DATA.Subscribe($"{Module}.FsmLastMessage", () => (((MSG)fsm.LastMsg).ToString()), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  552. //DATA.Subscribe($"{Module}.LoadLockPurge.PurgeCounter", () => _purgeLoadLockRoutine.PurgeCounter, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  553. DATA.Subscribe($"{Module}.PartialPressureCounter", () => _pmPartialPressureRoutine.counter, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  554. DATA.Subscribe($"{Module}.VATPerformanceCounter", () => _pmVATPerformanceRoutine.counter, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  555. DATA.Subscribe($"{Module}.VATPerformanceResult", () => _pmVATPerformanceRoutine?.m_sb.ToString(), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  556. DATA.Subscribe($"{Module}.PartialPressureResult", () => _pmPartialPressureRoutine?.m_sb.ToString(), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  557. DATA.Subscribe($"{Module}.MFCCalibrationDatas", () => _gasVerificationRoutine?._MFCCalibrationDatas, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  558. DATA.Subscribe($"{Module}.IsIdle", () => IsIdle, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  559. DATA.Subscribe($"{Module}.IsAlarm", () => IsError, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  560. DATA.Subscribe($"{Module}.IsBusy", () => IsBusy, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  561. DATA.Subscribe($"{Module}.IsInit", () => IsInit, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  562. DATA.Subscribe($"{Module}.IsOnline", () => _isOnline, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  563. DATA.Subscribe($"{Module}.VentingFlag", () => ChamberType == JetChamber.VenusSE || ChamberType == JetChamber.VenusDE ? _venusVentRoutine.VentingFlag: _ventRoutine.VentingFlag, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  564. //DATA.Subscribe($"{Module}.GetLeakCheckDatas", () => LeakCheckDataRecorder.GetAllLeakCheckData(Module.ToString()));
  565. DATA.Subscribe($"{Module}.CurrentRecipeResult", () => _processRoutine.currentRecipeResult, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  566. DATA.Subscribe($"{Module}.LeakCheck.Step", () => _leakCheckRoutine.CurrentStep, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  567. DATA.Subscribe($"{Module}.GasLeakCheck.Step", () => _gasBoxLeakCheckRoutine.CurrentStep, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  568. DATA.Subscribe($"{Module}.IsInclude", () => IsInclude, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  569. OP.Subscribe($"{Module}.{RtOperation.GasFlow}", (cmd, args) => CheckToPostMessage((int)MSG.GasFlow, args));
  570. OP.Subscribe($"{Module}.{RtOperation.LeakCheck}", (cmd, args) => CheckToPostMessage((int)MSG.LeakCheck, args));
  571. OP.Subscribe($"{Module}.{RtOperation.GasLeakCheck}", (cmd, args) => CheckToPostMessage((int)MSG.GasLeakCheck, args));
  572. OP.Subscribe($"{Module}.Home", (cmd, args) => CheckToPostMessage((int)MSG.Home));
  573. OP.Subscribe($"{Module}.{RtOperation.StartPump}", (cmd, args) => CheckToPostMessage((int)MSG.LaunchPump));
  574. OP.Subscribe($"{Module}.{RtOperation.StartTurboPump}", (cmd, args) => CheckToPostMessage((int)MSG.LaunchTurboPump));
  575. OP.Subscribe($"{Module}.{RtOperation.Pump}", (cmd, args) => CheckToPostMessage((int)MSG.Pump));
  576. OP.Subscribe($"{Module}.{RtOperation.Purge}", (cmd, args) => CheckToPostMessage((int)MSG.CyclePurge));
  577. OP.Subscribe($"{Module}.{RtOperation.RfPower}", (cmd, args) => CheckToPostMessage((int)MSG.RfPower));
  578. OP.Subscribe($"{Module}.{RtOperation.Vent}", (cmd, args) => CheckToPostMessage((int)MSG.Vent));
  579. OP.Subscribe($"{Module}.{RtOperation.VentLoadLock}", (cmd, args) => CheckToPostMessage((int)MSG.VentLoadLock));
  580. OP.Subscribe($"{Module}.{RtOperation.PurgeLoadLock}", (cmd, args) => CheckToPostMessage((int)MSG.PurgeLoadLock));
  581. OP.Subscribe($"{Module}.{RtOperation.PumpLoadLock}", (cmd, args) => CheckToPostMessage((int)MSG.PumpLoadLock));
  582. OP.Subscribe($"{Module}.{RtOperation.Reset}", (cmd, args) => CheckToPostMessage((int)MSG.Reset));
  583. OP.Subscribe($"{Module}.{RtOperation.Abort}", (cmd, args) => CheckToPostMessage((int)MSG.Abort));
  584. OP.Subscribe($"{Module}.{RtOperation.LLPick}", (cmd, args) => CheckToPostMessage((int)MSG.LLPick));
  585. OP.Subscribe($"{Module}.{RtOperation.LLPlace}", (cmd, args) => CheckToPostMessage((int)MSG.LLPlace));
  586. OP.Subscribe($"{Module}.{RtOperation.MFCVerification}", (cmd, args) => CheckToPostMessage((int)MSG.MFCVerification, args));
  587. OP.Subscribe($"{Module}.{RtOperation.RunRecipe}", (cmd, args) => CheckToPostMessage((int)MSG.RunRecipe, args));
  588. OP.Subscribe($"{Module}.{RtOperation.RunCleanRecipe}", (cmd, args) => CheckToPostMessage((int)MSG.Clean, args));
  589. OP.Subscribe($"{Module}.PartialPressureTest", (cmd, args) => CheckToPostMessage((int)MSG.PartialPressure, args[0], args[1]));
  590. OP.Subscribe($"{Module}.VATPerformanceTest", (cmd, args) => CheckToPostMessage((int)MSG.VATPerformance, args[0], args[1], args[2]));
  591. OP.Subscribe($"{Module}.GasLinePurge", (cmd, args) => CheckToPostMessage((int)MSG.GasLinePurge));
  592. OP.Subscribe($"{Module}.ManualEndStep", (cmd, args) => ManualEndStep());
  593. OP.Subscribe($"{Module}.{RtOperation.Online}", (cmd, args) => CheckToPostMessage((int)MSG.Online));
  594. OP.Subscribe($"{Module}.{RtOperation.Offline}", (cmd, args) => CheckToPostMessage((int)MSG.Offline));
  595. OP.Subscribe($"{Module}.{RtOperation.PmError}", (cmd, args) => CheckToPostMessage((int)MSG.Error));
  596. OP.Subscribe($"{Module}.{RtOperation.Include}", (cmd, args) => FnSetInclude());
  597. OP.Subscribe($"{Module}.{RtOperation.Exclude}", (cmd, args) => FnSetExclude());
  598. StatsDataManager.Instance.Subscribe($"{Module}.ProcessedWaferCount", "Processed Wafer Count", 0);
  599. if (_chamber.IsRFAble())
  600. StatsDataManager.Instance.Subscribe($"{Module}.RfOnTime", "Rf On Time");
  601. if (_chamber.IsBiasRFAble())
  602. StatsDataManager.Instance.Subscribe($"{Module}.BiasRfOnTime", "Bias Rf On Time");
  603. //StatsDataManager.Instance.Subscribe($"{Module}.PumpOnTime", "Pump On Time");
  604. _statProcessedWafer = StatsDataManager.Instance.GetItem($"{Module}.ProcessedWaferCount");
  605. _statRfOnTime = StatsDataManager.Instance.GetItemRFAndPump($"{Module}.RfOnTime");
  606. if (_chamber.IsBiasRFAble())
  607. _statBiasRfOnTime = StatsDataManager.Instance.GetItemRFAndPump($"{Module}.BiasRfOnTime");
  608. //_statPumpOnTime = StatsDataManager.Instance.GetItemRFAndPump($"{Module}.PumpOnTime");
  609. DATA.Subscribe($"{Module}.ProcessedWaferCount", () => _statProcessedWafer.Value, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  610. if (_chamber.IsRFAble())
  611. DATA.Subscribe($"{Module}.RfOnTime", () => _statRfOnTime.fromLastPM);
  612. if (_chamber.IsBiasRFAble())
  613. DATA.Subscribe($"{Module}.BiasRfOnTime", () => _statBiasRfOnTime.fromLastPM);
  614. //DATA.Subscribe($"{Module}.PumpOnTime", () => _statPumpOnTime.fromLastPM);
  615. if (ChamberType == JetChamber.Kepler2200A && ChamberType == JetChamber.Kepler2200B)
  616. {
  617. LOG.PMErrorInterrupt += (pmname) => PMErrorInterrupt(pmname);
  618. }
  619. return true;
  620. }
  621. private void PMErrorInterrupt(ModuleName pmname)
  622. {
  623. if (pmname == Module)
  624. {
  625. LOG.Write(eEvent.ERR_PM, Module, $"Device Error Happend! {Module} Crash!");
  626. CheckToPostMessage((int)MSG.Error);
  627. }
  628. }
  629. private bool ManualEndStep()
  630. {
  631. _processRoutine.isMaualEndStep = true;
  632. return true;
  633. }
  634. private bool FnIdle(object[] objs)
  635. {
  636. Running = false;
  637. return true;
  638. }
  639. private bool fEnterError(object[] objs)
  640. {
  641. return true;
  642. }
  643. private bool fnEnterPickReady(object[] objs)
  644. {
  645. Status = PMStatus.Ready_For_Pick;
  646. return true;
  647. }
  648. private bool fnExitPickReady(object[] objs)
  649. {
  650. Status = PMStatus.Not_Ready;
  651. return true;
  652. }
  653. private bool fnEnterPlaceReady(object[] objs)
  654. {
  655. Status = PMStatus.Ready_For_Place;
  656. return true;
  657. }
  658. private bool fnExitPlaceReady(object[] objs)
  659. {
  660. Status = PMStatus.Not_Ready;
  661. return true;
  662. }
  663. private bool fnEnterDropDownReady(object[] objs)
  664. {
  665. Status = PMStatus.Exchange_Ready;
  666. return true;
  667. }
  668. private bool fnExitDropDownReady(object[] objs)
  669. {
  670. Status = PMStatus.Not_Ready;
  671. return true;
  672. }
  673. private bool fnEnterLiftUpReady(object[] objs)
  674. {
  675. Status = PMStatus.Exchange_Ready;
  676. return true;
  677. }
  678. private bool fnExitLiftUpReady(object[] objs)
  679. {
  680. Status = PMStatus.Not_Ready;
  681. return true;
  682. }
  683. private bool FnAlarm(object[] objs)
  684. {
  685. if ((PMState)fsm.State == PMState.Processing)
  686. {
  687. }
  688. return true;
  689. }
  690. private bool FnError(object[] objs)
  691. {
  692. Running = false;
  693. _isOnline = false;
  694. //if (((PMState)fsm.State == PMState.Processing) || ((PMState)fsm.State == PMState.PreProcess)
  695. // || ((PMState)fsm.State == PMState.Homing) || ((PMState)fsm.State == PMState.LoadProcessRecipe))
  696. // return false;
  697. //_chamber.CloseValves();
  698. //_chamber.GeneratorPowerOn(false);
  699. //_chamber.GeneratorBiasPowerOn(false);
  700. //_chamber.OpenValve(ValveType.TurboPumpPumping, true);
  701. //_chamber.OpenValve(ValveType.TurboPumpPurge, true);
  702. //_chamber.OnOffSetESCHV(false);
  703. _chamber.PMInError();
  704. if (IsProcessing)
  705. {
  706. WaferManager.Instance.UpdateWaferProcessStatus(Module, 0, EnumWaferProcessStatus.Failed);
  707. }
  708. return true;
  709. }
  710. private bool FnTimeout(object[] objs)
  711. {
  712. _debugRoutine();
  713. return true;
  714. }
  715. private bool FnIdleTimeout(object[] objs)
  716. {
  717. _chamber.CheckIdleInterlock(0);
  718. //_debugRoutine();
  719. return true;
  720. }
  721. private bool FnErrorTimeout(object[] objs)
  722. {
  723. //_debugRoutine();
  724. return true;
  725. }
  726. private bool FnStartHome(object[] objs)
  727. {
  728. return _home.Start() == RState.Running;
  729. }
  730. private bool FnMonitorHome(object[] objs)
  731. {
  732. RState ret = _home.Monitor();
  733. if (ret == RState.Failed || ret == RState.Timeout)
  734. {
  735. PostMsg(MSG.Error);
  736. return false;
  737. }
  738. return ret == RState.End;
  739. }
  740. private bool FnAbortHome(object[] objs)
  741. {
  742. _home.Abort();
  743. return true;
  744. }
  745. private bool FnLaunchPump(object[] param)
  746. {
  747. return _startDryPumpRoutine.Start() == RState.Running;
  748. }
  749. private bool FnLaunchPumpTimeout(object[] param)
  750. {
  751. RState ret = _startDryPumpRoutine.Monitor();
  752. if (ret == RState.Failed || ret == RState.Timeout)
  753. {
  754. PostMsg(MSG.Error);
  755. return false;
  756. }
  757. return ret == RState.End;
  758. }
  759. private bool FnAbortStartPumping(object[] param)
  760. {
  761. _startDryPumpRoutine.Abort();
  762. return true;
  763. }
  764. private bool FnLaunchTurboPump(object[] param)
  765. {
  766. return _startTurboPumpRoutine.Start() == RState.Running;
  767. }
  768. private bool FnLaunchTurboPumpTimeout(object[] param)
  769. {
  770. RState ret = _startTurboPumpRoutine.Monitor();
  771. if (ret == RState.Failed || ret == RState.Timeout)
  772. {
  773. PostMsg(MSG.Error);
  774. return false;
  775. }
  776. return ret == RState.End;
  777. }
  778. private bool FnAbortStartTurboPumping(object[] param)
  779. {
  780. _startTurboPumpRoutine.Abort();
  781. return true;
  782. }
  783. private bool FnStartVent(object[] param)
  784. {
  785. switch (ChamberType)
  786. {
  787. case JetChamber.VenusSE:
  788. case JetChamber.VenusDE:
  789. return _venusVentRoutine.Start() == RState.Running;
  790. default:
  791. return _ventRoutine.Start() == RState.Running;
  792. }
  793. }
  794. private bool FnVentTimeout(object[] param)
  795. {
  796. RState ret;
  797. switch (ChamberType)
  798. {
  799. case JetChamber.VenusSE:
  800. case JetChamber.VenusDE:
  801. ret = _venusVentRoutine.Monitor();
  802. break;
  803. default:
  804. ret = _ventRoutine.Monitor();
  805. break;
  806. }
  807. if (ret == RState.Failed || ret == RState.Timeout)
  808. {
  809. PostMsg(MSG.Error);
  810. return false;
  811. }
  812. return ret == RState.End;
  813. }
  814. private bool FnVentToPumping(object[] param)
  815. {
  816. switch (ChamberType)
  817. {
  818. case JetChamber.VenusSE:
  819. case JetChamber.VenusDE:
  820. _venusVentRoutine.Abort();
  821. break;
  822. default:
  823. _ventRoutine.Abort();
  824. break;
  825. }
  826. return true; // FnStartPumpDown(param);
  827. }
  828. private bool FnAbortVent(object[] param)
  829. {
  830. switch (ChamberType)
  831. {
  832. case JetChamber.VenusSE:
  833. case JetChamber.VenusDE:
  834. _venusVentRoutine.Abort();
  835. break;
  836. default:
  837. _ventRoutine.Abort();
  838. break;
  839. }
  840. return true;
  841. }
  842. private bool FnStartPumpDown(object[] param)
  843. {
  844. return _pumpRoutine.Start() == RState.Running;
  845. }
  846. private bool FnPumpDownTimeout(object[] param)
  847. {
  848. RState ret = _pumpRoutine.Monitor();
  849. if (ret == RState.Failed || ret == RState.Timeout)
  850. {
  851. PostMsg(MSG.Error);
  852. return false;
  853. }
  854. return ret == RState.End;
  855. }
  856. private bool FnAbortPumping(object[] param)
  857. {
  858. _pumpRoutine.Abort();
  859. return true;
  860. }
  861. //private bool FnStartVentLoadlock(object[] param)
  862. //{
  863. // return _ventLoadLockRoutine.Start() == RState.Running;
  864. //}
  865. //private bool FnVentLoadLockTimeout(object[] param)
  866. //{
  867. // RState ret = _ventLoadLockRoutine.Monitor();
  868. // if (ret == RState.Failed || ret == RState.Timeout)
  869. // {
  870. // PostMsg(MSG.Error);
  871. // return false;
  872. // }
  873. // return ret == RState.End;
  874. //}
  875. //private bool FnVentLoadLockToPumpingLoadLock(object[] param)
  876. //{
  877. // _ventLoadLockRoutine.Abort();
  878. // return FnStartPumpDownLoadLock(param);
  879. //}
  880. //private bool FnAbortVentLoadLock(object[] param)
  881. //{
  882. // _ventLoadLockRoutine.Abort();
  883. // return true;
  884. //}
  885. //private bool FnStartPumpDownLoadLock(object[] param)
  886. //{
  887. // return _pumpLoadLockRoutine.Start() == RState.Running;
  888. //}
  889. //private bool FnPumpDownLoadLockTimeout(object[] param)
  890. //{
  891. // RState ret = _pumpLoadLockRoutine.Monitor();
  892. // if (ret == RState.Failed || ret == RState.Timeout)
  893. // {
  894. // PostMsg(MSG.Error);
  895. // return false;
  896. // }
  897. // return ret == RState.End;
  898. //}
  899. private bool FnPumpingToVent(object[] param)
  900. {
  901. _pumpRoutine.Abort();
  902. return FnStartVent(param);
  903. }
  904. //private bool FnPumpingLoadLockToVentLoadLock(object[] param)
  905. //{
  906. // _pumpLoadLockRoutine.Abort();
  907. // return FnStartVentLoadlock(param);
  908. //}
  909. //private bool FnAbortPumpingLoadLock(object[] param)
  910. //{
  911. // _pumpLoadLockRoutine.Abort();
  912. // return true;
  913. //}
  914. //private bool FnStartPurgeLoadlock(object[] param)
  915. //{
  916. // return _purgeLoadLockRoutine.Start() == RState.Running;
  917. //}
  918. //private bool FnPurgeLoadLockTimeout(object[] param)
  919. //{
  920. // RState ret = _purgeLoadLockRoutine.Monitor();
  921. // if (ret == RState.Failed || ret == RState.Timeout)
  922. // {
  923. // PostMsg(MSG.Error);
  924. // return false;
  925. // }
  926. // return ret == RState.End;
  927. //}
  928. //private bool FnAbortPurgeLoadLock(object[] param)
  929. //{
  930. // _purgeLoadLockRoutine.Abort();
  931. // return true;
  932. //}
  933. //private bool FnStartLoadLockLeakCheck(object[] param)
  934. //{
  935. // return _loadLockLeakCheckRoutine.Start() == RState.Running;
  936. //}
  937. //private bool FnLoadLockLeakCheckTimeout(object[] param)
  938. //{
  939. // RState ret = _loadLockLeakCheckRoutine.Monitor();
  940. // if (ret == RState.Failed || ret == RState.Timeout)
  941. // {
  942. // PostMsg(MSG.Error);
  943. // return false;
  944. // }
  945. // return ret == RState.End;
  946. //}
  947. //private bool FnAbortLoadLockLeakCheck(object[] param)
  948. //{
  949. // _loadLockLeakCheckRoutine.Abort();
  950. // return true;
  951. //}
  952. private bool FnStartPurge(object[] param)
  953. {
  954. return _purgeRoutine.Start() == RState.Running;
  955. }
  956. private bool FnPurgeTimeout(object[] param)
  957. {
  958. RState ret = _purgeRoutine.Monitor();
  959. if (ret == RState.Failed || ret == RState.Timeout)
  960. {
  961. PostMsg(MSG.Error);
  962. return false;
  963. }
  964. return ret == RState.End;
  965. }
  966. private bool FnAbortPurge(object[] param)
  967. {
  968. _purgeRoutine.Abort();
  969. return true;
  970. }
  971. private bool FnStartGasLinePurge(object[] param)
  972. {
  973. return _gaslinePurgeRoutine.Start() == RState.Running;
  974. }
  975. private bool FnGasLinePurgeTimeout(object[] param)
  976. {
  977. RState ret = _gaslinePurgeRoutine.Monitor();
  978. if (ret == RState.Failed || ret == RState.Timeout)
  979. {
  980. PostMsg(MSG.Error);
  981. return false;
  982. }
  983. return ret == RState.End;
  984. }
  985. private bool FnAbortGasLinePurge(object[] param)
  986. {
  987. _gaslinePurgeRoutine.Abort();
  988. return true;
  989. }
  990. private bool FnStartPMLeakCheck(object[] param)
  991. {
  992. return _leakCheckRoutine.Start(param) == RState.Running;
  993. }
  994. private bool FnPMLeakCheckTimeout(object[] param)
  995. {
  996. RState ret = _leakCheckRoutine.Monitor();
  997. if (ret == RState.Failed || ret == RState.Timeout)
  998. {
  999. PostMsg(MSG.Error);
  1000. return false;
  1001. }
  1002. return ret == RState.End;
  1003. }
  1004. private bool FnAbortPMLeakCheck(object[] param)
  1005. {
  1006. _leakCheckRoutine.Abort();
  1007. return true;
  1008. }
  1009. private bool FnStartGasBoxLeakCheck(object[] param)
  1010. {
  1011. return _gasBoxLeakCheckRoutine.Start(param) == RState.Running;
  1012. }
  1013. private bool FnGasBoxLeakCheckTimeout(object[] param)
  1014. {
  1015. RState ret = _gasBoxLeakCheckRoutine.Monitor();
  1016. if (ret == RState.Failed || ret == RState.Timeout)
  1017. {
  1018. PostMsg(MSG.Error);
  1019. return false;
  1020. }
  1021. return ret == RState.End;
  1022. }
  1023. private bool FnAbortGasBoxLeakCheck(object[] param)
  1024. {
  1025. _gasBoxLeakCheckRoutine.Abort();
  1026. return true;
  1027. }
  1028. //private bool FnStartLLPlace(object[] param)
  1029. //{
  1030. // return _llPlaceRoutine.Start() == RState.Running;
  1031. //}
  1032. //private bool FnLLPlaceTimeout(object[] param)
  1033. //{
  1034. // RState ret = _llPlaceRoutine.Monitor();
  1035. // if (ret == RState.Failed || ret == RState.Timeout)
  1036. // {
  1037. // PostMsg(MSG.Error);
  1038. // return false;
  1039. // }
  1040. // return ret == RState.End;
  1041. //}
  1042. //private bool FnAbortLLPlace(object[] param)
  1043. //{
  1044. // _llPlaceRoutine.Abort();
  1045. // return true;
  1046. //}
  1047. //private bool FnStartLLPick(object[] param)
  1048. //{
  1049. // return _llPickRoutine.Start() == RState.Running;
  1050. //}
  1051. //private bool FnLLPickTimeout(object[] param)
  1052. //{
  1053. // RState ret = _llPickRoutine.Monitor();
  1054. // if (ret == RState.Failed || ret == RState.Timeout)
  1055. // {
  1056. // PostMsg(MSG.Error);
  1057. // return false;
  1058. // }
  1059. // return ret == RState.End;
  1060. //}
  1061. //private bool FnAbortLLPick(object[] param)
  1062. //{
  1063. // _llPickRoutine.Abort();
  1064. // return true;
  1065. //}
  1066. private bool FnRunRecipe(object[] param)
  1067. {
  1068. RState ret = _processRoutine.Start(param);
  1069. if (ret == RState.Failed || ret == RState.Timeout)
  1070. {
  1071. PostMsg(MSG.Error);
  1072. return false;
  1073. }
  1074. return ret == RState.Running;
  1075. }
  1076. private bool FnProcessTimeout(object[] param)
  1077. {
  1078. _chamber.CheckIdleInterlock(500);
  1079. RState ret = _processRoutine.Monitor();
  1080. if (ret == RState.Failed || ret == RState.Timeout)
  1081. {
  1082. PostMsg(MSG.Error);
  1083. return false;
  1084. }
  1085. if (ret == RState.End)
  1086. {
  1087. _dictRecipeTime[_processRoutine.currentRecipeResult.RecipeName] = fsm.ElapsedTime;
  1088. return true;
  1089. }
  1090. return false;
  1091. }
  1092. private bool FnAbortProcess(object[] param)
  1093. {
  1094. StatsDataManager.Instance.Increase(_statProcessedWafer.Name);
  1095. _processRoutine.Abort();
  1096. return true;
  1097. }
  1098. private bool FnStartGasFlow(object[] param)
  1099. {
  1100. return _gasFlowRoutine.Start(param) == RState.Running;
  1101. }
  1102. private bool FnGasFlowTimeout(object[] param)
  1103. {
  1104. RState ret = _gasFlowRoutine.Monitor();
  1105. if (ret == RState.Failed || ret == RState.Timeout)
  1106. {
  1107. PostMsg(MSG.Error);
  1108. return false;
  1109. }
  1110. return ret == RState.End;
  1111. }
  1112. private bool FnStopGasFlow(object[] param)
  1113. {
  1114. _gasFlowRoutine.Abort();
  1115. return true;
  1116. }
  1117. private bool FnAbortGasFlow(object[] param)
  1118. {
  1119. _gasFlowRoutine.Abort();
  1120. return true;
  1121. }
  1122. private bool FnStartRfPower(object[] param)
  1123. {
  1124. return _rfPowerRoutine.Start(param) == RState.Running;
  1125. }
  1126. private bool FnRfPowerTimeout(object[] param)
  1127. {
  1128. RState ret = _rfPowerRoutine.Monitor();
  1129. if (ret == RState.Failed || ret == RState.Timeout)
  1130. {
  1131. PostMsg(MSG.Error);
  1132. return false;
  1133. }
  1134. return ret == RState.End;
  1135. }
  1136. private bool FnAbortRfPower(object[] param)
  1137. {
  1138. _rfPowerRoutine.Abort();
  1139. if (_gasFlowRoutine._gasStatus)
  1140. {
  1141. _gasFlowRoutine.StopFlow();
  1142. }
  1143. return true;
  1144. }
  1145. private bool FnStartMFCVerification(object[] param)
  1146. {
  1147. _gasVerificationRoutine.Init((string[])param[0], Convert.ToDouble(param[1]), (int)param[2]);
  1148. return _gasVerificationRoutine.Start(param) == RState.Running;
  1149. }
  1150. private bool FnMFCVerificationTimeout(object[] param)
  1151. {
  1152. RState ret = _gasVerificationRoutine.Monitor();
  1153. if (ret == RState.Failed || ret == RState.Timeout)
  1154. {
  1155. PostMsg(MSG.Error);
  1156. return false;
  1157. }
  1158. return ret == RState.End;
  1159. }
  1160. private bool FnAbortMFCVerification(object[] param)
  1161. {
  1162. _gasVerificationRoutine.Abort();
  1163. return true;
  1164. }
  1165. private bool FnControlPressure(object[] param)
  1166. {
  1167. if (RouteManager.IsATMMode)
  1168. {
  1169. return true;
  1170. }
  1171. if (IsOnline == true && fsm.State != (int)PMState.Processing && fsm.State != (int)PMState.Clean)
  1172. {
  1173. if (startControlPressureFlag == true)
  1174. {
  1175. startControlPressureFlag = false;
  1176. if (_chamber.GetPVPosition() <= 0)
  1177. {
  1178. LOG.Write(eEvent.WARN_PM, Module, $"{Module} control pressure fail,due to pendulum valve is not Open");
  1179. return false;
  1180. }
  1181. if (_chamber.IsTurboPumpRunning == false)
  1182. {
  1183. LOG.Write(eEvent.WARN_PM, Module, $"{Module} control pressure fail,due to turbo pump is not Open");
  1184. return false;
  1185. }
  1186. _controlPressureSetPoint = SC.GetValue<int>($"{Module}.ControlPressureSetPoint");
  1187. _controlFlowSetPoint = SC.GetValue<int>($"{Module}.ControlPressureN2FlowSetPoint");
  1188. _chamber.StartControlPressure(_controlPressureSetPoint, _controlFlowSetPoint);
  1189. }
  1190. }
  1191. else
  1192. {
  1193. if (startControlPressureFlag == false)
  1194. {
  1195. _chamber.AbortControlPressure();
  1196. startControlPressureFlag = true;
  1197. }
  1198. }
  1199. return true;
  1200. }
  1201. #region Exchange wafer with TM
  1202. private bool FnStartPreparePick(object[] param)
  1203. {
  1204. if (!_chamber.PreparePick())
  1205. {
  1206. LOG.Write(eEvent.ERR_PM, Module, $"Prepare Pick failed");
  1207. return false;
  1208. }
  1209. return true;
  1210. }
  1211. private bool FnPreparePickTimeout(object[] param)
  1212. {
  1213. // return _chamber.WaferIsDown && IsSlitDoorOpen;
  1214. return _chamber.PreparePickIsOK();
  1215. }
  1216. private bool FnAbortPreparePick(object[] param)
  1217. {
  1218. return true;
  1219. }
  1220. private bool FnStartFinishPick(object[] param)
  1221. {
  1222. //if (!_chamber.SetSlitDoor(false, out string reason))
  1223. //{
  1224. // LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  1225. // return false;
  1226. //}
  1227. //return true;
  1228. return _chamber.EndPick();
  1229. }
  1230. private bool FnAbortPick(object[] param)
  1231. {
  1232. return true;
  1233. }
  1234. private bool FnFinishPickTimeout(object[] param)
  1235. {
  1236. //return IsSlitDoorClose;
  1237. return _chamber.EndPickIsOK();
  1238. }
  1239. private bool FnStartDropDownWafer(object[] param)
  1240. {
  1241. if (!_chamber.SetLiftPin(MovementPosition.Down, out string reason))
  1242. {
  1243. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Down failed:{reason}");
  1244. return false;
  1245. }
  1246. return _chamber.SetLiftPin(MovementPosition.Down, out string _);
  1247. }
  1248. private bool FnDropDownTimeout(object[] param)
  1249. {
  1250. return _chamber.LiftPinIsDown;
  1251. }
  1252. private bool FnStartPreparePlace(object[] param)
  1253. {
  1254. //if (_chamber.ChamberType == JetChamber.Venus || _chamber.ChamberType == JetChamber.Kepler2300)
  1255. //{
  1256. // if (!_chamber.SetLiftPin(MovementPosition.Down, out string reason))
  1257. // {
  1258. // LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  1259. // return false;
  1260. // }
  1261. //}
  1262. if (!_chamber.PreparePlace())
  1263. {
  1264. LOG.Write(eEvent.ERR_PM, Module, $"Set Wafer Down failed");
  1265. return false;
  1266. }
  1267. //string reason = "";
  1268. //if (!_chamber.SetLiftPin(MovementPosition.Down, out string reason))
  1269. //{
  1270. // LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  1271. // return false;
  1272. //}
  1273. return true;
  1274. }
  1275. private bool FnPreparePlaceTimeout(object[] param)
  1276. {
  1277. return _chamber.PreparePlaceIsOK();
  1278. }
  1279. private bool FnAbortPreparePlace(object[] param)
  1280. {
  1281. return true;
  1282. }
  1283. private bool FnStartLiftUpWafer(object[] param)
  1284. {
  1285. if (!_chamber.SetLiftPin(MovementPosition.Up, out string reason))
  1286. {
  1287. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Up failed:{reason}");
  1288. return false;
  1289. }
  1290. return true;
  1291. }
  1292. private bool FnLiftUpTimeout(object[] param)
  1293. {
  1294. return _chamber.LiftPinIsUp;
  1295. }
  1296. private bool FnStartFinishPlace(object[] param)
  1297. {
  1298. return _chamber.EndPlace();
  1299. }
  1300. private bool FnAortPlace(object[] param)
  1301. {
  1302. return true;
  1303. }
  1304. private bool FnFinishPlaceTimeout(object[] param)
  1305. {
  1306. //return _chamber.LiftPinIsDown && IsSlitDoorClose;
  1307. return _chamber.EndPlaceIsOK();
  1308. }
  1309. private bool FnStartSwapPlace(object[] param)
  1310. {
  1311. return true;
  1312. }
  1313. private bool FnStartPartialPressure(object[] param)
  1314. {
  1315. return _pmPartialPressureRoutine.Start(param) == RState.Running;
  1316. }
  1317. private bool FnPartialPressureTimeout(object[] param)
  1318. {
  1319. RState ret = _pmPartialPressureRoutine.Monitor();
  1320. if (ret == RState.Failed || ret == RState.Timeout)
  1321. {
  1322. PostMsg(MSG.Error);
  1323. return false;
  1324. }
  1325. return ret == RState.End;
  1326. }
  1327. private bool FnAbortPartialPressure(object[] param)
  1328. {
  1329. _pmPartialPressureRoutine.Abort();
  1330. return true;
  1331. }
  1332. private bool FnStartVATPerformance(object[] param)
  1333. {
  1334. return _pmVATPerformanceRoutine.Start(param) == RState.Running;
  1335. }
  1336. private bool FnVATPerformanceTimeout(object[] param)
  1337. {
  1338. RState ret = _pmVATPerformanceRoutine.Monitor();
  1339. if (ret == RState.Failed || ret == RState.Timeout)
  1340. {
  1341. PostMsg(MSG.Error);
  1342. return false;
  1343. }
  1344. return ret == RState.End;
  1345. }
  1346. private bool FnAbortVATPerformance(object[] param)
  1347. {
  1348. _pmVATPerformanceRoutine.Abort();
  1349. return true;
  1350. }
  1351. //private bool FnStartHeat(object[] param)
  1352. //{
  1353. // if (ChamberType == JetChamber.Kepler2200A || ChamberType == JetChamber.Kepler2200B)
  1354. // {
  1355. // _pmHeatRoutine.Start();
  1356. // }
  1357. // return true;
  1358. //}
  1359. #endregion
  1360. private void _debugRoutine()
  1361. {
  1362. int flag = 0;
  1363. // Test Home routine
  1364. if (flag == 1)
  1365. {
  1366. PostMsg(MSG.Home);
  1367. }
  1368. else if (flag == 2)
  1369. {
  1370. PostMsg(MSG.Vent);
  1371. }
  1372. else if (flag == 3)
  1373. {
  1374. PostMsg(MSG.Pump);
  1375. }
  1376. else if (flag == 4)
  1377. {
  1378. PostMsg(MSG.PumpLoadLock);
  1379. }
  1380. else if (flag == 5)
  1381. {
  1382. PostMsg(MSG.VentLoadLock);
  1383. }
  1384. else if (flag == 6)
  1385. {
  1386. PostMsg(MSG.PurgeLoadLock);
  1387. }
  1388. else if (flag == 7)
  1389. {
  1390. PostMsg(MSG.LaunchPump);
  1391. }
  1392. else if (flag == 8)
  1393. {
  1394. PostMsg(MSG.LaunchTurboPump);
  1395. }
  1396. else if (flag == 9)
  1397. {
  1398. PostMsg(MSG.LoadLockLeakCheck);
  1399. }
  1400. else if (flag == 10)
  1401. {
  1402. PostMsg(MSG.CyclePurge);
  1403. }
  1404. else if (flag == 11)
  1405. {
  1406. PostMsg(MSG.GasLinePurge);
  1407. }
  1408. else if (flag == 12)
  1409. {
  1410. PostMsg(MSG.LeakCheck);
  1411. }
  1412. else if (flag == 13)
  1413. {
  1414. PostMsg(MSG.GasLeakCheck);
  1415. }
  1416. else if (flag == 14)
  1417. {
  1418. PostMsg(MSG.LLPlace);
  1419. }
  1420. else if (flag == 15)
  1421. {
  1422. PostMsg(MSG.LLPick);
  1423. }
  1424. else if (flag == 16)
  1425. {
  1426. PostMsg(MSG.RunRecipe, "7777");
  1427. }
  1428. else if (flag == 17)
  1429. {
  1430. PostMsg(MSG.MFCVerification, "MFC2", (double)50, 10);
  1431. }
  1432. }
  1433. }
  1434. }