LoadPortModule.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758
  1. using System;
  2. using Aitex.Core.RT.DataCenter;
  3. using Aitex.Core.RT.Device;
  4. using Aitex.Core.RT.Event;
  5. using Aitex.Core.RT.Fsm;
  6. using Aitex.Core.RT.OperationCenter;
  7. using Aitex.Core.RT.Routine;
  8. using Aitex.Core.Utilities;
  9. using Aitex.Sorter.Common;
  10. using MECF.Framework.Common.Equipment;
  11. using MECF.Framework.Common.Schedulers;
  12. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Efems.Rorzes;
  13. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts;
  14. using MECF.Framework.RT.ModuleLibrary.LPModules;
  15. namespace FutureEfemLib.LPs
  16. {
  17. public class LoadPortModule : LoadPortModuleBase, IE87CallBack
  18. {
  19. public enum STATE
  20. {
  21. NotInstall,
  22. NotConnected,
  23. Init,
  24. Idle,
  25. Homing,
  26. Loading,
  27. Unloading,
  28. Error,
  29. ReadingCarrierId,
  30. Clamp,
  31. Unclamp,
  32. Dock,
  33. Undock,
  34. OpenDoor,
  35. CloseDoor,
  36. Map,
  37. InTransfer,
  38. }
  39. public enum MSG
  40. {
  41. Disconnected,
  42. Connected,
  43. Home,
  44. Reset,
  45. Init,
  46. Error,
  47. Abort,
  48. InTransfer,
  49. TransferComplete,
  50. Load,
  51. Unload,
  52. ReadCarrierId,
  53. Clamp,
  54. Map,
  55. CloseDoor,
  56. OpenDoor,
  57. Undock,
  58. Dock,
  59. Unclamp,
  60. ToInit,
  61. ToIdle,
  62. }
  63. public override bool IsReady
  64. {
  65. get { return FsmState == (int)STATE.Idle && CheckAllMessageProcessed(); }
  66. }
  67. public override bool IsError
  68. {
  69. get { return FsmState == (int)STATE.Error; }
  70. }
  71. public override bool IsInit
  72. {
  73. get { return FsmState == (int)STATE.Init; }
  74. }
  75. public override bool IsLoaded
  76. {
  77. get { return LPDevice.DoorState ==FoupDoorState.Open; }
  78. }
  79. public override bool IsUnloaded
  80. {
  81. get { return LPDevice.DoorState ==FoupDoorState.Close; }
  82. }
  83. public override bool IsClamped
  84. {
  85. get { return LPDevice.ClampState == FoupClampState.Close; }
  86. }
  87. public override bool IsUnclamped
  88. {
  89. get { return LPDevice.ClampState == FoupClampState.Open; }
  90. }
  91. public event Action<string> OnEnterError;
  92. public FutureEfemLoadPort LPDevice
  93. {
  94. get
  95. {
  96. return _lpDevice;
  97. }
  98. }
  99. private RorzeEfem _efemDevice;
  100. private FutureEfemLoadPort _lpDevice;
  101. private LoadPortHomeRoutine _home;
  102. private LoadPortCloseDoorRoutine _closeDoor;
  103. private LoadPortClampRoutine _clamp;
  104. private LoadPortDockRoutine _dock;
  105. private LoadPortMapRoutine _map;
  106. private LoadPortOpenDoorRoutine _openDoor;
  107. private LoadPortReadCarrierIdRoutine _readCarrierId;
  108. private LoadPortGetMapInfoRoutine _MapDT;
  109. private LoadPortUnclampRoutine _unclamp;
  110. private LoadPortUndockRoutine _undock;
  111. private LoadPortLoadRoutine _load;
  112. private bool _isInit;
  113. private bool _jobDone;
  114. public LoadPortModule(ModuleName module) : base(25)
  115. {
  116. Name = module.ToString();
  117. Module = module.ToString();
  118. IsOnline = false;
  119. }
  120. public override bool Initialize()
  121. {
  122. InitRoutine();
  123. InitDevice();
  124. InitFsm();
  125. InitOp();
  126. InitData();
  127. return base.Initialize();
  128. }
  129. private void InitRoutine()
  130. {
  131. _home = new LoadPortHomeRoutine(this);
  132. _closeDoor = new LoadPortCloseDoorRoutine(this);
  133. _clamp = new LoadPortClampRoutine(this);
  134. _dock = new LoadPortDockRoutine(this);
  135. _map = new LoadPortMapRoutine(this);
  136. _openDoor = new LoadPortOpenDoorRoutine(this);
  137. _readCarrierId = new LoadPortReadCarrierIdRoutine(this);
  138. _unclamp = new LoadPortUnclampRoutine(this);
  139. _undock = new LoadPortUndockRoutine(this);
  140. _MapDT = new LoadPortGetMapInfoRoutine(this);
  141. _load = new LoadPortLoadRoutine(this);
  142. }
  143. public void InitDevice()
  144. {
  145. _efemDevice = DEVICE.GetDevice<RorzeEfem>($"{ModuleName.System}.{ModuleName.EFEM}");
  146. _lpDevice = DEVICE.GetDevice<FutureEfemLoadPort>($"{Module}");
  147. (_lpDevice as LoadPort).LPCallBack = this;
  148. }
  149. private void InitData()
  150. {
  151. DATA.Subscribe($"{Module}.Status", () => StringFsmStatus);
  152. DATA.Subscribe($"{Module}.IsOnline", () => IsOnline);
  153. DATA.Subscribe($"{Module}.JobDone", () =>
  154. {
  155. if (!_lpDevice.IsPlacement) _jobDone = false;
  156. if (!_jobDone || !_lpDevice.IsPlacement)
  157. return false;
  158. //if (SC.GetValue<int>("System.Job.BuzzerTimeWhenJobDone") >= 0
  159. // && _timerNotifyJobDone.ElapsedMilliseconds > SC.GetValue<int>("System.Job.BuzzerTimeWhenJobDone") * 1000)
  160. // return false;
  161. return _jobDone;
  162. });
  163. }
  164. private void InitOp()
  165. {
  166. OP.Subscribe($"{Name}.Home", (string cmd, object[] args) =>
  167. {
  168. return CheckToPostMessage((int)MSG.Home);
  169. });
  170. OP.Subscribe($"{Name}.Abort", (string cmd, object[] args) =>
  171. {
  172. return CheckToPostMessage((int)MSG.Abort);
  173. });
  174. OP.Subscribe($"{Name}.Reset", (string cmd, object[] args) =>
  175. {
  176. return CheckToPostMessage((int)MSG.Reset);
  177. });
  178. OP.Subscribe($"{Name}.ReadCarrierId", (string cmd, object[] args) =>
  179. {
  180. return CheckToPostMessage((int)MSG.ReadCarrierId);
  181. });
  182. OP.Subscribe($"{Name}.Load", (string cmd, object[] args) =>
  183. {
  184. return CheckToPostMessage((int)MSG.Load);
  185. });
  186. OP.Subscribe($"{Name}.Unload", (string cmd, object[] args) =>
  187. {
  188. return CheckToPostMessage((int)MSG.Unload);
  189. });
  190. OP.Subscribe($"{Name}.Clamp", (string cmd, object[] args) =>
  191. {
  192. return CheckToPostMessage((int)MSG.Clamp);
  193. });
  194. OP.Subscribe($"{Name}.Unclamp", (string cmd, object[] args) =>
  195. {
  196. return CheckToPostMessage((int)MSG.Unclamp);
  197. });
  198. OP.Subscribe($"{Name}.Dock", (string cmd, object[] args) =>
  199. {
  200. return CheckToPostMessage((int)MSG.Dock);
  201. });
  202. OP.Subscribe($"{Name}.Undock", (string cmd, object[] args) =>
  203. {
  204. return CheckToPostMessage((int)MSG.Undock);
  205. });
  206. OP.Subscribe($"{Name}.OpenDoor", (string cmd, object[] args) =>
  207. {
  208. return CheckToPostMessage((int)MSG.OpenDoor);
  209. });
  210. OP.Subscribe($"{Name}.CloseDoor", (string cmd, object[] args) =>
  211. {
  212. return CheckToPostMessage((int)MSG.CloseDoor);
  213. });
  214. OP.Subscribe($"{Name}.Map", (string cmd, object[] args) =>
  215. {
  216. return CheckToPostMessage((int)MSG.Map);
  217. });
  218. }
  219. private void InitFsm()
  220. {
  221. EnumLoop<STATE>.ForEach((item) =>
  222. {
  223. MapState((int)item, item.ToString());
  224. });
  225. EnumLoop<MSG>.ForEach((item) =>
  226. {
  227. MapMessage((int)item, item.ToString());
  228. });
  229. EnableFsm(50, IsInstalled ? STATE.Init : STATE.NotInstall);
  230. //Error
  231. AnyStateTransition(MSG.Error, FsmOnError, STATE.Error);
  232. Transition(STATE.Error, MSG.Reset, FsmReset, STATE.Idle);
  233. EnterExitTransition<STATE, FSM_MSG>(STATE.Error, FsmEnterError, FSM_MSG.NONE, FsmExitError);
  234. //Init
  235. Transition(STATE.Init, MSG.Home, FsmStartHome, STATE.Homing);
  236. Transition(STATE.Error, MSG.Home, FsmStartHome, STATE.Homing);
  237. Transition(STATE.Idle, MSG.Home, FsmStartHome, STATE.Homing);
  238. Transition(STATE.Homing, FSM_MSG.TIMER, FsmMonitorHomeTask, STATE.Idle);
  239. Transition(STATE.Homing, MSG.Error, null, STATE.Init);
  240. Transition(STATE.Homing, MSG.Abort, FsmAbortTask, STATE.Init);
  241. EnterExitTransition<STATE, FSM_MSG>(STATE.Idle, FsmEnterIdle, FSM_MSG.NONE, FsmExitIdle);
  242. AnyStateTransition(MSG.ToInit, FsmToInit, STATE.Init);
  243. AnyStateTransition(MSG.ToIdle, FsmToIdle, STATE.Idle);
  244. //load
  245. Transition(STATE.Idle, MSG.Load, FsmStartLoad, STATE.Loading);
  246. Transition(STATE.Loading, FSM_MSG.TIMER, FsmMonitorLoadTask, STATE.Idle);
  247. Transition(STATE.Loading, MSG.Abort, FsmAbortTask, STATE.Idle);
  248. //unload
  249. Transition(STATE.Idle, MSG.Unload, FsmStartUnload, STATE.Unloading);
  250. Transition(STATE.Unloading, FSM_MSG.TIMER, FsmMonitorTask, STATE.Idle);
  251. Transition(STATE.Unloading, MSG.Abort, FsmAbortTask, STATE.Idle);
  252. //read carrier id
  253. Transition(STATE.Idle, MSG.ReadCarrierId, FsmStartReadCarrierId, STATE.ReadingCarrierId);
  254. Transition(STATE.ReadingCarrierId, FSM_MSG.TIMER, FsmMonitorTask, STATE.Idle);
  255. Transition(STATE.ReadingCarrierId, MSG.Abort, FsmAbortTask, STATE.Idle);
  256. //clamp
  257. Transition(STATE.Idle, MSG.Clamp, FsmStartClamp, STATE.Clamp);
  258. Transition(STATE.Clamp, FSM_MSG.TIMER, FsmMonitorTask, STATE.Idle);
  259. Transition(STATE.Clamp, MSG.Abort, FsmAbortTask, STATE.Idle);
  260. //unclamp
  261. Transition(STATE.Idle, MSG.Unclamp, FsmStartUnclamp, STATE.Unclamp);
  262. Transition(STATE.Unclamp, FSM_MSG.TIMER, FsmMonitorTask, STATE.Idle);
  263. Transition(STATE.Unclamp, MSG.Abort, FsmAbortTask, STATE.Idle);
  264. //dock
  265. Transition(STATE.Idle, MSG.Dock, FsmStartDock, STATE.Dock);
  266. Transition(STATE.Dock, FSM_MSG.TIMER, FsmMonitorTask, STATE.Idle);
  267. Transition(STATE.Dock, MSG.Abort, FsmAbortTask, STATE.Idle);
  268. //undock
  269. Transition(STATE.Idle, MSG.Undock, FsmStartUndock, STATE.Undock);
  270. Transition(STATE.Undock, FSM_MSG.TIMER, FsmMonitorTask, STATE.Idle);
  271. Transition(STATE.Undock, MSG.Abort, FsmAbortTask, STATE.Idle);
  272. //open door
  273. Transition(STATE.Idle, MSG.OpenDoor, FsmStartOpenDoor, STATE.OpenDoor);
  274. Transition(STATE.OpenDoor, FSM_MSG.TIMER, FsmMonitorTask, STATE.Idle);
  275. Transition(STATE.OpenDoor, MSG.Abort, FsmAbortTask, STATE.Idle);
  276. //close door
  277. Transition(STATE.Idle, MSG.CloseDoor, FsmStartCloseDoor, STATE.CloseDoor);
  278. Transition(STATE.CloseDoor, FSM_MSG.TIMER, FsmMonitorTask, STATE.Idle);
  279. Transition(STATE.CloseDoor, MSG.Abort, FsmAbortTask, STATE.Idle);
  280. //map
  281. Transition(STATE.Idle, MSG.Map, FsmStartMap, STATE.Map);
  282. Transition(STATE.Map, FSM_MSG.TIMER, FsmMonitorTask, STATE.Idle);
  283. Transition(STATE.Map, MSG.Abort, FsmAbortTask, STATE.Idle);
  284. Transition(STATE.Idle, MSG.Disconnected, null, STATE.NotConnected);
  285. Transition(STATE.Idle, MSG.InTransfer, null, STATE.InTransfer);
  286. Transition(STATE.InTransfer, MSG.InTransfer, null, STATE.InTransfer);
  287. Transition(STATE.InTransfer, MSG.TransferComplete, null, STATE.Idle);
  288. Transition(STATE.InTransfer, MSG.Abort, null, STATE.Idle);
  289. Transition(STATE.NotConnected, MSG.Connected, null, STATE.Idle);
  290. }
  291. public override bool Home(out string reason)
  292. {
  293. if (!CheckToPostMessage((int)MSG.Home))
  294. {
  295. reason = $"Can not home in {StringFsmStatus} status";
  296. return false;
  297. }
  298. reason = string.Empty;
  299. return true;
  300. }
  301. public override void NoteJobStart()
  302. {
  303. _jobDone = false;
  304. }
  305. public override void NoteJobComplete()
  306. {
  307. _jobDone = true;
  308. }
  309. public override bool Load()
  310. {
  311. return CheckToPostMessage((int)MSG.Load);
  312. }
  313. public override bool Unload()
  314. {
  315. return CheckToPostMessage((int)MSG.Unload);
  316. }
  317. public override bool Clamp()
  318. {
  319. return CheckToPostMessage((int)MSG.Clamp);
  320. }
  321. public override bool Unclamp()
  322. {
  323. return CheckToPostMessage((int)MSG.Unclamp);
  324. }
  325. public void NotJobStart()
  326. {
  327. _lpDevice.SetIndicator(IndicatorType.Busy, IndicatorState.ON);
  328. }
  329. public void NotJobComplete()
  330. {
  331. _lpDevice.SetIndicator(IndicatorType.Busy, IndicatorState.OFF);
  332. _lpDevice.SetIndicator(IndicatorType.Complete, IndicatorState.ON);
  333. }
  334. public override void Reset()
  335. {
  336. if (IsError)
  337. {
  338. CheckToPostMessage((int)MSG.Reset);
  339. }
  340. }
  341. public override bool PrepareTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  342. {
  343. reason = string.Empty;
  344. return true;
  345. }
  346. public override bool TransferHandoff(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  347. {
  348. reason = string.Empty;
  349. return true;
  350. }
  351. public override bool PostTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  352. {
  353. reason = string.Empty;
  354. return true;
  355. }
  356. public override bool CheckReadyForTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType,
  357. out string reason)
  358. {
  359. return _lpDevice.IsEnableTransferWafer(out reason) && IsReady && _lpDevice.DoorState == FoupDoorState.Open;
  360. }
  361. public override bool CheckReadyForMap(ModuleName robot, Hand blade, out string reason)
  362. {
  363. return _lpDevice.IsEnableMapWafer(out reason) && IsReady && _lpDevice.DoorState == FoupDoorState.Open;
  364. }
  365. public override void NoteTransferStart(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
  366. {
  367. CheckToPostMessage(MSG.InTransfer);
  368. }
  369. public override void NoteTransferStop(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
  370. {
  371. if (FsmState == (int)STATE.InTransfer)
  372. CheckToPostMessage(MSG.TransferComplete);
  373. }
  374. public void CarrierArrive()
  375. {
  376. //_lpDevice.SetIndicator(IndicatorType.Busy, IndicatorState.OFF);
  377. //_lpDevice.SetIndicator(IndicatorType.Complete, IndicatorState.OFF);
  378. _jobDone = false;
  379. }
  380. public void CarrerRemove(string carrierID)
  381. {
  382. //_lpDevice.SetIndicator(IndicatorType.Busy, IndicatorState.OFF);
  383. //_lpDevice.SetIndicator(IndicatorType.Complete, IndicatorState.OFF);
  384. _jobDone = false;
  385. }
  386. public void CarrierIDReadSuccess(string carrierID)
  387. {
  388. }
  389. public void CarrierIDReadFail()
  390. {
  391. }
  392. public void MappingComplete(string carrierID, string slotmap)
  393. {
  394. }
  395. public void LoadportError(string errorcode)
  396. {
  397. }
  398. public void LoadComplete()
  399. {
  400. }
  401. public void UnloadComplete()
  402. {
  403. }
  404. public void OnLPHomed()
  405. {
  406. PostMsg(MSG.ToIdle);
  407. }
  408. public void OnE84HandoffStart(bool isload)
  409. {
  410. }
  411. public void OnE84HandoffComplete(bool isload)
  412. {
  413. }
  414. //重新连接了EFEM,重置数据
  415. public void ResetData()
  416. {
  417. _lpDevice.SetIndicator(IndicatorType.Busy, IndicatorState.OFF);
  418. _lpDevice.SetIndicator(IndicatorType.Complete, IndicatorState.OFF);
  419. _lpDevice.ResetData();
  420. }
  421. private bool FsmReset(object[] param)
  422. {
  423. if (!_efemDevice.Connection.IsConnected)
  424. {
  425. _efemDevice.Connect();
  426. return false;
  427. }
  428. if (!_isInit)
  429. {
  430. PostMsg(MSG.ToInit);
  431. return false;
  432. }
  433. if (_lpDevice.IsError)
  434. {
  435. EV.PostWarningLog(Module, $"{Module} in error, home to recover");
  436. PostMsg(MSG.ToInit);
  437. return false;
  438. }
  439. return true;
  440. }
  441. private bool FsmOnError(object[] param)
  442. {
  443. if (FsmState == (int)STATE.Error)
  444. {
  445. return false;
  446. }
  447. AbortRoutine();
  448. if (FsmState == (int)STATE.Init)
  449. return false;
  450. return true;
  451. }
  452. private bool FsmExitIdle(object[] param)
  453. {
  454. return true;
  455. }
  456. private bool FsmEnterIdle(object[] param)
  457. {
  458. return true;
  459. }
  460. private bool FsmExitError(object[] param)
  461. {
  462. return true;
  463. }
  464. private bool FsmEnterError(object[] param)
  465. {
  466. if (OnEnterError != null)
  467. OnEnterError(Module);
  468. return true;
  469. }
  470. private bool FsmAbortTask(object[] param)
  471. {
  472. AbortRoutine();
  473. return true;
  474. }
  475. private bool FsmStartHome(object[] param)
  476. {
  477. Result ret = StartRoutine(_home);
  478. if (ret == Result.FAIL || ret == Result.DONE)
  479. return false;
  480. _isInit = false;
  481. return ret == Result.RUN;
  482. }
  483. private bool FsmMonitorHomeTask(object[] param)
  484. {
  485. Result ret = MonitorRoutine();
  486. if (ret == Result.FAIL)
  487. {
  488. PostMsg(MSG.Error);
  489. return false;
  490. }
  491. if (ret == Result.DONE)
  492. {
  493. _isInit = true;
  494. return true;
  495. }
  496. return false;
  497. }
  498. private bool FsmToInit(object[] param)
  499. {
  500. return true;
  501. }
  502. private bool FsmToIdle(object[] param)
  503. {
  504. _lpDevice.Initalized = true;
  505. _lpDevice.OnHomed();
  506. return true;
  507. }
  508. private bool FsmMonitorLoadTask(object[] param)
  509. {
  510. Result ret = MonitorRoutine();
  511. if (ret == Result.FAIL)
  512. {
  513. PostMsg(MSG.Error);
  514. return false;
  515. }
  516. if (ret == Result.DONE)
  517. {
  518. IsOnline = true;
  519. _lpDevice.DockState = FoupDockState.Docked;
  520. LPDevice.OnLoaded();
  521. }
  522. return ret == Result.DONE;
  523. }
  524. private bool FsmMonitorTask(object[] param)
  525. {
  526. Result ret = MonitorRoutine();
  527. if (ret == Result.FAIL)
  528. {
  529. PostMsg(MSG.Error);
  530. return false;
  531. }
  532. if (ret == Result.DONE)
  533. {
  534. LPDevice.OnUnloaded();
  535. }
  536. return ret == Result.DONE;
  537. }
  538. private bool FsmStartLoad(object[] param)
  539. {
  540. //QueueRoutine.Clear();
  541. //QueueRoutine.Enqueue(_clamp);
  542. ////QueueRoutine.Enqueue(_dock);
  543. //QueueRoutine.Enqueue(_openDoor);
  544. ////QueueRoutine.Enqueue(_map);
  545. //QueueRoutine.Enqueue(_MapDT);
  546. //Result ret = StartRoutine();
  547. Result ret = StartRoutine(_load);
  548. if (ret == Result.FAIL || ret == Result.DONE)
  549. return false;
  550. return ret == Result.RUN;
  551. }
  552. private bool FsmStartUnload(object[] param)
  553. {
  554. IsOnline = false;
  555. QueueRoutine.Clear();
  556. QueueRoutine.Enqueue(_closeDoor);
  557. //QueueRoutine.Enqueue(_undock);
  558. //QueueRoutine.Enqueue(_unclamp);
  559. Result ret = StartRoutine();
  560. if (ret == Result.FAIL || ret == Result.DONE)
  561. return false;
  562. return ret == Result.RUN;
  563. }
  564. private bool FsmStartMap(object[] param)
  565. {
  566. Result ret = StartRoutine(_map);
  567. if (ret == Result.FAIL || ret == Result.DONE)
  568. return false;
  569. return ret == Result.RUN;
  570. }
  571. private bool FsmStartCloseDoor(object[] param)
  572. {
  573. Result ret = StartRoutine(_closeDoor);
  574. if (ret == Result.FAIL || ret == Result.DONE)
  575. return false;
  576. return ret == Result.RUN;
  577. }
  578. private bool FsmStartOpenDoor(object[] param)
  579. {
  580. Result ret = StartRoutine(_openDoor);
  581. if (ret == Result.FAIL || ret == Result.DONE)
  582. return false;
  583. return ret == Result.RUN;
  584. }
  585. private bool FsmStartUndock(object[] param)
  586. {
  587. Result ret = StartRoutine(_undock);
  588. if (ret == Result.FAIL || ret == Result.DONE)
  589. return false;
  590. return ret == Result.RUN;
  591. }
  592. private bool FsmStartDock(object[] param)
  593. {
  594. Result ret = StartRoutine(_dock);
  595. if (ret == Result.FAIL || ret == Result.DONE)
  596. return false;
  597. return ret == Result.RUN;
  598. }
  599. private bool FsmStartUnclamp(object[] param)
  600. {
  601. Result ret = StartRoutine(_unclamp);
  602. if (ret == Result.FAIL || ret == Result.DONE)
  603. return false;
  604. return ret == Result.RUN;
  605. }
  606. private bool FsmStartClamp(object[] param)
  607. {
  608. Result ret = StartRoutine(_clamp);
  609. if (ret == Result.FAIL || ret == Result.DONE)
  610. return false;
  611. return ret == Result.RUN;
  612. }
  613. private bool FsmStartReadCarrierId(object[] param)
  614. {
  615. Result ret = StartRoutine(_readCarrierId);
  616. if (ret == Result.FAIL || ret == Result.DONE)
  617. return false;
  618. return ret == Result.RUN;
  619. }
  620. }
  621. }