EFEMViewModel.cs 32 KB

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