FutureEfemLoadPortBase.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847
  1. using System;
  2. using System.Collections;
  3. using System.Threading.Tasks;
  4. using Aitex.Core.Common;
  5. using Aitex.Core.RT.DataCenter;
  6. using Aitex.Core.RT.Device;
  7. using Aitex.Core.RT.Device.Unit;
  8. using Aitex.Core.RT.Event;
  9. using Aitex.Core.RT.Log;
  10. using Aitex.Core.RT.OperationCenter;
  11. using Aitex.Core.RT.SCCore;
  12. using Aitex.Core.Util;
  13. using Aitex.Sorter.Common;
  14. using MECF.Framework.Common.Equipment;
  15. using MECF.Framework.Common.FAServices;
  16. using MECF.Framework.Common.SubstrateTrackings;
  17. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Efems.Rorzes;
  18. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts;
  19. namespace JetEfemLib.LPs
  20. {
  21. public abstract class FutureEfemLoadPortBase : LoadPort, IEfemLoadPortCallback
  22. {
  23. public enum LoadPortStates
  24. {
  25. Undefined = 0,
  26. NotInitialized = 1,
  27. Initializing = 2,
  28. Idle = 3,
  29. Mapping = 4,
  30. MappingStation = 5,
  31. Homing = 6,
  32. Faulted = 7,
  33. Clamping = 8,
  34. Docking = 9,
  35. Unclamping = 10,
  36. Undocking = 11,
  37. OpeningDoor = 12,
  38. ClosingDoor = 13,
  39. Loading = 15,
  40. Unloading = 16,
  41. ReadingCarrierID = 17,
  42. Querying = 18,
  43. ChangeAccessMode = 19,
  44. ChangeTransferState = 20,
  45. WritingCarrierID = 21,
  46. ClearError,
  47. SetIndicator,
  48. }
  49. private LoadportCassetteState _cassetteState;
  50. public override LoadportCassetteState CassetteState
  51. {
  52. get { return _cassetteState; }
  53. set { _cassetteState = value; }
  54. }
  55. protected FoupClampState _clampState;
  56. public override FoupClampState ClampState
  57. {
  58. get { return _clampState; }
  59. set { _clampState = value; }
  60. }
  61. protected FoupDockState _dockState;
  62. public override FoupDockState DockState
  63. {
  64. get { return _dockState; }
  65. set { _dockState = value; }
  66. }
  67. protected FoupDoorState _doorState;
  68. public override FoupDoorState DoorState
  69. {
  70. get { return _doorState; }
  71. set { _doorState = value; }
  72. }
  73. public override bool IsAutoClampOnFoupOn
  74. {
  75. get
  76. {
  77. return SC.GetValueOrDefault<bool>($"EFEM.LoadPort.AutoClampOnFoupOn");
  78. }
  79. }
  80. public override bool IsAutoReadCarrierID
  81. {
  82. get
  83. {
  84. return SC.GetValueOrDefault<bool>($"EFEM.LoadPort.EnableAutoCarrierIdRead");
  85. }
  86. }
  87. protected RorzeEfem _efem;
  88. public override bool IsWaferProtrude { get; set; }
  89. private RD_TRIG _trigPresentAbsent = new RD_TRIG();
  90. private RD_TRIG _trigPresentAbsentDely = new RD_TRIG();
  91. private RD_TRIG _trigPlacement = new RD_TRIG();
  92. private R_TRIG _trigWaferProtrude = new R_TRIG();
  93. protected LoadPortStates _loadPortState;
  94. public WaferSize WaferSize { get; set; }
  95. public string LastMapResult { get; set; }
  96. public override bool IsBusy => !(_loadPortState == LoadPortStates.Idle || _loadPortState == LoadPortStates.ReadingCarrierID || _loadPortState == LoadPortStates.WritingCarrierID || _loadPortState == LoadPortStates.Querying);
  97. private DeviceTimer _deviceTimer = new DeviceTimer();
  98. private int _timeDelayNotifyCassettePresent = 100; //ms
  99. public override WaferSize GetCurrentWaferSize()
  100. {
  101. return WaferSize;
  102. }
  103. //private bool _present4;
  104. //private bool _present6;
  105. protected string _efemName;
  106. //private bool _indicatorPlaced;
  107. //private bool _indicatorError;
  108. //private bool _isIntialized;
  109. public FutureEfemLoadPortBase(string module, string name, string efem)
  110. {
  111. base.Module = module;
  112. base.Name = name;
  113. base.Display = name;
  114. base.DeviceID = "";
  115. _efemName = efem;
  116. IsMapWaferByLoadPort = false;
  117. _loadPortState = LoadPortStates.NotInitialized;
  118. }
  119. public override bool Initialize()
  120. {
  121. //if (_efem == null && !string.IsNullOrEmpty(_efemName))
  122. //{
  123. // _efem = DEVICE.GetDevice<FutureEfem>(_efemName);
  124. // _efem.SetLoadPortCallback(ModuleHelper.Converter(Module), this);
  125. //}
  126. //DATA.Subscribe($"{Module}.IndicatorPlaced", () => _indicatorPlaced);
  127. //DATA.Subscribe($"{Module}.IndicatorError", () => _indicatorError);
  128. DATA.Subscribe($"{Module}.IsWaferProtrude", () => IsWaferProtrude);
  129. //DATA.Subscribe($"{Module}.IsPresent4", () => _present4);
  130. //DATA.Subscribe($"{Module}.IsPresent6", () => _present6);
  131. DATA.Subscribe($"{Module}.WaferSize", () => WaferSize.ToString());
  132. DATA.Subscribe($"{Module}.LastMapResult", () => LastMapResult);
  133. if (SC.ContainsItem("EFEM.LoadPort.TimeDelayNotifyCassettePresent"))
  134. {
  135. _timeDelayNotifyCassettePresent = SC.GetValue<int>("EFEM.LoadPort.TimeDelayNotifyCassettePresent");
  136. }
  137. return base.Initialize();
  138. }
  139. public override void Reset()
  140. {
  141. base.Reset();
  142. _trigWaferProtrude.RST = true;
  143. }
  144. public override bool IsEnableMapWafer()
  145. {
  146. return IsPlacement && !IsWaferProtrude;
  147. }
  148. public override bool IsEnableMapWafer(out string reason)
  149. {
  150. reason = string.Empty;
  151. //if (_loadPortState != LoadPortStates.Idle)
  152. //{
  153. // reason = "Cassette is busy";
  154. // return false;
  155. //}
  156. if (!IsPlacement)
  157. {
  158. reason = "Cassette not properly placed";
  159. return false;
  160. }
  161. if (IsWaferProtrude)
  162. {
  163. reason = "Found wafer protrude";
  164. return false;
  165. }
  166. if (CassetteState != LoadportCassetteState.Normal)
  167. {
  168. reason = "Cassette is abnormal";
  169. return false;
  170. }
  171. return IsPlacement && !IsWaferProtrude;
  172. }
  173. public override bool IsEnableTransferWafer()
  174. {
  175. return IsEnableTransferWafer(out _);
  176. }
  177. public override bool IsEnableTransferWafer(out string reason)
  178. {
  179. //if (_loadPortState != LoadPortStates.Idle)
  180. //{
  181. // reason = "Cassette is busy";
  182. // return false;
  183. //}
  184. if (!IsPlacement)
  185. {
  186. reason = "No cassette present";
  187. return false;
  188. }
  189. if (IsWaferProtrude)
  190. {
  191. reason = "Found wafer protrude";
  192. return false;
  193. }
  194. if (!_isMapped)
  195. {
  196. reason = "Cassette not mapped";
  197. return false;
  198. }
  199. if (DoorState != FoupDoorState.Open)
  200. {
  201. reason = "Cassette not open";
  202. return false;
  203. }
  204. if (CassetteState != LoadportCassetteState.Normal)
  205. {
  206. reason = "Cassette is abnormal";
  207. return false;
  208. }
  209. reason = "";
  210. return true;
  211. }
  212. public virtual void NoteStatus(string data1, string data2)
  213. {
  214. }
  215. /*
  216. *Report the wafer presence of all slots.
  217. 0 =No wafer
  218. 1 =Wafer presence
  219. 2 =Abnormal thickness (Wafer is thick)
  220. 3 =Cross slotted wafer
  221. 4 =Front down wafer
  222. 7 =Multiple wafers are in the same slot
  223. 8 =Abnormal thickness (Wafer is thin)
  224. */
  225. public virtual void NoteSlotMap(string slotMap)
  226. {
  227. slotMap = slotMap.Replace('3', '2');
  228. slotMap = slotMap.Replace('4', 'W');
  229. slotMap = slotMap.Replace('7', 'W');
  230. slotMap = slotMap.Replace('8', 'W');
  231. slotMap = slotMap.Replace('2', 'W');
  232. LastMapResult = slotMap;
  233. base.OnSlotMapRead(slotMap);
  234. }
  235. protected IndicatorState GetIndicatorState(bool flag)
  236. {
  237. if (flag)
  238. return IndicatorState.ON;
  239. else
  240. return IndicatorState.OFF;
  241. }
  242. public override void ResetData()
  243. {
  244. _isMapped = false;
  245. _isLoaded = false;
  246. }
  247. public void NoteComplete()
  248. {
  249. //if (_loadPortState == LoadPortStates.Homing)
  250. // _isIntialized = true;
  251. if (_loadPortState == LoadPortStates.Clamping)
  252. EV.Notify(EventPortClamped, new SerializableDictionary<string, string>()
  253. {
  254. {DataVariables.PortID,PortId}
  255. });
  256. if (_loadPortState == LoadPortStates.Unclamping)
  257. EV.Notify(EventPortUnClamped, new SerializableDictionary<string, string>()
  258. {
  259. {DataVariables.PortID,PortId}
  260. });
  261. _loadPortState = LoadPortStates.Idle;
  262. }
  263. public void NoteCancel(string error)
  264. {
  265. IsBusy = false;
  266. EV.PostAlarmLog(Module, $"{Module} is canceled since {error}");
  267. }
  268. public void NoteFailed(string error)
  269. {
  270. IsBusy = false;
  271. EV.PostAlarmLog(Module, $"{Module} is failed since {error}");
  272. }
  273. public void NoteCarrierID(string carrierID)
  274. {
  275. base.OnCarrierIdRead(ModuleHelper.Converter(Module), Name, carrierID);
  276. }
  277. public void NoteWRITETAG(string cid)
  278. {
  279. base.ProceedSetCarrierID(cid);
  280. }
  281. public override bool FALoad(out string reason) //map and loads
  282. {
  283. reason = "";
  284. OP.DoOperation($"{Name}.Load");
  285. return true;
  286. }
  287. public override bool FAUnload(out string reason)
  288. {
  289. reason = "";
  290. OP.DoOperation($"{Name}.Unload");
  291. return true;
  292. }
  293. public override bool Home(out string reason)
  294. {
  295. reason = string.Empty;
  296. if (_efem == null || !_efem.Connection.IsConnected)
  297. {
  298. reason = "efem not connected";
  299. return false;
  300. }
  301. _loadPortState = LoadPortStates.Homing;
  302. //_isIntialized = false;
  303. _isMapped = false;
  304. if (!_efem.HomeLoadPort(Module, out reason))
  305. {
  306. _loadPortState = LoadPortStates.Faulted;
  307. return false;
  308. }
  309. _isLoaded = false;
  310. return true;
  311. }
  312. public override bool ClearError(out string reason)
  313. {
  314. reason = string.Empty;
  315. if (_efem == null || !_efem.Connection.IsConnected)
  316. {
  317. reason = "efem not connected";
  318. return false;
  319. }
  320. //_loadPortState = LoadPortStates.ClearError;
  321. //if (!_efem.ClearAlarm(Module, out reason))
  322. //{
  323. // _loadPortState = LoadPortStates.Faulted;
  324. // return false;
  325. //}
  326. return true;
  327. }
  328. public override bool Clamp(out string reason)
  329. {
  330. reason = string.Empty;
  331. if (_efem == null || !_efem.Connection.IsConnected)
  332. {
  333. reason = "efem not connected";
  334. return false;
  335. }
  336. if (!IsPlacement)
  337. {
  338. reason = "no carrier at load port";
  339. return false;
  340. }
  341. if (ClampState == FoupClampState.Close)
  342. {
  343. return true;
  344. }
  345. _loadPortState = LoadPortStates.Clamping;
  346. if (!_efem.ClampCarrier(Module, out reason))
  347. {
  348. _loadPortState = LoadPortStates.Faulted;
  349. return false;
  350. }
  351. return true;
  352. }
  353. public override bool Unclamp(out string reason)
  354. {
  355. reason = string.Empty;
  356. if (_efem == null || !_efem.Connection.IsConnected)
  357. {
  358. reason = "efem not connected";
  359. return false;
  360. }
  361. if (!IsPlacement)
  362. {
  363. reason = "no carrier at load port";
  364. return false;
  365. }
  366. //if(DoorState != FoupDoorState.Close)
  367. //{
  368. // reason = "cassette not closed";
  369. // return false;
  370. //}
  371. //if(DockState != FoupDockState.Undocked)
  372. //{
  373. // reason = "cassette not undocked";
  374. // return false;
  375. //}
  376. //if (ClampState == FoupClampState.Open)
  377. //{
  378. // return true;
  379. //}
  380. _loadPortState = LoadPortStates.Unclamping;
  381. if (!_efem.UnclampCarrier(Module, out reason))
  382. {
  383. _loadPortState = LoadPortStates.Faulted;
  384. return false;
  385. }
  386. _isMapped = false;
  387. return true;
  388. }
  389. public override bool Dock(out string reason)
  390. {
  391. reason = string.Empty;
  392. if (_efem == null || !_efem.Connection.IsConnected)
  393. {
  394. reason = "efem not connected";
  395. return false;
  396. }
  397. if (!IsPlacement)
  398. {
  399. reason = "no carrier at load port";
  400. return false;
  401. }
  402. //if (ClampState != FoupClampState.Close)
  403. //{
  404. // reason = "cassette not clamped";
  405. // return false;
  406. //}
  407. if (DockState == FoupDockState.Docked)
  408. {
  409. return true;
  410. }
  411. _loadPortState = LoadPortStates.Docking;
  412. if (!_efem.MoveCarrierPort(Module, "Dock", out reason))
  413. {
  414. _loadPortState = LoadPortStates.Faulted;
  415. return false;
  416. }
  417. return true;
  418. }
  419. public override bool Undock(out string reason)
  420. {
  421. reason = string.Empty;
  422. if (_efem == null || !_efem.Connection.IsConnected)
  423. {
  424. reason = "efem not connected";
  425. return false;
  426. }
  427. if (!IsPlacement)
  428. {
  429. reason = "no carrier at load port";
  430. return false;
  431. }
  432. //if (DoorState != FoupDoorState.Close)
  433. //{
  434. // reason = "cassette not closed";
  435. // return false;
  436. //}
  437. if (DockState == FoupDockState.Undocked)
  438. {
  439. return true;
  440. }
  441. _loadPortState = LoadPortStates.Undocking;
  442. if (!_efem.MoveCarrierPort(Module, "Undock", out reason))
  443. {
  444. _loadPortState = LoadPortStates.Faulted;
  445. return false;
  446. }
  447. _isMapped = false;
  448. return true;
  449. }
  450. public override bool OpenDoor(out string reason)
  451. {
  452. reason = string.Empty;
  453. if (_efem == null || !_efem.Connection.IsConnected)
  454. {
  455. reason = "efem not connected";
  456. return false;
  457. }
  458. if (!IsPlacement)
  459. {
  460. reason = "no carrier at load port";
  461. return false;
  462. }
  463. //if (ClampState != FoupClampState.Close)
  464. //{
  465. // reason = "cassette not clamped";
  466. // return false;
  467. //}
  468. //if (DockState != FoupDockState.Docked)
  469. //{
  470. // reason = "cassette not docked";
  471. // return false;
  472. //}
  473. if (DoorState == FoupDoorState.Open)
  474. {
  475. return true;
  476. }
  477. _loadPortState = LoadPortStates.OpeningDoor;
  478. if (!_efem.OpenCarrierDoor(Module, out reason))
  479. {
  480. _loadPortState = LoadPortStates.Faulted;
  481. return false;
  482. }
  483. return true;
  484. }
  485. public override bool CloseDoor(out string reason)
  486. {
  487. reason = string.Empty;
  488. if (_efem == null || !_efem.Connection.IsConnected)
  489. {
  490. reason = "efem not connected";
  491. return false;
  492. }
  493. if (!IsPlacement)
  494. {
  495. reason = "no carrier at load port";
  496. return false;
  497. }
  498. //if (ClampState != FoupClampState.Close)
  499. //{
  500. // reason = "cassette not clamped";
  501. // return false;
  502. //}
  503. //if (DockState != FoupDockState.Docked)
  504. //{
  505. // reason = "cassette not docked";
  506. // return false;
  507. //}
  508. if (DoorState == FoupDoorState.Close)
  509. {
  510. return true;
  511. }
  512. _loadPortState = LoadPortStates.ClosingDoor;
  513. if (!_efem.CloseCarrierDoor(Module, out reason))
  514. {
  515. _loadPortState = LoadPortStates.Faulted;
  516. return false;
  517. }
  518. _isMapped = false;
  519. return true;
  520. }
  521. public override bool ReadRfId(out string reason)
  522. {
  523. reason = string.Empty;
  524. if (_efem == null || !_efem.Connection.IsConnected)
  525. {
  526. reason = "efem not connected";
  527. return false;
  528. }
  529. if (!IsPlacement)
  530. {
  531. reason = "no carrier at load port";
  532. return false;
  533. }
  534. //_loadPortState = LoadPortStates.ReadingCarrierID;
  535. if (!_efem.ReadCarrierId(Module, out string carrierId, out reason))
  536. {
  537. _loadPortState = LoadPortStates.Faulted;
  538. return false;
  539. }
  540. return true;
  541. }
  542. public override bool WriteRfId(string carrierId, out string reason)
  543. {
  544. reason = string.Empty;
  545. if (_efem == null || !_efem.Connection.IsConnected)
  546. {
  547. reason = "efem not connected";
  548. return false;
  549. }
  550. if (!IsPlacement)
  551. {
  552. reason = "no carrier at load port";
  553. return false;
  554. }
  555. //_loadPortState = LoadPortStates.WritingCarrierID;
  556. if (!_efem.WriteCarrierId(Module, carrierId, out reason))
  557. {
  558. SerializableDictionary<string, string> dvid = new SerializableDictionary<string, string>();
  559. dvid["PortID"] = PortId;
  560. dvid[PORT_CTGRY] = PortCategory;
  561. EV.Notify(EventCarrierIdWriteFailed, dvid);
  562. _loadPortState = LoadPortStates.Faulted;
  563. return false;
  564. }
  565. return true;
  566. }
  567. public override bool ChangeAccessMode(bool auto, out string reason)
  568. {
  569. reason = string.Empty;
  570. if (_efem == null || !_efem.Connection.IsConnected)
  571. {
  572. reason = "efem not connected";
  573. return false;
  574. }
  575. _loadPortState = LoadPortStates.ChangeAccessMode;
  576. if (!_efem.ChangeLoadPortAccessMode(ModuleHelper.Converter(Module), auto ? LPAccessMode.AUTO.ToString() : LPAccessMode.MANUAL.ToString(), out reason))
  577. //if (!_efem.SetLoadPortLight(ModuleHelper.Converter(Module), IndicatorType.AccessManual, auto ? IndicatorState.OFF : IndicatorState.ON, out reason))
  578. {
  579. _loadPortState = LoadPortStates.Faulted;
  580. return false;
  581. }
  582. return true;
  583. }
  584. public override bool GetAccessMode(out string reason)
  585. {
  586. reason = string.Empty;
  587. if (_efem == null || !_efem.Connection.IsConnected)
  588. {
  589. reason = "efem not connected";
  590. return false;
  591. }
  592. if (!_efem.GetLoadPortAccessMode(ModuleHelper.Converter(Module), out reason))
  593. {
  594. return false;
  595. }
  596. return true;
  597. }
  598. public override bool SetIndicator(IndicatorType light, IndicatorState state)
  599. {
  600. if (_efem == null || !_efem.Connection.IsConnected)
  601. {
  602. return false;
  603. }
  604. if (!LoadPortIndicatorLightMap.ContainsKey(light))
  605. {
  606. EV.PostWarningLog(Module, $"Not supported indicator {light}");
  607. return false;
  608. }
  609. _loadPortState = LoadPortStates.SetIndicator;
  610. if (!_efem.SetLoadPortLight(ModuleHelper.Converter(Module), light, state, out string reason))
  611. {
  612. _loadPortState = LoadPortStates.Faulted;
  613. LOG.Write(reason);
  614. return false;
  615. }
  616. return true;
  617. }
  618. public override bool QueryState(out string reason)
  619. {
  620. reason = string.Empty;
  621. if (_efem == null || !_efem.Connection.IsConnected)
  622. {
  623. reason = "efem not connected";
  624. return false;
  625. }
  626. _loadPortState = LoadPortStates.Querying;
  627. if (!_efem.GetLoadPortStatus(Module, out _cassetteState, out _clampState, out _dockState, out _doorState, out reason))
  628. {
  629. _loadPortState = LoadPortStates.Faulted;
  630. return false;
  631. }
  632. return true;
  633. }
  634. public override bool QueryWaferMap(out string reason)
  635. {
  636. reason = string.Empty;
  637. if (_efem == null || !_efem.Connection.IsConnected)
  638. {
  639. reason = "efem not connected";
  640. return false;
  641. }
  642. if (!IsPlacement)
  643. {
  644. reason = "no carrier at load port";
  645. return false;
  646. }
  647. if (_efem.CheckIsBusy(ModuleName.EfemRobot))
  648. {
  649. reason = "efem robot is busy";
  650. return false;
  651. }
  652. //if (ClampState != FoupClampState.Close)
  653. //{
  654. // reason = "cassette not clamped";
  655. // return false;
  656. //}
  657. //if (DockState != FoupDockState.Docked)
  658. //{
  659. // reason = "cassette not docked";
  660. // return false;
  661. //}
  662. if (DoorState != FoupDoorState.Open)
  663. {
  664. reason = "cassette not open";
  665. return false;
  666. }
  667. _loadPortState = LoadPortStates.Mapping;
  668. if (!_efem.MapCarrier(Module, out string slotMap, out reason))
  669. {
  670. _loadPortState = LoadPortStates.Faulted;
  671. return false;
  672. }
  673. return true;
  674. }
  675. public override bool GetMapInfo(out string reason)
  676. {
  677. reason = string.Empty;
  678. if (!IsPlacement)
  679. {
  680. reason = "no carrier at load port";
  681. return false;
  682. }
  683. _loadPortState = LoadPortStates.Querying;
  684. if (!_efem.QueryMapResult(Module, out reason, false))
  685. {
  686. _loadPortState = LoadPortStates.Faulted;
  687. return false;
  688. }
  689. return true;
  690. }
  691. public override bool Stop(out string reason)
  692. {
  693. reason = string.Empty;
  694. _loadPortState = LoadPortStates.Idle;
  695. return true;
  696. }
  697. public void CarrierProcessStartEventNotify()
  698. {
  699. EV.Notify(UniversalEvents.CarrierProcessStart, new SerializableDictionary<string, object>()
  700. {
  701. { DataVariables.PortID, Module},
  702. { DataVariables.CarrierID, _carrierId},
  703. });
  704. }
  705. public void CarrierProcessCompleteEventNotify()
  706. {
  707. EV.Notify(UniversalEvents.CarrierProcessComplete, new SerializableDictionary<string, object>()
  708. {
  709. { DataVariables.PortID, Module},
  710. { DataVariables.CarrierID, _carrierId},
  711. });
  712. }
  713. public void WriteLoadPortAccessModeSuccess()
  714. {
  715. Task.Delay(200).ContinueWith(x => GetAccessMode(out string reason));
  716. }
  717. }
  718. }