EFEMViewModel.cs 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Windows;
  4. using Aitex.Core.Common.DeviceData;
  5. using Aitex.Core.Util;
  6. using Aitex.Sorter.Common;
  7. using Bolt.Toolkit.Wpf.Data;
  8. using Bolt.Toolkit.Wpf.Data.Enum;
  9. using Caliburn.Micro.Core;
  10. using MECF.Framework.Common.CommonData;
  11. using MECF.Framework.Common.DataCenter;
  12. using MECF.Framework.Common.Equipment;
  13. using MECF.Framework.Common.OperationCenter;
  14. using VirgoCommon;
  15. using VirgoUI.Client.Models.Operate;
  16. using VirgoUI.Client.Models.Platform.LoadPort;
  17. using VirgoUI.Client.Models.Sys;
  18. namespace VirgoUI.Client.Models.Platform.EFEM
  19. {
  20. public class EFEMViewModel : UiViewModelBase
  21. {
  22. private int MenuPermission;
  23. #region Properties
  24. [Subscription("LP1.Status")]
  25. public string LP1Status { get; set; }
  26. public string LP1StatusBackground
  27. {
  28. get { return GetUnitStatusBackground(LP1Status); }
  29. }
  30. [Subscription("LP1.IsMapped")]
  31. public bool IsLP1Mapped { get; set; }
  32. [Subscription("LP2.Status")]
  33. public string LP2Status { get; set; }
  34. public string LP2StatusBackground
  35. {
  36. get { return GetUnitStatusBackground(LP2Status); }
  37. }
  38. [Subscription("LP2.IsMapped")]
  39. public bool IsLP2Mapped { get; set; }
  40. [Subscription("EFEM.FsmState")]
  41. public string EfemStatus { get; set; }
  42. public string EfemStatusBackground
  43. {
  44. get { return GetUnitStatusBackground(EfemStatus); }
  45. }
  46. [Subscription("System.IsAutoRunning")]
  47. public string EfemRtStatus { get; set; }
  48. [Subscription("System.IsAutoIdle")]
  49. public string EfemIdleStatus { get; set; }
  50. [Subscription("Rt.Status")]
  51. public string RtStatus { get; set; }
  52. public bool EfemViewEnable => RtStatus != "AutoIdle" && RtStatus != "AutoRunning";
  53. [Subscription("PMA.IsAutoMode")]
  54. public bool PMAIsAutoMode { get; set; }
  55. [Subscription("PMB.IsAutoMode")]
  56. public bool PMBIsAutoMode { get; set; }
  57. [Subscription("PMA.IsOnline")]
  58. public bool PMAIsOnline { get; set; }
  59. [Subscription("PMB.IsOnline")]
  60. public bool PMBIsOnline { get; set; }
  61. public string PMAState
  62. {
  63. get
  64. {
  65. return "PMA/" + (PMAIsAutoMode ? "Auto/" : "Manual/") + (PMAIsOnline ? "Online" : "Offline");
  66. }
  67. }
  68. public string PMBState
  69. {
  70. get
  71. {
  72. return "PMB/" + (PMBIsAutoMode ? "Auto/" : "Manual/") + (PMBIsOnline ? "Online" : "Offline");
  73. }
  74. }
  75. private string _SelectedModule;
  76. public string SelectedModule
  77. {
  78. get
  79. {
  80. return _SelectedModule;
  81. }
  82. set
  83. {
  84. _SelectedModule = value;
  85. Slots = GetSlotsByModule(_SelectedModule);
  86. SelectedSlot = 1;
  87. NotifyOfPropertyChange("SelectedModule");
  88. }
  89. }
  90. private string _PickSelectedModule;
  91. public string PickSelectedModule
  92. {
  93. get
  94. {
  95. return _PickSelectedModule;
  96. }
  97. set
  98. {
  99. _PickSelectedModule = value;
  100. PickSlots = GetSlotsByModule(_PickSelectedModule);
  101. PickSelectedSlot = 1;
  102. NotifyOfPropertyChange("PickSelectedModule");
  103. }
  104. }
  105. private string _PlaceSelectedModule;
  106. public string PlaceSelectedModule
  107. {
  108. get
  109. {
  110. return _PlaceSelectedModule;
  111. }
  112. set
  113. {
  114. _PlaceSelectedModule = value;
  115. PlaceSlots = GetSlotsByModule(_PlaceSelectedModule);
  116. PlaceSelectedSlot = 1;
  117. NotifyOfPropertyChange("PlaceSelectedModule");
  118. }
  119. }
  120. private string _ExtendSelectedModule;
  121. public string ExtendSelectedModule
  122. {
  123. get
  124. {
  125. return _ExtendSelectedModule;
  126. }
  127. set
  128. {
  129. _ExtendSelectedModule = value;
  130. ExtendSlots = GetExtendPos();
  131. NotifyOfPropertyChange("ExtendSelectedModule");
  132. }
  133. }
  134. private List<string> GetExtendPos()
  135. {
  136. //return new List<string> { "G1", "GB", "G4", "P1", "PB", "P4" };
  137. return new List<string> { "GoIntoGet", "GoBackGet", "GoIntoPut", "GoBackPut" };
  138. }
  139. private static Dictionary<string, string> ExtendParam = new Dictionary<string, string>()
  140. {
  141. {"GoIntoGet","GB" },
  142. {"GoBackGet","G4" },
  143. {"GoIntoPut","PB" },
  144. {"GoBackPut","P4" }
  145. };
  146. private string _RetractSelectedModule;
  147. public string RetractSelectedModule
  148. {
  149. get
  150. {
  151. return _RetractSelectedModule;
  152. }
  153. set
  154. {
  155. _RetractSelectedModule = value;
  156. RetractSlots = GetExtendPos();
  157. NotifyOfPropertyChange("RetractSelectedModule");
  158. }
  159. }
  160. private string _MapSelectedModule;
  161. public string MapSelectedModule
  162. {
  163. get
  164. {
  165. return _MapSelectedModule;
  166. }
  167. set
  168. {
  169. _MapSelectedModule = value;
  170. //MapSlots = GetSlotsByModule(_MapSelectedModule);
  171. MapSelectedSlot = 1;
  172. NotifyOfPropertyChange("MapSelectedModule");
  173. }
  174. }
  175. //[Subscription("EfemRobot.RobotMoveAction")]
  176. //public string EfemRobotMoveAction
  177. //{
  178. // get;
  179. // set;
  180. //}
  181. //[Subscription("EFEM.CassetteDoor")]
  182. //public AITSensorData CassetteDoorStatus
  183. //{
  184. // get;
  185. // set;
  186. //}
  187. private EfemType _efemType = EfemType.FutureEfem;
  188. public Visibility GripVisibility
  189. {
  190. get;
  191. set;
  192. }
  193. public Visibility CassetteDoorVisibility
  194. {
  195. get
  196. {
  197. return _efemType == EfemType.FutureEfem ? Visibility.Visible : Visibility.Collapsed;
  198. }
  199. }
  200. public Visibility LoadUnloadVisibility
  201. {
  202. get { return _efemType == EfemType.JetEfem ? Visibility.Visible : Visibility.Collapsed; }
  203. }
  204. public Visibility MapVisibility
  205. {
  206. get { return _efemType == EfemType.FutureEfem ? Visibility.Visible : Visibility.Collapsed; }
  207. }
  208. public Visibility CIDVisibility
  209. {
  210. get { return _efemType == EfemType.FutureEfem ? Visibility.Collapsed : Visibility.Visible; }
  211. }
  212. public bool EnableWaferSize
  213. {
  214. get { return _efemType == EfemType.FutureEfem ; }
  215. }
  216. public bool EnableCIDLP1
  217. {
  218. get
  219. {
  220. return Foup1Present;
  221. }
  222. }
  223. public bool EnableLoadLP1
  224. {
  225. get
  226. {
  227. return Foup1Present;
  228. }
  229. }
  230. public bool EnableUnloadLP1
  231. {
  232. get
  233. {
  234. return Foup1Present;
  235. }
  236. }
  237. public bool EnableHomeLP1
  238. {
  239. get
  240. {
  241. return Foup1Present;
  242. }
  243. }
  244. public bool EnableLockLP1
  245. {
  246. get
  247. {
  248. return Foup1Present;
  249. }
  250. }
  251. public bool EnableUnlockLP1
  252. {
  253. get
  254. {
  255. return Foup1Present;
  256. }
  257. }
  258. public bool EnableCIDLP2
  259. {
  260. get
  261. {
  262. return Foup2Present;
  263. }
  264. }
  265. public bool EnableLoadLP2
  266. {
  267. get
  268. {
  269. return Foup2Present;
  270. }
  271. }
  272. public bool EnableHomeLP2
  273. {
  274. get
  275. {
  276. return Foup2Present;
  277. }
  278. }
  279. public bool EnableUnloadLP2
  280. {
  281. get
  282. {
  283. return Foup2Present;
  284. }
  285. }
  286. public bool EnableLockLP2
  287. {
  288. get
  289. {
  290. return Foup2Present;
  291. }
  292. }
  293. public bool EnableUnlockLP2
  294. {
  295. get
  296. {
  297. return Foup2Present;
  298. }
  299. }
  300. [Subscription("EFEM.CassetteDoor")]
  301. public LidState CassetteDoorStatus
  302. {
  303. get;
  304. set;
  305. }
  306. public bool IsLP1PresentFeedback
  307. {
  308. get { return LP1CassetteState == LoadportCassetteState.Normal; }
  309. }
  310. public bool IsLP2PresentFeedback
  311. {
  312. get { return LP2CassetteState == LoadportCassetteState.Normal; }
  313. }
  314. [Subscription("LP1.IsClamped")]
  315. public bool IsLP1ClampedFeedback { get; set; }
  316. [Subscription("LP2.IsClamped")]
  317. public bool IsLP2ClampedFeedback { get; set; }
  318. [Subscription("LP1.CassetteState")]
  319. public LoadportCassetteState LP1CassetteState { get; set; }
  320. [Subscription("LP2.CassetteState")]
  321. public LoadportCassetteState LP2CassetteState { get; set; }
  322. public bool Foup1Present
  323. {
  324. get { return LP1CassetteState == LoadportCassetteState.Normal; }
  325. }
  326. public bool Foup2Present
  327. {
  328. get { return LP2CassetteState == LoadportCassetteState.Normal; }
  329. }
  330. [Subscription("EfemRobot.RobotMoveInfo")]
  331. public RobotMoveInfo EfemRobotMoveInfo { get; set; }
  332. //{
  333. // get
  334. // {
  335. // RobotMoveInfo _moveInfo = new RobotMoveInfo() { BladeTarget = "System" };
  336. // if (!string.IsNullOrEmpty(EfemRobotMoveAction))
  337. // {
  338. // var action = EfemRobotMoveAction.Split('.');
  339. // _moveInfo.BladeTarget = action[0];
  340. // _moveInfo.Action = (RobotAction)Enum.Parse(typeof(RobotAction), action[1]);
  341. // }
  342. // return _moveInfo;
  343. // }
  344. //}
  345. private List<string> _blades = new List<string>() { "Blade1", "Blade2" };
  346. public List<string> Blades
  347. {
  348. get { return _blades; }
  349. set { _blades = value; NotifyOfPropertyChange("Blades"); }
  350. }
  351. private int _SelectedSlot;
  352. public int SelectedSlot
  353. {
  354. get { return _SelectedSlot; }
  355. set { _SelectedSlot = value; NotifyOfPropertyChange("SelectedSlot"); }
  356. }
  357. private int _PickSelectedSlot;
  358. public int PickSelectedSlot
  359. {
  360. get { return _PickSelectedSlot; }
  361. set { _PickSelectedSlot = value; NotifyOfPropertyChange("PickSelectedSlot"); }
  362. }
  363. private string _pickSelectedBlade;
  364. public string PickSelectedBlade
  365. {
  366. get { return _pickSelectedBlade; }
  367. set { _pickSelectedBlade = value; NotifyOfPropertyChange("PickSelectedBlade"); }
  368. }
  369. private int _PlaceSelectedSlot;
  370. public int PlaceSelectedSlot
  371. {
  372. get { return _PlaceSelectedSlot; }
  373. set { _PlaceSelectedSlot = value; NotifyOfPropertyChange("PlaceSelectedSlot"); }
  374. }
  375. private string _placeSelectedBlade;
  376. public string PlaceSelectedBlade
  377. {
  378. get { return _placeSelectedBlade; }
  379. set { _placeSelectedBlade = value; NotifyOfPropertyChange("PlaceSelectedBlade"); }
  380. }
  381. private string _ExtendSelectedSlot;
  382. public string ExtendSelectedSlot
  383. {
  384. get { return _ExtendSelectedSlot; }
  385. set { _ExtendSelectedSlot = value; NotifyOfPropertyChange("ExtendSelectedSlot"); }
  386. }
  387. private string _extendSelectedBlade;
  388. public string ExtendSelectedBlade
  389. {
  390. get { return _extendSelectedBlade; }
  391. set { _extendSelectedBlade = value; NotifyOfPropertyChange("ExtendSelectedBlade"); }
  392. }
  393. private string _gripSelectedBlade;
  394. public string GripSelectedBlade
  395. {
  396. get { return _gripSelectedBlade; }
  397. set { _gripSelectedBlade = value; NotifyOfPropertyChange("GripSelectedBlade"); }
  398. }
  399. private string _ungripSelectedBlade;
  400. public string UngripSelectedBlade
  401. {
  402. get { return _ungripSelectedBlade; }
  403. set { _ungripSelectedBlade = value; NotifyOfPropertyChange("UngripSelectedBlade"); }
  404. }
  405. private int _RetractSelectedSlot;
  406. public int RetractSelectedSlot
  407. {
  408. get { return _RetractSelectedSlot; }
  409. set { _RetractSelectedSlot = value; NotifyOfPropertyChange("RetractSelectedSlot"); }
  410. }
  411. private int _MapSelectedSlot;
  412. public int MapSelectedSlot
  413. {
  414. get { return _MapSelectedSlot; }
  415. set { _MapSelectedSlot = value; NotifyOfPropertyChange("MapSelectedSlot"); }
  416. }
  417. private List<string> _pickModules;
  418. public List<string> PickPlaceModules
  419. {
  420. get { return _pickModules; }
  421. set { _pickModules = value; NotifyOfPropertyChange("PickPlaceModules"); }
  422. }
  423. private List<string> _mapModules;
  424. public List<string> MapModules
  425. {
  426. get { return _mapModules; }
  427. set { _mapModules = value; NotifyOfPropertyChange("MapModules"); }
  428. }
  429. private List<string> _extendModules;
  430. public List<string> ExtendRetractModules
  431. {
  432. get { return _extendModules; }
  433. set { _extendModules = value; NotifyOfPropertyChange("ExtendRetractModules"); }
  434. }
  435. private List<int> _slots;
  436. public List<int> Slots
  437. {
  438. get { return _slots; }
  439. set { _slots = value; NotifyOfPropertyChange("Slots"); }
  440. }
  441. private List<int> _Pickslots;
  442. public List<int> PickSlots
  443. {
  444. get { return _Pickslots; }
  445. set { _Pickslots = value; NotifyOfPropertyChange("PickSlots"); }
  446. }
  447. private List<int> _Placeslots;
  448. public List<int> PlaceSlots
  449. {
  450. get { return _Placeslots; }
  451. set { _Placeslots = value; NotifyOfPropertyChange("PlaceSlots"); }
  452. }
  453. private List<string> _Extendslots;
  454. public List<string> ExtendSlots
  455. {
  456. get { return _Extendslots; }
  457. set { _Extendslots = value; NotifyOfPropertyChange("ExtendSlots"); }
  458. }
  459. private List<string> _Retractslots;
  460. public List<string> RetractSlots
  461. {
  462. get { return _Retractslots; }
  463. set { _Retractslots = value; NotifyOfPropertyChange("RetractSlots"); }
  464. }
  465. [Subscription("LP1.IsLoaded")]
  466. public bool IsLoadedLP1 { get; set; }
  467. [Subscription("LP1.FsmState")]
  468. public string StateLP1 { get; set; }
  469. [Subscription("LP1.CarrierId")]
  470. public string CarrierIdLP1 { get; set; }
  471. [Subscription("LP1.SmartTag")]
  472. public string SmartTagLP1 { get; set; }
  473. [Subscription("LP1.WaferSize")]
  474. public string LP1WaferSize { get; set; }
  475. public string WaferSizeLP1
  476. {
  477. get { return LP1CassetteState == LoadportCassetteState.Normal ? GetWaferSize(LP1WaferSize) : "--"; }
  478. }
  479. [Subscription("LP2.IsLoaded")]
  480. public bool IsLoadedLP2 { get; set; }
  481. [Subscription("LP2.FsmState")]
  482. public string StateLP2 { get; set; }
  483. [Subscription("LP2.CarrierId")]
  484. public string CarrierIdLP2 { get; set; }
  485. [Subscription("LP2.SmartTag")]
  486. public string _smartTagLP2 { get; set; }
  487. public string SmartTagLP2
  488. {
  489. get
  490. {
  491. return _smartTagLP2;
  492. }
  493. }
  494. [Subscription("LP2.WaferSize")]
  495. public string LP2WaferSize { get; set; }
  496. public string WaferSizeLP2
  497. {
  498. get { return LP2CassetteState == LoadportCassetteState.Normal ? GetWaferSize(LP2WaferSize) : "--"; }
  499. }
  500. [Subscription("Aligner1.WaferSize")]
  501. public string Aligner1WaferSize { get; set; }
  502. public string WaferSizeAligner1
  503. {
  504. get { return GetWaferSize(Aligner1WaferSize); }
  505. }
  506. [Subscription("Aligner2.WaferSize")]
  507. public string Aligner2WaferSize { get; set; }
  508. public string WaferSizeAligner2
  509. {
  510. get { return GetWaferSize(Aligner2WaferSize); }
  511. }
  512. [Subscription("Cooling1.WaferSize")]
  513. public string Cooling1WaferSize { get; set; }
  514. public string WaferSizeCooling1
  515. {
  516. get { return GetWaferSize(Cooling1WaferSize); }
  517. }
  518. [Subscription("Cooling2.WaferSize")]
  519. public string Cooling2WaferSize { get; set; }
  520. public string WaferSizeCooling2
  521. {
  522. get { return GetWaferSize(Cooling2WaferSize); }
  523. }
  524. [Subscription("EfemRobot.WaferSize")]
  525. public string EfemRobotWaferSize { get; set; }
  526. public string WaferSizeEfemRobot
  527. {
  528. get { return GetWaferSize(EfemRobotWaferSize); }
  529. }
  530. [Subscription("PMA.WaferSize")]
  531. public string PMAWaferSize { get; set; }
  532. public string WaferSizePMA
  533. {
  534. get { return GetWaferSize(PMAWaferSize); }
  535. }
  536. [Subscription("PMB.WaferSize")]
  537. public string PMBWaferSize { get; set; }
  538. public string WaferSizePMB
  539. {
  540. get { return GetWaferSize(PMBWaferSize); }
  541. }
  542. [Subscription("EFEM.SmallWafer")]
  543. public int SmallWafer { get; set; }
  544. [Subscription("EFEM.MidWafer")]
  545. public int MidWafer { get; set; }
  546. [Subscription("EFEM.BigWafer")]
  547. public int BigWafer { get; set; }
  548. #region
  549. public bool WaferSizePMA_3
  550. {
  551. set { }
  552. get { return PMAWaferSize == "WS3"; }
  553. }
  554. public bool WaferSizePMA_4
  555. {
  556. set { }
  557. get { return PMAWaferSize == "WS4"; }
  558. }
  559. public bool WaferSizePMA_6
  560. {
  561. set { }
  562. get { return PMAWaferSize == "WS6"; }
  563. }
  564. public bool WaferSizePMB_3
  565. {
  566. set { }
  567. get { return PMBWaferSize == "WS3"; }
  568. }
  569. public bool WaferSizePMB_4
  570. {
  571. set { }
  572. get { return PMBWaferSize == "WS4"; }
  573. }
  574. public bool WaferSizePMB_6
  575. {
  576. set { }
  577. get { return PMBWaferSize == "WS6"; }
  578. }
  579. public bool WaferSizeCooling2_3
  580. {
  581. set { }
  582. get { return Cooling2WaferSize == "WS3"; }
  583. }
  584. public bool WaferSizeCooling2_4
  585. {
  586. set { }
  587. get { return Cooling2WaferSize == "WS4"; }
  588. }
  589. public bool WaferSizeCooling2_6
  590. {
  591. set { }
  592. get { return Cooling2WaferSize == "WS6"; }
  593. }
  594. public bool WaferSizeCooling1_3
  595. {
  596. set { }
  597. get { return Cooling1WaferSize == "WS3"; }
  598. }
  599. public bool WaferSizeCooling1_4
  600. {
  601. set { }
  602. get { return Cooling1WaferSize == "WS4"; }
  603. }
  604. public bool WaferSizeCooling1_6
  605. {
  606. set { }
  607. get { return Cooling1WaferSize == "WS6"; }
  608. }
  609. public bool WaferSizeAligner2_3
  610. {
  611. set { }
  612. get { return Aligner2WaferSize == "WS3"; }
  613. }
  614. public bool WaferSizeAligner2_4
  615. {
  616. set { }
  617. get { return Aligner2WaferSize == "WS4"; }
  618. }
  619. public bool WaferSizeAligner2_6
  620. {
  621. set { }
  622. get { return Aligner2WaferSize == "WS6"; }
  623. }
  624. public bool WaferSizeAligner1_3
  625. {
  626. set { }
  627. get { return Aligner1WaferSize == "WS3"; }
  628. }
  629. public bool WaferSizeAligner1_4
  630. {
  631. set { }
  632. get { return Aligner1WaferSize == "WS4"; }
  633. }
  634. public bool WaferSizeAligner1_6
  635. {
  636. set { }
  637. get { return Aligner1WaferSize == "WS6"; }
  638. }
  639. public bool WaferSizeEfemRobot_3
  640. {
  641. set { }
  642. get { return EfemRobotWaferSize == "WS3"; }
  643. }
  644. public bool WaferSizeEfemRobot_4
  645. {
  646. set { }
  647. get { return EfemRobotWaferSize == "WS4"; }
  648. }
  649. public bool WaferSizeEfemRobot_6
  650. {
  651. set { }
  652. get { return EfemRobotWaferSize == "WS6"; }
  653. }
  654. #endregion
  655. public bool PMASlitValveIsOpen
  656. {
  657. get { return SlitDoorDataA != null && SlitDoorDataA.OpenFeedback && !SlitDoorDataA.CloseFeedback; }
  658. }
  659. [Subscription("PMA.SlitDoor.DeviceData")]
  660. public AITCylinderData SlitDoorDataA
  661. {
  662. get;
  663. set;
  664. }
  665. public bool PMBSlitValveIsOpen
  666. {
  667. get { return SlitDoorDataB != null && SlitDoorDataB.OpenFeedback && !SlitDoorDataB.CloseFeedback; }
  668. }
  669. [Subscription("PMB.SlitDoor.DeviceData")]
  670. public AITCylinderData SlitDoorDataB
  671. {
  672. get;
  673. set;
  674. }
  675. public Dictionary<string, string> _waferSizeMap = new Dictionary<string, string>()
  676. {
  677. {"WS3", "3'"},{"WS4", "4'"},{"WS6", "6'"}
  678. };
  679. private string GetWaferSize(string size)
  680. {
  681. if (_efemType == EfemType.JetEfem)
  682. return "";
  683. if (size != null && _waferSizeMap.ContainsKey(size))
  684. switch (size)
  685. {
  686. case "WS3": return SmallWafer.ToString();
  687. case "WS4": return MidWafer.ToString();
  688. case "WS6": return BigWafer.ToString();
  689. default: return "";
  690. }
  691. //return _waferSizeMap[size];
  692. return "";
  693. }
  694. [Subscription("EfemRobot.GripStateBlade1")]
  695. public string GripStateBlade1 { get; set; }
  696. public string Blade1GripStateColor
  697. {
  698. get
  699. {
  700. switch (GripStateBlade1)
  701. {
  702. case "ON": return "Lime";
  703. case "OFF": return "Gray";
  704. default: return "Yellow";
  705. }
  706. }
  707. }
  708. [Subscription("EfemRobot.GripStateBlade2")]
  709. public string GripStateBlade2 { get; set; }
  710. public string Blade2GripStateColor
  711. {
  712. get
  713. {
  714. switch (GripStateBlade2)
  715. {
  716. case "ON": return "Lime";
  717. case "OFF": return "Gray";
  718. default: return "Yellow";
  719. }
  720. }
  721. }
  722. public Aitex.Core.Common.WaferSize SmallPinWaferSize { get; set; }
  723. public Aitex.Core.Common.WaferSize MediumPinWaferSize { get; set; }
  724. public Aitex.Core.Common.WaferSize BigPinWaferSize { get; set; }
  725. #endregion Properties
  726. public EFEMViewModel()
  727. {
  728. this.DisplayName = "EFEM";
  729. _pickModules = new List<string>() { "LP1", "LP2", "Aligner1", "Aligner2", "Cooling1", "Cooling2" };
  730. _mapModules = new List<string>() { "LP1", "LP2" };
  731. _extendModules = new List<string>() { "PMA", "PMB" };
  732. PickSelectedModule = "LP1";
  733. PlaceSelectedModule = "LP1";
  734. ExtendSelectedModule = "PMA";
  735. RetractSelectedModule = "PMA";
  736. MapSelectedModule = "LP1";
  737. PickSelectedBlade = PlaceSelectedBlade = ExtendSelectedBlade = GripSelectedBlade = UngripSelectedBlade = "Blade1";
  738. }
  739. protected override void OnActivate()
  740. {
  741. SmallPinWaferSize = MapWaferSize((int)QueryDataClient.Instance.Service.GetConfig($"System.SmallWafer"));
  742. MediumPinWaferSize = MapWaferSize((int)QueryDataClient.Instance.Service.GetConfig($"System.MidWafer"));
  743. BigPinWaferSize = MapWaferSize((int)QueryDataClient.Instance.Service.GetConfig($"System.BigWafer"));
  744. NotifyOfPropertyChange(nameof(SmallPinWaferSize));
  745. NotifyOfPropertyChange(nameof(MediumPinWaferSize));
  746. NotifyOfPropertyChange(nameof(BigPinWaferSize));
  747. _efemType = (int)QueryDataClient.Instance.Service.GetConfig("EFEM.EfemType") == 1 ? EfemType.FutureEfem : EfemType.JetEfem;
  748. GripVisibility = (bool)QueryDataClient.Instance.Service.GetConfig("EFEM.EnableGrip") ? Visibility.Visible : Visibility.Hidden;
  749. base.OnActivate();
  750. }
  751. private Aitex.Core.Common.WaferSize MapWaferSize(int value)
  752. {
  753. switch (value)
  754. {
  755. case 3: return Aitex.Core.Common.WaferSize.WS3;
  756. case 4: return Aitex.Core.Common.WaferSize.WS4;
  757. case 6: return Aitex.Core.Common.WaferSize.WS6;
  758. case 8: return Aitex.Core.Common.WaferSize.WS8;
  759. case 12: return Aitex.Core.Common.WaferSize.WS12;
  760. case 150: return Aitex.Core.Common.WaferSize.WS150;
  761. case 159: return Aitex.Core.Common.WaferSize.WS159;
  762. }
  763. return Aitex.Core.Common.WaferSize.WS0;
  764. }
  765. private List<int> GetSlotsByModule(string module)
  766. {
  767. List<int> slots = new List<int>();
  768. int num = 0;
  769. switch (module)
  770. {
  771. case "LP1":
  772. case "LP2":
  773. num = 25;
  774. break;
  775. case "Aligner1":
  776. case "Aligner2":
  777. case "Cooling1":
  778. case "Cooling2":
  779. case "PMA":
  780. case "PMB":
  781. num = 1;
  782. break;
  783. }
  784. int j = 0;
  785. while (j < num)
  786. {
  787. slots.Add(j + 1);
  788. j++;
  789. }
  790. return slots;
  791. }
  792. protected override void OnInitialize()
  793. {
  794. MenuPermission = ClientApp.Instance.GetPermission("EFEM");
  795. base.OnInitialize();
  796. base.InitModules();
  797. }
  798. public void SetWaferSize(string module, string size)
  799. {
  800. if (MenuPermission != 3) return;
  801. InvokeClient.Instance.Service.DoOperation("System.SetWaferSize", module, size);
  802. }
  803. public void HomeAligner(string module)
  804. {
  805. if (MenuPermission != 3) return;
  806. InvokeClient.Instance.Service.DoOperation($"{module}.{EfemOperation.Home}");
  807. }
  808. public void AlignAligner(string module)
  809. {
  810. if (MenuPermission != 3) return;
  811. string size = Aligner1WaferSize;
  812. if (module == ModuleName.Aligner2.ToString())
  813. size = Aligner2WaferSize;
  814. if (module == ModuleName.Cooling1.ToString())
  815. size = Cooling1WaferSize;
  816. if (module == ModuleName.Cooling2.ToString())
  817. size = Cooling2WaferSize;
  818. InvokeClient.Instance.Service.DoOperation($"{module}.{EfemOperation.Align}", size);
  819. }
  820. public void LiftAligner(string module)
  821. {
  822. if (MenuPermission != 3) return;
  823. InvokeClient.Instance.Service.DoOperation($"{module}.{EfemOperation.Lift}",true);
  824. }
  825. public void LiftAlignerDown(string module)
  826. {
  827. if (MenuPermission != 3) return;
  828. InvokeClient.Instance.Service.DoOperation($"{module}.{EfemOperation.Lift}", false);
  829. }
  830. public void HomeEfem()
  831. {
  832. if (MenuPermission != 3) return;
  833. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EFEM}.{EfemOperation.Home}");
  834. }
  835. public void ResetEfem()
  836. {
  837. if (MenuPermission != 3) return;
  838. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EFEM}.Reset");
  839. }
  840. public void ClearError()
  841. {
  842. if (MenuPermission != 3) return;
  843. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EFEM}.{EfemOperation.ClearError}");
  844. }
  845. public void HomeRobot()
  846. {
  847. if (MenuPermission != 3) return;
  848. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Home}");
  849. }
  850. public void AbortRobot()
  851. {
  852. if (MenuPermission != 3) return;
  853. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Abort}");
  854. }
  855. public void RobotPick()
  856. {
  857. if (MenuPermission != 3) return;
  858. string ws = PickSelectedModule == ModuleName.LP1.ToString() ? LP1WaferSize :
  859. PickSelectedModule == ModuleName.LP2.ToString() ? LP2WaferSize :
  860. PickSelectedModule == ModuleName.Aligner1.ToString() ? Aligner1WaferSize :
  861. PickSelectedModule == ModuleName.Aligner2.ToString() ? Aligner2WaferSize :
  862. PickSelectedModule == ModuleName.Cooling2.ToString() ? Cooling2WaferSize :
  863. PickSelectedModule == ModuleName.Cooling1.ToString() ? Cooling1WaferSize : throw new ArgumentOutOfRangeException();
  864. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Pick}",
  865. PickSelectedModule, PickSelectedSlot - 1, ws, PickSelectedBlade);
  866. }
  867. public void RobotPlace()
  868. {
  869. if (MenuPermission != 3) return;
  870. string ws = PlaceSelectedModule == ModuleName.LP1.ToString() ? LP1WaferSize :
  871. PlaceSelectedModule == ModuleName.LP2.ToString() ? LP2WaferSize :
  872. PlaceSelectedModule == ModuleName.Aligner1.ToString() ? Aligner1WaferSize :
  873. PlaceSelectedModule == ModuleName.Aligner2.ToString() ? Aligner2WaferSize :
  874. PlaceSelectedModule == ModuleName.Cooling1.ToString() ? Cooling1WaferSize :
  875. PlaceSelectedModule == ModuleName.Cooling2.ToString() ? Cooling2WaferSize : throw new ArgumentOutOfRangeException();
  876. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Place}",
  877. PlaceSelectedModule, PlaceSelectedSlot - 1, ws, PlaceSelectedBlade);
  878. }
  879. public void RobotExtend()
  880. {
  881. if (MenuPermission != 3) return;
  882. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Extend}", ExtendSelectedModule, ExtendParam[ExtendSelectedSlot], ExtendSelectedBlade, EfemRobotWaferSize);
  883. }
  884. public void RobotRetract()
  885. {
  886. if (MenuPermission != 3) return;
  887. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Retract}", RetractSelectedModule, RetractSlots[RetractSelectedSlot]);
  888. }
  889. public void RobotMap()
  890. {
  891. if (MenuPermission != 3) return;
  892. InvokeClient.Instance.Service.DoOperation($"{MapSelectedModule}.{EfemOperation.Map}");
  893. }
  894. public void RobotGrip()
  895. {
  896. if (MenuPermission != 3) return;
  897. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Grip}", "ON", GripSelectedBlade);
  898. }
  899. public void RobotUngrip()
  900. {
  901. if (MenuPermission != 3) return;
  902. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Grip}", "OFF", UngripSelectedBlade);
  903. }
  904. public void MapLP(string moduleID)
  905. {
  906. if (MenuPermission != 3) return;
  907. LoadPortProvider.Instance.MapLP(moduleID);
  908. }
  909. public void LoadLP(string moduleID)
  910. {
  911. if (MenuPermission != 3) return;
  912. LoadPortProvider.Instance.LoadLP(moduleID);
  913. }
  914. public void UnloadLP(string moduleID)
  915. {
  916. if (MenuPermission != 3) return;
  917. LoadPortProvider.Instance.UnloadLP(moduleID);
  918. }
  919. public void HomeLP(string moduleID)
  920. {
  921. if (MenuPermission != 3) return;
  922. LoadPortProvider.Instance.Home(moduleID);
  923. }
  924. public void ResetLP(string moduleID)
  925. {
  926. if (MenuPermission != 3) return;
  927. LoadPortProvider.Instance.Reset(moduleID);
  928. }
  929. public void LockLP(string moduleID)
  930. {
  931. if (MenuPermission != 3) return;
  932. LoadPortProvider.Instance.Clamp(moduleID);
  933. }
  934. public void UnlockLP(string moduleID)
  935. {
  936. if (MenuPermission != 3) return;
  937. LoadPortProvider.Instance.Unclamp(moduleID);
  938. }
  939. public void ReadCarrierIdLP(string moduleID)
  940. {
  941. if (MenuPermission != 3) return;
  942. LoadPortProvider.Instance.ReadCarrierID(moduleID);
  943. }
  944. }
  945. }