EFEMViewModel.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866
  1. using System;
  2. using System.Collections.Generic;
  3. using Aitex.Core.Common.DeviceData;
  4. using Aitex.Core.Util;
  5. using Aitex.Sorter.Common;
  6. using Bolt.Toolkit.Wpf.Data;
  7. using Bolt.Toolkit.Wpf.Data.Enum;
  8. using Caliburn.Micro.Core;
  9. using MECF.Framework.Common.DataCenter;
  10. using MECF.Framework.Common.Equipment;
  11. using MECF.Framework.Common.OperationCenter;
  12. using VirgoCommon;
  13. using VirgoUI.Client.Models.Sys;
  14. namespace VirgoUI.Client.Models.Platform.EFEM
  15. {
  16. public class EFEMViewModel : UiViewModelBase
  17. {
  18. private int MenuPermission;
  19. #region Properties
  20. [Subscription("LP1.Status")]
  21. public string LP1Status { get; set; }
  22. public string LP1StatusBackground
  23. {
  24. get { return GetUnitStatusBackground(LP1Status); }
  25. }
  26. [Subscription("LP1.IsMapped")]
  27. public bool IsLP1Mapped { get; set; }
  28. [Subscription("LP2.Status")]
  29. public string LP2Status { get; set; }
  30. public string LP2StatusBackground
  31. {
  32. get { return GetUnitStatusBackground(LP2Status); }
  33. }
  34. [Subscription("LP2.IsMapped")]
  35. public bool IsLP2Mapped { get; set; }
  36. [Subscription("EFEM.FsmState")]
  37. public string EfemStatus { get; set; }
  38. public string EfemStatusBackground
  39. {
  40. get { return GetUnitStatusBackground(EfemStatus); }
  41. }
  42. [Subscription("PMA.IsAutoMode")]
  43. public bool PMAIsAutoMode { get; set; }
  44. [Subscription("PMB.IsAutoMode")]
  45. public bool PMBIsAutoMode { get; set; }
  46. [Subscription("PMA.IsOnline")]
  47. public bool PMAIsOnline { get; set; }
  48. [Subscription("PMB.IsOnline")]
  49. public bool PMBIsOnline { get; set; }
  50. public string PMAState
  51. {
  52. get
  53. {
  54. return "PMA/" + (PMAIsAutoMode ? "Auto/" : "Manual/") + (PMAIsOnline ? "Online" : "Offline");
  55. }
  56. }
  57. public string PMBState
  58. {
  59. get
  60. {
  61. return "PMB/" + (PMBIsAutoMode ? "Auto/" : "Manual/") + (PMBIsOnline ? "Online" : "Offline");
  62. }
  63. }
  64. private string _SelectedModule;
  65. public string SelectedModule
  66. {
  67. get
  68. {
  69. return _SelectedModule;
  70. }
  71. set
  72. {
  73. _SelectedModule = value;
  74. Slots = GetSlotsByModule(_SelectedModule);
  75. SelectedSlot = 1;
  76. NotifyOfPropertyChange("SelectedModule");
  77. }
  78. }
  79. private string _PickSelectedModule;
  80. public string PickSelectedModule
  81. {
  82. get
  83. {
  84. return _PickSelectedModule;
  85. }
  86. set
  87. {
  88. _PickSelectedModule = value;
  89. PickSlots = GetSlotsByModule(_PickSelectedModule);
  90. PickSelectedSlot = 1;
  91. NotifyOfPropertyChange("PickSelectedModule");
  92. }
  93. }
  94. private string _PlaceSelectedModule;
  95. public string PlaceSelectedModule
  96. {
  97. get
  98. {
  99. return _PlaceSelectedModule;
  100. }
  101. set
  102. {
  103. _PlaceSelectedModule = value;
  104. PlaceSlots = GetSlotsByModule(_PlaceSelectedModule);
  105. PlaceSelectedSlot = 1;
  106. NotifyOfPropertyChange("PlaceSelectedModule");
  107. }
  108. }
  109. private string _ExtendSelectedModule;
  110. public string ExtendSelectedModule
  111. {
  112. get
  113. {
  114. return _ExtendSelectedModule;
  115. }
  116. set
  117. {
  118. _ExtendSelectedModule = value;
  119. ExtendSlots = GetExtendPos();
  120. NotifyOfPropertyChange("ExtendSelectedModule");
  121. }
  122. }
  123. private List<string> GetExtendPos()
  124. {
  125. //return new List<string> { "G1", "GB", "G4", "P1", "PB", "P4" };
  126. return new List<string> { "GoIntoGet", "GoBackGet", "GoIntoPut", "GoBackPut" };
  127. }
  128. private static Dictionary<string, string> ExtendParam = new Dictionary<string, string>()
  129. {
  130. {"GoIntoGet","GB" },
  131. {"GoBackGet","G4" },
  132. {"GoIntoPut","PB" },
  133. {"GoBackPut","P4" }
  134. };
  135. private string _RetractSelectedModule;
  136. public string RetractSelectedModule
  137. {
  138. get
  139. {
  140. return _RetractSelectedModule;
  141. }
  142. set
  143. {
  144. _RetractSelectedModule = value;
  145. RetractSlots = GetExtendPos();
  146. NotifyOfPropertyChange("RetractSelectedModule");
  147. }
  148. }
  149. private string _MapSelectedModule;
  150. public string MapSelectedModule
  151. {
  152. get
  153. {
  154. return _MapSelectedModule;
  155. }
  156. set
  157. {
  158. _MapSelectedModule = value;
  159. //MapSlots = GetSlotsByModule(_MapSelectedModule);
  160. MapSelectedSlot = 1;
  161. NotifyOfPropertyChange("MapSelectedModule");
  162. }
  163. }
  164. [Subscription("EfemRobot.RobotMoveAction")]
  165. public string EfemRobotMoveAction
  166. {
  167. get;
  168. set;
  169. }
  170. //[Subscription("EFEM.CassetteDoor")]
  171. //public AITSensorData CassetteDoorStatus
  172. //{
  173. // get;
  174. // set;
  175. //}
  176. [Subscription("EFEM.CassetteDoor")]
  177. public LidState CassetteDoorStatus
  178. {
  179. get;
  180. set;
  181. }
  182. public bool IsLP1PresentFeedback
  183. {
  184. get { return LP1CassetteState == LoadportCassetteState.Normal; }
  185. }
  186. public bool IsLP2PresentFeedback
  187. {
  188. get { return LP2CassetteState == LoadportCassetteState.Normal; }
  189. }
  190. [Subscription("LP1.CassetteState")]
  191. public LoadportCassetteState LP1CassetteState { get; set; }
  192. [Subscription("LP2.CassetteState")]
  193. public LoadportCassetteState LP2CassetteState { get; set; }
  194. public bool Foup1Present
  195. {
  196. get { return LP1CassetteState == LoadportCassetteState.Normal; }
  197. }
  198. public bool Foup2Present
  199. {
  200. get { return LP2CassetteState == LoadportCassetteState.Normal; }
  201. }
  202. public RobotMoveInfo EfemRobotMoveInfo
  203. {
  204. get
  205. {
  206. RobotMoveInfo _moveInfo = new RobotMoveInfo() { BladeTarget = "System" };
  207. if (!string.IsNullOrEmpty(EfemRobotMoveAction))
  208. {
  209. var action = EfemRobotMoveAction.Split('.');
  210. _moveInfo.BladeTarget = action[0];
  211. _moveInfo.Action = (RobotAction)Enum.Parse(typeof(RobotAction), action[1]);
  212. }
  213. return _moveInfo;
  214. }
  215. }
  216. private List<string> _blades = new List<string>() { "Blade1", "Blade2" };
  217. public List<string> Blades
  218. {
  219. get { return _blades; }
  220. set { _blades = value; NotifyOfPropertyChange("Blades"); }
  221. }
  222. private int _SelectedSlot;
  223. public int SelectedSlot
  224. {
  225. get { return _SelectedSlot; }
  226. set { _SelectedSlot = value; NotifyOfPropertyChange("SelectedSlot"); }
  227. }
  228. private int _PickSelectedSlot;
  229. public int PickSelectedSlot
  230. {
  231. get { return _PickSelectedSlot; }
  232. set { _PickSelectedSlot = value; NotifyOfPropertyChange("PickSelectedSlot"); }
  233. }
  234. private string _pickSelectedBlade;
  235. public string PickSelectedBlade
  236. {
  237. get { return _pickSelectedBlade; }
  238. set { _pickSelectedBlade = value; NotifyOfPropertyChange("PickSelectedBlade"); }
  239. }
  240. private int _PlaceSelectedSlot;
  241. public int PlaceSelectedSlot
  242. {
  243. get { return _PlaceSelectedSlot; }
  244. set { _PlaceSelectedSlot = value; NotifyOfPropertyChange("PlaceSelectedSlot"); }
  245. }
  246. private string _placeSelectedBlade;
  247. public string PlaceSelectedBlade
  248. {
  249. get { return _placeSelectedBlade; }
  250. set { _placeSelectedBlade = value; NotifyOfPropertyChange("PlaceSelectedBlade"); }
  251. }
  252. private string _ExtendSelectedSlot;
  253. public string ExtendSelectedSlot
  254. {
  255. get { return _ExtendSelectedSlot; }
  256. set { _ExtendSelectedSlot = value; NotifyOfPropertyChange("ExtendSelectedSlot"); }
  257. }
  258. private string _extendSelectedBlade;
  259. public string ExtendSelectedBlade
  260. {
  261. get { return _extendSelectedBlade; }
  262. set { _extendSelectedBlade = value; NotifyOfPropertyChange("ExtendSelectedBlade"); }
  263. }
  264. private string _gripSelectedBlade;
  265. public string GripSelectedBlade
  266. {
  267. get { return _gripSelectedBlade; }
  268. set { _gripSelectedBlade = value; NotifyOfPropertyChange("GripSelectedBlade"); }
  269. }
  270. private string _ungripSelectedBlade;
  271. public string UngripSelectedBlade
  272. {
  273. get { return _ungripSelectedBlade; }
  274. set { _ungripSelectedBlade = value; NotifyOfPropertyChange("UngripSelectedBlade"); }
  275. }
  276. private int _RetractSelectedSlot;
  277. public int RetractSelectedSlot
  278. {
  279. get { return _RetractSelectedSlot; }
  280. set { _RetractSelectedSlot = value; NotifyOfPropertyChange("RetractSelectedSlot"); }
  281. }
  282. private int _MapSelectedSlot;
  283. public int MapSelectedSlot
  284. {
  285. get { return _MapSelectedSlot; }
  286. set { _MapSelectedSlot = value; NotifyOfPropertyChange("MapSelectedSlot"); }
  287. }
  288. private List<string> _pickModules;
  289. public List<string> PickPlaceModules
  290. {
  291. get { return _pickModules; }
  292. set { _pickModules = value; NotifyOfPropertyChange("PickPlaceModules"); }
  293. }
  294. private List<string> _mapModules;
  295. public List<string> MapModules
  296. {
  297. get { return _mapModules; }
  298. set { _mapModules = value; NotifyOfPropertyChange("MapModules"); }
  299. }
  300. private List<string> _extendModules;
  301. public List<string> ExtendRetractModules
  302. {
  303. get { return _extendModules; }
  304. set { _extendModules = value; NotifyOfPropertyChange("ExtendRetractModules"); }
  305. }
  306. private List<int> _slots;
  307. public List<int> Slots
  308. {
  309. get { return _slots; }
  310. set { _slots = value; NotifyOfPropertyChange("Slots"); }
  311. }
  312. private List<int> _Pickslots;
  313. public List<int> PickSlots
  314. {
  315. get { return _Pickslots; }
  316. set { _Pickslots = value; NotifyOfPropertyChange("PickSlots"); }
  317. }
  318. private List<int> _Placeslots;
  319. public List<int> PlaceSlots
  320. {
  321. get { return _Placeslots; }
  322. set { _Placeslots = value; NotifyOfPropertyChange("PlaceSlots"); }
  323. }
  324. private List<string> _Extendslots;
  325. public List<string> ExtendSlots
  326. {
  327. get { return _Extendslots; }
  328. set { _Extendslots = value; NotifyOfPropertyChange("ExtendSlots"); }
  329. }
  330. private List<string> _Retractslots;
  331. public List<string> RetractSlots
  332. {
  333. get { return _Retractslots; }
  334. set { _Retractslots = value; NotifyOfPropertyChange("RetractSlots"); }
  335. }
  336. [Subscription("LP1.WaferSize")]
  337. public string LP1WaferSize { get; set; }
  338. public string WaferSizeLP1
  339. {
  340. get { return LP1CassetteState == LoadportCassetteState.Normal ? GetWaferSize(LP1WaferSize) : "--"; }
  341. }
  342. [Subscription("LP2.WaferSize")]
  343. public string LP2WaferSize { get; set; }
  344. public string WaferSizeLP2
  345. {
  346. get { return LP2CassetteState == LoadportCassetteState.Normal ? GetWaferSize(LP2WaferSize) : "--"; }
  347. }
  348. [Subscription("Aligner1.WaferSize")]
  349. public string Aligner1WaferSize { get; set; }
  350. public string WaferSizeAligner1
  351. {
  352. get { return GetWaferSize(Aligner1WaferSize); }
  353. }
  354. [Subscription("Aligner2.WaferSize")]
  355. public string Aligner2WaferSize { get; set; }
  356. public string WaferSizeAligner2
  357. {
  358. get { return GetWaferSize(Aligner2WaferSize); }
  359. }
  360. [Subscription("Cooling1.WaferSize")]
  361. public string Cooling1WaferSize { get; set; }
  362. public string WaferSizeCooling1
  363. {
  364. get { return GetWaferSize(Cooling1WaferSize); }
  365. }
  366. [Subscription("Cooling2.WaferSize")]
  367. public string Cooling2WaferSize { get; set; }
  368. public string WaferSizeCooling2
  369. {
  370. get { return GetWaferSize(Cooling2WaferSize); }
  371. }
  372. [Subscription("EfemRobot.WaferSize")]
  373. public string EfemRobotWaferSize { get; set; }
  374. public string WaferSizeEfemRobot
  375. {
  376. get { return GetWaferSize(EfemRobotWaferSize); }
  377. }
  378. [Subscription("PMA.WaferSize")]
  379. public string PMAWaferSize { get; set; }
  380. public string WaferSizePMA
  381. {
  382. get { return GetWaferSize(PMAWaferSize); }
  383. }
  384. [Subscription("PMB.WaferSize")]
  385. public string PMBWaferSize { get; set; }
  386. public string WaferSizePMB
  387. {
  388. get { return GetWaferSize(PMBWaferSize); }
  389. }
  390. [Subscription("EFEM.SmallWafer")]
  391. public int SmallWafer { get; set; }
  392. [Subscription("EFEM.MidWafer")]
  393. public int MidWafer { get; set; }
  394. [Subscription("EFEM.BigWafer")]
  395. public int BigWafer { get; set; }
  396. #region
  397. public bool WaferSizePMA_3
  398. {
  399. set { }
  400. get { return PMAWaferSize == "WS3"; }
  401. }
  402. public bool WaferSizePMA_4
  403. {
  404. set { }
  405. get { return PMAWaferSize == "WS4"; }
  406. }
  407. public bool WaferSizePMA_6
  408. {
  409. set { }
  410. get { return PMAWaferSize == "WS6"; }
  411. }
  412. public bool WaferSizePMB_3
  413. {
  414. set { }
  415. get { return PMBWaferSize == "WS3"; }
  416. }
  417. public bool WaferSizePMB_4
  418. {
  419. set { }
  420. get { return PMBWaferSize == "WS4"; }
  421. }
  422. public bool WaferSizePMB_6
  423. {
  424. set { }
  425. get { return PMBWaferSize == "WS6"; }
  426. }
  427. public bool WaferSizeCooling2_3
  428. {
  429. set { }
  430. get { return Cooling2WaferSize == "WS3"; }
  431. }
  432. public bool WaferSizeCooling2_4
  433. {
  434. set { }
  435. get { return Cooling2WaferSize == "WS4"; }
  436. }
  437. public bool WaferSizeCooling2_6
  438. {
  439. set { }
  440. get { return Cooling2WaferSize == "WS6"; }
  441. }
  442. public bool WaferSizeCooling1_3
  443. {
  444. set { }
  445. get { return Cooling1WaferSize == "WS3"; }
  446. }
  447. public bool WaferSizeCooling1_4
  448. {
  449. set { }
  450. get { return Cooling1WaferSize == "WS4"; }
  451. }
  452. public bool WaferSizeCooling1_6
  453. {
  454. set { }
  455. get { return Cooling1WaferSize == "WS6"; }
  456. }
  457. public bool WaferSizeAligner2_3
  458. {
  459. set { }
  460. get { return Aligner2WaferSize == "WS3"; }
  461. }
  462. public bool WaferSizeAligner2_4
  463. {
  464. set { }
  465. get { return Aligner2WaferSize == "WS4"; }
  466. }
  467. public bool WaferSizeAligner2_6
  468. {
  469. set { }
  470. get { return Aligner2WaferSize == "WS6"; }
  471. }
  472. public bool WaferSizeAligner1_3
  473. {
  474. set { }
  475. get { return Aligner1WaferSize == "WS3"; }
  476. }
  477. public bool WaferSizeAligner1_4
  478. {
  479. set { }
  480. get { return Aligner1WaferSize == "WS4"; }
  481. }
  482. public bool WaferSizeAligner1_6
  483. {
  484. set { }
  485. get { return Aligner1WaferSize == "WS6"; }
  486. }
  487. public bool WaferSizeEfemRobot_3
  488. {
  489. set { }
  490. get { return EfemRobotWaferSize == "WS3"; }
  491. }
  492. public bool WaferSizeEfemRobot_4
  493. {
  494. set { }
  495. get { return EfemRobotWaferSize == "WS4"; }
  496. }
  497. public bool WaferSizeEfemRobot_6
  498. {
  499. set { }
  500. get { return EfemRobotWaferSize == "WS6"; }
  501. }
  502. #endregion
  503. public bool PMASlitValveIsOpen
  504. {
  505. get { return SlitDoorDataA != null && SlitDoorDataA.OpenFeedback && !SlitDoorDataA.CloseFeedback; }
  506. }
  507. [Subscription("PMA.SlitDoor.DeviceData")]
  508. public AITCylinderData SlitDoorDataA
  509. {
  510. get;
  511. set;
  512. }
  513. public bool PMBSlitValveIsOpen
  514. {
  515. get { return SlitDoorDataB != null && SlitDoorDataB.OpenFeedback && !SlitDoorDataB.CloseFeedback; }
  516. }
  517. [Subscription("PMB.SlitDoor.DeviceData")]
  518. public AITCylinderData SlitDoorDataB
  519. {
  520. get;
  521. set;
  522. }
  523. public Dictionary<string, string> _waferSizeMap = new Dictionary<string, string>()
  524. {
  525. {"WS3", "3'"},{"WS4", "4'"},{"WS6", "6'"}
  526. };
  527. private string GetWaferSize(string size)
  528. {
  529. if (size != null && _waferSizeMap.ContainsKey(size))
  530. switch (size)
  531. {
  532. case "WS3": return SmallWafer.ToString();
  533. case "WS4": return MidWafer.ToString();
  534. case "WS6": return BigWafer.ToString();
  535. default: return "";
  536. }
  537. //return _waferSizeMap[size];
  538. return "";
  539. }
  540. [Subscription("EfemRobot.GripStateBlade1")]
  541. public string GripStateBlade1 { get; set; }
  542. public string Blade1GripStateColor
  543. {
  544. get
  545. {
  546. switch (GripStateBlade1)
  547. {
  548. case "ON": return "Lime";
  549. case "OFF": return "Gray";
  550. default: return "Yellow";
  551. }
  552. }
  553. }
  554. [Subscription("EfemRobot.GripStateBlade2")]
  555. public string GripStateBlade2 { get; set; }
  556. public string Blade2GripStateColor
  557. {
  558. get
  559. {
  560. switch (GripStateBlade2)
  561. {
  562. case "ON": return "Lime";
  563. case "OFF": return "Gray";
  564. default: return "Yellow";
  565. }
  566. }
  567. }
  568. public Aitex.Core.Common.WaferSize SmallPinWaferSize { get; set; }
  569. public Aitex.Core.Common.WaferSize MediumPinWaferSize { get; set; }
  570. public Aitex.Core.Common.WaferSize BigPinWaferSize { get; set; }
  571. #endregion Properties
  572. public EFEMViewModel()
  573. {
  574. this.DisplayName = "EFEM";
  575. _pickModules = new List<string>() { "LP1", "LP2", "Aligner1", "Aligner2", "Cooling1", "Cooling2" };
  576. _mapModules = new List<string>() { "LP1", "LP2" };
  577. _extendModules = new List<string>() { "PMA", "PMB" };
  578. PickSelectedModule = "LP1";
  579. PlaceSelectedModule = "LP1";
  580. ExtendSelectedModule = "PMA";
  581. RetractSelectedModule = "PMA";
  582. MapSelectedModule = "LP1";
  583. PickSelectedBlade = PlaceSelectedBlade = ExtendSelectedBlade = GripSelectedBlade = UngripSelectedBlade = "Blade1";
  584. }
  585. protected override void OnActivate()
  586. {
  587. SmallPinWaferSize = MapWaferSize((int)QueryDataClient.Instance.Service.GetConfig($"System.SmallWafer"));
  588. MediumPinWaferSize = MapWaferSize((int)QueryDataClient.Instance.Service.GetConfig($"System.MidWafer"));
  589. BigPinWaferSize = MapWaferSize((int)QueryDataClient.Instance.Service.GetConfig($"System.BigWafer"));
  590. NotifyOfPropertyChange(nameof(SmallPinWaferSize));
  591. NotifyOfPropertyChange(nameof(MediumPinWaferSize));
  592. NotifyOfPropertyChange(nameof(BigPinWaferSize));
  593. base.OnActivate();
  594. }
  595. private Aitex.Core.Common.WaferSize MapWaferSize(int value)
  596. {
  597. switch (value)
  598. {
  599. case 3: return Aitex.Core.Common.WaferSize.WS3;
  600. case 4: return Aitex.Core.Common.WaferSize.WS4;
  601. case 6: return Aitex.Core.Common.WaferSize.WS6;
  602. case 8: return Aitex.Core.Common.WaferSize.WS8;
  603. }
  604. return Aitex.Core.Common.WaferSize.WS0;
  605. }
  606. private List<int> GetSlotsByModule(string module)
  607. {
  608. List<int> slots = new List<int>();
  609. int num = 0;
  610. switch (module)
  611. {
  612. case "LP1":
  613. case "LP2":
  614. num = 25;
  615. break;
  616. case "Aligner1":
  617. case "Aligner2":
  618. case "Cooling1":
  619. case "Cooling2":
  620. case "PMA":
  621. case "PMB":
  622. num = 1;
  623. break;
  624. }
  625. int j = 0;
  626. while (j < num)
  627. {
  628. slots.Add(j + 1);
  629. j++;
  630. }
  631. return slots;
  632. }
  633. protected override void OnInitialize()
  634. {
  635. MenuPermission = ClientApp.Instance.GetPermission("EFEM");
  636. base.OnInitialize();
  637. base.InitModules();
  638. }
  639. #region Operation
  640. public void SetWaferSize(string module, string size)
  641. {
  642. if (MenuPermission != 3) return;
  643. InvokeClient.Instance.Service.DoOperation("System.SetWaferSize", module, size);
  644. }
  645. public void HomeAligner(string module)
  646. {
  647. if (MenuPermission != 3) return;
  648. InvokeClient.Instance.Service.DoOperation($"{module}.{EfemOperation.Home}");
  649. }
  650. public void AlignAligner(string module)
  651. {
  652. if (MenuPermission != 3) return;
  653. string size = Aligner1WaferSize;
  654. if (module == ModuleName.Aligner2.ToString())
  655. size = Aligner2WaferSize;
  656. if (module == ModuleName.Cooling1.ToString())
  657. size = Cooling1WaferSize;
  658. if (module == ModuleName.Cooling2.ToString())
  659. size = Cooling2WaferSize;
  660. InvokeClient.Instance.Service.DoOperation($"{module}.{EfemOperation.Align}", size);
  661. }
  662. public void LiftAligner(string module)
  663. {
  664. if (MenuPermission != 3) return;
  665. InvokeClient.Instance.Service.DoOperation($"{module}.{EfemOperation.Lift}");
  666. }
  667. public void HomeEfem()
  668. {
  669. if (MenuPermission != 3) return;
  670. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EFEM}.{EfemOperation.Home}");
  671. }
  672. public void ResetEfem()
  673. {
  674. if (MenuPermission != 3) return;
  675. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EFEM}.Reset");
  676. }
  677. public void ClearError()
  678. {
  679. if (MenuPermission != 3) return;
  680. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EFEM}.{EfemOperation.ClearError}");
  681. }
  682. public void HomeRobot()
  683. {
  684. if (MenuPermission != 3) return;
  685. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Home}");
  686. }
  687. public void AbortRobot()
  688. {
  689. if (MenuPermission != 3) return;
  690. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Abort}");
  691. }
  692. public void RobotPick()
  693. {
  694. if (MenuPermission != 3) return;
  695. string ws = PickSelectedModule == ModuleName.LP1.ToString() ? LP1WaferSize :
  696. PickSelectedModule == ModuleName.LP2.ToString() ? LP2WaferSize :
  697. PickSelectedModule == ModuleName.Aligner1.ToString() ? Aligner1WaferSize :
  698. PickSelectedModule == ModuleName.Aligner2.ToString() ? Aligner2WaferSize :
  699. PickSelectedModule == ModuleName.Cooling2.ToString() ? Cooling2WaferSize :
  700. PickSelectedModule == ModuleName.Cooling1.ToString() ? Cooling1WaferSize : throw new ArgumentOutOfRangeException();
  701. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Pick}",
  702. PickSelectedModule, PickSelectedSlot - 1, ws, PickSelectedBlade);
  703. }
  704. public void RobotPlace()
  705. {
  706. if (MenuPermission != 3) return;
  707. string ws = PlaceSelectedModule == ModuleName.LP1.ToString() ? LP1WaferSize :
  708. PlaceSelectedModule == ModuleName.LP2.ToString() ? LP2WaferSize :
  709. PlaceSelectedModule == ModuleName.Aligner1.ToString() ? Aligner1WaferSize :
  710. PlaceSelectedModule == ModuleName.Aligner2.ToString() ? Aligner2WaferSize :
  711. PlaceSelectedModule == ModuleName.Cooling1.ToString() ? Cooling1WaferSize :
  712. PlaceSelectedModule == ModuleName.Cooling2.ToString() ? Cooling2WaferSize : throw new ArgumentOutOfRangeException();
  713. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Place}",
  714. PlaceSelectedModule, PlaceSelectedSlot - 1, ws, PlaceSelectedBlade);
  715. }
  716. public void RobotExtend()
  717. {
  718. if (MenuPermission != 3) return;
  719. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Extend}", ExtendSelectedModule, ExtendParam[ExtendSelectedSlot], ExtendSelectedBlade);
  720. }
  721. public void RobotRetract()
  722. {
  723. if (MenuPermission != 3) return;
  724. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Retract}", RetractSelectedModule, RetractSlots[RetractSelectedSlot]);
  725. }
  726. public void RobotMap()
  727. {
  728. if (MenuPermission != 3) return;
  729. InvokeClient.Instance.Service.DoOperation($"{MapSelectedModule}.{EfemOperation.Map}");
  730. }
  731. public void RobotGrip()
  732. {
  733. if (MenuPermission != 3) return;
  734. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Grip}", "ON", GripSelectedBlade);
  735. }
  736. public void RobotUngrip()
  737. {
  738. if (MenuPermission != 3) return;
  739. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Grip}", "OFF", UngripSelectedBlade);
  740. }
  741. #endregion Operation
  742. }
  743. }