VceEntity.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. using Aitex.Core.RT.DataCenter;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Core.RT.Fsm;
  4. using Aitex.Core.RT.Log;
  5. using Aitex.Core.RT.OperationCenter;
  6. using Aitex.Core.RT.SCCore;
  7. using Aitex.Core.Util;
  8. using Aitex.Core.Utilities;
  9. using MECF.Framework.Common.Equipment;
  10. using MECF.Framework.Common.Schedulers;
  11. using MECF.Framework.Common.SubstrateTrackings;
  12. using MECF.Framework.RT.ModuleLibrary.VceModules;
  13. using System;
  14. using System.Collections.Generic;
  15. using System.Linq;
  16. using System.Reflection;
  17. using System.Text;
  18. using System.Threading.Tasks;
  19. using System.Windows;
  20. using Venus_Core;
  21. using Venus_RT.Devices;
  22. using Venus_RT.Devices.SMIF;
  23. using Venus_RT.Devices.VCE;
  24. using Venus_RT.Modules.PMs;
  25. using Venus_RT.Modules.TM;
  26. using Venus_RT.Modules.TM.VenusEntity;
  27. namespace Venus_RT.Modules.VCE
  28. {
  29. #region 状态和消息
  30. public enum VceMSG
  31. {
  32. Home,
  33. Error,
  34. DoorOpen,
  35. DoorClose,
  36. Map,
  37. ReadMap,
  38. Load,
  39. UnLoad,
  40. LoadPrepare,
  41. LoadWithSMIF,
  42. UnLoadWithSMIF,
  43. Reset,
  44. Goto,
  45. GotoLP,
  46. SafeLoad,
  47. SafeUnload,
  48. Pump,
  49. Vent,
  50. Abort,
  51. None,
  52. ClearError
  53. }
  54. #endregion
  55. public class VceEntity : Entity, IEntity, IModuleEntity
  56. {
  57. private ModuleName _modulename;
  58. private readonly VceModuleBase _vce;
  59. private readonly ISMIF _smif;
  60. private bool _CassetteArrive;
  61. public bool IsIdle => fsm.State == (int)VceSTATE.Idle;
  62. public bool IsInit => fsm.State == (int)VceSTATE.Init || fsm.State == (int)VceSTATE.Unknown;
  63. public bool IsBusy => !IsInit && !IsError && !IsIdle;
  64. public bool IsError => fsm.State == (int)VceSTATE.Error;
  65. public bool VCEOutDoorClosed => !_vce.OutDoorIsOpen;
  66. public bool CassetteArrive => _CassetteArrive;
  67. public int CurrentSlot => currentSlot;
  68. private int currentSlot;
  69. private int targetSlot;
  70. private LoadRoutine _loadRoutine;
  71. private LoadPrepareRoutine _prepareRoutine;
  72. private UnloadRoutine _unloadRoutine;
  73. private LoadWithSMIFRoutine _loadwithSMIFRoutine;
  74. private UnloadWithSMIFRoutine _unloadwithSMIFRoutine;
  75. private readonly SEMFPumpRoutine _pumpRoutine;
  76. private readonly SEMFVentRoutine _ventRoutine;
  77. public VceEntity(ModuleName moduleName)
  78. {
  79. currentSlot = 0;
  80. _modulename = moduleName;
  81. _vce = new HongHuVce(25, _modulename);
  82. _smif = new FortrendPLUS500(_modulename);
  83. _loadRoutine = new LoadRoutine(_modulename, _vce);
  84. _prepareRoutine = new LoadPrepareRoutine(_modulename, _vce);
  85. _unloadRoutine = new UnloadRoutine(_modulename, _vce);
  86. _loadwithSMIFRoutine = new LoadWithSMIFRoutine(_modulename, _vce, _smif);
  87. _unloadwithSMIFRoutine = new UnloadWithSMIFRoutine(_modulename, _vce, _smif);
  88. _pumpRoutine = new SEMFPumpRoutine(DEVICE.GetDevice<HongHuTM>("SETM"), _modulename);
  89. _ventRoutine = new SEMFVentRoutine(DEVICE.GetDevice<HongHuTM>("SETM"), _modulename);
  90. InitFsmMap();
  91. }
  92. protected override bool Init()
  93. {
  94. DATA.Subscribe($"{_modulename}.VCEOutDoorClosed", () => !VCEOutDoorClosed);
  95. DATA.Subscribe($"{_modulename}.CurrentSlot", () => currentSlot);
  96. DATA.Subscribe($"{_modulename}.FsmState", () => ((VceSTATE)fsm.State).ToString());
  97. DATA.Subscribe($"{_modulename}.CassetteArrive", () => CassetteArrive);
  98. //DATA.Subscribe($"{_modulename}.IsRunning", () => IsIdle);
  99. OP.Subscribe($"{_modulename}.HOME", (cmd, args) => { PostMsg(VceMSG.Home); return true; });
  100. OP.Subscribe($"{_modulename}.DoorOpen", (cmd, args) => { PostMsg(VceMSG.DoorOpen); return true; });
  101. OP.Subscribe($"{_modulename}.DoorClose", (cmd, args) => { PostMsg(VceMSG.DoorClose); return true; });
  102. OP.Subscribe($"{_modulename}.Map", (cmd, args) => { PostMsg(VceMSG.Map); return true; });
  103. OP.Subscribe($"{_modulename}.ReadMap", (cmd, args) => { PostMsg(VceMSG.ReadMap); return true; });
  104. OP.Subscribe($"{_modulename}.Load", (cmd, args) => { PostMsg(VceMSG.Load); return true; });
  105. OP.Subscribe($"{_modulename}.UnLoad", (cmd, args) => { PostMsg(VceMSG.UnLoad); return true; });
  106. OP.Subscribe($"{_modulename}.Reset", (cmd, args) => { PostMsg(VceMSG.Reset); return true; });
  107. OP.Subscribe($"{_modulename}.Goto", (cmd, args) => { PostMsg(VceMSG.Goto, args[0]); return true; });
  108. OP.Subscribe($"{_modulename}.GotoLP", (cmd, args) => { PostMsg(VceMSG.GotoLP); return true; });
  109. OP.Subscribe($"{_modulename}.Abort", (cmd, args) => { PostMsg(VceMSG.Abort); return true; });
  110. OP.Subscribe($"{_modulename}.PumpDown", (cmd, args) => { PostMsg(VceMSG.Pump); return true; });
  111. OP.Subscribe($"{_modulename}.Vent", (cmd, args) => { PostMsg(VceMSG.Vent); return true; });
  112. OP.Subscribe($"{_modulename}.ClearError", (cmd, args) => { PostMsg(VceMSG.ClearError); return true; });
  113. OP.Subscribe($"{_modulename}.LoadPrepare", (cmd, args) => { PostMsg(VceMSG.LoadPrepare); return true; });
  114. OP.Subscribe($"{_modulename}.SafeLoad", (cmd, args) => { PostMsg(VceMSG.SafeLoad); return true; });
  115. OP.Subscribe($"{_modulename}.SafeUnload", (cmd, args) => { PostMsg(VceMSG.SafeUnload); return true; });
  116. OP.Subscribe($"{_modulename}.LoadWithSMIF", (cmd, args) => { PostMsg(VceMSG.LoadWithSMIF); return true; });
  117. OP.Subscribe($"{_modulename}.UnLoadWithSMIF", (cmd, args) => { PostMsg(VceMSG.UnLoadWithSMIF); return true; });
  118. return true;
  119. }
  120. /// <summary>
  121. /// 定义状态机的迁移表
  122. /// </summary>
  123. private void InitFsmMap()
  124. {
  125. fsm = new StateMachine<VceEntity>(_modulename.ToString(), (int)VceSTATE.Init, 50);
  126. fsm.EnableRepeatedMsg(true);
  127. AnyStateTransition(VceMSG.Error, fnError, VceSTATE.Error);
  128. AnyStateTransition(VceMSG.Abort, fnAbort, VceSTATE.Idle);
  129. AnyStateTransition(VceMSG.Home, fnStartHome, VceSTATE.Homing);
  130. //HOME init->homing idle->homing
  131. Transition(VceSTATE.Init, VceMSG.Home, fnStartHome, VceSTATE.Homing);
  132. Transition(VceSTATE.Idle, VceMSG.Home, fnStartHome, VceSTATE.Homing);
  133. Transition(VceSTATE.Error, VceMSG.Home, fnStartHome, VceSTATE.Homing);
  134. Transition(VceSTATE.Homing, FSM_MSG.TIMER, fnHomeTimeout, VceSTATE.Idle);
  135. //clear Error
  136. Transition(VceSTATE.Error, VceMSG.ClearError, fnStartClearError,VceSTATE.ClearError);
  137. Transition(VceSTATE.ClearError, FSM_MSG.TIMER, fnClearErrorTimeout, VceSTATE.Idle);
  138. //Open Door 开门
  139. Transition(VceSTATE.Idle, VceMSG.DoorOpen, fnStartOpenDoor, VceSTATE.DoorOpenning);
  140. Transition(VceSTATE.DoorOpenning, FSM_MSG.TIMER, fnOpenDoorTimeout, VceSTATE.Idle);
  141. //Close Door 关门
  142. Transition(VceSTATE.Idle, VceMSG.DoorClose, fnStartCloseDoor, VceSTATE.DoorClosing);
  143. Transition(VceSTATE.DoorClosing, FSM_MSG.TIMER, fnCloseDoorTimeout, VceSTATE.Idle);
  144. //Map 扫片
  145. Transition(VceSTATE.Idle, VceMSG.Map, fnStartMapping, VceSTATE.Mapping);
  146. Transition(VceSTATE.Mapping, FSM_MSG.TIMER, fnMappingTimeout, VceSTATE.Idle);
  147. //Load 取cassette
  148. Transition(VceSTATE.Idle, VceMSG.Load, fnStartLoading, VceSTATE.Loading);
  149. Transition(VceSTATE.Loading, FSM_MSG.TIMER, fnLoadingTimeout, VceSTATE.Idle);
  150. //UnLoad 放cassette
  151. Transition(VceSTATE.Idle, VceMSG.UnLoad, fnStartUnLoading, VceSTATE.UnLoading);
  152. Transition(VceSTATE.UnLoading, FSM_MSG.TIMER, fnUnLoadingTimeout, VceSTATE.Idle);
  153. //Goto 指定槽对准窗口
  154. Transition(VceSTATE.Idle, VceMSG.Goto, fnStartGoto, VceSTATE.Goting);
  155. Transition(VceSTATE.Goting, FSM_MSG.TIMER, fnGotingTimeout, VceSTATE.Idle);
  156. //ReadMap
  157. Transition(VceSTATE.Idle, VceMSG.ReadMap, fnStartReadingMap, VceSTATE.ReadingMap);
  158. Transition(VceSTATE.ReadingMap, FSM_MSG.TIMER, fnReadingMapTimeout, VceSTATE.Idle);
  159. //Load Prepare
  160. Transition(VceSTATE.Idle, VceMSG.LoadPrepare, fnStartLoadPrepare, VceSTATE.LoadPreparing);
  161. Transition(VceSTATE.LoadPreparing, FSM_MSG.TIMER, fnLoadingPrepareTimeout, VceSTATE.Idle);
  162. //Safe Load
  163. Transition(VceSTATE.Idle, VceMSG.SafeLoad, fnStartSafeLoad, VceSTATE.SafeLoading);
  164. Transition(VceSTATE.SafeLoading, FSM_MSG.TIMER, fnSafeLoadTimeout, VceSTATE.Idle);
  165. //LoadWithSMIF => LoadPrepare & SMIF Load & Load
  166. Transition(VceSTATE.Idle, VceMSG.LoadWithSMIF, fnStartLoadWithSMIF, VceSTATE.LoadingWithSMIF);
  167. Transition(VceSTATE.LoadingWithSMIF, FSM_MSG.TIMER, fnLoadWithSMIFTimeout, VceSTATE.Idle);
  168. //Safe UnLoad
  169. Transition(VceSTATE.Idle, VceMSG.SafeUnload, fnStartSafeUnLoad, VceSTATE.SafeUnloading);
  170. Transition(VceSTATE.SafeUnloading, FSM_MSG.TIMER, fnSafeUnLoadTimeout, VceSTATE.Idle);
  171. //UnLoad With SMIF => UnLoad with smif
  172. Transition(VceSTATE.Idle, VceMSG.UnLoadWithSMIF, fnStartUnLoadWithSMIF, VceSTATE.UnLoadingWithSMIF);
  173. Transition(VceSTATE.UnLoadingWithSMIF, FSM_MSG.TIMER, fnUnLoadWithSMIFTimeout, VceSTATE.Idle);
  174. //Goto LP
  175. Transition(VceSTATE.Idle, VceMSG.GotoLP, fnStartGotoLP, VceSTATE.GotingLP);
  176. Transition(VceSTATE.GotingLP, FSM_MSG.TIMER, fnGotoLPTimeout, VceSTATE.Idle);
  177. //Pump
  178. Transition(VceSTATE.Idle, VceMSG.Pump, fnStartPump, VceSTATE.Pumping);
  179. Transition(VceSTATE.Pumping, FSM_MSG.TIMER, fnPumpTimeout, VceSTATE.Idle);
  180. Transition(VceSTATE.Pumping, VceMSG.Abort, fnAbortPump, VceSTATE.Idle);
  181. //Vent
  182. Transition(VceSTATE.Idle, VceMSG.Vent, fnStartVent, VceSTATE.Venting);
  183. Transition(VceSTATE.Venting, FSM_MSG.TIMER, fnVentTimeout, VceSTATE.Idle);
  184. Transition(VceSTATE.Venting, VceMSG.Abort, fnAbortVent, VceSTATE.Idle);
  185. EnumLoop<VceSTATE>.ForEach((item) => { fsm.MapState((int)item, item.ToString()); });
  186. EnumLoop<VceMSG>.ForEach((item) => { fsm.MapMessage((int)item, item.ToString()); });
  187. Running = true;
  188. }
  189. private bool fnAbortVent(object[] param)
  190. {
  191. _ventRoutine.Abort();
  192. return true;
  193. }
  194. private bool fnVentTimeout(object[] param)
  195. {
  196. RState ret = _ventRoutine.Monitor();
  197. if (ret == RState.Timeout || ret == RState.Failed)
  198. {
  199. PostMsg(VceMSG.Error);
  200. return false;
  201. }
  202. return ret == RState.End;
  203. }
  204. private bool fnStartVent(object[] param)
  205. {
  206. return _ventRoutine.Start(param) == RState.Running;
  207. }
  208. private bool fnAbortPump(object[] param)
  209. {
  210. _pumpRoutine.Abort();
  211. return true;
  212. }
  213. private bool fnPumpTimeout(object[] param)
  214. {
  215. RState ret = _pumpRoutine.Monitor();
  216. if (ret == RState.Timeout || ret == RState.Failed)
  217. {
  218. PostMsg(VceMSG.Error);
  219. return false;
  220. }
  221. return ret == RState.End;
  222. }
  223. private bool fnStartPump(object[] param)
  224. {
  225. return _pumpRoutine.Start(param) == RState.Running;
  226. }
  227. private bool fnGotoLPTimeout(object[] param)
  228. {
  229. if (_vce.Status == RState.Timeout || _vce.Status == RState.Failed)
  230. {
  231. PostMsg(VceMSG.Error);
  232. return false;
  233. }
  234. if (_vce.Status == RState.End)
  235. {
  236. currentSlot = targetSlot;
  237. }
  238. return _vce.Status == RState.End;
  239. }
  240. private bool fnStartGotoLP(object[] param)
  241. {
  242. if (_vce.GotoLP())
  243. {
  244. targetSlot = -1;
  245. return true;
  246. }
  247. else
  248. return false;
  249. }
  250. private bool fnSafeUnLoadTimeout(object[] param)
  251. {
  252. RState ret = _unloadRoutine.Monitor();
  253. if (ret == RState.Timeout || ret == RState.Failed)
  254. {
  255. PostMsg(VceMSG.Error);
  256. return false;
  257. }
  258. if (ret == RState.End)
  259. {
  260. _CassetteArrive = false;
  261. WaferManager.Instance.DeleteWafer(_modulename, 0, 25);
  262. }
  263. return ret == RState.End;
  264. }
  265. private bool fnStartClearError(object[] param)
  266. {
  267. if (_vce.ClearError())
  268. {
  269. return true;
  270. }
  271. else
  272. return false;
  273. }
  274. private bool fnClearErrorTimeout(object[] param)
  275. {
  276. if (_vce.Status == RState.Timeout || _vce.Status == RState.Failed)
  277. {
  278. PostMsg(VceMSG.Error);
  279. return false;
  280. }
  281. if (_vce.Status == RState.End)
  282. {
  283. currentSlot = targetSlot;
  284. }
  285. return _vce.Status == RState.End;
  286. }
  287. private bool fnStartSafeUnLoad(object[] param)
  288. {
  289. return _unloadRoutine.Start(param) == RState.Running;
  290. }
  291. private bool fnSafeLoadTimeout(object[] param)
  292. {
  293. RState ret = _loadRoutine.Monitor();
  294. if (ret == RState.Timeout || ret == RState.Failed)
  295. {
  296. PostMsg(VceMSG.Error);
  297. return false;
  298. }
  299. if (ret == RState.End)
  300. {
  301. _CassetteArrive = true;
  302. }
  303. return ret == RState.End;
  304. }
  305. private bool fnStartLoadWithSMIF(object[] param)
  306. {
  307. return _loadwithSMIFRoutine.Start(param) == RState.Running;
  308. }
  309. private bool fnLoadWithSMIFTimeout(object[] param)
  310. {
  311. RState ret = _loadwithSMIFRoutine.Monitor();
  312. if (ret == RState.Timeout || ret == RState.Failed)
  313. {
  314. PostMsg(VceMSG.Error);
  315. return false;
  316. }
  317. if (ret == RState.End)
  318. {
  319. _CassetteArrive = true;
  320. }
  321. return ret == RState.End;
  322. }
  323. private bool fnStartUnLoadWithSMIF(object[] param)
  324. {
  325. return _unloadwithSMIFRoutine.Start(param) == RState.Running;
  326. }
  327. private bool fnUnLoadWithSMIFTimeout(object[] param)
  328. {
  329. RState ret = _unloadwithSMIFRoutine.Monitor();
  330. if (ret == RState.Timeout || ret == RState.Failed)
  331. {
  332. PostMsg(VceMSG.Error);
  333. return false;
  334. }
  335. if (ret == RState.End)
  336. {
  337. _CassetteArrive = false;
  338. WaferManager.Instance.DeleteWafer(_modulename, 0, 25);
  339. }
  340. return ret == RState.End;
  341. }
  342. private bool fnStartSafeLoad(object[] param)
  343. {
  344. return _loadRoutine.Start(param) == RState.Running;
  345. }
  346. private bool fnLoadingPrepareTimeout(object[] param)
  347. {
  348. RState ret = _prepareRoutine.Monitor();
  349. if (ret == RState.Timeout || ret == RState.Failed)
  350. {
  351. PostMsg(VceMSG.Error);
  352. return false;
  353. }
  354. return ret == RState.End;
  355. }
  356. private bool fnStartLoadPrepare(object[] param)
  357. {
  358. return _prepareRoutine.Start(param) == RState.Running;
  359. }
  360. private bool fnReadingMapTimeout(object[] param)
  361. {
  362. if (_vce.Status == RState.Timeout || _vce.Status == RState.Failed)
  363. {
  364. PostMsg(VceMSG.Error);
  365. return false;
  366. }
  367. return _vce.Status == RState.End;
  368. }
  369. private bool fnStartReadingMap(object[] param)
  370. {
  371. return _vce.ReadMap();
  372. }
  373. //急停
  374. private bool fnAbort(object[] param)
  375. {
  376. return true;
  377. }
  378. //升降到槽位
  379. private bool fnStartGoto(object[] param)
  380. {
  381. if (_vce.Goto(Convert.ToInt32(param[0])))
  382. {
  383. targetSlot = Convert.ToInt32(param[0]);
  384. return true;
  385. }
  386. else
  387. return false;
  388. }
  389. private bool fnGotingTimeout(object[] param)
  390. {
  391. if (_vce.Status == RState.Timeout || _vce.Status == RState.Failed)
  392. {
  393. PostMsg(VceMSG.Error);
  394. return false;
  395. }
  396. if(_vce.Status == RState.End)
  397. currentSlot = targetSlot;
  398. return _vce.Status == RState.End;
  399. }
  400. private bool fnError(object[] param)
  401. {
  402. return true;
  403. }
  404. private bool fnStartHome(object[] param)
  405. {
  406. return _vce.HomeALL();
  407. }
  408. private bool fnHomeTimeout(object[] param)
  409. {
  410. if (_vce.Status == RState.Timeout || _vce.Status == RState.Failed)
  411. {
  412. PostMsg(VceMSG.Error);
  413. return false;
  414. }
  415. return _vce.Status == RState.End;
  416. }
  417. private bool fnStartOpenDoor(object[] param)
  418. {
  419. if (Singleton<RouteManager>.Instance.seTM.VCEIsATM && Singleton<RouteManager>.Instance.seTM.VCEPressure >= SC.GetValue<int>($"{_modulename}.OutDoorOpenPressure"))
  420. {
  421. return _vce.OpenDoor();
  422. }
  423. else
  424. {
  425. LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _modulename, $"{_modulename} is not ATM or Pressure not arrive {SC.GetValue<int>($"{_modulename}.OutDoorOpenPressure")}");
  426. return false;
  427. }
  428. }
  429. private bool fnOpenDoorTimeout(object[] param)
  430. {
  431. if (_vce.Status == RState.Timeout || _vce.Status == RState.Failed)
  432. {
  433. PostMsg(VceMSG.Error);
  434. return false;
  435. }
  436. return _vce.Status == RState.End;
  437. }
  438. private bool fnStartCloseDoor(object[] param)
  439. {
  440. return _vce.CloseDoor();
  441. }
  442. private bool fnCloseDoorTimeout(object[] param)
  443. {
  444. if (_vce.Status == RState.Timeout || _vce.Status == RState.Failed)
  445. {
  446. PostMsg(VceMSG.Error);
  447. return false;
  448. }
  449. return _vce.Status == RState.End;
  450. }
  451. private bool fnStartMapping(object[] param)
  452. {
  453. return _vce.Map();
  454. }
  455. private bool fnMappingTimeout(object[] param)
  456. {
  457. if(_vce.Status == RState.Timeout || _vce.Status == RState.Failed)
  458. {
  459. PostMsg(VceMSG.Error);
  460. return false;
  461. }
  462. return _vce.Status == RState.End;
  463. }
  464. private bool fnStartLoading(object[] param)
  465. {
  466. return _vce.Load();
  467. }
  468. private bool fnLoadingTimeout(object[] param)
  469. {
  470. if (_vce.Status == RState.Timeout || _vce.Status == RState.Failed)
  471. {
  472. PostMsg(VceMSG.Error);
  473. return false;
  474. }
  475. return _vce.Status == RState.End;
  476. }
  477. private bool fnStartUnLoading(object[] param)
  478. {
  479. return _vce.UnLoad();
  480. }
  481. private bool fnUnLoadingTimeout(object[] param)
  482. {
  483. if (_vce.Status == RState.Timeout || _vce.Status == RState.Failed)
  484. {
  485. PostMsg(VceMSG.Error);
  486. return false;
  487. }
  488. return _vce.Status == RState.End;
  489. }
  490. public bool Check(int msg, out string reason, params object[] args)
  491. {
  492. reason = "";
  493. return true;
  494. }
  495. public int Invoke(string function, params object[] args)
  496. {
  497. switch (function)
  498. {
  499. case "Home":
  500. CheckToPostMessage((int)VceMSG.Home);
  501. return (int)VceMSG.Home;
  502. }
  503. return (int)VceMSG.None;
  504. }
  505. public bool CheckToPostMessage(int msg, params object[] args)
  506. {
  507. if (!fsm.FindTransition(fsm.State, msg))
  508. {
  509. LOG.Write(eEvent.WARN_FSM_WARN, _modulename, $"{_modulename} is in {(VceSTATE)fsm.State} state,can not do {(VceMSG)msg}");
  510. return false;
  511. }
  512. Running = true;
  513. fsm.PostMsg(msg, args);
  514. return true;
  515. }
  516. public bool CheckAcked(int msg)
  517. {
  518. return fsm.CheckExecuted(msg);
  519. }
  520. public bool IsPrepareTransferReady(ModuleName module, EnumTransferType transferType, int slot)
  521. {
  522. return false;
  523. }
  524. }
  525. }