LoaderEntity.cs 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084
  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.Routine;
  7. using Aitex.Core.RT.SCCore;
  8. using Aitex.Core.Util;
  9. using Aitex.Core.Utilities;
  10. using MECF.Framework.Common.Equipment;
  11. using MECF.Framework.Common.SubstrateTrackings;
  12. using MECF.Framework.Common.Utilities;
  13. using MECF.Framework.Common.WaferHolder;
  14. using CyberX8_Core;
  15. using CyberX8_RT.Devices.AXIS;
  16. using CyberX8_RT.Devices.Loader;
  17. using System;
  18. using System.Collections.Generic;
  19. using System.Linq;
  20. using System.Text;
  21. using System.Threading.Tasks;
  22. using MECF.Framework.Common.Alarm;
  23. using MECF.Framework.Common.CommonData;
  24. using MECF.Framework.Common.Routine;
  25. using System.Collections;
  26. using System.Windows.Markup;
  27. using MECF.Framework.Common.CommonData.Loader;
  28. using Aitex.Core.Common;
  29. using MECF.Framework.RT.Core.Equipments;
  30. using CyberX8_RT.Modules.Dryer;
  31. using System.Runtime.CompilerServices;
  32. namespace CyberX8_RT.Modules.Loader
  33. {
  34. public class LoaderEntity : Entity, IEntity, IModuleEntity
  35. {
  36. public enum LotTrackDatasStatus
  37. {
  38. None,
  39. Half,
  40. Complete
  41. }
  42. #region 属性
  43. public ModuleName Module { get; private set; }
  44. public bool IsInit
  45. {
  46. get { return fsm.State == (int)LOADERSTATE.Init; }
  47. }
  48. public bool IsIdle
  49. {
  50. get
  51. {
  52. return fsm.State == (int)LOADERSTATE.Idle;
  53. }
  54. }
  55. public bool IsError
  56. {
  57. get { return fsm.State == (int)LOADERSTATE.Error; }
  58. }
  59. public bool IsBusy
  60. {
  61. get { return !IsInit && !IsError && !IsIdle; }
  62. }
  63. public bool IsAuto { get; } = true;
  64. /// <summary>
  65. /// 是否为工程模式
  66. /// </summary>
  67. public bool IsEngineering { get; } = false;
  68. /// <summary>
  69. /// 是否为产品模式
  70. /// </summary>
  71. public bool IsProduction { get; } = true;
  72. public bool IsHomed
  73. {
  74. get { return _isHomed; }
  75. }
  76. /// <summary>
  77. /// 当前状态机状态
  78. /// </summary>
  79. public int State { get { return fsm.State; } }
  80. /// <summary>
  81. /// 是否禁用
  82. /// </summary>
  83. public bool IsDisable { get; internal set; }
  84. /// <summary>
  85. /// Rotation是否SwitchOn
  86. /// </summary>
  87. public bool IsRotationSwitchOn
  88. {
  89. get { return _rotationAxis.IsSwitchOn; }
  90. }
  91. /// <summary>
  92. /// ShuttleA是否SwitchOn
  93. /// </summary>
  94. public bool IsShuttleASwitchOn
  95. {
  96. get { return _shuttleAAxis.IsSwitchOn; }
  97. }
  98. /// <summary>
  99. /// ShuttleB是否SwitchOn
  100. /// </summary>
  101. public bool IsShuttleBSwitchOn
  102. {
  103. get { return _shuttleBAxis.IsSwitchOn; }
  104. }
  105. /// <summary>
  106. /// TiltA是否SwitchOn
  107. /// </summary>
  108. public bool IsTiltASwitchOn
  109. {
  110. get { return _tiltAAxis.IsSwitchOn; }
  111. }
  112. /// <summary>
  113. /// TiltB是否SwitchOn
  114. /// </summary>
  115. public bool IsTiltBSwitchOn
  116. {
  117. get { return _tiltBAxis.IsSwitchOn; }
  118. }
  119. /// <summary>
  120. /// CrsA是否SwitchOn
  121. /// </summary>
  122. public bool IsCrsASwitchOn
  123. {
  124. get { return _crsAAxis.IsSwitchOn; }
  125. }
  126. /// <summary>
  127. /// CrsB是否SwitchOn
  128. /// </summary>
  129. public bool IsCrsBSwitchOn
  130. {
  131. get { return _crsBAxis.IsSwitchOn; }
  132. }
  133. /// <summary>
  134. /// WaferHolder信息
  135. /// </summary>
  136. public WaferHolderInfo WaferHolderInfo { get { return WaferHolderManager.Instance.GetWaferHolder("Loader"); } }
  137. /// <summary>
  138. /// A面Wafer尺寸
  139. /// </summary>
  140. public int SideAWaferSize { get { return _sideAWaferSize; } }
  141. /// <summary>
  142. /// B面Wafer尺寸
  143. /// </summary>
  144. public int SideBWaferSize { get { return _sideBWaferSize; } }
  145. #endregion
  146. #region 内部变量
  147. private bool _isHomed = false;
  148. private IRoutine _currentRoutine;
  149. /// <summary>
  150. /// Loader当前unload、load操作Slot
  151. /// </summary>
  152. private Dictionary<string, List<string>> _loaderOperatingWaferInfosList = new Dictionary<string, List<string>> { { "unload", new List<string>(new string[2]) }, { "load", new List<string>(new string[2]) } };
  153. #region Axis
  154. JetAxisBase _shuttleAAxis;
  155. JetAxisBase _shuttleBAxis;
  156. JetAxisBase _tiltAAxis;
  157. JetAxisBase _tiltBAxis;
  158. JetAxisBase _crsAAxis;
  159. JetAxisBase _crsBAxis;
  160. JetAxisBase _rotationAxis;
  161. LoaderSideDevice _sideA;
  162. LoaderSideDevice _sideB;
  163. LoaderCommonDevice _loaderCommon;
  164. int _sideAWaferSize;
  165. int _sideBWaferSize;
  166. #endregion
  167. #region routine
  168. private LoaderHomeAllRoutine _homeAllRoutine;
  169. private LoaderSwitchAllOnRoutine _switchAllOnRoutine;
  170. private LoaderSwitchAllOffRoutine _switchAllOffRoutine;
  171. private LoaderUnloadSideRoutine _unloadSideRoutine;
  172. private LoaderLoadSideRoutine _loadSideRoutine;
  173. #endregion
  174. #region LotTrackDatas
  175. /// <summary>
  176. /// Load LotTrackData
  177. /// </summary>
  178. private List<LoaderLotTrackData> _loaderLotTrackDatas = new List<LoaderLotTrackData>();
  179. /// <summary>
  180. /// Flow Test LotTrackData
  181. /// </summary>
  182. private List<LoaderFlowLotTrackData> _flowLotTrackDatas = new List<LoaderFlowLotTrackData>();
  183. /// <summary>
  184. /// Load / Unload Time
  185. /// </summary>
  186. private List<DateTime> _timeList = new List<DateTime>();
  187. /// <summary>
  188. /// Load Start Time(file name)
  189. /// </summary>
  190. private DateTime _startTime;
  191. /// <summary>
  192. /// LotTrackHead
  193. /// </summary>
  194. private LotTrackFileHeaderCommonData _headerdata;
  195. /// <summary>
  196. /// Load Datas Status
  197. private LotTrackDatasStatus _datasStatus = LotTrackDatasStatus.None;
  198. /// <summary>
  199. /// Flow Test Datas status
  200. /// </summary>
  201. private LotTrackDatasStatus _flowDatasStatus = LotTrackDatasStatus.None;
  202. /// <summary>
  203. /// WaferGroup str
  204. /// </summary>
  205. private string _preWaferGroup = "";
  206. #endregion
  207. #endregion
  208. /// <summary>
  209. /// 构造函数
  210. /// </summary>
  211. /// <param name="module"></param>
  212. public LoaderEntity(ModuleName module)
  213. {
  214. this.Module = module;
  215. _shuttleAAxis = DEVICE.GetDevice<JetAxisBase>($"{module}.ShuttleA");
  216. _shuttleBAxis = DEVICE.GetDevice<JetAxisBase>($"{module}.ShuttleB");
  217. _tiltAAxis = DEVICE.GetDevice<JetAxisBase>($"{module}.TiltA");
  218. _tiltBAxis = DEVICE.GetDevice<JetAxisBase>($"{module}.TiltB");
  219. _crsAAxis = DEVICE.GetDevice<JetAxisBase>($"{module}.LSA");
  220. _crsBAxis = DEVICE.GetDevice<JetAxisBase>($"{module}.LSB");
  221. _rotationAxis = DEVICE.GetDevice<JetAxisBase>($"{module}.Rotation");
  222. _sideA = DEVICE.GetDevice<LoaderSideDevice>($"{Module}.SideA");
  223. _sideB = DEVICE.GetDevice<LoaderSideDevice>($"{Module}.SideB");
  224. _loaderCommon = DEVICE.GetDevice<LoaderCommonDevice>($"{module}.Common");
  225. WaferManager.Instance.SubscribeLocation(Module, 2);
  226. _sideAWaferSize = SC.GetValue<int>("Loader1.SideAWaferSize");
  227. _sideBWaferSize = SC.GetValue<int>("Loader1.SideBWaferSize");
  228. InitialOperation();
  229. InitializeRoutine();
  230. InitialDATA();
  231. InitialFsm();
  232. }
  233. /// <summary>
  234. /// 初始化操作
  235. /// </summary>
  236. private void InitialOperation()
  237. {
  238. OP.Subscribe($"{Module}.Abort", (cmd, args) => { return CheckToPostMessage<LOADERSTATE, LoaderMSG>(eEvent.ERR_LOADER, Module.ToString(), (int)LoaderMSG.Abort); });
  239. OP.Subscribe($"{Module}.ClearError", (cmd, args) => { return CheckToPostMessage<LOADERSTATE, LoaderMSG>(eEvent.ERR_LOADER, Module.ToString(), (int)LoaderMSG.ClearError); });
  240. OP.Subscribe($"{Module}.Common.HomeAll", (cmd, args) => { PostMsg((int)LoaderMSG.HomeAll); return true; });
  241. OP.Subscribe($"{Module}.Common.SwitchOnAll", (cmd, args) => { PostMsg((int)LoaderMSG.SwitchOnAll); return true; });
  242. OP.Subscribe($"{Module}.Common.SwitchOffAll", (cmd, args) => { PostMsg((int)LoaderMSG.SwitchOffAll); return true; });
  243. }
  244. /// <summary>
  245. /// 初始化Routine
  246. /// </summary>
  247. private void InitializeRoutine()
  248. {
  249. _homeAllRoutine=new LoaderHomeAllRoutine(Module.ToString());
  250. _switchAllOnRoutine=new LoaderSwitchAllOnRoutine(Module.ToString());
  251. _switchAllOffRoutine=new LoaderSwitchAllOffRoutine(Module.ToString());
  252. _unloadSideRoutine = new LoaderUnloadSideRoutine(Module.ToString());
  253. _loadSideRoutine=new LoaderLoadSideRoutine(Module.ToString());
  254. }
  255. /// <summary>
  256. /// 初始化数据
  257. /// </summary>
  258. private void InitialDATA()
  259. {
  260. InitializeSvid();
  261. DATA.Subscribe($"{Module}.FsmState", () => ((LOADERSTATE)fsm.State).ToString(), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  262. DATA.Subscribe($"{Module}.IsHomed", () => _isHomed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  263. DATA.Subscribe($"{Module}.IsError", () => IsError, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  264. }
  265. /// <summary>
  266. /// 初始化SVID
  267. /// </summary>
  268. private void InitializeSvid()
  269. {
  270. DATA.Subscribe($"{Module}.State", () => ((LOADERSTATE)fsm.State).ToString(), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  271. DATA.Subscribe($"{Module}.LotID", () => WaferHolderInfo?.LotId, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  272. DATA.Subscribe($"{Module}.WSID", () => WaferHolderInfo?.Id, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  273. DATA.Subscribe($"{Module}.LSAID", () => WaferHolderInfo?.CrsAId, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  274. DATA.Subscribe($"{Module}.LSBID", () => WaferHolderInfo?.CrsBId, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  275. DATA.Subscribe($"{Module}.SequenceRecipe", () => WaferHolderInfo?.SequenceId, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  276. DATA.Subscribe($"{Module}.WaferAID", () => WaferHolderInfo?.WaferAId, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  277. DATA.Subscribe($"{Module}.WaferBID", () => WaferHolderInfo?.WaferBId, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  278. DATA.Subscribe($"{Module}.Task", () => WaferHolderInfo?.CurrentControlJobId, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  279. }
  280. /// <summary>
  281. /// 检验所有电机是否已经完成Home
  282. /// </summary>
  283. /// <returns></returns>
  284. private bool CheckAllAxisIsHomed()
  285. {
  286. bool shuttleAIsHomed = _shuttleAAxis.CheckAxisIsAreadyHomed();
  287. if (!shuttleAIsHomed)
  288. {
  289. return false;
  290. }
  291. bool shuttleAMid = _shuttleAAxis.CheckPositionIsInStation(_shuttleAAxis.MotionData.MotorPosition, "MID");
  292. if (!shuttleAMid)
  293. {
  294. return false;
  295. }
  296. bool shuttleBIsHomed = _shuttleBAxis.CheckAxisIsAreadyHomed();
  297. if (!shuttleAIsHomed)
  298. {
  299. return false;
  300. }
  301. bool shuttleBMid = _shuttleBAxis.CheckPositionIsInStation(_shuttleBAxis.MotionData.MotorPosition, "MID");
  302. if (!shuttleAMid)
  303. {
  304. return false;
  305. }
  306. bool tiltAIsHomed = _tiltAAxis.CheckAxisIsAreadyHomed();
  307. if (!tiltAIsHomed)
  308. {
  309. return false;
  310. }
  311. bool tiltAVert = _tiltAAxis.CheckPositionIsInStation(_tiltAAxis.MotionData.MotorPosition, "VERT");
  312. if (!tiltAVert)
  313. {
  314. return false;
  315. }
  316. bool tiltBIsHomed = _tiltBAxis.CheckAxisIsAreadyHomed();
  317. if (!tiltBIsHomed)
  318. {
  319. return false;
  320. }
  321. bool tiltBVert = _tiltBAxis.CheckPositionIsInStation(_tiltBAxis.MotionData.MotorPosition, "VERT");
  322. if (!tiltBVert)
  323. {
  324. return false;
  325. }
  326. bool crsAIsHomed = _crsAAxis.CheckAxisIsAreadyHomed();
  327. if (!crsAIsHomed)
  328. {
  329. return false;
  330. }
  331. bool crsASetUp = _crsAAxis.CheckPositionIsInStation(_crsAAxis.MotionData.MotorPosition, $"Setup{SideAWaferSize}");
  332. if (!crsASetUp)
  333. {
  334. return false;
  335. }
  336. bool crsBIsHomed = _crsBAxis.CheckAxisIsAreadyHomed();
  337. if (!crsBIsHomed)
  338. {
  339. return false;
  340. }
  341. bool crsBSetUp = _crsBAxis.CheckPositionInStationIgnoreWaferSize(_crsBAxis.MotionData.MotorPosition, $"Setup{SideBWaferSize}");
  342. if (!crsBSetUp)
  343. {
  344. return false;
  345. }
  346. bool rotationIsHomed = _rotationAxis.CheckAxisIsAreadyHomed();
  347. if (!rotationIsHomed)
  348. {
  349. return false;
  350. }
  351. bool rotationClosed = _rotationAxis.CheckPositionIsInStation(_rotationAxis.MotionData.MotorPosition, "TRNPA");
  352. if (!crsASetUp)
  353. {
  354. return false;
  355. }
  356. return true;
  357. }
  358. /// <summary>
  359. /// 初始化状态机
  360. /// </summary>
  361. private void InitialFsm()
  362. {
  363. if (CheckAllAxisIsHomed())
  364. {
  365. _isHomed = true;
  366. fsm = new StateMachine<LoaderEntity>(Module.ToString(), (int)LOADERSTATE.Idle, 100);
  367. }
  368. else
  369. {
  370. fsm = new StateMachine<LoaderEntity>(Module.ToString(), (int)LOADERSTATE.Init, 100);
  371. }
  372. fsm.EnableRepeatedMsg(true);
  373. AnyStateTransition(LoaderMSG.Error, EnterError, LOADERSTATE.Error);
  374. AnyStateTransition(LoaderMSG.ReturnInit, EnterInit, LOADERSTATE.Init);
  375. AnyStateTransition(LoaderMSG.ReturnIdle, NullFunc, LOADERSTATE.Idle);
  376. AnyStateTransition(LoaderMSG.Abort, Abort, LOADERSTATE.Init);
  377. //clear error
  378. Transition(LOADERSTATE.Error, LoaderMSG.ClearError, ResumeError, LOADERSTATE.Init);
  379. //HomeAll
  380. AnyStateTransition(LoaderMSG.HomeAll, HomeAll, LOADERSTATE.Homing);
  381. Transition(LOADERSTATE.Homing, FSM_MSG.TIMER, HomeAllMonitor, LOADERSTATE.Idle);
  382. //Switch On All
  383. Transition(LOADERSTATE.Error, LoaderMSG.SwitchOnAll, SwitchOnAll, LOADERSTATE.SwitchOning);
  384. Transition(LOADERSTATE.Init, LoaderMSG.SwitchOnAll, SwitchOnAll, LOADERSTATE.SwitchOning);
  385. Transition(LOADERSTATE.Idle, LoaderMSG.SwitchOnAll, SwitchOnAll, LOADERSTATE.SwitchOning);
  386. Transition(LOADERSTATE.SwitchOning, FSM_MSG.TIMER, SwitchOnAllMonitor, LOADERSTATE.Init);
  387. //Switch Off All
  388. Transition(LOADERSTATE.Error, LoaderMSG.SwitchOffAll, SwitchOffAll, LOADERSTATE.SwitchOffing);
  389. Transition(LOADERSTATE.Init, LoaderMSG.SwitchOffAll, SwitchOffAll, LOADERSTATE.SwitchOffing);
  390. Transition(LOADERSTATE.Idle, LoaderMSG.SwitchOffAll, SwitchOffAll, LOADERSTATE.SwitchOffing);
  391. Transition(LOADERSTATE.SwitchOffing, FSM_MSG.TIMER, SwitchOffAllMonitor, LOADERSTATE.Init);
  392. //Prepare for Place
  393. Transition(LOADERSTATE.Idle, LoaderMSG.PrepareForPlace, PrePareForPlace, LOADERSTATE.PrepreForPlacing);
  394. Transition(LOADERSTATE.PrepreForPlacing, FSM_MSG.TIMER, PrepareForPlaceMonitor, LOADERSTATE.WaitForUnload);
  395. Transition(LOADERSTATE.Idle, LoaderMSG.ReadyForPuf, NullFunc, LOADERSTATE.WaitForUnload);
  396. Transition(LOADERSTATE.WaitForUnload, LoaderMSG.UnloadSide, UnloadSide, LOADERSTATE.Unloading);
  397. Transition(LOADERSTATE.Unloading, FSM_MSG.TIMER, UnloadSideMonitor, LOADERSTATE.WaitForLoad);
  398. Transition(LOADERSTATE.WaitForLoad, LoaderMSG.LoadSide, LoadSide, LOADERSTATE.Loading);
  399. Transition(LOADERSTATE.Loading, FSM_MSG.TIMER, LoadSideMonitor, LOADERSTATE.Idle);
  400. //Flip
  401. Transition(LOADERSTATE.Idle, LoaderMSG.WaitFlip, NullFunc, LOADERSTATE.WaitForFlip);
  402. Transition(LOADERSTATE.WaitForFlip,LoaderMSG.PrepareForPlace, PrePareForPlace, LOADERSTATE.PrepreForPlacing);
  403. //Retry
  404. Transition(LOADERSTATE.Error, LoaderMSG.Retry, NullFunc, LOADERSTATE.Retrying);
  405. Transition(LOADERSTATE.Retrying,FSM_MSG.TIMER,LoaderRetry,LOADERSTATE.Retrying);
  406. Transition(LOADERSTATE.Retrying, LoaderMSG.UnloadSide, RetryUnloadSide, LOADERSTATE.Unloading);
  407. Transition(LOADERSTATE.Retrying, LoaderMSG.LoadSide, RetryLoadSide, LOADERSTATE.Loading);
  408. //ConfirmComplete
  409. Transition(LOADERSTATE.Init, LoaderMSG.ConfirmComplete, ClearModuleAlarm, LOADERSTATE.Init);
  410. Transition(LOADERSTATE.Idle, LoaderMSG.ConfirmComplete, ClearModuleAlarm, LOADERSTATE.Idle);
  411. Transition(LOADERSTATE.Error, LoaderMSG.ConfirmComplete, NullFunc, LOADERSTATE.ConfirmCompleting);
  412. Transition(LOADERSTATE.ConfirmCompleting,FSM_MSG.TIMER,ConfirmComplete, LOADERSTATE.ConfirmCompleting);
  413. Transition(LOADERSTATE.ConfirmCompleting, LoaderMSG.PrepareForPlace, NullFunc, LOADERSTATE.WaitForUnload);
  414. Transition(LOADERSTATE.ConfirmCompleting,LoaderMSG.UnloadSide,ConfirmUnloadSide, LOADERSTATE.WaitForLoad);
  415. Transition(LOADERSTATE.ConfirmCompleting, LoaderMSG.LoadSide, ConfirmLoadSide, LOADERSTATE.Idle);
  416. EnumLoop<LOADERSTATE>.ForEach((item) => { fsm.MapState((int)item, item.ToString()); });
  417. EnumLoop<LoaderMSG>.ForEach((item) => { fsm.MapMessage((int)item, item.ToString()); });
  418. }
  419. /// <summary>
  420. /// 恢复错误
  421. /// </summary>
  422. /// <param name="param"></param>
  423. /// <returns></returns>
  424. private bool ResumeError(object[] param)
  425. {
  426. if (_isHomed)
  427. {
  428. PostMsg(LoaderMSG.ReturnIdle);
  429. return false;
  430. }
  431. return true;
  432. }
  433. /// <summary>
  434. /// 检验Loader两边waferSize不一致
  435. /// </summary>
  436. /// <returns></returns>
  437. public bool CheckLoaderWaferSizeNotEqual()
  438. {
  439. return _sideAWaferSize != _sideBWaferSize;
  440. }
  441. #region Abort
  442. private bool Abort(object parameter)
  443. {
  444. bool preHomed = IsHomed;
  445. _shuttleAAxis.StopPositionOperation();
  446. _shuttleBAxis.StopPositionOperation();
  447. _tiltAAxis.StopPositionOperation();
  448. _tiltBAxis.StopPositionOperation();
  449. _crsAAxis.StopPositionOperation();
  450. _crsBAxis.StopPositionOperation();
  451. _rotationAxis.StopPositionOperation();
  452. if (_currentRoutine != null)
  453. {
  454. _currentRoutine.Abort();
  455. _currentRoutine = null;
  456. }
  457. if (preHomed)
  458. {
  459. PostMsg(LoaderMSG.ReturnIdle);
  460. return false;
  461. }
  462. //Header信息
  463. if (_headerdata != null)
  464. {
  465. WaferHolderInfo info = WaferHolderManager.Instance.GetWaferHolder(Module.ToString());
  466. _headerdata.SequenceRecipe = (info != null ? $"{info.SequenceRecipe.SequenceType}\\" + $"{info.SequenceRecipe.Ppid}.seq.rcp" : null);
  467. _headerdata.ProcessTransferList = (info != null ? info.SchedulerModules : null);
  468. WaferInfo waferInfo = WaferManager.Instance.GetWafer(Module, _unloadSideRoutine.IsSideA ? 0 : 1);
  469. LoaderLotTrackUtil.ExportLoaderLotTrack(Module.ToString(), _headerdata, _loaderLotTrackDatas, _datasStatus, _timeList, waferInfo,
  470. "SeqGroup", false, _startTime, _flowLotTrackDatas, _flowDatasStatus);
  471. }
  472. return true;
  473. }
  474. #endregion
  475. /// <summary>
  476. /// 进入错误状态
  477. /// </summary>
  478. /// <param name="param"></param>
  479. /// <returns></returns>
  480. private bool EnterError(object param)
  481. {
  482. return true;
  483. }
  484. /// <summary>
  485. /// 进入初始化状态
  486. /// </summary>
  487. /// <param name="param"></param>
  488. /// <returns></returns>
  489. private bool EnterInit(object param)
  490. {
  491. _isHomed = false;
  492. return true;
  493. }
  494. #region HomeAll
  495. /// <summary>
  496. /// Home All
  497. /// </summary>
  498. /// <param name="param"></param>
  499. /// <returns></returns>
  500. private bool HomeAll(object[] param)
  501. {
  502. _isHomed = false;
  503. bool result= _homeAllRoutine.Start(param) == RState.Running;
  504. if (result)
  505. {
  506. _currentRoutine = _homeAllRoutine;
  507. }
  508. return result;
  509. }
  510. /// <summary>
  511. /// Load All监控
  512. /// </summary>
  513. /// <param name="param"></param>
  514. /// <returns></returns>
  515. private bool HomeAllMonitor(object[] param)
  516. {
  517. RState state = _homeAllRoutine.Monitor();
  518. if (state==RState.Failed||state==RState.Timeout)
  519. {
  520. _currentRoutine = null;
  521. PostMsg(LoaderMSG.Error);
  522. return false;
  523. }
  524. bool result= state == RState.End;
  525. if(result)
  526. {
  527. _currentRoutine = null;
  528. _isHomed = true;
  529. }
  530. return result;
  531. }
  532. #endregion
  533. #region Switch On All
  534. private bool SwitchOnAll(object[] param)
  535. {
  536. return _switchAllOnRoutine.Start(param) == RState.Running;
  537. }
  538. private bool SwitchOnAllMonitor(object[] param)
  539. {
  540. RState state = _switchAllOnRoutine.Monitor();
  541. if (state == RState.Failed || state == RState.Timeout)
  542. {
  543. PostMsg(LoaderMSG.ReturnInit);
  544. return false;
  545. }
  546. bool result= state == RState.End;
  547. if(result)
  548. {
  549. _isHomed = false;
  550. }
  551. return result;
  552. }
  553. #endregion
  554. #region Switch Off All
  555. private bool SwitchOffAll(object[] param)
  556. {
  557. return _switchAllOffRoutine.Start(param) == RState.Running;
  558. }
  559. private bool SwitchOffAllMonitor(object[] param)
  560. {
  561. RState state = _switchAllOffRoutine.Monitor();
  562. if (state == RState.Failed || state == RState.Timeout)
  563. {
  564. PostMsg(LoaderMSG.ReturnInit);
  565. return false;
  566. }
  567. bool result = state == RState.End;
  568. if (result)
  569. {
  570. _isHomed = false;
  571. }
  572. return result;
  573. }
  574. #endregion
  575. #region Prepare for Place
  576. /// <summary>
  577. /// Prepare For Place
  578. /// </summary>
  579. /// <returns></returns>
  580. private bool PrePareForPlace(object[] param)
  581. {
  582. //默认"TRNPA"
  583. string str = (param==null||param.Length==0)? "TRNPA":param[0].ToString();
  584. return _rotationAxis.PositionStation(str);
  585. }
  586. /// <summary>
  587. /// Prepare For Place监控
  588. /// </summary>
  589. /// <param name="param"></param>
  590. /// <returns></returns>
  591. private bool PrepareForPlaceMonitor(object param)
  592. {
  593. RState ret = _rotationAxis.Status;
  594. if (ret == RState.End)
  595. {
  596. return true;
  597. }
  598. if (ret == RState.Failed || ret == RState.Timeout)
  599. {
  600. PostMsg(LoaderMSG.Error);
  601. }
  602. return false;
  603. }
  604. #endregion
  605. #region Unload Side
  606. /// <summary>
  607. /// Unload Side
  608. /// </summary>
  609. /// <param name="param"></param>
  610. /// <returns></returns>
  611. private bool UnloadSide(object[] param)
  612. {
  613. bool result= _unloadSideRoutine.Start(param) == RState.Running;
  614. if(result)
  615. {
  616. _currentRoutine = _unloadSideRoutine;
  617. InitLotTrackDatas();
  618. _timeList.Add(DateTime.Now);
  619. }
  620. return result;
  621. }
  622. /// <summary>
  623. /// Retry UloadSide
  624. /// </summary>
  625. /// <param name="param"></param>
  626. /// <returns></returns>
  627. private bool RetryUnloadSide(object[] param)
  628. {
  629. int stepIndex = (int)param[0];
  630. bool result = _unloadSideRoutine.Retry(stepIndex)==RState.Running;
  631. if (result)
  632. {
  633. _datasStatus = LotTrackDatasStatus.Half;
  634. _loaderLotTrackDatas.Clear();
  635. _currentRoutine = _unloadSideRoutine;
  636. }
  637. return result;
  638. }
  639. /// <summary>
  640. /// Unload Side监控
  641. /// </summary>
  642. /// <param name="param"></param>
  643. /// <returns></returns>
  644. private bool UnloadSideMonitor(object param)
  645. {
  646. RState ret = _unloadSideRoutine.Monitor();
  647. if (ret == RState.End)
  648. {
  649. AlarmListManager.Instance.CheckModuleAlamAndRemove(Module.ToString(), LOADERSTATE.Unloading.ToString());
  650. _loaderLotTrackDatas.AddRange(_unloadSideRoutine.UnloadLotTrackDatas);
  651. _timeList.Add(DateTime.Now);
  652. //Header信息
  653. WaferHolderInfo info = WaferHolderManager.Instance.GetWaferHolder(Module.ToString());
  654. _headerdata.SequenceRecipe = ((info != null && info.SequenceRecipe != null) ? $"{info.SequenceRecipe.SequenceType}\\" + $"{info.SequenceRecipe.Ppid}.seq.rcp" : "");
  655. if (info != null)
  656. {
  657. _headerdata.ProcessTransferList.AddRange(info.SchedulerModules);
  658. info.SchedulerModules.Clear();
  659. }
  660. WaferInfo waferInfo = WaferManager.Instance.GetWafer(Module, _unloadSideRoutine.IsSideA ? 0 : 1);
  661. LoaderLotTrackUtil.ExportLoaderLotTrack(Module.ToString(), _headerdata, _loaderLotTrackDatas, _datasStatus, _timeList, waferInfo, _unloadSideRoutine.WaferGroup, false, _startTime);
  662. return true;
  663. }
  664. if (ret == RState.Failed || ret == RState.Timeout)
  665. {
  666. if (Singleton<RouteManager>.Instance.IsAutoRunning)
  667. {
  668. AlarmList alarmList = new AlarmList(Module.ToString(), ((LOADERSTATE)fsm.State).ToString(), (int)LoaderMSG.UnloadSide,
  669. _unloadSideRoutine.ErrorMsg, _unloadSideRoutine.ErrorStep, (int)AlarmType.Error);
  670. AlarmListManager.Instance.AddAlarm(alarmList);
  671. }
  672. PostMsg(LoaderMSG.Error);
  673. _loaderLotTrackDatas.AddRange(_unloadSideRoutine.UnloadLotTrackDatas);
  674. ////Header信息
  675. WaferHolderInfo info = WaferHolderManager.Instance.GetWaferHolder(Module.ToString());
  676. _headerdata.SequenceRecipe = ((info != null && info.SequenceRecipe != null) ? $"{info.SequenceRecipe.SequenceType}\\" + $"{info.SequenceRecipe.Ppid}.seq.rcp" : "");
  677. if (info != null)
  678. {
  679. _headerdata.ProcessTransferList.AddRange(info.SchedulerModules);
  680. info.SchedulerModules.Clear();
  681. }
  682. WaferInfo waferInfo = WaferManager.Instance.GetWafer(Module, _unloadSideRoutine.IsSideA ? 0 : 1);
  683. LoaderLotTrackUtil.ExportLoaderLotTrack(Module.ToString(), _headerdata, _loaderLotTrackDatas, _datasStatus, _timeList, waferInfo, _unloadSideRoutine.WaferGroup, false, _startTime);
  684. }
  685. return false;
  686. }
  687. /// <summary>
  688. /// 确认UnloadAll是否完成
  689. /// </summary>
  690. /// <param name="param"></param>
  691. /// <returns></returns>
  692. private bool ConfirmUnloadSide(object[] param)
  693. {
  694. int stepIdex=(int)param[0];
  695. bool result = _unloadSideRoutine.CheckCompleteCondition(stepIdex);
  696. if(!result)
  697. {
  698. if (Singleton<RouteManager>.Instance.IsAutoRunning)
  699. {
  700. AlarmList alarmList = new AlarmList(Module.ToString(), ((LOADERSTATE)fsm.State).ToString(), (int)LoaderMSG.UnloadSide,
  701. _unloadSideRoutine.ErrorMsg, _unloadSideRoutine.ErrorStep, (int)AlarmType.Error);
  702. AlarmListManager.Instance.AddAlarm(alarmList);
  703. }
  704. PostMsg(LoaderMSG.Error);
  705. }
  706. else
  707. {
  708. if (Singleton<RouteManager>.Instance.IsAutoRunning)
  709. {
  710. AlarmListManager.Instance.CheckModuleAlamAndRemove(Module.ToString(), LOADERSTATE.Unloading.ToString());
  711. }
  712. }
  713. return result;
  714. }
  715. #endregion
  716. #region Load Side
  717. /// <summary>
  718. /// Load Side
  719. /// </summary>
  720. /// <param name="param"></param>
  721. /// <returns></returns>
  722. private bool LoadSide(object[] param)
  723. {
  724. bool result= _loadSideRoutine.Start(param) == RState.Running;
  725. if(result)
  726. {
  727. _currentRoutine = _loadSideRoutine;
  728. InitLotTrackDatas();
  729. }
  730. return result;
  731. }
  732. /// <summary>
  733. /// Retry LoadSide
  734. /// </summary>
  735. /// <param name="param"></param>
  736. /// <returns></returns>
  737. private bool RetryLoadSide(object[] param)
  738. {
  739. int stepIndex = (int)param[0];
  740. bool result = _loadSideRoutine.Retry(stepIndex) == RState.Running;
  741. if (result)
  742. {
  743. SetLotTrackDatasStatus(stepIndex);
  744. _currentRoutine = _loadSideRoutine;
  745. }
  746. return result;
  747. }
  748. /// <summary>
  749. /// 监控LoadSide
  750. /// </summary>
  751. /// <param name="param"></param>
  752. /// <returns></returns>
  753. private bool LoadSideMonitor(object param)
  754. {
  755. RState ret = _loadSideRoutine.Monitor();
  756. if (ret == RState.End)
  757. {
  758. AlarmListManager.Instance.CheckModuleAlamAndRemove(Module.ToString(), LOADERSTATE.Loading.ToString());
  759. _loaderLotTrackDatas.AddRange(_loadSideRoutine.LoadLotTrackDatas);
  760. _timeList.AddRange(_loadSideRoutine.LoadTimeList);
  761. _flowLotTrackDatas.AddRange(_loadSideRoutine.FlowLotTrackDatas);
  762. //Header信息
  763. WaferHolderInfo info = WaferHolderManager.Instance.GetWaferHolder(Module.ToString());
  764. _headerdata.SequenceRecipe = ((info != null && info.SequenceRecipe != null) ? $"{info.SequenceRecipe.SequenceType}\\" + $"{info.SequenceRecipe.Ppid}.seq.rcp" : "");
  765. if (info != null)
  766. {
  767. _headerdata.ProcessTransferList.AddRange(info.SchedulerModules);
  768. info.SchedulerModules.Clear();
  769. }
  770. WaferInfo waferInfo = WaferManager.Instance.GetWafer(Module, _loadSideRoutine.IsSideA ? 0 : 1);
  771. CheckStartTime(_loadSideRoutine.WaferGroup);
  772. LoaderLotTrackUtil.ExportLoaderLotTrack(Module.ToString(), _headerdata, _loaderLotTrackDatas, _datasStatus, _timeList,
  773. waferInfo, _loadSideRoutine.WaferGroup, true, _startTime, _flowLotTrackDatas, _flowDatasStatus);
  774. return true;
  775. }
  776. if (ret == RState.Failed || ret == RState.Timeout)
  777. {
  778. if (Singleton<RouteManager>.Instance.IsAutoRunning)
  779. {
  780. AlarmList alarmList = new AlarmList(Module.ToString(), ((LOADERSTATE)fsm.State).ToString(), (int)LoaderMSG.LoadSide,
  781. _loadSideRoutine.ErrorMsg, _loadSideRoutine.ErrorStep, (int)AlarmType.Error);
  782. AlarmListManager.Instance.AddAlarm(alarmList);
  783. }
  784. PostMsg(LoaderMSG.Error);
  785. _loaderLotTrackDatas.AddRange(_loadSideRoutine.LoadLotTrackDatas);
  786. _timeList.AddRange(_loadSideRoutine.LoadTimeList);
  787. _flowLotTrackDatas.AddRange(_loadSideRoutine.FlowLotTrackDatas);
  788. //Header信息
  789. WaferHolderInfo info = WaferHolderManager.Instance.GetWaferHolder(Module.ToString());
  790. _headerdata.SequenceRecipe = ((info != null && info.SequenceRecipe != null) ? $"{info.SequenceRecipe.SequenceType}\\" + $"{info.SequenceRecipe.Ppid}.seq.rcp" : "");
  791. if (info != null)
  792. {
  793. _headerdata.ProcessTransferList.AddRange(info.SchedulerModules);
  794. info.SchedulerModules.Clear();
  795. }
  796. WaferInfo waferInfo = WaferManager.Instance.GetWafer(Module, _loadSideRoutine.IsSideA ? 0 : 1);
  797. LoaderLotTrackUtil.ExportLoaderLotTrack(Module.ToString(), _headerdata, _loaderLotTrackDatas, _datasStatus, _timeList,
  798. waferInfo, _loadSideRoutine.WaferGroup, true, _startTime, _flowLotTrackDatas, _flowDatasStatus);
  799. }
  800. return false;
  801. }
  802. /// <summary>
  803. /// 确认UnloadSide是否完成
  804. /// </summary>
  805. /// <param name="param"></param>
  806. /// <returns></returns>
  807. private bool ConfirmLoadSide(object[] param)
  808. {
  809. int stepIdex = (int)param[0];
  810. bool result = _loadSideRoutine.CheckCompleteCondition(stepIdex);
  811. if (!result)
  812. {
  813. if (Singleton<RouteManager>.Instance.IsAutoRunning)
  814. {
  815. AlarmList alarmList = new AlarmList(Module.ToString(), ((LOADERSTATE)fsm.State).ToString(), (int)LoaderMSG.LoadSide,
  816. _loadSideRoutine.ErrorMsg, _loadSideRoutine.ErrorStep, (int)AlarmType.Error);
  817. AlarmListManager.Instance.AddAlarm(alarmList);
  818. }
  819. PostMsg(LoaderMSG.Error);
  820. }
  821. else
  822. {
  823. if (Singleton<RouteManager>.Instance.IsAutoRunning)
  824. {
  825. AlarmListManager.Instance.CheckModuleAlamAndRemove(Module.ToString(),LOADERSTATE.Loading.ToString());
  826. }
  827. }
  828. return result;
  829. }
  830. #endregion
  831. #region LotTrack
  832. /// <summary>
  833. /// Init LotTrackDatas
  834. /// </summary>
  835. private void InitLotTrackDatas()
  836. {
  837. _loaderLotTrackDatas.Clear();
  838. _flowLotTrackDatas.Clear();
  839. _timeList.Clear();
  840. //Header信息
  841. _headerdata = new LotTrackFileHeaderCommonData();
  842. _headerdata.SoftWareVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
  843. if (SC.ContainsItem("System.ToolID")) _headerdata.ToolID = SC.GetStringValue("System.ToolID");
  844. _headerdata.ProcessTransferList = new List<string>();
  845. _datasStatus = LotTrackDatasStatus.None;
  846. _flowDatasStatus = LotTrackDatasStatus.None;
  847. }
  848. /// <summary>
  849. /// Set LotTrack Datas Status
  850. /// </summary>
  851. /// <param name="stepIndex"></param>
  852. private void SetLotTrackDatasStatus(int stepIndex)
  853. {
  854. if (stepIndex == 0 || stepIndex == -1)
  855. {
  856. _datasStatus = LotTrackDatasStatus.Half;
  857. _flowDatasStatus = LotTrackDatasStatus.None;
  858. }
  859. else if (stepIndex == 1)
  860. {
  861. _datasStatus = LotTrackDatasStatus.Complete;
  862. _flowDatasStatus = LotTrackDatasStatus.None;
  863. }
  864. else
  865. {
  866. _datasStatus = LotTrackDatasStatus.Complete;
  867. _flowDatasStatus = LotTrackDatasStatus.Complete;
  868. }
  869. _loaderLotTrackDatas.Clear();
  870. _flowLotTrackDatas.Clear();
  871. }
  872. /// <summary>
  873. /// Check WaferGroup change
  874. /// </summary>
  875. /// <param name="currentGroupWafer"></param>
  876. /// <returns></returns>
  877. private void CheckStartTime(string currentWaferGroup)
  878. {
  879. if (!currentWaferGroup.Equals(_preWaferGroup))
  880. {
  881. _preWaferGroup = currentWaferGroup;
  882. _startTime = _timeList[0];
  883. }
  884. }
  885. #endregion
  886. #region LoaderRetry
  887. /// <summary>
  888. /// Retry
  889. /// </summary>
  890. /// <param name="param"></param>
  891. /// <returns></returns>
  892. private bool LoaderRetry(object[] param)
  893. {
  894. AlarmList alarmList = AlarmListManager.Instance.GetAlarmListByModule(Module.ToString());
  895. if (alarmList != null)
  896. {
  897. CheckToPostMessage<LOADERSTATE, LoaderMSG>(eEvent.ERR_LOADER, Module.ToString(), alarmList.ModuleCmd,
  898. alarmList.ModuleStep);
  899. }
  900. return false;
  901. }
  902. #endregion
  903. #region ConfirmComplete
  904. /// <summary>
  905. /// 确认是否完成
  906. /// </summary>
  907. /// <param name="param"></param>
  908. /// <returns></returns>
  909. private bool ConfirmComplete(object[] param)
  910. {
  911. AlarmList alarmList = AlarmListManager.Instance.GetAlarmListByModule(Module.ToString());
  912. if (alarmList != null)
  913. {
  914. if(alarmList.ModuleState==LOADERSTATE.Unloading.ToString())
  915. {
  916. CheckToPostMessage<LOADERSTATE, LoaderMSG>(eEvent.ERR_LOADER, Module.ToString(),(int)LoaderMSG.UnloadSide,alarmList.ModuleStep);
  917. }
  918. else if(alarmList.ModuleState==LOADERSTATE.Loading.ToString())
  919. {
  920. CheckToPostMessage<LOADERSTATE, LoaderMSG>(eEvent.ERR_LOADER, Module.ToString(), (int)LoaderMSG.LoadSide,alarmList.ModuleStep);
  921. }
  922. else if (alarmList.ModuleState == LOADERSTATE.PrepreForPlacing.ToString())
  923. {
  924. CheckToPostMessage<LOADERSTATE, LoaderMSG>(eEvent.ERR_LOADER, Module.ToString(), (int)LoaderMSG.PrepareForPlace, alarmList.ModuleStep);
  925. }
  926. else
  927. {
  928. PostMsg(LoaderMSG.Error);
  929. }
  930. }
  931. return false;
  932. }
  933. /// <summary>
  934. /// 清除报警
  935. /// </summary>
  936. /// <param name="param"></param>
  937. /// <returns></returns>
  938. private bool ClearModuleAlarm(object[] param)
  939. {
  940. AlarmList alarmList = AlarmListManager.Instance.GetAlarmListByModule(Module.ToString());
  941. if (alarmList != null)
  942. {
  943. AlarmListManager.Instance.CheckModuleAlamAndRemove(Module.ToString(), "");
  944. }
  945. return true;
  946. }
  947. #endregion
  948. public bool Check(int msg, out string reason, params object[] args)
  949. {
  950. reason = "";
  951. return false;
  952. }
  953. public bool CheckAcked(int msg)
  954. {
  955. return false;
  956. }
  957. public int Invoke(string function, params object[] args)
  958. {
  959. switch (function)
  960. {
  961. case "HomeAll":
  962. if(IsIdle)
  963. {
  964. return (int)FSM_MSG.NONE;
  965. }
  966. if (CheckToPostMessage<LOADERSTATE, LoaderMSG>(eEvent.ERR_LOADER, Module.ToString(), (int)LoaderMSG.HomeAll))
  967. {
  968. return (int)FSM_MSG.NONE;
  969. }
  970. else
  971. {
  972. return (int)FSM_MSG.ALARM;
  973. }
  974. case "Abort":
  975. CheckToPostMessage<LOADERSTATE, LoaderMSG>(eEvent.ERR_LOADER, Module.ToString(), (int)LoaderMSG.Abort);
  976. return (int)FSM_MSG.NONE;
  977. case "PrepareForPlace":
  978. if (State == (int)LOADERSTATE.WaitForUnload||State==(int)LOADERSTATE.PrepreForPlacing)
  979. {
  980. return (int)LoaderMSG.PrepareForPlace;
  981. }
  982. if (CheckToPostMessage<LOADERSTATE, LoaderMSG>(eEvent.WARN_LOADER, Module.ToString(), (int)LoaderMSG.PrepareForPlace,args))
  983. {
  984. return (int)LoaderMSG.PrepareForPlace;
  985. }
  986. else
  987. {
  988. return (int)FSM_MSG.NONE;
  989. }
  990. case "Retry":
  991. if (CheckToPostMessage<LOADERSTATE, LoaderMSG>(eEvent.ERR_LOADER, Module.ToString(), (int)LoaderMSG.Retry,args))
  992. {
  993. return (int)LoaderMSG.Retry;
  994. }
  995. else
  996. {
  997. return (int)FSM_MSG.NONE;
  998. }
  999. case "ConfirmComplete":
  1000. if (CheckToPostMessage<LOADERSTATE, LoaderMSG>(eEvent.ERR_LOADER, Module.ToString(), (int)LoaderMSG.ConfirmComplete, args))
  1001. {
  1002. return (int)LoaderMSG.ConfirmComplete;
  1003. }
  1004. else
  1005. {
  1006. return (int)FSM_MSG.NONE;
  1007. }
  1008. }
  1009. return (int)FSM_MSG.NONE;
  1010. }
  1011. }
  1012. public enum LoaderMSG
  1013. {
  1014. ReturnInit,
  1015. ReturnIdle,
  1016. Abort,
  1017. HomeAll,
  1018. GoToSavedPosition,
  1019. StopFlow,
  1020. SwitchOnAll,
  1021. SwitchOffAll,
  1022. Error,
  1023. ClearError,
  1024. PrepareForPlace,
  1025. ReadyForPuf,
  1026. UnloadSide,
  1027. LoadSide,
  1028. Retry,
  1029. ConfirmComplete,
  1030. WaitFlip,
  1031. }
  1032. }