ServerModule.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915
  1. using Aitex.Core.Common;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Core.RT.Device.Unit;
  4. using Aitex.Core.RT.SCCore;
  5. using Aitex.Core.Util;
  6. using Aitex.Sorter.Common;
  7. using Efem.Protocol;
  8. using EFEM.RT.Devices.Aligner;
  9. using EFEM.RT.Devices.Flipper;
  10. using EFEM.RT.Modules;
  11. using MECF.Framework.Common.Equipment;
  12. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.BufferStations;
  13. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.LoadPortBase;
  14. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot;
  15. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotBase;
  16. using System;
  17. using System.Collections.Generic;
  18. using System.Text.RegularExpressions;
  19. using System.Threading;
  20. namespace EFEM.RT.Tasks
  21. {
  22. public interface IData
  23. {
  24. bool Error { get; }
  25. bool IsLinkOk { get; }
  26. bool Busy { get; }
  27. //bool Moving { get; }
  28. bool Disabled { get; set; }
  29. bool Initialized { get; set; }
  30. bool OriginSearched { get; set; }
  31. bool InUsed { get; set; }
  32. }
  33. public interface IFunction
  34. {
  35. bool Reset(out string reason);
  36. bool Init(out string reason);
  37. bool Home(out string reason);
  38. }
  39. public interface IServerModule : IData, IFunction
  40. {
  41. string Name { get; set; }
  42. }
  43. public class SystemServerModule : IServerModule
  44. {
  45. //public bool Communication { get { return Singleton<EfemManager>.Instance.IsConnected; } set { } }
  46. public string Name { get; set; }
  47. public bool Busy
  48. { get { return Singleton<RouteManager>.Instance.IsRunning; } }
  49. public bool Moving { get; set; }
  50. public bool Error
  51. {
  52. get { return Singleton<RouteManager>.Instance.IsError; }
  53. }
  54. public bool IsLinkOk
  55. {
  56. get { return Singleton<EfemEntity>.Instance.IsCommunicationOk; }
  57. }
  58. public bool Disabled { get; set; }
  59. public bool Initialized { get; set; }
  60. public bool OriginSearched { get; set; }
  61. public bool InUsed { get; set; }
  62. private Dictionary<EfemEventType, EfemEventValue> _dicEventStatus = new Dictionary<EfemEventType, EfemEventValue>();
  63. public SystemServerModule(string name)
  64. {
  65. Name = name;
  66. foreach (var value in Enum.GetValues(typeof(EfemEventType)))
  67. {
  68. _dicEventStatus[(EfemEventType)value] = EfemEventValue.ON;
  69. }
  70. }
  71. public bool Reset(out string reason)
  72. {
  73. reason = string.Empty;
  74. if (!Singleton<RouteManager>.Instance.CheckToPostMsg(RouteManager.MSG.RESET))
  75. {
  76. reason = "BUSY";
  77. return false;
  78. }
  79. Thread.Sleep(100);//can not remove
  80. //Initialized = true;
  81. return true;
  82. }
  83. public bool Init(out string reason)
  84. {
  85. reason = string.Empty;
  86. if (!Singleton<RouteManager>.Instance.CheckToPostMsg(RouteManager.MSG.HOME))
  87. {
  88. reason = "BUSY";
  89. return false;
  90. }
  91. Thread.Sleep(100);//can not remove
  92. Initialized = true;
  93. return true;
  94. }
  95. public bool Home(out string reason)
  96. {
  97. reason = string.Empty;
  98. if (!Singleton<RouteManager>.Instance.CheckToPostMsg(RouteManager.MSG.HOME))
  99. {
  100. reason = "BUSY";
  101. return false;
  102. }
  103. Initialized = true;
  104. return true;
  105. }
  106. public bool MapWafer(string device, out string reason)
  107. {
  108. reason = string.Empty;
  109. if (!Singleton<RouteManager>.Instance.CheckToPostMsg(RouteManager.MSG.MapWafer, device))
  110. {
  111. reason = "BUSY";
  112. return false;
  113. }
  114. return true;
  115. }
  116. public bool SetEvent(EfemEventType type, EfemEventValue value)
  117. {
  118. _dicEventStatus[type] = value;
  119. return true;
  120. }
  121. public bool IsEventEnabled(EfemEventType type)
  122. {
  123. return _dicEventStatus[type] == EfemEventValue.ON;
  124. }
  125. public bool Hold()
  126. {
  127. return true;
  128. }
  129. public bool Resume()
  130. {
  131. return true;
  132. }
  133. public bool Abort()
  134. {
  135. return true;
  136. }
  137. public bool Stop()
  138. {
  139. return true;
  140. }
  141. public bool ClearError()
  142. {
  143. //InvokeClient.Instance.Service.DoOperation("System.Reset");
  144. //Singleton<EventManager>.Instance.ClearAlarmEvent();
  145. if (Singleton<RouteManager>.Instance.IsError || (DEVICE.GetDevice<LoadPortBaseDevice>(ModuleName.LP1.ToString()) != null && DEVICE.GetDevice<LoadPortBaseDevice>(ModuleName.LP1.ToString()).State == DeviceState.Error) || (DEVICE.GetDevice<LoadPortBaseDevice>(ModuleName.LP2.ToString()) != null && DEVICE.GetDevice<LoadPortBaseDevice>(ModuleName.LP2.ToString()).State == DeviceState.Error))
  146. {
  147. // Singleton<RouteManager>.Instance.Invoke("Reset");
  148. //OP.DoOperation("System.Reset");
  149. //Thread.Sleep(1000);
  150. Singleton<RouteManager>.Instance.ClearEventLogEnable = true;
  151. //Singleton<EventManager>.Instance.ClearAlarmEvent();
  152. }
  153. return true;
  154. }
  155. public string GetLastError()
  156. {
  157. return string.Empty;
  158. }
  159. }
  160. public class AlignerServerModule : IServerModule
  161. {
  162. public bool IsLinkOk
  163. {
  164. get { return _aligner != null && _aligner.Communication; }
  165. }
  166. public bool Busy
  167. {
  168. get { return _aligner.Busy; }
  169. }
  170. public bool Moving
  171. {
  172. get { return _aligner.Moving; }
  173. }
  174. public bool Error
  175. {
  176. get { return _aligner.Error; }
  177. }
  178. public string Name { get; set; }
  179. public bool Disabled { get; set; }
  180. public bool Initialized { get; set; }
  181. public bool OriginSearched { get; set; }
  182. public bool InUsed { get; set; }
  183. private double _angle = 0;
  184. public Aligner GetDevice()
  185. {
  186. return _aligner;
  187. }
  188. protected Aligner _aligner = null;
  189. public AlignerServerModule(string name)
  190. {
  191. Name = name;
  192. _aligner = DEVICE.GetDevice<Aligner>(DeviceName.Aligner);
  193. }
  194. public bool Init(out string reason)
  195. {
  196. return _aligner.Init(out reason);
  197. }
  198. public bool Home(out string reason)
  199. {
  200. return _aligner.Home(out reason);
  201. }
  202. public bool Align(out string reason)
  203. {
  204. return _aligner.Align(_angle, out reason);
  205. }
  206. public bool SetAlign(string target, out string reason)
  207. {
  208. reason = string.Empty;
  209. if (target.StartsWith("P1"))
  210. {
  211. _angle = 0;
  212. }
  213. else if (target.StartsWith("P2"))
  214. {
  215. _angle = 0;
  216. }
  217. else if (target.StartsWith("P3"))
  218. {
  219. _angle = 0;
  220. }
  221. else if (target.StartsWith("P4"))
  222. {
  223. _angle = 0;
  224. }
  225. else if (target.StartsWith("LLA"))
  226. {
  227. _angle = 0;
  228. }
  229. else if (target.StartsWith("LLB"))
  230. {
  231. _angle = 0;
  232. }
  233. else
  234. {
  235. target = target.Replace("D", "");//D***.**, ***.** is angle. (0 to 360.00°)
  236. if (!double.TryParse(target, out _angle))
  237. {
  238. return false;
  239. }
  240. }
  241. return true;
  242. }
  243. bool IFunction.Reset(out string reason)
  244. {
  245. reason = string.Empty;
  246. return true;
  247. }
  248. }
  249. public class RobotServerModule : IServerModule
  250. {
  251. public bool IsLinkOk
  252. {
  253. get { return _robot != null; }
  254. }
  255. public bool Busy
  256. {
  257. get { return _robot.IsBusy; }
  258. }
  259. //public bool Moving
  260. //{
  261. // get { return _robot.Moving; }
  262. //}
  263. public bool Error
  264. {
  265. get { return _robot.IsError; }
  266. }
  267. public bool Disabled { get; set; }
  268. public bool Initialized { get; set; }
  269. public bool OriginSearched { get; set; }
  270. public bool InUsed { get; set; }
  271. public string Name { get; set; }
  272. public RobotBaseDevice GetDevice()
  273. {
  274. return _robot;
  275. }
  276. protected RobotBaseDevice _robot = null;
  277. public RobotServerModule(string name)
  278. {
  279. Name = name;
  280. _robot = DEVICE.GetDevice<RobotBaseDevice>(DeviceName.Robot);
  281. }
  282. public bool Reset(out string reason)
  283. {
  284. reason = null;
  285. return _robot.RobotReset();
  286. }
  287. public bool Init(out string reason)
  288. {
  289. reason = null;
  290. return _robot.Init(null);
  291. }
  292. public bool Home(out string reason)
  293. {
  294. reason = null;
  295. return _robot.Home(null);
  296. }
  297. }
  298. public class LoadPortServerModule : IServerModule
  299. {
  300. public bool IsLinkOk
  301. {
  302. get { return _loadport != null; }
  303. }
  304. public bool Busy
  305. {
  306. get { return _loadport.IsBusy; }
  307. }
  308. //public bool Moving
  309. //{
  310. // get { return _loadport.IsMoving; }
  311. //}
  312. public bool Error
  313. {
  314. get { return _loadport.IsError; }
  315. }
  316. public FoupDockState DockState
  317. {
  318. get { return _loadport.DockState; }
  319. }
  320. public bool Disabled { get; set; }
  321. public bool Initialized { get; set; }
  322. public bool OriginSearched { get; set; }
  323. public bool InUsed { get; set; }
  324. public string Name { get; set; }
  325. public string SlotMap => _loadport.SlotMap;
  326. public LoadPortBaseDevice GetDevice()
  327. {
  328. return _loadport;
  329. }
  330. protected LoadPortBaseDevice _loadport = null;
  331. public LoadPortServerModule(string name)
  332. {
  333. Name = name;
  334. _loadport = DEVICE.GetDevice<LoadPortBaseDevice>(name);
  335. }
  336. public bool Reset(out string reason)
  337. {
  338. return _loadport.LoadportReset(out reason);
  339. }
  340. public bool Init(out string reason)
  341. {
  342. return _loadport.Home(out reason);
  343. }
  344. public bool Home(out string reason)
  345. {
  346. return _loadport.Home(out reason);
  347. }
  348. public bool Lock(out string reason)
  349. {
  350. return _loadport.Clamp(out reason);
  351. }
  352. public bool Unlock(out string reason)
  353. {
  354. return _loadport.Unclamp(out reason);
  355. }
  356. public bool Dock(out string reason)
  357. {
  358. return _loadport.Dock(out reason);
  359. }
  360. public bool Undock(out string reason)
  361. {
  362. return _loadport.Undock(out reason);
  363. }
  364. public bool OpenDoor(out string reason)
  365. {
  366. return _loadport.OpenDoor(out reason);
  367. }
  368. public bool CloseDoor(out string reason)
  369. {
  370. return _loadport.CloseDoor(out reason);
  371. }
  372. public bool Open(out string reason)
  373. {
  374. return _loadport.Load(out reason);
  375. }
  376. public bool Read(out string reason)
  377. {
  378. reason = null;
  379. return _loadport.ReadCarrierID(0, 16);
  380. }
  381. public bool Read()
  382. {
  383. return _loadport.ReadCarrierID();
  384. }
  385. public bool Read(string type, out string reason)
  386. {
  387. reason = null;
  388. string filename = "LCDFILE.TXT";
  389. if (type == "LID") filename = "LCDFILE.TXT";
  390. if (type == "CID") filename = "CARRIER.TXT";
  391. return _loadport.ReadCarrierID(new object[] { filename });
  392. }
  393. public bool Write(string cid)
  394. {
  395. return _loadport.WriteCarrierID(cid, 0, 16, "", out _);
  396. }
  397. public bool Write(string cid, out string reason)
  398. {
  399. reason = null;
  400. return SC.GetValue<Boolean>("System.OnlyLotId") ? _loadport.WriteCarrierIDByIndex(cid, 0, 16, 0) : _loadport.WriteCarrierID(cid, 0, 16);
  401. }
  402. public bool Close(out string reason)
  403. {
  404. return _loadport.Unload(out reason);
  405. }
  406. public bool QueryWaferMap(out string reason)
  407. {
  408. return _loadport.QueryWaferMap(out reason);
  409. }
  410. }
  411. public class BufferServerModule : IServerModule
  412. {
  413. public bool IsLinkOk
  414. {
  415. get { return _buffer != null; }
  416. }
  417. public bool Busy
  418. {
  419. get { return _buffer.Busy; }
  420. }
  421. //public bool Moving
  422. //{
  423. // get { return _buffer.Moving; }
  424. //}
  425. public bool Error
  426. {
  427. get { return _buffer.Error; }
  428. }
  429. public bool Disabled { get; set; }
  430. public bool Initialized { get; set; }
  431. public bool OriginSearched { get; set; }
  432. public bool InUsed { get; set; }
  433. public string Name { get; set; }
  434. public IoCoolingBuffer GetDevice()
  435. {
  436. return _buffer;
  437. }
  438. protected IoCoolingBuffer _buffer = null;
  439. public BufferServerModule(string name)
  440. {
  441. Name = name;
  442. _buffer = DEVICE.GetDevice<IoCoolingBuffer>(name);
  443. }
  444. public bool Init(out string reason)
  445. {
  446. return _buffer.Home(out reason);
  447. }
  448. public bool Home(out string reason)
  449. {
  450. return _buffer.Home(out reason);
  451. }
  452. public bool LiftUp(WaferSize size, out string reason)
  453. {
  454. return _buffer.Move(size, true, out reason);
  455. }
  456. public bool LiftDown(WaferSize size, out string reason)
  457. {
  458. return _buffer.Move(size, false, out reason);
  459. }
  460. public bool Align(WaferSize size, out string reason)
  461. {
  462. return _buffer.Move(size, false, out reason);
  463. }
  464. public bool Reset(out string reason)
  465. {
  466. reason = string.Empty;
  467. return true;
  468. }
  469. }
  470. public class BufferStationServerModule : IServerModule
  471. {
  472. public bool IsLinkOk
  473. {
  474. get { return _buffer != null; }
  475. }
  476. public bool Busy
  477. {
  478. get { return false; }
  479. }
  480. public bool Error
  481. {
  482. get { return false; }
  483. }
  484. public bool Disabled { get; set; }
  485. public bool Initialized { get; set; }
  486. public bool OriginSearched { get; set; }
  487. public bool InUsed { get; set; }
  488. public string Name { get; set; }
  489. public BufferStation GetDevice()
  490. {
  491. return _buffer;
  492. }
  493. protected BufferStation _buffer = null;
  494. public BufferStationServerModule(string name)
  495. {
  496. OriginSearched = true;
  497. Initialized = true;
  498. Name = name;
  499. _buffer = DEVICE.GetDevice<BufferStation>(name);
  500. }
  501. public bool Init(out string reason)
  502. {
  503. reason = string.Empty;
  504. return true;
  505. }
  506. public bool Home(out string reason)
  507. {
  508. reason = string.Empty;
  509. return true;
  510. }
  511. public bool Reset(out string reason)
  512. {
  513. reason = string.Empty;
  514. return true;
  515. }
  516. }
  517. public class MechanicalAlignerServerModule : IServerModule
  518. {
  519. public bool IsLinkOk
  520. {
  521. get { return _mechanicalAligner != null; }
  522. }
  523. public bool Busy
  524. {
  525. get { return false; }
  526. }
  527. public bool Error
  528. {
  529. get { return false; }
  530. }
  531. public bool Disabled { get; set; }
  532. public bool Initialized { get; set; }
  533. public bool OriginSearched { get; set; }
  534. public bool InUsed { get; set; }
  535. public string Name { get; set; }
  536. public MechanicalAligner GetDevice()
  537. {
  538. return _mechanicalAligner;
  539. }
  540. protected MechanicalAligner _mechanicalAligner = null;
  541. public MechanicalAlignerServerModule(string name)
  542. {
  543. OriginSearched = true;
  544. Initialized = true;
  545. Name = name;
  546. _mechanicalAligner = DEVICE.GetDevice<MechanicalAligner>(name);
  547. }
  548. public bool Init(out string reason)
  549. {
  550. reason = string.Empty;
  551. return true;
  552. }
  553. public bool Home(out string reason)
  554. {
  555. reason = string.Empty;
  556. return true;
  557. }
  558. public bool Reset(out string reason)
  559. {
  560. reason = string.Empty;
  561. return true;
  562. }
  563. }
  564. public class FlipperStationServerModule : IServerModule
  565. {
  566. public bool IsLinkOk
  567. {
  568. get { return _flipper != null; }
  569. }
  570. public bool Busy
  571. {
  572. get { return false; }
  573. }
  574. public bool Error
  575. {
  576. get { return false; }
  577. }
  578. public bool Disabled { get; set; }
  579. public bool Initialized { get; set; }
  580. public bool OriginSearched { get; set; }
  581. public bool InUsed { get; set; }
  582. public string Name { get; set; }
  583. public FlipperBase GetDevice()
  584. {
  585. return _flipper;
  586. }
  587. protected FlipperBase _flipper = null;
  588. public FlipperStationServerModule(string name)
  589. {
  590. OriginSearched = true;
  591. Initialized = true;
  592. Name = name;
  593. _flipper = DEVICE.GetDevice<JetFlipper>(name);
  594. }
  595. public bool Init(out string reason)
  596. {
  597. reason = string.Empty;
  598. return true;
  599. }
  600. public bool Home(out string reason)
  601. {
  602. reason = string.Empty;
  603. return true;
  604. }
  605. public bool Reset(out string reason)
  606. {
  607. reason = string.Empty;
  608. return true;
  609. }
  610. }
  611. public class EntityFactory
  612. {
  613. private SystemServerModule _system = null;
  614. private AlignerServerModule _aligner = null;
  615. private RobotServerModule _robot = null;
  616. private LoadPortServerModule _loadportA = null;
  617. private LoadPortServerModule _loadportB = null;
  618. private LoadPortServerModule _loadportC = null;
  619. private LoadPortServerModule _loadportD = null;
  620. private LoadPortServerModule _loadportE = null;
  621. private LoadPortServerModule _loadportF = null;
  622. private LoadPortServerModule _loadportG = null;
  623. private LoadPortServerModule _loadportH = null;
  624. private LoadPortServerModule _loadportI = null;
  625. private LoadPortServerModule _loadportJ = null;
  626. private BufferServerModule _buffer1 = null;
  627. private BufferServerModule _buffer2 = null;
  628. private BufferServerModule _aligner1 = null;
  629. private BufferServerModule _aligner2 = null;
  630. private MechanicalAlignerServerModule _mechanicalAligner1 = null;
  631. private MechanicalAlignerServerModule _mechanicalAligner2 = null;
  632. private BufferStationServerModule _bufferStation = null;
  633. private BufferStationServerModule _bufferStation1 = null;
  634. private BufferStationServerModule _bufferStation2 = null;
  635. private FlipperStationServerModule _flipper = null;
  636. public EntityFactory()
  637. {
  638. _system = new SystemServerModule(DeviceName.System);
  639. _aligner = new AlignerServerModule(DeviceName.Aligner);
  640. _robot = new RobotServerModule(DeviceName.Robot);
  641. _loadportA = new LoadPortServerModule(DeviceName.LP1);
  642. _loadportB = new LoadPortServerModule(DeviceName.LP2);
  643. _loadportC = new LoadPortServerModule(DeviceName.LP3);
  644. _loadportD = new LoadPortServerModule(DeviceName.LP4);
  645. _loadportE = new LoadPortServerModule(DeviceName.LP5);
  646. _loadportF = new LoadPortServerModule(DeviceName.LP6);
  647. _loadportG = new LoadPortServerModule(DeviceName.LP7);
  648. _loadportH = new LoadPortServerModule(DeviceName.LP8);
  649. _loadportI = new LoadPortServerModule(DeviceName.LP9);
  650. _loadportJ = new LoadPortServerModule(DeviceName.LP10);
  651. _aligner1 = new BufferServerModule(DeviceName.Aligner1);
  652. _aligner2 = new BufferServerModule(DeviceName.Aligner2);
  653. _mechanicalAligner1 = new MechanicalAlignerServerModule(DeviceName.Aligner1);
  654. _mechanicalAligner2 = new MechanicalAlignerServerModule(DeviceName.Aligner2);
  655. _buffer1 = new BufferServerModule(DeviceName.CoolingBuffer1);
  656. _buffer2 = new BufferServerModule(DeviceName.CoolingBuffer2);
  657. _bufferStation = new BufferStationServerModule(DeviceName.Buffer);
  658. _bufferStation1 = new BufferStationServerModule(DeviceName.Buffer1);
  659. _bufferStation2 = new BufferStationServerModule(DeviceName.Buffer2);
  660. _flipper = new FlipperStationServerModule(DeviceName.Flipper);
  661. }
  662. public IServerModule GetEntity(string name)
  663. {
  664. if (string.IsNullOrEmpty(name))
  665. return null;
  666. if (ModuleHelper.IsLoadPort((ModuleName)Enum.Parse(typeof(ModuleName), name)))
  667. {
  668. string pattern = "[1-9]\\d*";
  669. Regex rgx = new Regex(pattern);
  670. var match = int.Parse(rgx.Match(name).ToString());
  671. if (match > DeviceDefineManager.Instance.GetValue<int>("LoadPortQuantity"))
  672. {
  673. return null;
  674. }
  675. }
  676. switch (name)
  677. {
  678. case DeviceName.System:
  679. return _system;
  680. case DeviceName.Aligner:
  681. return _aligner;
  682. case DeviceName.Robot:
  683. return _robot;
  684. case DeviceName.LP1:
  685. return _loadportA;
  686. case DeviceName.LP2:
  687. return _loadportB;
  688. case DeviceName.LP3:
  689. return _loadportC;
  690. case DeviceName.LP4:
  691. return _loadportD;
  692. case DeviceName.LP5:
  693. return _loadportE;
  694. case DeviceName.LP6:
  695. return _loadportF;
  696. case DeviceName.LP7:
  697. return _loadportG;
  698. case DeviceName.LP8:
  699. return _loadportH;
  700. case DeviceName.LP9:
  701. return _loadportI;
  702. case DeviceName.LP10:
  703. return _loadportJ;
  704. case DeviceName.Aligner1:
  705. if (SC.ContainsItem("Aligner.AlignerType") && SC.GetValue<int>("Aligner.AlignerType") == 1)
  706. {
  707. return _aligner1;
  708. }
  709. else
  710. {
  711. return _mechanicalAligner1;
  712. }
  713. case DeviceName.Aligner2:
  714. if (SC.ContainsItem("Aligner.AlignerType") && SC.GetValue<int>("Aligner.AlignerType") == 1)
  715. {
  716. return _aligner2;
  717. }
  718. else
  719. {
  720. return _mechanicalAligner2;
  721. }
  722. case DeviceName.Aligner3:
  723. return _aligner1;
  724. case DeviceName.Aligner4:
  725. return _aligner2;
  726. case DeviceName.CoolingBuffer1:
  727. return _buffer1;
  728. case DeviceName.CoolingBuffer2:
  729. return _buffer2;
  730. case DeviceName.Buffer1:
  731. return _bufferStation1;
  732. case DeviceName.Buffer2:
  733. return _bufferStation2;
  734. case DeviceName.Buffer:
  735. return _bufferStation;
  736. case DeviceName.Flipper:
  737. return _flipper;
  738. }
  739. return null;
  740. }
  741. }
  742. }