PlatingCellEntity.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. using Aitex.Core.Common;
  2. using Aitex.Core.RT.DataCenter;
  3. using Aitex.Core.RT.Device;
  4. using Aitex.Core.RT.Fsm;
  5. using Aitex.Core.RT.Log;
  6. using Aitex.Core.RT.OperationCenter;
  7. using Aitex.Core.RT.RecipeCenter;
  8. using Aitex.Core.RT.SCCore;
  9. using Aitex.Core.Util;
  10. using Aitex.Core.Utilities;
  11. using CyberX12_RT.Modules.VpwCell;
  12. using MECF.Framework.Common.Equipment;
  13. using MECF.Framework.Common.Persistent.Reservoirs;
  14. using MECF.Framework.Common.ProcessCell;
  15. using MECF.Framework.Common.RecipeCenter;
  16. using MECF.Framework.Common.Routine;
  17. using MECF.Framework.Common.SubstrateTrackings;
  18. using MECF.Framework.Common.ToolLayout;
  19. using MECF.Framework.RT.Core.Equipments;
  20. using PunkHPX8_Core;
  21. using PunkHPX8_RT.Devices.PlatingCell;
  22. using PunkHPX8_RT.Devices.PowerSupplier;
  23. using PunkHPX8_RT.Devices.Reservoir;
  24. using PunkHPX8_RT.Devices.Temperature;
  25. using PunkHPX8_RT.Modules.Reservoir;
  26. using PunkHPX8_RT.Modules.VpwCell;
  27. using PunkHPX8_RT.Modules.VpwMain;
  28. using System;
  29. using System.Collections.Generic;
  30. using System.Linq;
  31. using System.Text;
  32. using System.Threading.Tasks;
  33. namespace PunkHPX8_RT.Modules.PlatingCell
  34. {
  35. public class PlatingCellEntity : Entity, IEntity, IModuleEntity
  36. {
  37. #region 常量
  38. private const string STRATUS = "Stratus";
  39. private const string AUTO = "Auto";
  40. private const string MANUAL = "Manual";
  41. private const string DISABLED = "Disabled";
  42. private const string ENGINEERING = "Engineering";
  43. private const string PRODUCTION = "Production";
  44. #endregion
  45. #region 内部变量
  46. /// <summary>
  47. /// 持久化数值
  48. /// </summary>
  49. private PlatingCellPersistentValue _persistentValue;
  50. /// <summary>
  51. /// 当前recipe
  52. /// </summary>
  53. private DepRecipe _currentRecipe;
  54. /// <summary>
  55. /// recipe时间
  56. /// </summary>
  57. private int _recipeTime;
  58. /// <summary>
  59. /// 循环次数
  60. /// </summary>
  61. private int _cycle = 0;
  62. /// <summary>
  63. /// 已经完成的Cycle次数
  64. /// </summary>
  65. private int _achievedCycle = 0;
  66. /// <summary>
  67. /// c&m Initialize routine
  68. /// </summary>
  69. private PlatingCellInitializeRoutine _initializeRoutine;
  70. /// <summary>
  71. /// CCR routine
  72. /// </summary>
  73. private PlatingCellCCRRoutine _platingCellCRRoutine;
  74. /// <summary>
  75. /// Run recipe routine
  76. /// </summary>
  77. private PlatingCellRunRecipeRoutine _runRecipeRoutine;
  78. /// <summary>
  79. /// Unload Routine
  80. /// </summary>
  81. private PlatingCellUnloadRoutine _unloadRoutine;
  82. /// <summary>
  83. /// 工艺当前执行小步骤
  84. /// </summary>
  85. private string _currentStepState = "Init";
  86. #endregion
  87. #region 属性
  88. /// <summary>
  89. /// 模块名称
  90. /// </summary>
  91. public ModuleName Module { get; private set; }
  92. /// <summary>
  93. /// 是否Init
  94. /// </summary>
  95. public bool IsInit
  96. {
  97. get { return fsm.State == (int)PlatingCellState.Init; }
  98. }
  99. /// <summary>
  100. /// 是否Idle
  101. /// </summary>
  102. public bool IsIdle
  103. {
  104. get
  105. {
  106. return fsm.State == (int)PlatingCellState.Idle;
  107. }
  108. }
  109. /// <summary>
  110. /// 是否错误
  111. /// </summary>
  112. public bool IsError
  113. {
  114. get { return fsm.State == (int)PlatingCellState.Error; }
  115. }
  116. /// <summary>
  117. /// 正在忙碌
  118. /// </summary>
  119. public bool IsBusy
  120. {
  121. get { return fsm.State == (int)PlatingCellState.Initializing; }
  122. }
  123. /// <summary>
  124. /// 已完成的RunRecipeCycle次数
  125. /// </summary>
  126. public int AchievedCycle { get { return _achievedCycle; } }
  127. /// <summary>
  128. /// 化学液
  129. /// </summary>
  130. public string Chemistry
  131. {
  132. get { return _currentRecipe != null ? _currentRecipe.Chemistry : ""; }
  133. }
  134. /// <summary>
  135. /// 是否禁用
  136. /// </summary>
  137. public bool IsDisable { get { return _persistentValue == null || _persistentValue.OperatingMode == DISABLED; } }
  138. /// <summary>
  139. /// 自动模式
  140. /// </summary>
  141. public bool IsAuto { get { return _persistentValue != null && _persistentValue.OperatingMode == AUTO; } }
  142. /// <summary>
  143. /// 自动模式
  144. /// </summary>
  145. public bool IsManual { get { return _persistentValue != null && _persistentValue.OperatingMode == MANUAL; } }
  146. /// <summary>
  147. /// 是否为工程模式
  148. /// </summary>
  149. public bool IsEngineering { get { return _persistentValue != null && _persistentValue.RecipeOperatingMode == ENGINEERING; } }
  150. /// <summary>
  151. /// 是否为产品模式
  152. /// </summary>
  153. public bool IsProduction { get { return _persistentValue != null && _persistentValue.RecipeOperatingMode == PRODUCTION; } }
  154. /// <summary>
  155. /// 当前状态机状态
  156. /// </summary>
  157. public int State { get { return fsm.State; } }
  158. /// <summary>
  159. /// 是否初始化完成
  160. /// </summary>
  161. public bool IsInitialized { get { return fsm.State >= (int)PlatingCellState.Initialized; } }
  162. /// <summary>
  163. /// Reservoir项
  164. /// </summary>
  165. private ReservoirItem _reservoirItem;
  166. /// <summary>
  167. /// Wafer信息
  168. /// </summary>
  169. public WaferInfo WaferInfo { get { return WaferManager.Instance.GetWafer(Module,0); } }
  170. /// <summary>
  171. /// 当前Metal设置的WaferSize
  172. /// </summary>
  173. public int MetalWaferSize { get { return _persistentValue.PlatingCellWaferSize; } }
  174. /// <summary>
  175. /// 当前工步
  176. /// </summary>
  177. public string CurrentStepState { get { return _currentStepState; } }
  178. #endregion
  179. /// <summary>
  180. /// 构造函数
  181. /// </summary>
  182. /// <param name="module"></param>
  183. public PlatingCellEntity(ModuleName module)
  184. {
  185. this.Module = module;
  186. InitialFsm();
  187. }
  188. /// <summary>
  189. /// 初始化
  190. /// </summary>
  191. /// <returns></returns>
  192. protected override bool Init()
  193. {
  194. WaferManager.Instance.SubscribeLocation(Module, 1);
  195. InitializeRoutine();
  196. InitializeDATA();
  197. InitializeOperation();
  198. InitializeParameter();
  199. return true;
  200. }
  201. /// <summary>
  202. /// 初始化参数
  203. /// </summary>
  204. private void InitializeParameter()
  205. {
  206. _persistentValue = PlatingCellPersistentManager.Instance.GetPlatingCellPersistentValue(Module.ToString());
  207. if (_persistentValue == null)
  208. {
  209. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module.ToString(), "Persistent Value Object is not exist");
  210. }
  211. }
  212. /// <summary>
  213. /// 初始化Routine
  214. /// </summary>
  215. private void InitializeRoutine()
  216. {
  217. _initializeRoutine = new PlatingCellInitializeRoutine(Module.ToString());
  218. _platingCellCRRoutine = new PlatingCellCCRRoutine(Module.ToString());
  219. _runRecipeRoutine=new PlatingCellRunRecipeRoutine(Module.ToString());
  220. _unloadRoutine=new PlatingCellUnloadRoutine(Module.ToString());
  221. }
  222. /// <summary>
  223. /// 初始化DATA
  224. /// </summary>
  225. private void InitializeDATA()
  226. {
  227. DATA.Subscribe($"{Module}.FsmState", () => ((PlatingCellState)fsm.State).ToString(), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  228. DATA.Subscribe($"{Module}.CurrentRecipe", () => _currentRecipe != null ? _currentRecipe.Ppid : "", SubscriptionAttribute.FLAG.IgnoreSaveDB);
  229. DATA.Subscribe($"{Module}.TotalTime", () => _recipeTime, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  230. DATA.Subscribe($"{Module}.TimeRemain", () => _recipeTime != 0 && _runRecipeRoutine != null ? (_recipeTime - Math.Round((double)_runRecipeRoutine.ElapsedMilliseconds / 1000, 0)) : 0, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  231. DATA.Subscribe($"{Module}.Chemistry", () => Chemistry, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  232. DATA.Subscribe($"{Module}.AchievedCycle", () => AchievedCycle, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  233. DATA.Subscribe($"{Module}.IsInit", () => IsInit, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  234. DATA.Subscribe($"{Module}.IsIdle", () => IsIdle, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  235. DATA.Subscribe($"{Module}.IsError", () => IsError, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  236. DATA.Subscribe($"{Module}.IsBusy", () => IsBusy, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  237. DATA.Subscribe($"{Module}.IsDisable", () => IsDisable, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  238. }
  239. /// <summary>
  240. /// 初始化Operation
  241. /// </summary>
  242. private void InitializeOperation()
  243. {
  244. OP.Subscribe($"{Module}.InitializeAll", (cmd, args) => { return CheckToPostMessage<PlatingCellState, PlatingCellMsg>(eEvent.ERR_RESERVOIR, Module.ToString(), (int)PlatingCellMsg.Initialize); });
  245. OP.Subscribe($"{Module}.ManualCCRStart", (cmd, args) => { return CheckToPostMessage<PlatingCellState, PlatingCellMsg>(eEvent.ERR_RESERVOIR, Module.ToString(), (int)PlatingCellMsg.CCR); });
  246. OP.Subscribe($"{Module}.ManualCCRStop", (cmd, args) => { return CheckToPostMessage<PlatingCellState, PlatingCellMsg>(eEvent.ERR_RESERVOIR, Module.ToString(), (int)PlatingCellMsg.CCRAbort); });
  247. OP.Subscribe($"{Module}.CycleManualProcessRecipe", (cmd, args) =>
  248. {
  249. DepRecipe recipe = RecipeFileManager.Instance.LoadGenericityRecipe<DepRecipe>(args[0].ToString());
  250. if (recipe == null)
  251. {
  252. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module.ToString(), $"{args[0]} recipe is null");
  253. return false;
  254. }
  255. object[] objects = new object[args.Length];
  256. objects[0] = recipe;
  257. for (int i = 1; i < args.Length; i++)
  258. {
  259. objects[i] = args[i];
  260. }
  261. return CheckToPostMessage<PlatingCellState, PlatingCellMsg>(eEvent.ERR_PREWET, Module.ToString(), (int)PlatingCellMsg.RunRecipe, objects);
  262. });
  263. }
  264. /// 初始化状态机
  265. /// </summary>
  266. private void InitialFsm()
  267. {
  268. fsm = new StateMachine<PlatingCellEntity>(Module.ToString(), (int)PlatingCellState.Init, 100);
  269. fsm.EnableRepeatedMsg(true);
  270. AnyStateTransition(PlatingCellMsg.Error, NullFunc, PlatingCellState.Error);
  271. //Initialized
  272. Transition(PlatingCellState.Error, PlatingCellMsg.Initialize, InitializeAll, PlatingCellState.Initializing);
  273. Transition(PlatingCellState.Init, PlatingCellMsg.Initialize, InitializeAll, PlatingCellState.Initializing);
  274. Transition(PlatingCellState.Idle, PlatingCellMsg.Initialize, InitializeAll, PlatingCellState.Initializing);
  275. Transition(PlatingCellState.Initializing, FSM_MSG.TIMER, InitializeAllMonitor, PlatingCellState.Idle);
  276. //CCR
  277. Transition(PlatingCellState.Idle, PlatingCellMsg.CCR, ManualCCRStart, PlatingCellState.CCRing);
  278. Transition(PlatingCellState.CCRing, FSM_MSG.TIMER, CCRMonitor, PlatingCellState.Idle);
  279. Transition(PlatingCellState.CCRing, PlatingCellMsg.CCRAbort, CCRAbort, PlatingCellState.Init);
  280. //Cycle Manual Process
  281. Transition(PlatingCellState.Idle, PlatingCellMsg.RunRecipe, CycleManualProcess, PlatingCellState.RunReciping);
  282. Transition(PlatingCellState.RunReciping, FSM_MSG.TIMER, CycleManualMonitor, PlatingCellState.Idle);
  283. Transition(PlatingCellState.RunReciping, PlatingCellMsg.Abort, RunRecipeAbort, PlatingCellState.Idle);
  284. //Unload
  285. Transition(PlatingCellState.Idle, PlatingCellMsg.Unload, Unload, PlatingCellState.Unloading);
  286. Transition(PlatingCellState.Unloading, FSM_MSG.TIMER, UnloadMonitor, PlatingCellState.Idle);
  287. Transition(PlatingCellState.Unloading, PlatingCellMsg.Abort, UnloadAbort, PlatingCellState.Idle);
  288. //直接进入Idle
  289. Transition(PlatingCellState.Initialized, FSM_MSG.TIMER, NullFunc, PlatingCellState.Idle);
  290. //Enter Init
  291. Transition(PlatingCellState.Idle, PlatingCellMsg.Init, NullFunc, PlatingCellState.Init);
  292. EnumLoop<PlatingCellState>.ForEach((item) => { fsm.MapState((int)item, item.ToString()); });
  293. EnumLoop<PlatingCellState>.ForEach((item) => { fsm.MapMessage((int)item, item.ToString()); });
  294. }
  295. /// <summary>
  296. /// 手动CCR
  297. /// </summary>
  298. /// <returns></returns>
  299. private bool ManualCCRStart(object[] param)
  300. {
  301. bool result = _platingCellCRRoutine.Start() == RState.Running;
  302. return result;
  303. }
  304. /// <summary>
  305. /// CCR 监控
  306. /// </summary>
  307. /// <param name="param"></param>
  308. /// <returns></returns>
  309. private bool CCRMonitor(object[] param)
  310. {
  311. RState rsstate = RState.Running;
  312. rsstate = _platingCellCRRoutine.Monitor();
  313. if (rsstate == RState.End)
  314. {
  315. return true;
  316. }
  317. else if (rsstate == RState.Failed || rsstate == RState.Timeout)
  318. {
  319. PostMsg(PlatingCellMsg.Error);
  320. return false;
  321. }
  322. return false;
  323. }
  324. /// <summary>
  325. /// CCR abort
  326. /// </summary>
  327. /// <param name="param"></param>
  328. /// <returns></returns>
  329. private bool CCRAbort(object[] param)
  330. {
  331. if(_platingCellCRRoutine.Monitor() == RState.Running)
  332. {
  333. _platingCellCRRoutine.Abort();
  334. }
  335. return true;
  336. }
  337. /// <summary>
  338. /// 初始化
  339. /// </summary>
  340. /// <returns></returns>
  341. private bool InitializeAll(object[] param)
  342. {
  343. if (_persistentValue == null)
  344. {
  345. LOG.WriteLog(eEvent.ERR_RESERVOIR, Module.ToString(), "persistent is null");
  346. return false;
  347. }
  348. if (fsm.State == (int)PlatingCellState.Initializing)
  349. {
  350. LOG.WriteLog(eEvent.WARN_PLATINGCELL, Module.ToString(), "state is Initializing,cannot do initialize");
  351. return false;
  352. }
  353. if (!CheckReservoirInitialized())
  354. {
  355. LOG.WriteLog(eEvent.ERR_METAL, Module.ToString(), "Reservoir is not initialized");
  356. return false;
  357. }
  358. if (!MetalUsageMointor(Module.ToString()))
  359. {
  360. return false;
  361. }
  362. if ("Auto".Equals(_persistentValue.OperatingMode))
  363. {
  364. if (!CheckReservoirIsAuto())
  365. {
  366. LOG.WriteLog(eEvent.ERR_METAL, Module.ToString(), "Reservoir is not in Auto OperationMode");
  367. return false;
  368. }
  369. }
  370. string AnotherModule = ModuleMatcherManager.Instance.GetMatcherByModule(Module.ToString());
  371. PlatingCellEntity anotherEntity = Singleton<RouteManager>.Instance.GetModule<PlatingCellEntity>(AnotherModule);
  372. {
  373. if(anotherEntity != null && anotherEntity.IsBusy)
  374. {
  375. LOG.WriteLog(eEvent.ERR_METAL, Module.ToString(), "Another Platingcell is busy, can not initialized");
  376. return false;
  377. }
  378. }
  379. bool result = _initializeRoutine.Start(_persistentValue) == RState.Running;
  380. return result;
  381. }
  382. /// <summary>
  383. /// 检验Reservoir是否Auto
  384. /// </summary>
  385. /// <returns></returns>
  386. private bool CheckReservoirIsAuto()
  387. {
  388. string reservoir = ReservoirItemManager.Instance.GetReservoirByPlatingCell(Module.ToString());
  389. ReservoirsPersistentValue reservoirsPersistentValue = ReservoirsPersistentManager.Instance.GetReservoirsPersistentValue(reservoir);
  390. if ("Auto".Equals(reservoirsPersistentValue.OperatingMode))
  391. {
  392. return true;
  393. }
  394. return false;
  395. }
  396. /// <summary>
  397. /// 检验Reservoir是否Initialized
  398. /// </summary>
  399. /// <returns></returns>
  400. private bool CheckReservoirInitialized()
  401. {
  402. string reservoir = ReservoirItemManager.Instance.GetReservoirByPlatingCell(Module.ToString());
  403. ReservoirEntity reservoirEntity = Singleton<RouteManager>.Instance.GetModule<ReservoirEntity>(reservoir);
  404. if (reservoirEntity != null)
  405. {
  406. return reservoirEntity.IsInitialized;
  407. }
  408. return false;
  409. }
  410. /// <summary>
  411. /// 监控 PM Counter Metal用量
  412. /// </summary>
  413. private bool MetalUsageMointor(string Module)
  414. {
  415. return true;
  416. }
  417. /// <summary>
  418. /// Initialize 监控
  419. /// </summary>
  420. /// <param name="param"></param>
  421. /// <returns></returns>
  422. private bool InitializeAllMonitor(object[] param)
  423. {
  424. RState rsstate = RState.Running;
  425. rsstate = _initializeRoutine.Monitor();
  426. if (rsstate == RState.End)
  427. {
  428. return true;
  429. }
  430. else if (rsstate == RState.Failed || rsstate == RState.Timeout)
  431. {
  432. PostMsg(PlatingCellMsg.Error);
  433. return false;
  434. }
  435. return false;
  436. }
  437. /// <summary>
  438. /// EnterInit
  439. /// </summary>
  440. public void EnterInit()
  441. {
  442. if ((PlatingCellState)fsm.State != PlatingCellState.Idle) return;
  443. else
  444. {
  445. CheckToPostMessage<PlatingCellState, PlatingCellMsg>(eEvent.ERR_PLATINGCELL, Module.ToString(), (int)PlatingCellMsg.Init);
  446. }
  447. }
  448. #region cycle manual process
  449. /// <summary>
  450. /// process
  451. /// </summary>
  452. /// <param name="param"></param>
  453. /// <returns></returns>
  454. private bool CycleManualProcess(object[] param)
  455. {
  456. bool result = _runRecipeRoutine.Start(param) == RState.Running;
  457. _currentStepState = "";
  458. DepRecipe recipe = param[0] as DepRecipe;
  459. _cycle = (int)param[2];
  460. if (result)
  461. {
  462. _recipeTime = recipe.CalculateRecipeTotalTime() * _cycle;
  463. _currentRecipe = recipe;
  464. }
  465. return result;
  466. }
  467. /// <summary>
  468. /// 监控
  469. /// </summary>
  470. /// <param name="param"></param>
  471. /// <returns></returns>
  472. private bool CycleManualMonitor(object[] param)
  473. {
  474. RState state = _runRecipeRoutine.Monitor();
  475. _currentStepState = _runRecipeRoutine.CurrentStep;
  476. _achievedCycle = _runRecipeRoutine.GetCurrentCycle();
  477. //LOG.WriteLog(eEvent.INFO_PLATINGCELL, Module.ToString(), _currentStepState);
  478. if (state == RState.Failed || state == RState.Timeout)
  479. {
  480. PostMsg(PlatingCellMsg.Error);
  481. _currentStepState = "";
  482. return false;
  483. }
  484. bool result = state == RState.End;
  485. if (result)
  486. {
  487. _currentStepState = "";
  488. }
  489. return result;
  490. }
  491. /// <summary>
  492. /// 中止
  493. /// </summary>
  494. /// <param name="param"></param>
  495. /// <returns></returns>
  496. private bool RunRecipeAbort(object[] param)
  497. {
  498. _runRecipeRoutine.Abort();
  499. _currentStepState = "";
  500. return true;
  501. }
  502. #endregion
  503. #region unload
  504. /// <summary>
  505. /// unload
  506. /// </summary>
  507. /// <param name="param"></param>
  508. /// <returns></returns>
  509. private bool Unload(object[] param)
  510. {
  511. return _unloadRoutine.Start(param) == RState.Running;
  512. }
  513. /// <summary>
  514. /// 监控
  515. /// </summary>
  516. /// <param name="param"></param>
  517. /// <returns></returns>
  518. private bool UnloadMonitor(object[] param)
  519. {
  520. RState state = _unloadRoutine.Monitor();
  521. if (state == RState.Failed || state == RState.Timeout)
  522. {
  523. PostMsg(PlatingCellMsg.Error);
  524. return false;
  525. }
  526. return state == RState.End;
  527. }
  528. /// <summary>
  529. /// 中止
  530. /// </summary>
  531. /// <param name="param"></param>
  532. /// <returns></returns>
  533. private bool UnloadAbort(object[] param)
  534. {
  535. _unloadRoutine.Abort();
  536. return true;
  537. }
  538. #endregion
  539. public bool Check(int msg, out string reason, params object[] args)
  540. {
  541. reason = "";
  542. return true;
  543. }
  544. public bool CheckAcked(int msg)
  545. {
  546. throw new NotImplementedException();
  547. }
  548. public int Invoke(string function, params object[] args)
  549. {
  550. switch (function)
  551. {
  552. case "HomeAll":
  553. if (IsIdle)
  554. {
  555. return (int)FSM_MSG.NONE;
  556. }
  557. if (CheckToPostMessage<PlatingCellState, PlatingCellMsg>(eEvent.ERR_PLATINGCELL, Module.ToString(), (int)PlatingCellMsg.Initialize))
  558. {
  559. return (int)PlatingCellMsg.Initialize;
  560. }
  561. else
  562. {
  563. return (int)FSM_MSG.NONE;
  564. }
  565. }
  566. return (int)FSM_MSG.NONE;
  567. }
  568. }
  569. public enum PlatingCellMsg
  570. {
  571. NONE,
  572. Error,
  573. ResumeError,
  574. Initialize,
  575. Manual,
  576. Auto,
  577. CloseFlowValve,
  578. OpenFlowValve,
  579. RunRecipe,
  580. Abort,
  581. Init,
  582. CCR,
  583. CCRAbort,
  584. Unload
  585. }
  586. }