TMEntity.cs 23 KB

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