TMEntity.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. using System;
  2. using System.Collections.Generic;
  3. using Aitex.Core.RT.Fsm;
  4. using Aitex.Core.RT.Log;
  5. using Aitex.Core.Util;
  6. using Venus_Core;
  7. using Aitex.Sorter.Common;
  8. using MECF.Framework.Common.Equipment;
  9. using MECF.Framework.Common.SubstrateTrackings;
  10. using Venus_RT.Devices;
  11. using Venus_RT.Modules.TM;
  12. using Aitex.Core.RT.DataCenter;
  13. using Aitex.Core.RT.OperationCenter;
  14. using MECF.Framework.Common.Schedulers;
  15. using MECF.Framework.Common.CommonData;
  16. namespace Venus_RT.Modules
  17. {
  18. class TMEntity : Entity, IModuleEntity
  19. {
  20. public enum STATE
  21. {
  22. Unknown,
  23. Init,
  24. Initializing,
  25. Idle,
  26. Error,
  27. Pumping,
  28. Venting,
  29. Purging,
  30. Leakchecking,
  31. Picking,
  32. Placing,
  33. Swaping,
  34. PMPicking,
  35. PMPlacing,
  36. PMSwaping,
  37. Aligning,
  38. Mapping,
  39. Extending,
  40. Retracting,
  41. Swapping,
  42. Gotoing,
  43. }
  44. public enum MSG
  45. {
  46. Home,
  47. Online,
  48. Offline,
  49. Pump,
  50. Vent,
  51. Purge,
  52. CyclePurge,
  53. LeakCheck,
  54. Pick,
  55. Place,
  56. Swap,
  57. DoublePick,
  58. DoublePlace,
  59. DoubleSwap,
  60. PMPick,
  61. PMPlace,
  62. PMSwap,
  63. Extend,
  64. Retract,
  65. Error,
  66. Abort,
  67. }
  68. public bool IsIdle
  69. {
  70. get { return fsm.State == (int)STATE.Idle; }
  71. }
  72. public bool IsError
  73. {
  74. get { return fsm.State == (int)STATE.Error; }
  75. }
  76. public bool IsInit
  77. {
  78. get { return fsm.State == (int)STATE.Unknown || fsm.State == (int)STATE.Init; }
  79. }
  80. public bool IsBusy
  81. {
  82. get { return !IsInit && !IsError && !IsIdle; }
  83. }
  84. public bool IsOnline { get; internal set; }
  85. private readonly JetTM _tm;
  86. private readonly ITransferRobot _robot;
  87. private readonly MFHomeRoutine _homeRoutine;
  88. private readonly MFPumpRoutine _pumpingRoutine;
  89. private readonly MFVentRoutine _ventingRoutine;
  90. private readonly MFLeakCheckRoutine _leakCheckRoutine;
  91. private readonly MFPurgeRoutine _purgeRoutine;
  92. private readonly MFPickRoutine _pickRoutine;
  93. private readonly MFPlaceRoutine _placeRoutine;
  94. private readonly MFSwapRoutine _swapRoutine;
  95. private readonly MFPMPickRoutine _pmPickRoutine;
  96. private readonly MFPMPlaceRoutine _pmPlaceRoutine;
  97. private readonly MFPMSwapRoutine _pmSwapRoutine;
  98. private readonly MFPMRetractRoutine _pmRetractRoutine;
  99. private readonly MFPMExtendRoutine _pmExtendRoutine;
  100. public TMEntity()
  101. {
  102. _tm = Singleton<JetTM>.Instance;
  103. _robot = new SIASUNRobot();
  104. _homeRoutine = new MFHomeRoutine(_tm, _robot);
  105. _pickRoutine = new MFPickRoutine(_tm, _robot);
  106. _placeRoutine = new MFPlaceRoutine(_tm, _robot);
  107. _swapRoutine = new MFSwapRoutine(_tm, _robot);
  108. _pmPickRoutine = new MFPMPickRoutine(_tm, _robot);
  109. _pmPlaceRoutine = new MFPMPlaceRoutine(_tm, _robot);
  110. _pmSwapRoutine = new MFPMSwapRoutine(_tm, _robot);
  111. _pumpingRoutine = new MFPumpRoutine(_tm, ModuleName.TM);
  112. _ventingRoutine = new MFVentRoutine(_tm, ModuleName.TM);
  113. _leakCheckRoutine = new MFLeakCheckRoutine(_tm, ModuleName.TM);
  114. _purgeRoutine = new MFPurgeRoutine(_tm, ModuleName.TM);
  115. _pmRetractRoutine = new MFPMRetractRoutine(_tm, _robot);
  116. _pmExtendRoutine = new MFPMExtendRoutine(_tm, _robot);
  117. WaferManager.Instance.SubscribeLocation(ModuleName.TM, 2);
  118. InitFsmMap();
  119. }
  120. protected override bool Init()
  121. {
  122. OP.Subscribe("TM.Home", (cmd, args) => CheckToPostMessage((int)MSG.Home));
  123. OP.Subscribe($"TM.{RtOperation.LLPick}", (cmd, args) => CheckToPostMessage((int)MSG.Pick, args));
  124. OP.Subscribe($"TM.{RtOperation.LLPlace}", (cmd, args) => CheckToPostMessage((int)MSG.Place, args));
  125. OP.Subscribe($"TM.{RtOperation.PMPick}", (cmd, args) => CheckToPostMessage((int)MSG.PMPick, args));
  126. OP.Subscribe($"TM.{RtOperation.PMPlace}", (cmd, args) => CheckToPostMessage((int)MSG.PMPlace, args));
  127. OP.Subscribe($"TM.{RtOperation.Extend}", (cmd, args) => CheckToPostMessage((int)MSG.Extend, args));
  128. OP.Subscribe($"TM.{RtOperation.Retract}", (cmd, args) => CheckToPostMessage((int)MSG.Retract, args));
  129. //OP.Subscribe($"TM.{RtOperation.LLPlace}", (cmd, args) => CheckToPostMessage((int)MSG.Place, args));
  130. OP.Subscribe($"TM.{RtOperation.Pump}", (cmd, args) => CheckToPostMessage((int)MSG.Pump));
  131. OP.Subscribe($"TM.{RtOperation.Vent}", (cmd, args) => CheckToPostMessage((int)MSG.Vent));
  132. OP.Subscribe($"TM.{RtOperation.LeakCheck}", (cmd, args) => CheckToPostMessage((int)MSG.LeakCheck));
  133. OP.Subscribe($"TM.{RtOperation.Purge}", (cmd, args) => CheckToPostMessage((int)MSG.Purge));
  134. OP.Subscribe($"TM.{RtOperation.Abort}", (cmd, args) => CheckToPostMessage((int)MSG.Abort));
  135. DATA.Subscribe("TM.FsmState", () => (((STATE)fsm.State).ToString()));
  136. DATA.Subscribe("TM.FsmPrevState", () => (((PMState)fsm.PrevState).ToString()));
  137. DATA.Subscribe("TM.FsmLastMessage", () => (((MSG)fsm.LastMsg).ToString()));
  138. DATA.Subscribe("TM.RobotMoveAction", () => _robot.TMRobotMoveInfo);
  139. DATA.Subscribe("TM.RobotMoveAction.ArmTarget", () => _robot.TMRobotMoveInfo.ArmTarget.ToString()) ;
  140. DATA.Subscribe("TM.RobotMoveAction.BladeTarget", () => _robot.TMRobotMoveInfo.BladeTarget);
  141. DATA.Subscribe("TM.RobotMoveAction.RobotAction", () => _robot.TMRobotMoveInfo.Action.ToString());
  142. return true;
  143. }
  144. private void InitFsmMap()
  145. {
  146. fsm = new StateMachine<TMEntity>("TM", (int)STATE.Init, 50);
  147. //AnyStateTransition(FSM_MSG.TIMER, fnMonitor, FSM_STATE.SAME);
  148. AnyStateTransition(MSG.Error, fnError, STATE.Error);
  149. AnyStateTransition(MSG.Online, fnOnline, FSM_STATE.SAME);
  150. AnyStateTransition(MSG.Offline, fnOffline, FSM_STATE.SAME);
  151. AnyStateTransition(MSG.Home, fnHome, STATE.Initializing);
  152. // Home
  153. Transition(STATE.Initializing, FSM_MSG.TIMER, fnHoming, STATE.Idle);
  154. Transition(STATE.Idle, FSM_MSG.TIMER, fnMonitor, STATE.Idle);
  155. Transition(STATE.Init, FSM_MSG.TIMER, fnMonitor, STATE.Init);
  156. // Vent sequence
  157. Transition(STATE.Idle, MSG.Vent, FnStartVent, STATE.Venting);
  158. Transition(STATE.Venting, FSM_MSG.TIMER, FnVentTimeout, STATE.Idle);
  159. Transition(STATE.Venting, MSG.Abort, FnAbortVent, STATE.Idle);
  160. // Pump sequence
  161. Transition(STATE.Idle, MSG.Pump, FnStartPump, STATE.Pumping);
  162. Transition(STATE.Pumping, FSM_MSG.TIMER, FnPumpTimeout, STATE.Idle);
  163. Transition(STATE.Pumping, MSG.Abort, FnAbortPump, STATE.Idle);
  164. // Purge sequence
  165. Transition(STATE.Idle, MSG.CyclePurge, FnStartPurge, STATE.Purging);
  166. Transition(STATE.Purging, FSM_MSG.TIMER, FnPurgeTimeout, STATE.Idle);
  167. Transition(STATE.Purging, MSG.Abort, FnAbortPurge, STATE.Idle);
  168. // Leak check sequence
  169. Transition(STATE.Idle, MSG.LeakCheck, FnStartLeakCheck, STATE.Leakchecking);
  170. Transition(STATE.Leakchecking, FSM_MSG.TIMER, FnLeakCheckTimeout, STATE.Idle);
  171. Transition(STATE.Leakchecking, MSG.Abort, FnAbortLeakCheck, STATE.Idle);
  172. // Pick wafer from LL sequence
  173. Transition(STATE.Idle, MSG.Pick, FnStartPick, STATE.Picking);
  174. Transition(STATE.Picking, FSM_MSG.TIMER, FnPickTimeout, STATE.Idle);
  175. Transition(STATE.Picking, MSG.Abort, FnAbortPick, STATE.Idle);
  176. // Place wafer to LL sequence
  177. Transition(STATE.Idle, MSG.Place, FnStartPlace, STATE.Placing);
  178. Transition(STATE.Placing, FSM_MSG.TIMER, FnPlaceTimeout, STATE.Idle);
  179. Transition(STATE.Placing, MSG.Abort, FnAbortPlace, STATE.Idle);
  180. // Swap wafer with LL sequence
  181. Transition(STATE.Idle, MSG.Swap, FnStartSwap, STATE.Swaping);
  182. Transition(STATE.Swaping, FSM_MSG.TIMER, FnSwapTimeout, STATE.Idle);
  183. Transition(STATE.Swaping, MSG.Abort, FnAbortSwap, STATE.Idle);
  184. // Pick wafer from PM sequence
  185. Transition(STATE.Idle, MSG.PMPick, FnStartPMPick, STATE.PMPicking);
  186. Transition(STATE.PMPicking, FSM_MSG.TIMER, FnPMPickTimeout, STATE.Idle);
  187. Transition(STATE.PMPicking, MSG.Abort, FnAbortPMPick, STATE.Idle);
  188. // Place wafer to PM sequence
  189. Transition(STATE.Idle, MSG.PMPlace, FnStartPMPlace, STATE.PMPlacing);
  190. Transition(STATE.PMPlacing, FSM_MSG.TIMER, FnPMPlaceTimeout, STATE.Idle);
  191. Transition(STATE.PMPlacing, MSG.Abort, FnAbortPMPlace, STATE.Idle);
  192. // Swap wafer with PM sequence
  193. Transition(STATE.Idle, MSG.PMSwap, FnStartPMSwap, STATE.PMSwaping);
  194. Transition(STATE.PMSwaping, FSM_MSG.TIMER, FnPMSwapTimeout, STATE.Idle);
  195. Transition(STATE.PMSwaping, MSG.Abort, FnAbortPMSwap, STATE.Idle);
  196. //Retract
  197. Transition(STATE.Idle, MSG.Retract, FnStartRetract, STATE.Retracting);
  198. Transition(STATE.Retracting, FSM_MSG.TIMER, FnRetract, STATE.Idle);
  199. Transition(STATE.Retracting, MSG.Abort, FnAbortRetract, STATE.Idle);
  200. //Extend
  201. Transition(STATE.Idle, MSG.Extend, FnStartExtend, STATE.Extending);
  202. Transition(STATE.Extending, FSM_MSG.TIMER, FnExtend, STATE.Idle);
  203. Transition(STATE.Extending, MSG.Abort, FnAbortExtend, STATE.Idle);
  204. Running = true;
  205. }
  206. private bool fnMonitor(object[] param)
  207. {
  208. _debugRoutine();
  209. return true;
  210. }
  211. private bool fnError(object[] param)
  212. {
  213. IsOnline = false;
  214. return true;
  215. }
  216. private bool fnOnline(object[] param)
  217. {
  218. return true;
  219. }
  220. private bool fnOffline(object[] param)
  221. {
  222. IsOnline = false;
  223. return true;
  224. }
  225. private bool fnAbort(object[] param)
  226. {
  227. _robot.Halt();
  228. return true;
  229. }
  230. private bool fnHome(object[] param)
  231. {
  232. return _homeRoutine.Start() == RState.Running;
  233. }
  234. private bool fnHoming(object[] param)
  235. {
  236. RState ret = _homeRoutine.Monitor();
  237. if (ret == RState.Failed || ret == RState.Timeout)
  238. {
  239. PostMsg(MSG.Error);
  240. return false;
  241. }
  242. return ret == RState.End;
  243. }
  244. private bool FnStartVent(object[] param)
  245. {
  246. return _ventingRoutine.Start() == RState.Running ;
  247. }
  248. private bool FnVentTimeout(object[] param)
  249. {
  250. RState ret = _ventingRoutine.Monitor();
  251. if (ret == RState.Failed || ret == RState.Timeout)
  252. {
  253. _ventingRoutine.Abort();
  254. PostMsg(MSG.Error);
  255. return false;
  256. }
  257. return ret == RState.End;
  258. }
  259. private bool FnAbortVent(object[] param)
  260. {
  261. _ventingRoutine.Abort();
  262. return true;
  263. }
  264. private bool FnStartPump(object[] param)
  265. {
  266. return _pumpingRoutine.Start() == RState.Running;
  267. }
  268. private bool FnPumpTimeout(object[] param)
  269. {
  270. RState ret = _pumpingRoutine.Monitor();
  271. if (ret == RState.Failed || ret == RState.Timeout)
  272. {
  273. _pumpingRoutine.Abort();
  274. PostMsg(MSG.Error);
  275. return false;
  276. }
  277. return ret == RState.End;
  278. }
  279. private bool FnAbortPump(object[] param)
  280. {
  281. _pumpingRoutine.Abort();
  282. return true;
  283. }
  284. private bool FnStartPurge(object[] param)
  285. {
  286. return _purgeRoutine.Start() == RState.Running;
  287. }
  288. private bool FnPurgeTimeout(object[] param)
  289. {
  290. RState ret = _purgeRoutine.Monitor();
  291. if (ret == RState.Failed || ret == RState.Timeout)
  292. {
  293. PostMsg(MSG.Error);
  294. return false;
  295. }
  296. return ret == RState.End;
  297. }
  298. private bool FnAbortPurge(object[] param)
  299. {
  300. _purgeRoutine.Abort();
  301. return true;
  302. }
  303. private bool FnStartLeakCheck(object[] param)
  304. {
  305. return _leakCheckRoutine.Start() == RState.Running;
  306. }
  307. private bool FnLeakCheckTimeout(object[] param)
  308. {
  309. RState ret = _leakCheckRoutine.Monitor();
  310. if (ret == RState.Failed || ret == RState.Timeout)
  311. {
  312. PostMsg(MSG.Error);
  313. return false;
  314. }
  315. return ret == RState.End;
  316. }
  317. private bool FnAbortLeakCheck(object[] param)
  318. {
  319. _leakCheckRoutine.Abort();
  320. return true;
  321. }
  322. private bool FnStartPick(object[] param)
  323. {
  324. return _pickRoutine.Start(param) == RState.Running;
  325. }
  326. private bool FnPickTimeout(object[] param)
  327. {
  328. RState ret = _pickRoutine.Monitor();
  329. if (ret == RState.Failed || ret == RState.Timeout)
  330. {
  331. PostMsg(MSG.Error);
  332. return false;
  333. }
  334. return ret == RState.End;
  335. }
  336. private bool FnAbortPick(object[] param)
  337. {
  338. _pickRoutine.Abort();
  339. return true;
  340. }
  341. private bool FnStartPlace(object[] param)
  342. {
  343. return _placeRoutine.Start(param) == RState.Running;
  344. }
  345. private bool FnPlaceTimeout(object[] param)
  346. {
  347. RState ret = _placeRoutine.Monitor();
  348. if (ret == RState.Failed || ret == RState.Timeout)
  349. {
  350. PostMsg(MSG.Error);
  351. return false;
  352. }
  353. return ret == RState.End;
  354. }
  355. private bool FnAbortPlace(object[] param)
  356. {
  357. _placeRoutine.Abort();
  358. return true;
  359. }
  360. private bool FnStartSwap(object[] param)
  361. {
  362. return _swapRoutine.Start(param) == RState.Running;
  363. }
  364. private bool FnSwapTimeout(object[] param)
  365. {
  366. RState ret = _swapRoutine.Monitor();
  367. if (ret == RState.Failed || ret == RState.Timeout)
  368. {
  369. PostMsg(MSG.Error);
  370. return false;
  371. }
  372. return ret == RState.End;
  373. }
  374. private bool FnAbortSwap(object[] param)
  375. {
  376. _swapRoutine.Abort();
  377. return true;
  378. }
  379. private bool FnStartPMPick(object[] param)
  380. {
  381. return _pmPickRoutine.Start(param) == RState.Running;
  382. }
  383. private bool FnPMPickTimeout(object[] param)
  384. {
  385. RState ret = _pmPickRoutine.Monitor();
  386. if (ret == RState.Failed || ret == RState.Timeout)
  387. {
  388. PostMsg(MSG.Error);
  389. return false;
  390. }
  391. return ret == RState.End;
  392. }
  393. private bool FnAbortPMPick(object[] param)
  394. {
  395. _pmPickRoutine.Abort();
  396. return true;
  397. }
  398. private bool FnStartPMPlace(object[] param)
  399. {
  400. return _pmPlaceRoutine.Start(param) == RState.Running;
  401. }
  402. private bool FnPMPlaceTimeout(object[] param)
  403. {
  404. RState ret = _pmPlaceRoutine.Monitor();
  405. if (ret == RState.Failed || ret == RState.Timeout)
  406. {
  407. PostMsg(MSG.Error);
  408. return false;
  409. }
  410. return ret == RState.End;
  411. }
  412. private bool FnAbortPMPlace(object[] param)
  413. {
  414. _pmPlaceRoutine.Abort();
  415. return true;
  416. }
  417. private bool FnStartPMSwap(object[] param)
  418. {
  419. return _pmSwapRoutine.Start(param) == RState.Running;
  420. }
  421. private bool FnPMSwapTimeout(object[] param)
  422. {
  423. RState ret = _pmSwapRoutine.Monitor();
  424. if (ret == RState.Failed || ret == RState.Timeout)
  425. {
  426. PostMsg(MSG.Error);
  427. return false;
  428. }
  429. return ret == RState.End;
  430. }
  431. private bool FnAbortPMSwap(object[] param)
  432. {
  433. _pmSwapRoutine.Abort();
  434. return true;
  435. }
  436. private bool FnStartRetract(object[] param)
  437. {
  438. return _pmRetractRoutine.Start(param) == RState.Running;
  439. }
  440. private bool FnRetract(object[] param)
  441. {
  442. RState ret = _pmRetractRoutine.Monitor();
  443. if (ret == RState.Failed || ret == RState.Timeout)
  444. {
  445. PostMsg(MSG.Error);
  446. return false;
  447. }
  448. return ret == RState.End;
  449. }
  450. private bool FnAbortRetract(object[] param)
  451. {
  452. _pmRetractRoutine.Abort();
  453. return true;
  454. }
  455. private bool FnStartExtend(object[] param)
  456. {
  457. return _pmExtendRoutine.Start(param) == RState.Running;
  458. }
  459. private bool FnExtend(object[] param)
  460. {
  461. RState ret = _pmExtendRoutine.Monitor();
  462. if (ret == RState.Failed || ret == RState.Timeout)
  463. {
  464. PostMsg(MSG.Error);
  465. return false;
  466. }
  467. return ret == RState.End;
  468. }
  469. private bool FnAbortExtend(object[] param)
  470. {
  471. _pmExtendRoutine.Abort();
  472. return true;
  473. }
  474. public bool Check(int msg, out string reason, params object[] args)
  475. {
  476. reason = "";
  477. return true;
  478. }
  479. public int Invoke(string function, params object[] args)
  480. {
  481. switch (function)
  482. {
  483. case "Home":
  484. CheckToPostMessage((int)MSG.Home);
  485. return (int)MSG.Home;
  486. }
  487. return (int)FSM_MSG.NONE;
  488. }
  489. public bool CheckAcked(int msg)
  490. {
  491. return fsm.CheckExecuted(msg);
  492. }
  493. public bool CheckToPostMessage(int msg, params object[] args)
  494. {
  495. if (!fsm.FindTransition(fsm.State, msg))
  496. {
  497. LOG.Write(eEvent.WARN_FSM_WARN, ModuleName.TM, $"TM is in {(STATE)fsm.State} state,can not do {(MSG)msg}");
  498. return false;
  499. }
  500. Running = true;
  501. fsm.PostMsg(msg, args);
  502. return true;
  503. }
  504. private void _debugRoutine()
  505. {
  506. int flag = 0;
  507. // Test Home routine
  508. if (flag == 1)
  509. {
  510. PostMsg(MSG.Home);
  511. }
  512. else if (flag == 2)
  513. {
  514. PostMsg(MSG.Vent);
  515. }
  516. else if (flag == 3)
  517. {
  518. PostMsg(MSG.Pump);
  519. }
  520. else if(flag == 4)
  521. {
  522. PostMsg(MSG.Pick, ModuleName.LLA, 0, 0);
  523. }
  524. else if(flag == 5)
  525. {
  526. PostMsg(MSG.Place, ModuleName.LLA, 0, 0);
  527. }
  528. else if(flag == 6)
  529. {
  530. Queue<MoveItem> items = new Queue<MoveItem>();
  531. items.Enqueue(new MoveItem(ModuleName.TM, 0, ModuleName.LLA, 0, Hand.Blade1));
  532. items.Enqueue(new MoveItem(ModuleName.TM, 1, ModuleName.LLA, 1, Hand.Blade2));
  533. items.Enqueue(new MoveItem(ModuleName.LLA, 0, ModuleName.TM, 0, Hand.Blade1));
  534. items.Enqueue(new MoveItem(ModuleName.LLA, 1, ModuleName.TM, 1, Hand.Blade2));
  535. PostMsg(MSG.Swap,items);
  536. }
  537. else if(flag == 7)
  538. {
  539. PostMsg(MSG.PMPick, ModuleName.PMA, 0, 0);
  540. }
  541. else if(flag == 8)
  542. {
  543. PostMsg(MSG.PMPlace, ModuleName.PMA, 0, 0);
  544. }
  545. else if(flag == 9)
  546. {
  547. PostMsg(MSG.PMSwap, ModuleName.PMA, 0, 0, 0, 0);
  548. }
  549. //else if (flag == 4)
  550. //{
  551. // PostMsg(MSG.PumpLoadLock);
  552. //}
  553. //else if (flag == 5)
  554. //{
  555. // PostMsg(MSG.VentLoadLock);
  556. //}
  557. //else if (flag == 6)
  558. //{
  559. // PostMsg(MSG.PurgeLoadLock);
  560. //}
  561. //else if (flag == 7)
  562. //{
  563. // PostMsg(MSG.LaunchPump);
  564. //}
  565. //else if (flag == 8)
  566. //{
  567. // PostMsg(MSG.LaunchTurboPump);
  568. //}
  569. //else if (flag == 9)
  570. //{
  571. // PostMsg(MSG.LoadLockLeakCheck);
  572. //}
  573. //else if (flag == 10)
  574. //{
  575. // PostMsg(MSG.CyclePurge);
  576. //}
  577. //else if (flag == 11)
  578. //{
  579. // PostMsg(MSG.GasLinePurge);
  580. //}
  581. //else if (flag == 12)
  582. //{
  583. // PostMsg(MSG.LeakCheck);
  584. //}
  585. //else if (flag == 13)
  586. //{
  587. // PostMsg(MSG.GasLeakCheck);
  588. //}
  589. //else if (flag == 14)
  590. //{
  591. // PostMsg(MSG.LLPlace);
  592. //}
  593. //else if (flag == 15)
  594. //{
  595. // PostMsg(MSG.LLPick);
  596. //}
  597. //else if (flag == 16)
  598. //{
  599. // PostMsg(MSG.RunRecipe, "7777");
  600. //}
  601. //else if (flag == 17)
  602. //{
  603. // PostMsg(MSG.MFCVerification, "MFC2", (double)50, 10);
  604. //}
  605. }
  606. }
  607. }