EFEMViewModel.cs 32 KB

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