InitRoutine.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. using Aitex.Core.Common;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Core.RT.Device.Unit;
  4. using Aitex.Core.RT.Event;
  5. using Aitex.Core.RT.Routine;
  6. using Aitex.Core.RT.SCCore;
  7. using Aitex.Core.Util;
  8. using Aitex.Sorter.Common;
  9. using EFEM.RT.Devices;
  10. using EFEMSC;
  11. using MECF.Framework.Common.Equipment;
  12. using MECF.Framework.Common.SubstrateTrackings;
  13. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts;
  14. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot;
  15. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotBase;
  16. using System;
  17. namespace EFEM.RT.Routines
  18. {
  19. public class InitRoutine : CommonRoutine, IRoutine, IEfemRoutine
  20. {
  21. private enum Home
  22. {
  23. DeviceReset,
  24. FfuStart1,
  25. FfuStart2,
  26. RobotClear,
  27. RobotInit,
  28. WaitingRobotInit,
  29. RobotHome,
  30. WaitingRobotHome,
  31. RobotSet,
  32. AlignClear,
  33. AlignerInit,
  34. WaitingAlignerInit,
  35. AlignerHome,
  36. WaitingAlignerHome,
  37. AlignerMoveUp,
  38. WaitingAlignerUp,
  39. Coolingbuffer1Home,
  40. Coolingbuffer2Home,
  41. Aligner1Home,
  42. Aligner2Home,
  43. AxisClearAlarm,
  44. AxisServon,
  45. AxisServonDelay,
  46. AxisSetConfig,
  47. AxisSetConfigDelay,
  48. AxisHome,
  49. CloseAtmShutterDoor,
  50. CloseVtmShutterDoor,
  51. LoadportAClear,
  52. LoadportAHome,
  53. WaitingLoadportAHome,
  54. LoadportBClear,
  55. LoadportBHome,
  56. WaitingLoadportBHome,
  57. LoadportCClear,
  58. LoadportCHome,
  59. WaitingLoadportCHome,
  60. LoadportDClear,
  61. LoadportDHome,
  62. WaitingLoadportDHome,
  63. LoadportEClear,
  64. LoadportEHome,
  65. WaitingLoadportEHome,
  66. LoadportFClear,
  67. LoadportFHome,
  68. WaitingLoadportFHome,
  69. LoadportGClear,
  70. LoadportGHome,
  71. WaitingLoadportGHome,
  72. LoadportHClear,
  73. LoadportHHome,
  74. WaitingLoadportHHome,
  75. LoadportIClear,
  76. LoadportIHome,
  77. WaitingLoadportIHome,
  78. LoadportJClear,
  79. LoadportJHome,
  80. WaitingLoadportJHome,
  81. LoadportAllReset,
  82. LoadportAllInit,
  83. RobotBlade1Grip,
  84. RobotBlade1ConfirmWafer,
  85. RobotBlade1Release,
  86. CheckWaferPrecense,
  87. CheckBlade1WaferPrecense,
  88. CheckBlade1WaferPrecenseWait,
  89. CheckBlade2WaferPrecense,
  90. CheckBlade2WaferPrecenseWait,
  91. RobotBlade2Grip,
  92. RobotBlade2ConfirmWafer,
  93. RobotBlade2Release,
  94. QuerySignalStatus,
  95. RobotBlade1Hold,
  96. RobotBlade2Hold
  97. }
  98. private SetSpeedRoutine RbSetRoutine = null;
  99. private bool _scanBuffer = true;
  100. private SCConfigItem _scRobotHomeTimeout = null;
  101. private int _scFfuSpeed;
  102. private int _timeoutRobot = 0;
  103. private int _timeoutBuffer = 0;
  104. public InitRoutine(string module, string name)
  105. {
  106. Module = module;
  107. Name = name;
  108. RbSetRoutine = new SetSpeedRoutine(module, name);
  109. }
  110. public bool Initalize()
  111. {
  112. RbSetRoutine.Initalize();
  113. _scRobotHomeTimeout = SC.GetConfigItem(SorterCommon.ScPathName.Robot_TimeLimitRobotHome);
  114. IsStopped = true;
  115. return true;
  116. }
  117. public void Terminate()
  118. {
  119. RbSetRoutine.Terminate();
  120. }
  121. public Result Start(params object[] objs)
  122. {
  123. Name = "Init";
  124. Reset();
  125. _timeoutRobot = _scRobotHomeTimeout.IntValue;
  126. _timeoutBuffer = SC.GetValue<int>(ScPathName.Coolbuffer_DownTimeout);
  127. RbSetRoutine.Speed = SC.GetValue<int>(SorterCommon.ScPathName.Robot_RobotSpeed);
  128. if (DeviceDefineManager.Instance.GetValue<bool>("FfuMemoBusControl") ?? false)
  129. {
  130. _scFfuSpeed = SC.GetValue<int>("System.FFUSetSpeed");
  131. }
  132. EV.PostMessage(ModuleName.System.ToString(), EventEnum.HomeBegins, ModuleName.System.ToString());
  133. robot = DEVICE.GetDevice<RobotBaseDevice>(DeviceName.Robot);
  134. _scanBuffer = true;
  135. WaferSensorResetCreate();
  136. IsStopped = false;
  137. return Result.RUN;
  138. }
  139. public Result Monitor()
  140. {
  141. if (IsStopped)
  142. return Result.DONE;
  143. try
  144. {
  145. DeviceReset((int)Home.DeviceReset, "Device Reset", 1, Notify, Stop);
  146. if (DeviceDefineManager.Instance.GetValue<bool>("FfuMemoBusControl") ?? false)
  147. {
  148. FfuSpeedSet((int)Home.FfuStart1, "FFU1", _scFfuSpeed, _timeoutRobot, Notify, Stop);
  149. FfuSpeedSet((int)Home.FfuStart2, "FFU2", _scFfuSpeed, _timeoutRobot, Notify, Stop);
  150. }
  151. RobotReset((int)Home.RobotClear, robot, "Robot reset", _timeoutRobot, Notify, Stop);
  152. RobotHome((int)Home.RobotHome, robot, "Robot home", Notify, Stop);
  153. WaitRobotMotion((int)Home.WaitingRobotHome, robot, "Robot homing...", _timeoutRobot, Notify, Stop);
  154. //GripRobotBlade((int)Home.RobotBlade1Hold, Hand.Blade1, robot, _timeoutRobot);
  155. //GripRobotBlade((int)Home.RobotBlade2Hold, Hand.Blade2, robot, _timeoutRobot);
  156. CheckBladeWaferIsExist((int)Home.CheckBlade1WaferPrecense, robot, Hand.Blade1, _timeoutRobot);
  157. WaitRobotMotion((int)Home.CheckBlade1WaferPrecenseWait, robot, "wait check blade1", _timeoutRobot, Notify, Stop);
  158. CheckBladeWaferIsExist((int)Home.CheckBlade2WaferPrecense, robot, Hand.Blade2, _timeoutRobot);
  159. WaitRobotMotion((int)Home.CheckBlade2WaferPrecenseWait, robot, "wait check blade2", _timeoutRobot, Notify, Stop);
  160. ConfirmRobotBladeWafer((int)Home.RobotBlade1ConfirmWafer, Hand.Blade1);
  161. ConfirmRobotBladeWafer((int)Home.RobotBlade2ConfirmWafer, Hand.Blade2);
  162. // if (NeedRobotGripAndUngrip)
  163. {
  164. HomeGripAndUngripRobotBlade((int)Home.RobotBlade1Grip, Hand.Blade1, robot, _timeoutRobot);
  165. HomeGripAndUngripRobotBlade((int)Home.RobotBlade2Grip, Hand.Blade2, robot, _timeoutRobot);
  166. }
  167. // //CheckRobotBladeWaferPrecense((int)Home.CheckWaferPrecense, robot, _timeoutRobot);
  168. //// RobotSignalStatus((int)Home.QuerySignalStatus, robot, _timeoutRobot);
  169. //HomeReleaseRobotBlade((int)Home.RobotBlade1Release, Hand.Blade1, robot, _timeoutRobot);
  170. //HomeReleaseRobotBlade((int)Home.RobotBlade2Release, Hand.Blade2, robot, _timeoutRobot);
  171. if (DeviceDefineManager.Instance.GetValue<bool>("CoolingBufferInstalled") ?? false)
  172. {
  173. if (!SC.GetValue<bool>("System.CoolingBuffer1Disable"))
  174. CooingbufferHome((int)Home.Coolingbuffer1Home, buffer1, "Cooling buffer1 moving down",
  175. _timeoutBuffer, Notify, Stop);
  176. if (!SC.GetValue<bool>("System.CoolingBuffer2Disable"))
  177. CooingbufferHome((int)Home.Coolingbuffer2Home, buffer2, "Cooling buffer2 moving down",
  178. _timeoutBuffer, Notify, Stop);
  179. if (!SC.GetValue<bool>("System.Aligner1Disable") && SC.ContainsItem("Aligner.AlignerType") && SC.GetValue<int>("Aligner.AlignerType") == 1)
  180. CooingbufferHome((int)Home.Aligner1Home, aligner1, "Aligner1 moving down",
  181. _timeoutBuffer, Notify, Stop);
  182. if (!SC.GetValue<bool>("System.Aligner2Disable") && SC.ContainsItem("Aligner.AlignerType") && SC.GetValue<int>("Aligner.AlignerType") == 1)
  183. CooingbufferHome((int)Home.Aligner2Home, aligner2, "Aligner2 moving down",
  184. _timeoutBuffer, Notify, Stop);
  185. }
  186. //if (LoadLockDoorControlByStation)
  187. //{
  188. // LoadLockCloseAtmDoor((int)Home.CloseAtmShutterDoor, DEVICE.GetDevice<LoadLockDevice>(ModuleName.LL1.ToString()), "Wait Atm Door Close", _timeoutRobot, Notify, Stop);
  189. // LoadLockCloseVtmDoor((int)Home.CloseVtmShutterDoor, DEVICE.GetDevice<LoadLockDevice>(ModuleName.LL1.ToString()), "Wait Vtm Door Close", _timeoutRobot, Notify, Stop);
  190. //}
  191. //if (initIndex < LoadPortQuantity)
  192. //{
  193. // LoadportReset((int)Home.LoadportAClear + initIndex * 3, DEVICE.GetDevice<LoadPortBaseDevice>($"LP{initIndex + 1}"), $"LP{initIndex + 1} reset", _timeoutRobot, Notify, Stop);
  194. // initIndex++;
  195. // return Result.RUN;
  196. //}
  197. LoadportAllReset((int)Home.LoadportAllReset, _timeoutRobot);
  198. LoadportAllInit((int)Home.LoadportAllInit, _timeoutRobot);
  199. }
  200. catch (RoutineBreakException)
  201. {
  202. return Result.RUN;
  203. }
  204. catch (RoutineFaildException)
  205. {
  206. IsStopped = true;
  207. return Result.FAIL;
  208. }
  209. EV.PostMessage(ModuleName.System.ToString(), EventEnum.HomeEnds, ModuleName.System.ToString());
  210. IsStopped = true;
  211. return Result.DONE;
  212. }
  213. public void FfuSpeedSet(int id, string name, int speed, int time, Action<string> notify, Action<string> error)
  214. {
  215. Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
  216. {
  217. var device = DEVICE.GetDevice<Ffu>(name);
  218. notify($"{device.Name} start and set speed");
  219. string reason = string.Empty;
  220. device.StartAndSetSpeed(speed);
  221. return true;
  222. }, () =>
  223. {
  224. var device = DEVICE.GetDevice<Ffu>(name);
  225. switch (device.Name)
  226. {
  227. case "FFU1":
  228. if (Ffu.SpeedSet1)
  229. {
  230. notify($"{device.Name} is running");
  231. return true;
  232. }
  233. break;
  234. case "FFU2":
  235. if (Ffu.SpeedSet2)
  236. {
  237. notify($"{device.Name} is running");
  238. return true;
  239. }
  240. break;
  241. }
  242. return false;
  243. }, time * 1000);
  244. if (ret.Item1)
  245. {
  246. if (ret.Item2 == Result.FAIL)
  247. {
  248. throw (new RoutineFaildException());
  249. }
  250. else if (ret.Item2 == Result.TIMEOUT) //timeout
  251. {
  252. error(String.Format("{0} timeout, than {1} seconds", name, time));
  253. throw (new RoutineFaildException());
  254. }
  255. else
  256. throw (new RoutineBreakException());
  257. }
  258. }
  259. protected void WaitRobotSet(int id, string name, IRoutine routines, Action<string> notify, Action<string> error)
  260. {
  261. Tuple<bool, Result> ret = ExecuteAndWait(id, routines);
  262. if (ret.Item1)
  263. {
  264. if (ret.Item2 == Result.FAIL)
  265. {
  266. error(name);
  267. throw (new RoutineFaildException());
  268. }
  269. else if (ret.Item2 == Result.RUN)
  270. {
  271. throw (new RoutineBreakException());
  272. }
  273. }
  274. }
  275. protected void DeviceReset(int id, string name, int time, Action<string> notify, Action<string> error)
  276. {
  277. Tuple<bool, Result> ret = Delay(id, () =>
  278. {
  279. notify(String.Format("Device reset"));
  280. Singleton<DeviceEntity>.Instance.PostMsg(DeviceEntity.MSG.RESET);
  281. return true;
  282. }, time * 1000);
  283. if (ret.Item1)
  284. {
  285. if (ret.Item2 == Result.RUN)
  286. {
  287. throw (new RoutineBreakException());
  288. }
  289. }
  290. }
  291. #region aligner
  292. public void AlignerReset(int id, Aligner device, string name, int time, Action<string> notify, Action<string> error)
  293. {
  294. Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
  295. {
  296. notify(String.Format("{0} clear error", device.Name));
  297. string reason = string.Empty;
  298. return device.Clear(out reason);
  299. }, () =>
  300. {
  301. if (device.Busy == false)
  302. {
  303. return true;
  304. }
  305. return false;
  306. }, time * 1000);
  307. if (ret.Item1)
  308. {
  309. if (ret.Item2 == Result.FAIL)
  310. {
  311. throw (new RoutineFaildException());
  312. }
  313. else if (ret.Item2 == Result.TIMEOUT) //timeout
  314. {
  315. error(String.Format("{0} timeout, than {1} seconds", name, time));
  316. throw (new RoutineFaildException());
  317. }
  318. else
  319. throw (new RoutineBreakException());
  320. }
  321. }
  322. public void AlignerInit(int id, Aligner device, string name, Action<string> notify, Action<string> error)
  323. {
  324. Tuple<bool, Result> ret = Execute(id, () =>
  325. {
  326. notify(String.Format("{0} Home", device.Name));
  327. string reason = string.Empty;
  328. return device.Init(out reason);
  329. });
  330. if (ret.Item1)
  331. {
  332. if (ret.Item2 == Result.FAIL)
  333. {
  334. throw (new RoutineFaildException());
  335. }
  336. }
  337. }
  338. public void AlignerHome(int id, Aligner device, string name, Action<string> notify, Action<string> error)
  339. {
  340. Tuple<bool, Result> ret = Execute(id, () =>
  341. {
  342. notify(String.Format("{0} Home", device.Name));
  343. string reason = string.Empty;
  344. return device.Home(out reason);
  345. });
  346. if (ret.Item1)
  347. {
  348. if (ret.Item2 == Result.FAIL)
  349. {
  350. throw (new RoutineFaildException());
  351. }
  352. }
  353. }
  354. public void AlignerMoveUp(int id, Aligner device, string name, Action<string> notify, Action<string> error)
  355. {
  356. Tuple<bool, Result> ret = Execute(id, () =>
  357. {
  358. notify(String.Format("{0} Lift up", device.Name));
  359. string reason = string.Empty;
  360. return device.LiftUp(out reason);
  361. });
  362. if (ret.Item1)
  363. {
  364. if (ret.Item2 == Result.FAIL)
  365. {
  366. throw (new RoutineFaildException());
  367. }
  368. }
  369. }
  370. #endregion aligner
  371. #region Loadport
  372. ///等待 Loadport
  373. public void QueryLoadportState(int id, LoadPort device, string name, int time, Action<string> notify, Action<string> error)
  374. {
  375. Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
  376. {
  377. notify(String.Format("{0} query state", device.Name));
  378. string reason = string.Empty;
  379. device.QueryState(out reason);
  380. return true;
  381. }, () =>
  382. {
  383. if (!device.IsBusy)
  384. {
  385. return true;
  386. }
  387. return false;
  388. }, time * 1000);
  389. if (ret.Item1)
  390. {
  391. if (ret.Item2 == Result.FAIL)
  392. {
  393. throw (new RoutineFaildException());
  394. }
  395. else if (ret.Item2 == Result.TIMEOUT) //timeout
  396. {
  397. error(String.Format("{0} query timeout, than {1} seconds", name, time));
  398. throw (new RoutineFaildException());
  399. }
  400. else
  401. throw (new RoutineBreakException());
  402. }
  403. }
  404. #endregion Loadport
  405. private void WaferSensorResetCreate()
  406. {
  407. if (!_scanBuffer) return;
  408. //var sensors = new List<bool>
  409. //{
  410. // DeviceModel.SensorCoolingStageSLOT1WaferON != null ? DeviceModel.SensorCoolingStageSLOT1WaferON.Value : true,
  411. // DeviceModel.SensorCoolingStageSLOT2WaferON != null ? DeviceModel.SensorCoolingStageSLOT2WaferON.Value : true,
  412. // DeviceModel.SensorCoolingStageSLOT3WaferON != null ? DeviceModel.SensorCoolingStageSLOT3WaferON.Value : true,
  413. // DeviceModel.SensorCoolingStageSLOT4WaferON != null ? DeviceModel.SensorCoolingStageSLOT4WaferON.Value : true,
  414. // DeviceModel.SensorCoolingStageSLOT5WaferON != null ? DeviceModel.SensorCoolingStageSLOT5WaferON.Value : true,
  415. // DeviceModel.SensorCoolingStageSLOT6WaferON != null ? DeviceModel.SensorCoolingStageSLOT6WaferON.Value : true,
  416. //};
  417. var index = 0;
  418. //foreach (var sensor in sensors)
  419. //{
  420. // if (!sensor && WaferManager.Instance.CheckNoWafer(ModuleName.CoolingBuffer1, index))
  421. // {
  422. // WaferManager.Instance.CreateWafer(ModuleName.CoolingBuffer1, index, WaferStatus.Normal);
  423. // }
  424. // else if (sensor && WaferManager.Instance.CheckHasWafer(ModuleName.CoolingBuffer1, index))
  425. // {
  426. // WaferManager.Instance.DeleteWafer(ModuleName.CoolingBuffer1, index);
  427. // }
  428. // if (!sensor && WaferManager.Instance.CheckNoWafer(ModuleName.CoolingBuffer2, index))
  429. // {
  430. // WaferManager.Instance.CreateWafer(ModuleName.CoolingBuffer2, index, WaferStatus.Normal);
  431. // }
  432. // else if (sensor && WaferManager.Instance.CheckHasWafer(ModuleName.CoolingBuffer2, index))
  433. // {
  434. // WaferManager.Instance.DeleteWafer(ModuleName.CoolingBuffer2, index);
  435. // }
  436. // index++;
  437. //}
  438. //var robotSensors = new List<bool>
  439. //{
  440. // DeviceModel.SensorRBlowerArmhavewafer != null ? DeviceModel.SensorRBlowerArmhavewafer.Value : true,
  441. // DeviceModel.SensorRBupperArmhavewafer != null ? DeviceModel.SensorRBupperArmhavewafer.Value : true,
  442. //};
  443. //index = 0;
  444. //foreach (var sensor in robotSensors)
  445. //{
  446. // if (!sensor && WaferManager.Instance.CheckNoWafer(ModuleName.Robot, index))
  447. // {
  448. // WaferManager.Instance.CreateWafer(ModuleName.Robot, index, WaferStatus.Normal);
  449. // }
  450. // else if (sensor && WaferManager.Instance.CheckHasWafer(ModuleName.Robot, index))
  451. // {
  452. // WaferManager.Instance.DeleteWafer(ModuleName.Robot, index);
  453. // }
  454. // index++;
  455. //}
  456. if (DeviceModel.SensorPreAlignerWaferOn != null && !DeviceModel.SensorPreAlignerWaferOn.Value && WaferManager.Instance.CheckNoWafer(ModuleName.Aligner, 0))
  457. {
  458. WaferManager.Instance.CreateWafer(ModuleName.Aligner, 0, WaferStatus.Normal);
  459. }
  460. else
  461. {
  462. if (DeviceDefineManager.Instance.GetValue<bool>("AlignerInstalled") ?? false)
  463. WaferManager.Instance.DeleteWafer(ModuleName.Aligner, 0);
  464. if (SC.ContainsItem("System.Aligner1Disable") ? !SC.GetValue<bool>("System.Aligner1Disable") : false)
  465. WaferManager.Instance.DeleteWafer(ModuleName.Aligner1, 0);
  466. if (SC.ContainsItem("System.Aligner2Disable") ? !SC.GetValue<bool>("System.Aligner2Disable") : false)
  467. WaferManager.Instance.DeleteWafer(ModuleName.Aligner2, 0);
  468. }
  469. //var loadLockQuantity = DeviceDefineManager.Instance.GetValue<int>("LoadLockQuantity") ?? 0;
  470. //if (loadLockQuantity > 0 && Singleton<EfemEntity>.Instance.IsOnlineMode)
  471. //{
  472. // for (int i = 1; i <= loadLockQuantity; i++)
  473. // {
  474. // var moduleName = ModuleHelper.Converter($"LL{i}");
  475. // if (WaferManager.Instance.CheckHasWafer(moduleName, 0))
  476. // {
  477. // WaferManager.Instance.DeleteWafer(moduleName, 0);
  478. // }
  479. // }
  480. //}
  481. _scanBuffer = false;
  482. }
  483. public void CooingbufferHome(int id, IoCoolingBuffer device, string name, int time, Action<string> notify, Action<string> error)
  484. {
  485. Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
  486. {
  487. if (SC.GetValue<bool>($"System.{device.Name}Disable"))
  488. {
  489. EV.PostInfoLog("System", String.Format("{0} is Disable", device.Name));
  490. return true;
  491. }
  492. notify(String.Format("{0} {1}", device.Name, name));
  493. string reason = string.Empty;
  494. return device.Home(out reason);
  495. }, () =>
  496. {
  497. if (SC.GetValue<bool>($"System.{device.Name}Disable"))
  498. {
  499. //EV.PostInfoLog("System", String.Format("{0} is Disable", device.Name));
  500. return true;
  501. }
  502. if (device.Error == true)
  503. {
  504. return null;
  505. }
  506. return device.CheckMovedDown() && !device.Busy;
  507. }, time * 1000);
  508. if (ret.Item1)
  509. {
  510. if (ret.Item2 == Result.FAIL)
  511. {
  512. throw (new RoutineFaildException());
  513. }
  514. else if (ret.Item2 == Result.TIMEOUT) //timeout
  515. {
  516. error(String.Format("{0} timeout, than {1} seconds", name, time));
  517. throw (new RoutineFaildException());
  518. }
  519. else
  520. throw (new RoutineBreakException());
  521. }
  522. }
  523. protected override void Notify(string message)
  524. {
  525. EV.PostMessage(Module, EventEnum.GeneralInfo, String.Format("Home sequence :{0}", message));
  526. }
  527. /// <summary>
  528. /// prepare process failed
  529. /// </summary>
  530. /// <param name="failReason"></param>
  531. /// <param name="reactor"></param>
  532. protected override void Stop(string failReason)
  533. {
  534. string reason = String.Empty;
  535. EV.PostMessage(Module, EventEnum.HomeFailed, failReason);
  536. }
  537. }
  538. }