PMEntity.cs 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688
  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 / 2;
  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.HomeIsOK(out string reason))
  359. {
  360. LOG.Write(eEvent.WARN_PM, Module, $"{Module} {reason},can not be put online");
  361. return false;
  362. }
  363. if (!_chamber.CheckSlitDoorClose())
  364. {
  365. EV.PostWarningLog(Module.ToString(), $"{Module} slit door is open,can not set online.");
  366. return false;
  367. }
  368. this._isOnline = true;
  369. return true;
  370. }
  371. private bool FnSetOffline(object[] param)
  372. {
  373. this._isOnline = false;
  374. return true;
  375. }
  376. public PMEntity(ModuleName module)
  377. {
  378. Module = module;
  379. _chamber = DEVICE.GetDevice<JetPMBase>(Module.ToString());
  380. _home = new PMHomeRoutine(_chamber);
  381. _startDryPumpRoutine = new StartDryPumpRoutine(_chamber);
  382. _startTurboPumpRoutine = new StartTurboPumpRoutine(_chamber);
  383. _ventRoutine = new VentRoutine(_chamber);
  384. _venusVentRoutine = new VenusVentRoutine(_chamber);
  385. _pumpRoutine = new PumpDownRoutine(_chamber);
  386. //_ventLoadLockRoutine = new LoadLockVentRoutine(_chamber);
  387. //_pumpLoadLockRoutine = new LoadLockPumpRoutine(_chamber);
  388. //_purgeLoadLockRoutine = new LoadLockPurgeRoutine(_chamber);
  389. //_loadLockLeakCheckRoutine = new LoadLockLeakCheckRoutine(_chamber);
  390. _purgeRoutine = new PMPurgeRoutine(_chamber);
  391. _gaslinePurgeRoutine = new PMGaslinePurgeRoutine(_chamber);
  392. _leakCheckRoutine = new PMLeakCheckRoutine(_chamber);
  393. _gasBoxLeakCheckRoutine = new GasBoxLeakCheckRoutine(_chamber);
  394. //_llPlaceRoutine = new LLPlaceRoutine(_chamber);
  395. //_llPickRoutine = new LLPickRoutine(_chamber, _ventLoadLockRoutine);
  396. _processRoutine = new PMProcessRoutine(_chamber, _pumpRoutine);
  397. _gasFlowRoutine = new GasFlowRoutine(_chamber);
  398. _rfPowerRoutine = new RFPowerSwitchRoutine(_chamber, true);
  399. _gasVerificationRoutine = new PMGasVerificationRoutine(_chamber, _pumpRoutine);
  400. _pmPartialPressureRoutine = new PMPartialPressureRoutine(_chamber);
  401. _pmVATPerformanceRoutine = new PMVATPerformanceRoutine(_chamber);
  402. //_pmControlPressureRoutine = new PMControlPressureRoutine(_chamber);
  403. //_pmHeatRoutine = new PMHeatRoutine(_chamber);
  404. fsm = new StateMachine<PMEntity>(Module.ToString(), (int)PMState.Init, 50);
  405. //Idle
  406. EnterExitTransition((int)PMState.Idle, FnIdle, (int)FSM_MSG.NONE, null);
  407. EnterExitTransition<PMState, FSM_MSG>(PMState.Error, fEnterError, FSM_MSG.NONE, null);
  408. EnterExitTransition<PMState, FSM_MSG>(PMState.ReadyForPick, fnEnterPickReady, FSM_MSG.NONE, fnExitPickReady);
  409. EnterExitTransition<PMState, FSM_MSG>(PMState.ReadyForPlace, fnEnterPlaceReady, FSM_MSG.NONE, fnExitPlaceReady);
  410. EnterExitTransition<PMState, FSM_MSG>(PMState.DropDownReady, fnEnterDropDownReady, FSM_MSG.NONE, fnExitDropDownReady);
  411. EnterExitTransition<PMState, FSM_MSG>(PMState.LiftUpReady, fnEnterLiftUpReady, FSM_MSG.NONE, fnExitLiftUpReady);
  412. //Home
  413. //EnterExitTransition((int)PMState.Homing, FnEnterHome, (int)FSM_MSG.NONE, FnExitHome);
  414. AnyStateTransition(MSG.Error, FnError, PMState.Error);
  415. AnyStateTransition(MSG.Online, FnSetOnline, FSM_STATE.SAME);
  416. AnyStateTransition(MSG.Offline, FnSetOffline, FSM_STATE.SAME);
  417. AnyStateTransition(FSM_MSG.ALARM, FnAlarm, PMState.Error);
  418. Transition(PMState.Init, FSM_MSG.TIMER, FnTimeout, PMState.Init);
  419. Transition(PMState.Init, MSG.Home, FnStartHome, PMState.Homing);
  420. Transition(PMState.Error, MSG.Home, FnStartHome, PMState.Homing);
  421. Transition(PMState.Idle, MSG.Home, FnStartHome, PMState.Homing);
  422. Transition(PMState.Homing, MSG.Home, FnStartHome, PMState.Homing);
  423. Transition(PMState.Homing, FSM_MSG.TIMER, FnMonitorHome, PMState.Idle);
  424. Transition(PMState.Homing, MSG.Abort, FnAbortHome, PMState.Idle);
  425. Transition(PMState.Idle, FSM_MSG.TIMER, FnIdleTimeout, PMState.Idle);
  426. Transition(PMState.Error, FSM_MSG.TIMER, FnErrorTimeout, PMState.Error);
  427. //Launch DryPump sequence
  428. Transition(PMState.Idle, MSG.LaunchPump, FnLaunchPump, PMState.LaunchingPump);
  429. Transition(PMState.LaunchingPump, FSM_MSG.TIMER, FnLaunchPumpTimeout, PMState.Idle);
  430. Transition(PMState.LaunchingPump, MSG.Abort, FnAbortStartPumping, PMState.Idle);
  431. //Launch TurboPump sequence
  432. Transition(PMState.Idle, MSG.LaunchTurboPump, FnLaunchTurboPump, PMState.LaunchingTurboPump);
  433. Transition(PMState.LaunchingTurboPump, FSM_MSG.TIMER, FnLaunchTurboPumpTimeout, PMState.Idle);
  434. Transition(PMState.LaunchingTurboPump, MSG.Abort, FnAbortStartTurboPumping, PMState.Idle);
  435. //vent sequence
  436. Transition(PMState.Idle, MSG.Vent, FnStartVent, PMState.Venting);
  437. Transition(PMState.Pumping, MSG.Vent, FnVentToPumping, PMState.Venting);
  438. Transition(PMState.Venting, FSM_MSG.TIMER, FnVentTimeout, PMState.Idle);
  439. Transition(PMState.Venting, MSG.Abort, FnAbortVent, PMState.Idle);
  440. //Pump sequence
  441. Transition(PMState.Idle, MSG.Pump, FnStartPumpDown, PMState.Pumping);
  442. Transition(PMState.Venting, MSG.Pump, FnVentToPumping, PMState.Pumping);
  443. Transition(PMState.Pumping, FSM_MSG.TIMER, FnPumpDownTimeout, PMState.Idle);
  444. Transition(PMState.Pumping, MSG.Abort, FnAbortPumping, PMState.Idle);
  445. //Pump Loadlock sequence
  446. //Transition(PMState.Idle, MSG.PumpLoadLock, FnStartPumpDownLoadLock, PMState.PumpingLoadLock);
  447. //Transition(PMState.VentingLoadLock, MSG.PumpLoadLock, FnVentLoadLockToPumpingLoadLock, PMState.PumpingLoadLock);
  448. //Transition(PMState.PumpingLoadLock, FSM_MSG.TIMER, FnPumpDownLoadLockTimeout, PMState.Idle);
  449. //Transition(PMState.PumpingLoadLock, MSG.Abort, FnAbortPumpingLoadLock, PMState.Idle);
  450. //Vent Loadlock sequence
  451. //Transition(PMState.Idle, MSG.VentLoadLock, FnStartVentLoadlock, PMState.VentingLoadLock);
  452. //Transition(PMState.PumpingLoadLock, MSG.VentLoadLock, FnPumpingLoadLockToVentLoadLock, PMState.VentingLoadLock);
  453. //Transition(PMState.VentingLoadLock, FSM_MSG.TIMER, FnVentLoadLockTimeout, PMState.Idle);
  454. //Transition(PMState.VentingLoadLock, MSG.Abort, FnAbortVentLoadLock, PMState.Idle);
  455. // Purge LoadLock sequence
  456. //Transition(PMState.Idle, MSG.PurgeLoadLock, FnStartPurgeLoadlock, PMState.PurgingLoadLock);
  457. //Transition(PMState.PurgingLoadLock, FSM_MSG.TIMER, FnPurgeLoadLockTimeout, PMState.Idle);
  458. //Transition(PMState.PurgingLoadLock, MSG.Abort, FnAbortPurgeLoadLock, PMState.Idle);
  459. //LoadLock Leak check sequence
  460. //Transition(PMState.Idle, MSG.LoadLockLeakCheck, FnStartLoadLockLeakCheck, PMState.LoadLockLeakCheck);
  461. //Transition(PMState.LoadLockLeakCheck, FSM_MSG.TIMER, FnLoadLockLeakCheckTimeout, PMState.Idle);
  462. //Transition(PMState.LoadLockLeakCheck, MSG.Abort, FnAbortLoadLockLeakCheck, PMState.Idle);
  463. // PM Purge sequence
  464. Transition(PMState.Idle, MSG.CyclePurge, FnStartPurge, PMState.Purging);
  465. Transition(PMState.Purging, FSM_MSG.TIMER, FnPurgeTimeout, PMState.Idle);
  466. Transition(PMState.Purging, MSG.Abort, FnAbortPurge, PMState.Idle);
  467. // PM GasLine Purge sequence
  468. Transition(PMState.Idle, MSG.GasLinePurge, FnStartGasLinePurge, PMState.GasLinePurge);
  469. Transition(PMState.GasLinePurge, FSM_MSG.TIMER, FnGasLinePurgeTimeout, PMState.Idle);
  470. Transition(PMState.GasLinePurge, MSG.Abort, FnAbortGasLinePurge, PMState.Idle);
  471. //PM Leak check sequence
  472. Transition(PMState.Idle, MSG.LeakCheck, FnStartPMLeakCheck, PMState.LeakCheck);
  473. Transition(PMState.LeakCheck, FSM_MSG.TIMER, FnPMLeakCheckTimeout, PMState.Idle);
  474. Transition(PMState.LeakCheck, MSG.Abort, FnAbortPMLeakCheck, PMState.Idle);
  475. //PM GasBox Leak check sequence
  476. Transition(PMState.Idle, MSG.GasLeakCheck, FnStartGasBoxLeakCheck, PMState.GasBoxLeakCheck);
  477. Transition(PMState.GasBoxLeakCheck, FSM_MSG.TIMER, FnGasBoxLeakCheckTimeout, PMState.Idle);
  478. Transition(PMState.GasBoxLeakCheck, MSG.Abort, FnAbortGasBoxLeakCheck, PMState.Idle);
  479. // PlaceWafer from LoadLock Arm sequence
  480. //Transition(PMState.Idle, MSG.LLPlace, FnStartLLPlace, PMState.LLPlacing);
  481. //Transition(PMState.LLPlacing, FSM_MSG.TIMER, FnLLPlaceTimeout, PMState.Idle);
  482. //Transition(PMState.LLPlacing, MSG.Abort, FnAbortLLPlace, PMState.Idle);
  483. // PickWafer to LoadLock Arm sequence
  484. //Transition(PMState.Idle, MSG.LLPick, FnStartLLPick, PMState.LLPicking);
  485. //Transition(PMState.LLPicking, FSM_MSG.TIMER, FnLLPickTimeout, PMState.Idle);
  486. //Transition(PMState.LLPicking, MSG.Abort, FnAbortLLPick, PMState.Idle);
  487. // Process
  488. Transition(PMState.Idle, MSG.RunRecipe, FnRunRecipe, PMState.Processing);
  489. Transition(PMState.Processing, FSM_MSG.TIMER, FnProcessTimeout, PMState.Idle);
  490. Transition(PMState.Processing, MSG.Abort, FnAbortProcess, PMState.Idle);
  491. // Clean
  492. Transition(PMState.Idle, MSG.Clean, FnRunRecipe, PMState.Clean);
  493. Transition(PMState.Clean, FSM_MSG.TIMER, FnProcessTimeout, PMState.Idle);
  494. Transition(PMState.Clean, MSG.Abort, FnAbortProcess, PMState.Idle);
  495. // Gas Flow sequence
  496. Transition(PMState.Idle, MSG.GasFlow, FnStartGasFlow, PMState.GasFlowing);
  497. Transition(PMState.GasFlowing, MSG.GasFlow, FnAbortGasFlow, PMState.Idle);
  498. Transition(PMState.GasFlowing, FSM_MSG.TIMER, FnGasFlowTimeout, PMState.Idle);
  499. Transition(PMState.GasFlowing, MSG.StopGasFlow, FnStopGasFlow, PMState.Idle);
  500. Transition(PMState.GasFlowing, MSG.Abort, FnAbortGasFlow, PMState.Idle);
  501. //RF Power sequence
  502. Transition(PMState.Idle, MSG.RfPower, FnStartRfPower, PMState.RfPowering);
  503. Transition(PMState.GasFlowing, MSG.RfPower, FnStartRfPower, PMState.RfPowering);
  504. Transition(PMState.RfPowering, FSM_MSG.TIMER, FnRfPowerTimeout, PMState.Idle);
  505. Transition(PMState.RfPowering, MSG.Abort, FnAbortRfPower, PMState.Idle);
  506. //MFC verification
  507. Transition(PMState.Idle, MSG.MFCVerification, FnStartMFCVerification, PMState.MFCVerification);
  508. Transition(PMState.MFCVerification, FSM_MSG.TIMER, FnMFCVerificationTimeout, PMState.Idle);
  509. Transition(PMState.MFCVerification, MSG.Abort, FnAbortMFCVerification, PMState.Idle);
  510. //////////////////////// Exchange Wafer with TM ///////////////////////////////////////////////////////
  511. // Pick Wafer from PM
  512. Transition(PMState.Idle, MSG.PreparePick, FnStartPreparePick, PMState.PreparePick);
  513. Transition(PMState.PreparePick, MSG.Abort, FnAbortPreparePick, PMState.Idle);
  514. Transition(PMState.PreparePick, FSM_MSG.TIMER, FnPreparePickTimeout, PMState.ReadyForPick);
  515. Transition(PMState.PreparePick, MSG.PreparePick, null, PMState.PreparePick);
  516. Transition(PMState.ReadyForPick, MSG.Abort, FnAbortPick, PMState.Idle);
  517. Transition(PMState.ReadyForPick, MSG.DropDownWafer, FnStartDropDownWafer, PMState.DropDownWafer);
  518. Transition(PMState.ReadyForPick, MSG.PreparePick, null, PMState.ReadyForPick);
  519. Transition(PMState.DropDownWafer, FSM_MSG.TIMER, FnDropDownTimeout, PMState.DropDownReady);
  520. Transition(PMState.DropDownReady, MSG.PickReady, FnStartFinishPick, PMState.FinishPick);
  521. Transition(PMState.ReadyForPick, MSG.PickReady, FnStartFinishPick, PMState.FinishPick);
  522. Transition(PMState.FinishPick, FSM_MSG.TIMER, FnFinishPickTimeout, PMState.Idle);
  523. // Place Wafer to PM
  524. Transition(PMState.Idle, MSG.PreparePlace, FnStartPreparePlace, PMState.PreparePlace);
  525. //Transition(PMState.Heating, MSG.PreparePlace, FnStartPreparePlace, PMState.PreparePlace);
  526. Transition(PMState.PreparePlace, MSG.Abort, FnAbortPreparePlace, PMState.Idle);
  527. Transition(PMState.PreparePlace, FSM_MSG.TIMER, FnPreparePlaceTimeout, PMState.ReadyForPlace);
  528. Transition(PMState.PreparePlace, MSG.PreparePlace, null, PMState.PreparePlace);
  529. Transition(PMState.ReadyForPlace, MSG.LiftUpWafer, FnStartLiftUpWafer, PMState.LiftUpWafer);
  530. Transition(PMState.LiftUpWafer, FSM_MSG.TIMER, FnLiftUpTimeout, PMState.LiftUpReady);
  531. Transition(PMState.LiftUpReady, MSG.PlaceReady, FnStartFinishPlace, PMState.FinishPlace);
  532. Transition(PMState.ReadyForPlace, MSG.PlaceReady, FnStartFinishPlace, PMState.FinishPlace);
  533. Transition(PMState.PreparePlace, MSG.Abort, FnAortPlace, PMState.Idle);
  534. Transition(PMState.ReadyForPlace, MSG.Abort, FnAortPlace, PMState.Idle);
  535. Transition(PMState.ReadyForPlace, MSG.PreparePlace, null, PMState.ReadyForPlace);
  536. Transition(PMState.LiftUpReady, MSG.Abort, FnAortPlace, PMState.Idle);
  537. Transition(PMState.FinishPlace, FSM_MSG.TIMER, FnFinishPlaceTimeout, PMState.Idle);
  538. // Swap Wafer With PM
  539. Transition(PMState.DropDownReady, MSG.PreparePlace, FnStartSwapPlace, PMState.PreparePlace);
  540. Transition(PMState.ReadyForPick, MSG.PreparePlace, FnStartPreparePlace, PMState.PreparePlace);
  541. Transition(PMState.Idle, MSG.PartialPressure, FnStartPartialPressure, PMState.PartialPressureTesting);
  542. Transition(PMState.PartialPressureTesting, FSM_MSG.TIMER, FnPartialPressureTimeout, PMState.Idle);
  543. Transition(PMState.PartialPressureTesting, MSG.Abort, FnAbortPartialPressure, PMState.Idle);
  544. Transition(PMState.Idle, MSG.VATPerformance, FnStartVATPerformance, PMState.VATPerformanceTesting);
  545. Transition(PMState.VATPerformanceTesting, FSM_MSG.TIMER, FnVATPerformanceTimeout, PMState.Idle);
  546. Transition(PMState.VATPerformanceTesting, MSG.Abort, FnAbortVATPerformance, PMState.Idle);
  547. //Transition(PMState.Idle, MSG.Heat, FnStartHeat, PMState.Heating);
  548. AnyStateTransition(FSM_MSG.TIMER, FnControlPressure, FSM_STATE.SAME);
  549. Running = true;
  550. WaferManager.Instance.SubscribeLocation(Module, 1);
  551. }
  552. protected override bool Init()
  553. {
  554. DATA.Subscribe($"{Module}.FsmState", () => (((PMState)fsm.State)), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  555. DATA.Subscribe($"{Module}.FsmPrevState", () => (((PMState)fsm.PrevState).ToString()), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  556. DATA.Subscribe($"{Module}.FsmLastMessage", () => (((MSG)fsm.LastMsg).ToString()), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  557. //DATA.Subscribe($"{Module}.LoadLockPurge.PurgeCounter", () => _purgeLoadLockRoutine.PurgeCounter, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  558. DATA.Subscribe($"{Module}.PartialPressureCounter", () => _pmPartialPressureRoutine.counter, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  559. DATA.Subscribe($"{Module}.VATPerformanceCounter", () => _pmVATPerformanceRoutine.counter, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  560. DATA.Subscribe($"{Module}.VATPerformanceResult", () => _pmVATPerformanceRoutine?.m_sb.ToString(), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  561. DATA.Subscribe($"{Module}.PartialPressureResult", () => _pmPartialPressureRoutine?.m_sb.ToString(), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  562. DATA.Subscribe($"{Module}.MFCCalibrationDatas", () => _gasVerificationRoutine?._MFCCalibrationDatas, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  563. DATA.Subscribe($"{Module}.IsIdle", () => IsIdle, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  564. DATA.Subscribe($"{Module}.IsAlarm", () => IsError, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  565. DATA.Subscribe($"{Module}.IsBusy", () => IsBusy, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  566. DATA.Subscribe($"{Module}.IsInit", () => IsInit, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  567. DATA.Subscribe($"{Module}.IsOnline", () => _isOnline, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  568. DATA.Subscribe($"{Module}.VentingFlag", () => ChamberType == JetChamber.VenusSE || ChamberType == JetChamber.VenusDE ? _venusVentRoutine.VentingFlag: _ventRoutine.VentingFlag, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  569. //DATA.Subscribe($"{Module}.GetLeakCheckDatas", () => LeakCheckDataRecorder.GetAllLeakCheckData(Module.ToString()));
  570. DATA.Subscribe($"{Module}.CurrentRecipeResult", () => _processRoutine.currentRecipeResult, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  571. DATA.Subscribe($"{Module}.LeakCheck.Step", () => _leakCheckRoutine.CurrentStep, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  572. DATA.Subscribe($"{Module}.GasLeakCheck.Step", () => _gasBoxLeakCheckRoutine.CurrentStep, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  573. DATA.Subscribe($"{Module}.IsInclude", () => IsInclude, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  574. OP.Subscribe($"{Module}.{RtOperation.GasFlow}", (cmd, args) => CheckToPostMessage((int)MSG.GasFlow, args));
  575. OP.Subscribe($"{Module}.{RtOperation.LeakCheck}", (cmd, args) => CheckToPostMessage((int)MSG.LeakCheck, args));
  576. OP.Subscribe($"{Module}.{RtOperation.GasLeakCheck}", (cmd, args) => CheckToPostMessage((int)MSG.GasLeakCheck, args));
  577. OP.Subscribe($"{Module}.Home", (cmd, args) => CheckToPostMessage((int)MSG.Home));
  578. OP.Subscribe($"{Module}.{RtOperation.StartPump}", (cmd, args) => CheckToPostMessage((int)MSG.LaunchPump));
  579. OP.Subscribe($"{Module}.{RtOperation.StartTurboPump}", (cmd, args) => CheckToPostMessage((int)MSG.LaunchTurboPump));
  580. OP.Subscribe($"{Module}.{RtOperation.Pump}", (cmd, args) => CheckToPostMessage((int)MSG.Pump));
  581. OP.Subscribe($"{Module}.{RtOperation.Purge}", (cmd, args) => CheckToPostMessage((int)MSG.CyclePurge));
  582. OP.Subscribe($"{Module}.{RtOperation.RfPower}", (cmd, args) => CheckToPostMessage((int)MSG.RfPower));
  583. OP.Subscribe($"{Module}.{RtOperation.Vent}", (cmd, args) => CheckToPostMessage((int)MSG.Vent));
  584. OP.Subscribe($"{Module}.{RtOperation.VentLoadLock}", (cmd, args) => CheckToPostMessage((int)MSG.VentLoadLock));
  585. OP.Subscribe($"{Module}.{RtOperation.PurgeLoadLock}", (cmd, args) => CheckToPostMessage((int)MSG.PurgeLoadLock));
  586. OP.Subscribe($"{Module}.{RtOperation.PumpLoadLock}", (cmd, args) => CheckToPostMessage((int)MSG.PumpLoadLock));
  587. OP.Subscribe($"{Module}.{RtOperation.Reset}", (cmd, args) => CheckToPostMessage((int)MSG.Reset));
  588. OP.Subscribe($"{Module}.{RtOperation.Abort}", (cmd, args) => CheckToPostMessage((int)MSG.Abort));
  589. OP.Subscribe($"{Module}.{RtOperation.LLPick}", (cmd, args) => CheckToPostMessage((int)MSG.LLPick));
  590. OP.Subscribe($"{Module}.{RtOperation.LLPlace}", (cmd, args) => CheckToPostMessage((int)MSG.LLPlace));
  591. OP.Subscribe($"{Module}.{RtOperation.MFCVerification}", (cmd, args) => CheckToPostMessage((int)MSG.MFCVerification, args));
  592. OP.Subscribe($"{Module}.{RtOperation.RunRecipe}", (cmd, args) => CheckToPostMessage((int)MSG.RunRecipe, args));
  593. OP.Subscribe($"{Module}.{RtOperation.RunCleanRecipe}", (cmd, args) => CheckToPostMessage((int)MSG.Clean, args));
  594. OP.Subscribe($"{Module}.PartialPressureTest", (cmd, args) => CheckToPostMessage((int)MSG.PartialPressure, args[0], args[1]));
  595. OP.Subscribe($"{Module}.VATPerformanceTest", (cmd, args) => CheckToPostMessage((int)MSG.VATPerformance, args[0], args[1], args[2]));
  596. OP.Subscribe($"{Module}.GasLinePurge", (cmd, args) => CheckToPostMessage((int)MSG.GasLinePurge, args[0]));
  597. OP.Subscribe($"{Module}.ManualEndStep", (cmd, args) => ManualEndStep());
  598. OP.Subscribe($"{Module}.{RtOperation.Online}", (cmd, args) => CheckToPostMessage((int)MSG.Online));
  599. OP.Subscribe($"{Module}.{RtOperation.Offline}", (cmd, args) => CheckToPostMessage((int)MSG.Offline));
  600. OP.Subscribe($"{Module}.{RtOperation.PmError}", (cmd, args) => CheckToPostMessage((int)MSG.Error));
  601. OP.Subscribe($"{Module}.{RtOperation.Include}", (cmd, args) => FnSetInclude());
  602. OP.Subscribe($"{Module}.{RtOperation.Exclude}", (cmd, args) => FnSetExclude());
  603. StatsDataManager.Instance.Subscribe($"{Module}.ProcessedWaferCount", "Processed Wafer Count", 0);
  604. if (_chamber.IsRFAble())
  605. StatsDataManager.Instance.Subscribe($"{Module}.RfOnTime", "Rf On Time");
  606. if (_chamber.IsBiasRFAble())
  607. StatsDataManager.Instance.Subscribe($"{Module}.BiasRfOnTime", "Bias Rf On Time");
  608. //StatsDataManager.Instance.Subscribe($"{Module}.PumpOnTime", "Pump On Time");
  609. _statProcessedWafer = StatsDataManager.Instance.GetItem($"{Module}.ProcessedWaferCount");
  610. _statRfOnTime = StatsDataManager.Instance.GetItemRFAndPump($"{Module}.RfOnTime");
  611. if (_chamber.IsBiasRFAble())
  612. _statBiasRfOnTime = StatsDataManager.Instance.GetItemRFAndPump($"{Module}.BiasRfOnTime");
  613. //_statPumpOnTime = StatsDataManager.Instance.GetItemRFAndPump($"{Module}.PumpOnTime");
  614. DATA.Subscribe($"{Module}.ProcessedWaferCount", () => _statProcessedWafer.Value, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  615. if (_chamber.IsRFAble())
  616. DATA.Subscribe($"{Module}.RfOnTime", () => _statRfOnTime.fromLastPM);
  617. if (_chamber.IsBiasRFAble())
  618. DATA.Subscribe($"{Module}.BiasRfOnTime", () => _statBiasRfOnTime.fromLastPM);
  619. //DATA.Subscribe($"{Module}.PumpOnTime", () => _statPumpOnTime.fromLastPM);
  620. if (ChamberType == JetChamber.Kepler2200A && ChamberType == JetChamber.Kepler2200B)
  621. {
  622. LOG.PMErrorInterrupt += (pmname) => PMErrorInterrupt(pmname);
  623. }
  624. return true;
  625. }
  626. private void PMErrorInterrupt(ModuleName pmname)
  627. {
  628. if (pmname == Module)
  629. {
  630. LOG.Write(eEvent.ERR_PM, Module, $"Device Error Happend! {Module} Crash!");
  631. CheckToPostMessage((int)MSG.Error);
  632. }
  633. }
  634. private bool ManualEndStep()
  635. {
  636. _processRoutine.isMaualEndStep = true;
  637. return true;
  638. }
  639. private bool FnIdle(object[] objs)
  640. {
  641. Running = false;
  642. return true;
  643. }
  644. private bool fEnterError(object[] objs)
  645. {
  646. return true;
  647. }
  648. private bool fnEnterPickReady(object[] objs)
  649. {
  650. Status = PMStatus.Ready_For_Pick;
  651. return true;
  652. }
  653. private bool fnExitPickReady(object[] objs)
  654. {
  655. Status = PMStatus.Not_Ready;
  656. return true;
  657. }
  658. private bool fnEnterPlaceReady(object[] objs)
  659. {
  660. Status = PMStatus.Ready_For_Place;
  661. return true;
  662. }
  663. private bool fnExitPlaceReady(object[] objs)
  664. {
  665. Status = PMStatus.Not_Ready;
  666. return true;
  667. }
  668. private bool fnEnterDropDownReady(object[] objs)
  669. {
  670. Status = PMStatus.Exchange_Ready;
  671. return true;
  672. }
  673. private bool fnExitDropDownReady(object[] objs)
  674. {
  675. Status = PMStatus.Not_Ready;
  676. return true;
  677. }
  678. private bool fnEnterLiftUpReady(object[] objs)
  679. {
  680. Status = PMStatus.Exchange_Ready;
  681. return true;
  682. }
  683. private bool fnExitLiftUpReady(object[] objs)
  684. {
  685. Status = PMStatus.Not_Ready;
  686. return true;
  687. }
  688. private bool FnAlarm(object[] objs)
  689. {
  690. if ((PMState)fsm.State == PMState.Processing)
  691. {
  692. }
  693. return true;
  694. }
  695. private bool FnError(object[] objs)
  696. {
  697. Running = false;
  698. _isOnline = false;
  699. //if (((PMState)fsm.State == PMState.Processing) || ((PMState)fsm.State == PMState.PreProcess)
  700. // || ((PMState)fsm.State == PMState.Homing) || ((PMState)fsm.State == PMState.LoadProcessRecipe))
  701. // return false;
  702. //_chamber.CloseValves();
  703. //_chamber.GeneratorPowerOn(false);
  704. //_chamber.GeneratorBiasPowerOn(false);
  705. //_chamber.OpenValve(ValveType.TurboPumpPumping, true);
  706. //_chamber.OpenValve(ValveType.TurboPumpPurge, true);
  707. //_chamber.OnOffSetESCHV(false);
  708. _chamber.PMInError();
  709. if (IsProcessing)
  710. {
  711. WaferManager.Instance.UpdateWaferProcessStatus(Module, 0, EnumWaferProcessStatus.Failed);
  712. }
  713. return true;
  714. }
  715. private bool FnTimeout(object[] objs)
  716. {
  717. _debugRoutine();
  718. return true;
  719. }
  720. private bool FnIdleTimeout(object[] objs)
  721. {
  722. _chamber.CheckIdleInterlock(0);
  723. //_debugRoutine();
  724. return true;
  725. }
  726. private bool FnErrorTimeout(object[] objs)
  727. {
  728. //_debugRoutine();
  729. return true;
  730. }
  731. private bool FnStartHome(object[] objs)
  732. {
  733. return _home.Start() == RState.Running;
  734. }
  735. private bool FnMonitorHome(object[] objs)
  736. {
  737. RState ret = _home.Monitor();
  738. if (ret == RState.Failed || ret == RState.Timeout)
  739. {
  740. PostMsg(MSG.Error);
  741. return false;
  742. }
  743. return ret == RState.End;
  744. }
  745. private bool FnAbortHome(object[] objs)
  746. {
  747. _home.Abort();
  748. return true;
  749. }
  750. private bool FnLaunchPump(object[] param)
  751. {
  752. return _startDryPumpRoutine.Start() == RState.Running;
  753. }
  754. private bool FnLaunchPumpTimeout(object[] param)
  755. {
  756. RState ret = _startDryPumpRoutine.Monitor();
  757. if (ret == RState.Failed || ret == RState.Timeout)
  758. {
  759. PostMsg(MSG.Error);
  760. return false;
  761. }
  762. return ret == RState.End;
  763. }
  764. private bool FnAbortStartPumping(object[] param)
  765. {
  766. _startDryPumpRoutine.Abort();
  767. return true;
  768. }
  769. private bool FnLaunchTurboPump(object[] param)
  770. {
  771. return _startTurboPumpRoutine.Start() == RState.Running;
  772. }
  773. private bool FnLaunchTurboPumpTimeout(object[] param)
  774. {
  775. RState ret = _startTurboPumpRoutine.Monitor();
  776. if (ret == RState.Failed || ret == RState.Timeout)
  777. {
  778. PostMsg(MSG.Error);
  779. return false;
  780. }
  781. return ret == RState.End;
  782. }
  783. private bool FnAbortStartTurboPumping(object[] param)
  784. {
  785. _startTurboPumpRoutine.Abort();
  786. return true;
  787. }
  788. private bool FnStartVent(object[] param)
  789. {
  790. switch (ChamberType)
  791. {
  792. case JetChamber.VenusSE:
  793. case JetChamber.VenusDE:
  794. return _venusVentRoutine.Start() == RState.Running;
  795. default:
  796. return _ventRoutine.Start() == RState.Running;
  797. }
  798. }
  799. private bool FnVentTimeout(object[] param)
  800. {
  801. RState ret;
  802. switch (ChamberType)
  803. {
  804. case JetChamber.VenusSE:
  805. case JetChamber.VenusDE:
  806. ret = _venusVentRoutine.Monitor();
  807. break;
  808. default:
  809. ret = _ventRoutine.Monitor();
  810. break;
  811. }
  812. if (ret == RState.Failed || ret == RState.Timeout)
  813. {
  814. PostMsg(MSG.Error);
  815. return false;
  816. }
  817. return ret == RState.End;
  818. }
  819. private bool FnVentToPumping(object[] param)
  820. {
  821. switch (ChamberType)
  822. {
  823. case JetChamber.VenusSE:
  824. case JetChamber.VenusDE:
  825. _venusVentRoutine.Abort();
  826. break;
  827. default:
  828. _ventRoutine.Abort();
  829. break;
  830. }
  831. return true; // FnStartPumpDown(param);
  832. }
  833. private bool FnAbortVent(object[] param)
  834. {
  835. switch (ChamberType)
  836. {
  837. case JetChamber.VenusSE:
  838. case JetChamber.VenusDE:
  839. _venusVentRoutine.Abort();
  840. break;
  841. default:
  842. _ventRoutine.Abort();
  843. break;
  844. }
  845. return true;
  846. }
  847. private bool FnStartPumpDown(object[] param)
  848. {
  849. return _pumpRoutine.Start() == RState.Running;
  850. }
  851. private bool FnPumpDownTimeout(object[] param)
  852. {
  853. RState ret = _pumpRoutine.Monitor();
  854. if (ret == RState.Failed || ret == RState.Timeout)
  855. {
  856. PostMsg(MSG.Error);
  857. return false;
  858. }
  859. return ret == RState.End;
  860. }
  861. private bool FnAbortPumping(object[] param)
  862. {
  863. _pumpRoutine.Abort();
  864. return true;
  865. }
  866. //private bool FnStartVentLoadlock(object[] param)
  867. //{
  868. // return _ventLoadLockRoutine.Start() == RState.Running;
  869. //}
  870. //private bool FnVentLoadLockTimeout(object[] param)
  871. //{
  872. // RState ret = _ventLoadLockRoutine.Monitor();
  873. // if (ret == RState.Failed || ret == RState.Timeout)
  874. // {
  875. // PostMsg(MSG.Error);
  876. // return false;
  877. // }
  878. // return ret == RState.End;
  879. //}
  880. //private bool FnVentLoadLockToPumpingLoadLock(object[] param)
  881. //{
  882. // _ventLoadLockRoutine.Abort();
  883. // return FnStartPumpDownLoadLock(param);
  884. //}
  885. //private bool FnAbortVentLoadLock(object[] param)
  886. //{
  887. // _ventLoadLockRoutine.Abort();
  888. // return true;
  889. //}
  890. //private bool FnStartPumpDownLoadLock(object[] param)
  891. //{
  892. // return _pumpLoadLockRoutine.Start() == RState.Running;
  893. //}
  894. //private bool FnPumpDownLoadLockTimeout(object[] param)
  895. //{
  896. // RState ret = _pumpLoadLockRoutine.Monitor();
  897. // if (ret == RState.Failed || ret == RState.Timeout)
  898. // {
  899. // PostMsg(MSG.Error);
  900. // return false;
  901. // }
  902. // return ret == RState.End;
  903. //}
  904. private bool FnPumpingToVent(object[] param)
  905. {
  906. _pumpRoutine.Abort();
  907. return FnStartVent(param);
  908. }
  909. //private bool FnPumpingLoadLockToVentLoadLock(object[] param)
  910. //{
  911. // _pumpLoadLockRoutine.Abort();
  912. // return FnStartVentLoadlock(param);
  913. //}
  914. //private bool FnAbortPumpingLoadLock(object[] param)
  915. //{
  916. // _pumpLoadLockRoutine.Abort();
  917. // return true;
  918. //}
  919. //private bool FnStartPurgeLoadlock(object[] param)
  920. //{
  921. // return _purgeLoadLockRoutine.Start() == RState.Running;
  922. //}
  923. //private bool FnPurgeLoadLockTimeout(object[] param)
  924. //{
  925. // RState ret = _purgeLoadLockRoutine.Monitor();
  926. // if (ret == RState.Failed || ret == RState.Timeout)
  927. // {
  928. // PostMsg(MSG.Error);
  929. // return false;
  930. // }
  931. // return ret == RState.End;
  932. //}
  933. //private bool FnAbortPurgeLoadLock(object[] param)
  934. //{
  935. // _purgeLoadLockRoutine.Abort();
  936. // return true;
  937. //}
  938. //private bool FnStartLoadLockLeakCheck(object[] param)
  939. //{
  940. // return _loadLockLeakCheckRoutine.Start() == RState.Running;
  941. //}
  942. //private bool FnLoadLockLeakCheckTimeout(object[] param)
  943. //{
  944. // RState ret = _loadLockLeakCheckRoutine.Monitor();
  945. // if (ret == RState.Failed || ret == RState.Timeout)
  946. // {
  947. // PostMsg(MSG.Error);
  948. // return false;
  949. // }
  950. // return ret == RState.End;
  951. //}
  952. //private bool FnAbortLoadLockLeakCheck(object[] param)
  953. //{
  954. // _loadLockLeakCheckRoutine.Abort();
  955. // return true;
  956. //}
  957. private bool FnStartPurge(object[] param)
  958. {
  959. return _purgeRoutine.Start() == RState.Running;
  960. }
  961. private bool FnPurgeTimeout(object[] param)
  962. {
  963. RState ret = _purgeRoutine.Monitor();
  964. if (ret == RState.Failed || ret == RState.Timeout)
  965. {
  966. PostMsg(MSG.Error);
  967. return false;
  968. }
  969. return ret == RState.End;
  970. }
  971. private bool FnAbortPurge(object[] param)
  972. {
  973. _purgeRoutine.Abort();
  974. return true;
  975. }
  976. private bool FnStartGasLinePurge(object[] param)
  977. {
  978. return _gaslinePurgeRoutine.Start(param) == RState.Running;
  979. }
  980. private bool FnGasLinePurgeTimeout(object[] param)
  981. {
  982. RState ret = _gaslinePurgeRoutine.Monitor();
  983. if (ret == RState.Failed || ret == RState.Timeout)
  984. {
  985. PostMsg(MSG.Error);
  986. return false;
  987. }
  988. return ret == RState.End;
  989. }
  990. private bool FnAbortGasLinePurge(object[] param)
  991. {
  992. _gaslinePurgeRoutine.Abort();
  993. return true;
  994. }
  995. private bool FnStartPMLeakCheck(object[] param)
  996. {
  997. return _leakCheckRoutine.Start(param) == RState.Running;
  998. }
  999. private bool FnPMLeakCheckTimeout(object[] param)
  1000. {
  1001. RState ret = _leakCheckRoutine.Monitor();
  1002. if (ret == RState.Failed || ret == RState.Timeout)
  1003. {
  1004. PostMsg(MSG.Error);
  1005. return false;
  1006. }
  1007. return ret == RState.End;
  1008. }
  1009. private bool FnAbortPMLeakCheck(object[] param)
  1010. {
  1011. _leakCheckRoutine.Abort();
  1012. return true;
  1013. }
  1014. private bool FnStartGasBoxLeakCheck(object[] param)
  1015. {
  1016. return _gasBoxLeakCheckRoutine.Start(param) == RState.Running;
  1017. }
  1018. private bool FnGasBoxLeakCheckTimeout(object[] param)
  1019. {
  1020. RState ret = _gasBoxLeakCheckRoutine.Monitor();
  1021. if (ret == RState.Failed || ret == RState.Timeout)
  1022. {
  1023. PostMsg(MSG.Error);
  1024. return false;
  1025. }
  1026. return ret == RState.End;
  1027. }
  1028. private bool FnAbortGasBoxLeakCheck(object[] param)
  1029. {
  1030. _gasBoxLeakCheckRoutine.Abort();
  1031. return true;
  1032. }
  1033. //private bool FnStartLLPlace(object[] param)
  1034. //{
  1035. // return _llPlaceRoutine.Start() == RState.Running;
  1036. //}
  1037. //private bool FnLLPlaceTimeout(object[] param)
  1038. //{
  1039. // RState ret = _llPlaceRoutine.Monitor();
  1040. // if (ret == RState.Failed || ret == RState.Timeout)
  1041. // {
  1042. // PostMsg(MSG.Error);
  1043. // return false;
  1044. // }
  1045. // return ret == RState.End;
  1046. //}
  1047. //private bool FnAbortLLPlace(object[] param)
  1048. //{
  1049. // _llPlaceRoutine.Abort();
  1050. // return true;
  1051. //}
  1052. //private bool FnStartLLPick(object[] param)
  1053. //{
  1054. // return _llPickRoutine.Start() == RState.Running;
  1055. //}
  1056. //private bool FnLLPickTimeout(object[] param)
  1057. //{
  1058. // RState ret = _llPickRoutine.Monitor();
  1059. // if (ret == RState.Failed || ret == RState.Timeout)
  1060. // {
  1061. // PostMsg(MSG.Error);
  1062. // return false;
  1063. // }
  1064. // return ret == RState.End;
  1065. //}
  1066. //private bool FnAbortLLPick(object[] param)
  1067. //{
  1068. // _llPickRoutine.Abort();
  1069. // return true;
  1070. //}
  1071. private bool FnRunRecipe(object[] param)
  1072. {
  1073. RState ret = _processRoutine.Start(param);
  1074. if (ret == RState.Failed || ret == RState.Timeout)
  1075. {
  1076. PostMsg(MSG.Error);
  1077. return false;
  1078. }
  1079. return ret == RState.Running;
  1080. }
  1081. private bool FnProcessTimeout(object[] param)
  1082. {
  1083. _chamber.CheckIdleInterlock(500);
  1084. RState ret = _processRoutine.Monitor();
  1085. if (ret == RState.Failed || ret == RState.Timeout)
  1086. {
  1087. PostMsg(MSG.Error);
  1088. return false;
  1089. }
  1090. if (ret == RState.End)
  1091. {
  1092. _dictRecipeTime[_processRoutine.currentRecipeResult.RecipeName] = fsm.ElapsedTime;
  1093. return true;
  1094. }
  1095. return false;
  1096. }
  1097. private bool FnAbortProcess(object[] param)
  1098. {
  1099. StatsDataManager.Instance.Increase(_statProcessedWafer.Name);
  1100. _processRoutine.Abort();
  1101. return true;
  1102. }
  1103. private bool FnStartGasFlow(object[] param)
  1104. {
  1105. return _gasFlowRoutine.Start(param) == RState.Running;
  1106. }
  1107. private bool FnGasFlowTimeout(object[] param)
  1108. {
  1109. RState ret = _gasFlowRoutine.Monitor();
  1110. if (ret == RState.Failed || ret == RState.Timeout)
  1111. {
  1112. PostMsg(MSG.Error);
  1113. return false;
  1114. }
  1115. return ret == RState.End;
  1116. }
  1117. private bool FnStopGasFlow(object[] param)
  1118. {
  1119. _gasFlowRoutine.Abort();
  1120. return true;
  1121. }
  1122. private bool FnAbortGasFlow(object[] param)
  1123. {
  1124. _gasFlowRoutine.Abort();
  1125. return true;
  1126. }
  1127. private bool FnStartRfPower(object[] param)
  1128. {
  1129. return _rfPowerRoutine.Start(param) == RState.Running;
  1130. }
  1131. private bool FnRfPowerTimeout(object[] param)
  1132. {
  1133. RState ret = _rfPowerRoutine.Monitor();
  1134. if (ret == RState.Failed || ret == RState.Timeout)
  1135. {
  1136. PostMsg(MSG.Error);
  1137. return false;
  1138. }
  1139. return ret == RState.End;
  1140. }
  1141. private bool FnAbortRfPower(object[] param)
  1142. {
  1143. _rfPowerRoutine.Abort();
  1144. if (_gasFlowRoutine._gasStatus)
  1145. {
  1146. _gasFlowRoutine.StopFlow();
  1147. }
  1148. return true;
  1149. }
  1150. private bool FnStartMFCVerification(object[] param)
  1151. {
  1152. _gasVerificationRoutine.Init((string)param[0], Convert.ToDouble(param[1]), (int)param[2]);
  1153. return _gasVerificationRoutine.Start(param) == RState.Running;
  1154. }
  1155. private bool FnMFCVerificationTimeout(object[] param)
  1156. {
  1157. RState ret = _gasVerificationRoutine.Monitor();
  1158. if (ret == RState.Failed || ret == RState.Timeout)
  1159. {
  1160. PostMsg(MSG.Error);
  1161. return false;
  1162. }
  1163. return ret == RState.End;
  1164. }
  1165. private bool FnAbortMFCVerification(object[] param)
  1166. {
  1167. _gasVerificationRoutine.Abort();
  1168. return true;
  1169. }
  1170. private bool FnControlPressure(object[] param)
  1171. {
  1172. if (RouteManager.IsATMMode)
  1173. {
  1174. return true;
  1175. }
  1176. if (IsOnline == true && fsm.State != (int)PMState.Processing && fsm.State != (int)PMState.Clean)
  1177. {
  1178. if (startControlPressureFlag == true)
  1179. {
  1180. startControlPressureFlag = false;
  1181. if (_chamber.GetPVPosition() <= 0)
  1182. {
  1183. LOG.Write(eEvent.WARN_PM, Module, $"{Module} control pressure fail,due to pendulum valve is not Open");
  1184. return false;
  1185. }
  1186. if (_chamber.IsTurboPumpRunning == false)
  1187. {
  1188. LOG.Write(eEvent.WARN_PM, Module, $"{Module} control pressure fail,due to turbo pump is not Open");
  1189. return false;
  1190. }
  1191. _controlPressureSetPoint = SC.GetValue<int>($"{Module}.ControlPressureSetPoint");
  1192. _controlFlowSetPoint = SC.GetValue<int>($"{Module}.ControlPressureN2FlowSetPoint");
  1193. _chamber.StartControlPressure(_controlPressureSetPoint, _controlFlowSetPoint);
  1194. }
  1195. }
  1196. else
  1197. {
  1198. if (startControlPressureFlag == false)
  1199. {
  1200. _chamber.AbortControlPressure();
  1201. startControlPressureFlag = true;
  1202. }
  1203. }
  1204. return true;
  1205. }
  1206. #region Exchange wafer with TM
  1207. private bool FnStartPreparePick(object[] param)
  1208. {
  1209. if (!_chamber.PreparePick())
  1210. {
  1211. LOG.Write(eEvent.ERR_PM, Module, $"Prepare Pick failed");
  1212. return false;
  1213. }
  1214. return true;
  1215. }
  1216. private bool FnPreparePickTimeout(object[] param)
  1217. {
  1218. // return _chamber.WaferIsDown && IsSlitDoorOpen;
  1219. return _chamber.PreparePickIsOK();
  1220. }
  1221. private bool FnAbortPreparePick(object[] param)
  1222. {
  1223. return true;
  1224. }
  1225. private bool FnStartFinishPick(object[] param)
  1226. {
  1227. //if (!_chamber.SetSlitDoor(false, out string reason))
  1228. //{
  1229. // LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  1230. // return false;
  1231. //}
  1232. //return true;
  1233. return _chamber.EndPick();
  1234. }
  1235. private bool FnAbortPick(object[] param)
  1236. {
  1237. return true;
  1238. }
  1239. private bool FnFinishPickTimeout(object[] param)
  1240. {
  1241. //return IsSlitDoorClose;
  1242. return _chamber.EndPickIsOK();
  1243. }
  1244. private bool FnStartDropDownWafer(object[] param)
  1245. {
  1246. if (!_chamber.SetLiftPin(MovementPosition.Down, out string reason))
  1247. {
  1248. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Down failed:{reason}");
  1249. return false;
  1250. }
  1251. return _chamber.SetLiftPin(MovementPosition.Down, out string _);
  1252. }
  1253. private bool FnDropDownTimeout(object[] param)
  1254. {
  1255. return _chamber.LiftPinIsDown;
  1256. }
  1257. private bool FnStartPreparePlace(object[] param)
  1258. {
  1259. //if (_chamber.ChamberType == JetChamber.Venus || _chamber.ChamberType == JetChamber.Kepler2300)
  1260. //{
  1261. // if (!_chamber.SetLiftPin(MovementPosition.Down, out string reason))
  1262. // {
  1263. // LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  1264. // return false;
  1265. // }
  1266. //}
  1267. if (!_chamber.PreparePlace())
  1268. {
  1269. LOG.Write(eEvent.ERR_PM, Module, $"Set Wafer Down failed");
  1270. return false;
  1271. }
  1272. //string reason = "";
  1273. //if (!_chamber.SetLiftPin(MovementPosition.Down, out string reason))
  1274. //{
  1275. // LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  1276. // return false;
  1277. //}
  1278. return true;
  1279. }
  1280. private bool FnPreparePlaceTimeout(object[] param)
  1281. {
  1282. return _chamber.PreparePlaceIsOK();
  1283. }
  1284. private bool FnAbortPreparePlace(object[] param)
  1285. {
  1286. return true;
  1287. }
  1288. private bool FnStartLiftUpWafer(object[] param)
  1289. {
  1290. if (!_chamber.SetLiftPin(MovementPosition.Up, out string reason))
  1291. {
  1292. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Up failed:{reason}");
  1293. return false;
  1294. }
  1295. return true;
  1296. }
  1297. private bool FnLiftUpTimeout(object[] param)
  1298. {
  1299. return _chamber.LiftPinIsUp;
  1300. }
  1301. private bool FnStartFinishPlace(object[] param)
  1302. {
  1303. return _chamber.EndPlace();
  1304. }
  1305. private bool FnAortPlace(object[] param)
  1306. {
  1307. return true;
  1308. }
  1309. private bool FnFinishPlaceTimeout(object[] param)
  1310. {
  1311. //return _chamber.LiftPinIsDown && IsSlitDoorClose;
  1312. return _chamber.EndPlaceIsOK();
  1313. }
  1314. private bool FnStartSwapPlace(object[] param)
  1315. {
  1316. return true;
  1317. }
  1318. private bool FnStartPartialPressure(object[] param)
  1319. {
  1320. return _pmPartialPressureRoutine.Start(param) == RState.Running;
  1321. }
  1322. private bool FnPartialPressureTimeout(object[] param)
  1323. {
  1324. RState ret = _pmPartialPressureRoutine.Monitor();
  1325. if (ret == RState.Failed || ret == RState.Timeout)
  1326. {
  1327. PostMsg(MSG.Error);
  1328. return false;
  1329. }
  1330. return ret == RState.End;
  1331. }
  1332. private bool FnAbortPartialPressure(object[] param)
  1333. {
  1334. _pmPartialPressureRoutine.Abort();
  1335. return true;
  1336. }
  1337. private bool FnStartVATPerformance(object[] param)
  1338. {
  1339. return _pmVATPerformanceRoutine.Start(param) == RState.Running;
  1340. }
  1341. private bool FnVATPerformanceTimeout(object[] param)
  1342. {
  1343. RState ret = _pmVATPerformanceRoutine.Monitor();
  1344. if (ret == RState.Failed || ret == RState.Timeout)
  1345. {
  1346. PostMsg(MSG.Error);
  1347. return false;
  1348. }
  1349. return ret == RState.End;
  1350. }
  1351. private bool FnAbortVATPerformance(object[] param)
  1352. {
  1353. _pmVATPerformanceRoutine.Abort();
  1354. return true;
  1355. }
  1356. //private bool FnStartHeat(object[] param)
  1357. //{
  1358. // if (ChamberType == JetChamber.Kepler2200A || ChamberType == JetChamber.Kepler2200B)
  1359. // {
  1360. // _pmHeatRoutine.Start();
  1361. // }
  1362. // return true;
  1363. //}
  1364. #endregion
  1365. private void _debugRoutine()
  1366. {
  1367. int flag = 0;
  1368. // Test Home routine
  1369. if (flag == 1)
  1370. {
  1371. PostMsg(MSG.Home);
  1372. }
  1373. else if (flag == 2)
  1374. {
  1375. PostMsg(MSG.Vent);
  1376. }
  1377. else if (flag == 3)
  1378. {
  1379. PostMsg(MSG.Pump);
  1380. }
  1381. else if (flag == 4)
  1382. {
  1383. PostMsg(MSG.PumpLoadLock);
  1384. }
  1385. else if (flag == 5)
  1386. {
  1387. PostMsg(MSG.VentLoadLock);
  1388. }
  1389. else if (flag == 6)
  1390. {
  1391. PostMsg(MSG.PurgeLoadLock);
  1392. }
  1393. else if (flag == 7)
  1394. {
  1395. PostMsg(MSG.LaunchPump);
  1396. }
  1397. else if (flag == 8)
  1398. {
  1399. PostMsg(MSG.LaunchTurboPump);
  1400. }
  1401. else if (flag == 9)
  1402. {
  1403. PostMsg(MSG.LoadLockLeakCheck);
  1404. }
  1405. else if (flag == 10)
  1406. {
  1407. PostMsg(MSG.CyclePurge);
  1408. }
  1409. else if (flag == 11)
  1410. {
  1411. PostMsg(MSG.GasLinePurge);
  1412. }
  1413. else if (flag == 12)
  1414. {
  1415. PostMsg(MSG.LeakCheck);
  1416. }
  1417. else if (flag == 13)
  1418. {
  1419. PostMsg(MSG.GasLeakCheck);
  1420. }
  1421. else if (flag == 14)
  1422. {
  1423. PostMsg(MSG.LLPlace);
  1424. }
  1425. else if (flag == 15)
  1426. {
  1427. PostMsg(MSG.LLPick);
  1428. }
  1429. else if (flag == 16)
  1430. {
  1431. PostMsg(MSG.RunRecipe, "7777");
  1432. }
  1433. else if (flag == 17)
  1434. {
  1435. PostMsg(MSG.MFCVerification, "MFC2", (double)50, 10);
  1436. }
  1437. }
  1438. }
  1439. }