SelfCheckViewModel.cs 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482
  1. using Aitex.Core.UI.MVVM;
  2. using Aitex.Core.Util;
  3. using MECF.Framework.Common.DataCenter;
  4. using MECF.Framework.Common.CommonData;
  5. using MECF.Framework.Common.Equipment;
  6. using MECF.Framework.Common.OperationCenter;
  7. using MECF.Framework.Common.SubstrateTrackings;
  8. using MECF.Framework.UI.Client.ClientBase;
  9. using System.Collections.Generic;
  10. using System.Linq;
  11. using System.Windows;
  12. using System.Windows.Input;
  13. using FurnaceUI.Models;
  14. using FurnaceUI;
  15. using FurnaceUI.Controls.Common;
  16. using FurnaceUI.Client;
  17. using Caliburn.Micro;
  18. using Caliburn.Micro.Core;
  19. namespace FurnaceUI.Views.Operations
  20. {
  21. public class SelfCheckViewModel : FurnaceUIViewModelBase
  22. {
  23. #region Subscription Properties
  24. [Subscription("WaferRobot.MappingResult")]
  25. public string MappingResult { get; set; }
  26. [Subscription("PM1.SensorStocker1.Value")]
  27. public bool SensorStation1Presence { get; set; }
  28. [Subscription("PM1.SensorStocker2.Value")]
  29. public bool SensorStation2Presence { get; set; }
  30. [Subscription("PM1.SensorStocker3.Value")]
  31. public bool SensorStation3Presence { get; set; }
  32. [Subscription("PM1.SensorStocker4.Value")]
  33. public bool SensorStation4Presence { get; set; }
  34. [Subscription("PM1.SensorStocker5.Value")]
  35. public bool SensorStation5Presence { get; set; }
  36. [Subscription("PM1.SensorStocker6.Value")]
  37. public bool SensorStation6Presence { get; set; }
  38. [Subscription("PM1.SensorStocker7.Value")]
  39. public bool SensorStation7Presence { get; set; }
  40. [Subscription("PM1.SensorStocker8.Value")]
  41. public bool SensorStation8Presence { get; set; }
  42. [Subscription("PM1.SensorStocker9.Value")]
  43. public bool SensorStation9Presence { get; set; }
  44. [Subscription("PM1.SensorStocker10.Value")]
  45. public bool SensorStation10Presence { get; set; }
  46. [Subscription("PM1.SensorStocker11.Value")]
  47. public bool SensorStation11Presence { get; set; }
  48. [Subscription("PM1.SensorStocker12.Value")]
  49. public bool SensorStation12Presence { get; set; }
  50. [Subscription("PM1.SensorStocker13.Value")]
  51. public bool SensorStation13Presence { get; set; }
  52. [Subscription("PM1.SensorStocker14.Value")]
  53. public bool SensorStation14Presence { get; set; }
  54. [Subscription("PM1.SensorStocker15.Value")]
  55. public bool SensorStation15Presence { get; set; }
  56. [Subscription("PM1.SensorStocker16.Value")]
  57. public bool SensorStation16Presence { get; set; }
  58. [Subscription("PM1.SensorStocker17.Value")]
  59. public bool SensorStation17Presence { get; set; }
  60. [Subscription("PM1.SensorStocker18.Value")]
  61. public bool SensorStation18Presence { get; set; }
  62. [Subscription("System.SensorStage1CASSPresence.Value")]
  63. public bool SensorStage1CASSPresence { get; set; }
  64. [Subscription("System.SensorStage2CASSPresence.Value")]
  65. public bool SensorStage2CASSPresence { get; set; }
  66. [Subscription("Stocker1.Carrier")]
  67. public CarrierInfo Stocker1CarrierData { get; set; }
  68. [Subscription("Stocker2.Carrier")]
  69. public CarrierInfo Stocker2CarrierData { get; set; }
  70. [Subscription("Stocker3.Carrier")]
  71. public CarrierInfo Stocker3CarrierData { get; set; }
  72. [Subscription("Stocker4.Carrier")]
  73. public CarrierInfo Stocker4CarrierData { get; set; }
  74. [Subscription("Stocker5.Carrier")]
  75. public CarrierInfo Stocker5CarrierData { get; set; }
  76. [Subscription("Stocker6.Carrier")]
  77. public CarrierInfo Stocker6CarrierData { get; set; }
  78. [Subscription("Stocker7.Carrier")]
  79. public CarrierInfo Stocker7CarrierData { get; set; }
  80. [Subscription("Stocker8.Carrier")]
  81. public CarrierInfo Stocker8CarrierData { get; set; }
  82. [Subscription("Stocker9.Carrier")]
  83. public CarrierInfo Stocker9CarrierData { get; set; }
  84. [Subscription("Stocker10.Carrier")]
  85. public CarrierInfo Stocker10CarrierData { get; set; }
  86. [Subscription("Stocker11.Carrier")]
  87. public CarrierInfo Stocker11CarrierData { get; set; }
  88. [Subscription("Stocker12.Carrier")]
  89. public CarrierInfo Stocker12CarrierData { get; set; }
  90. [Subscription("Stocker13.Carrier")]
  91. public CarrierInfo Stocker13CarrierData { get; set; }
  92. [Subscription("Stocker14.Carrier")]
  93. public CarrierInfo Stocker14CarrierData { get; set; }
  94. [Subscription("Stocker15.Carrier")]
  95. public CarrierInfo Stocker15CarrierData { get; set; }
  96. [Subscription("Stocker16.Carrier")]
  97. public CarrierInfo Stocker16CarrierData { get; set; }
  98. [Subscription("Stocker17.Carrier")]
  99. public CarrierInfo Stocker17CarrierData { get; set; }
  100. [Subscription("Stocker18.Carrier")]
  101. public CarrierInfo Stocker18CarrierData { get; set; }
  102. [Subscription("FIMS1.Carrier")]
  103. public CarrierInfo FIMS1CarrierData { get; set; }
  104. [Subscription("FIMS2.Carrier")]
  105. public CarrierInfo FIMS2CarrierData { get; set; }
  106. [Subscription("LP1.Carrier")]
  107. public CarrierInfo LP1CarrierData { get; set; }
  108. [Subscription("LP2.Carrier")]
  109. public CarrierInfo LP2CarrierData { get; set; }
  110. [Subscription("LP3.Carrier")]
  111. public CarrierInfo LP3CarrierData { get; set; }
  112. [Subscription("LP4.Carrier")]
  113. public CarrierInfo LP4CarrierData { get; set; }
  114. [Subscription("CarrierRobot.Carrier")]
  115. public CarrierInfo CassetteRobotCarrierData { get; set; }
  116. [Subscription("CarrierRobot.RobotMoveInfo")]
  117. public RobotMoveInfo CassetteRobotMoveInfo { get; set; }
  118. [Subscription("WaferRobot.RobotMoveInfo")]
  119. public RobotMoveInfo WaferRobotMoveInfo { get; set; }
  120. public ICommand CreateCassetteCommand { get; private set; }
  121. public ICommand DeleteCassetteCommand { get; private set; }
  122. [Subscription("CarrierRobot.Status")]
  123. public string CassetteRobotStatus { get; set; }
  124. public bool IsCassetteRobotInitialized
  125. {
  126. get
  127. {
  128. return CassetteRobotStatus != "Init" && CassetteRobotStatus != "Homing";
  129. }
  130. }
  131. [Subscription("WaferRobot.Status")]
  132. public string WaferRobotStatus { get; set; }
  133. [Subscription("LP1.Status")]
  134. public string LP1Status { get; set; }
  135. [Subscription("LP2.Status")]
  136. public string LP2Status { get; set; }
  137. [Subscription("LP3.Status")]
  138. public string LP3Status { get; set; }
  139. [Subscription("LP4.Status")]
  140. public string LP4Status { get; set; }
  141. [Subscription("BoatElevatorRobot.Status")]
  142. public string BoatElevatorRobotStatus { get; set; }
  143. private string _boatPosition;
  144. [Subscription("Boat.BoatPosition")]
  145. public string BoatPosition
  146. {
  147. get => _boatPosition;
  148. set
  149. {
  150. _boatPosition = value;
  151. NotifyOfPropertyChange(nameof(BoatPosition));
  152. }
  153. }
  154. [Subscription("Boat.BoatZCurrentPosition")]
  155. public int BoatCurrentValue { get; set; }
  156. private int _boatZMinValue;
  157. public int BoatZMinValue
  158. {
  159. get => _boatZMinValue;
  160. set
  161. {
  162. _boatZMinValue = value;
  163. NotifyOfPropertyChange(nameof(BoatZMinValue));
  164. }
  165. }
  166. private int _boatZMaxValue;
  167. public int BoatZMaxValue
  168. {
  169. get => _boatZMaxValue;
  170. set
  171. {
  172. _boatZMaxValue = value;
  173. NotifyOfPropertyChange(nameof(BoatZMaxValue));
  174. }
  175. }
  176. public bool IsWaferRobotInitialized
  177. {
  178. get
  179. {
  180. return WaferRobotStatus != "Init" && WaferRobotStatus != "Homing";
  181. }
  182. }
  183. public string WaferRobotAxleStatusPath
  184. {
  185. get
  186. {
  187. switch (WaferRobotStatus)
  188. {
  189. case "Homing":
  190. case "Init":
  191. return "/FurnaceUI;component/Resources/Images/Controls3/hg2y.png";
  192. case "Idle":
  193. case "InTransfer":
  194. case "Loading":
  195. case "Unloading":
  196. case "Picking":
  197. case "Placing":
  198. return "/FurnaceUI;component/Resources/Images/Controls3/hg2g.png";
  199. case "Error":
  200. return "/FurnaceUI;component/Resources/Images/Controls3/hg2r.png";
  201. default:
  202. break;
  203. }
  204. return "/FurnaceUI;component/Resources/Images/Controls3/hg2g.png";
  205. }
  206. }
  207. public string CassetteRobotAxleStatusPath
  208. {
  209. get
  210. {
  211. switch (CassetteRobotStatus)
  212. {
  213. case "Homing":
  214. case "Init":
  215. return "/FurnaceUI;component/Resources/Images/Controls3/hg1y.png";
  216. case "Idle":
  217. case "InTransfer":
  218. case "Picking":
  219. case "Placing":
  220. return "/FurnaceUI;component/Resources/Images/Controls3/hg1g.png";
  221. case "Error":
  222. return "/FurnaceUI;component/Resources/Images/Controls3/hg1r.png";
  223. default:
  224. break;
  225. }
  226. return "/FurnaceUI;component/Resources/Images/Controls3/hg1g.png";
  227. }
  228. }
  229. public string SMIFAStatusPath
  230. {
  231. get
  232. {
  233. switch (LP1Status)
  234. {
  235. case "Homing":
  236. case "Init":
  237. return "/FurnaceUI;component/Resources/Images/Controls/smif-yellow.png";
  238. case "Idle":
  239. case "InTransfer":
  240. case "Picking":
  241. case "Placing":
  242. return "/FurnaceUI;component/Resources/Images/Controls/smif-green.png";
  243. case "Error":
  244. return "/FurnaceUI;component/Resources/Images/Controls/smif-red.png";
  245. default:
  246. break;
  247. }
  248. return "/FurnaceUI;component/Resources/Images/Controls/smif-green.png";
  249. }
  250. }
  251. public string SMIFBStatusPath
  252. {
  253. get
  254. {
  255. switch (LP2Status)
  256. {
  257. case "Homing":
  258. case "Init":
  259. return "/FurnaceUI;component/Resources/Images/Controls/smif-yellow.png";
  260. case "Idle":
  261. case "InTransfer":
  262. case "Picking":
  263. case "Placing":
  264. return "/FurnaceUI;component/Resources/Images/Controls/smif-green.png";
  265. case "Error":
  266. return "/FurnaceUI;component/Resources/Images/Controls/smif-red.png";
  267. default:
  268. break;
  269. }
  270. return "/FurnaceUI;component/Resources/Images/Controls/smif-green.png";
  271. }
  272. }
  273. [Subscription("PM1.Status")]
  274. public string PM1Status { get; set; }
  275. public bool IsPM1Initialized
  276. {
  277. get
  278. {
  279. return PM1Status != "Init" && PM1Status != "Homing";
  280. }
  281. }
  282. private string _boatStatus;
  283. [Subscription("Boat.Status")]
  284. public string BoatStatus
  285. {
  286. get => _boatStatus;
  287. set
  288. {
  289. _boatStatus = value;
  290. NotifyOfPropertyChange(nameof(BoatStatus));
  291. }
  292. }
  293. public bool IsBoatInitialized
  294. {
  295. get
  296. {
  297. return BoatStatus != "Init" && BoatStatus != "Homing";
  298. }
  299. }
  300. [Subscription("System.IsInitialized")]
  301. public bool SystemIsInitialized { get; set; }
  302. [Subscription("Rt.Status")]
  303. public string RtStatus { get; set; }
  304. public bool IsAuto
  305. {
  306. get { return RtStatus == "AutoRunning" || RtStatus == "AutoIdle"; }
  307. }
  308. public bool IsRtRunning
  309. {
  310. get
  311. {
  312. return RtStatus != "Init" && RtStatus != "Idle" && RtStatus != "AutoIdle";
  313. }
  314. }
  315. public bool IsRtInitialized
  316. {
  317. get
  318. {
  319. return RtStatus != "Init" && RtStatus != "Initializing";
  320. }
  321. }
  322. public bool IsEnableInitialize
  323. {
  324. get { return !IsAuto && !IsRtRunning; }
  325. }
  326. private bool _isShowBoatElevatorRobot = true;
  327. public bool IsShowBoatElevatorRobot
  328. {
  329. get => _isShowBoatElevatorRobot;
  330. set
  331. {
  332. _isShowBoatElevatorRobot = value;
  333. NotifyOfPropertyChange(nameof(IsShowBoatElevatorRobot));
  334. }
  335. }
  336. public int Stocker1WaferCount { get; set; } = 0;
  337. public int Stocker2WaferCount { get; set; } = 0;
  338. public int Stocker3WaferCount { get; set; } = 0;
  339. public int Stocker4WaferCount { get; set; } = 0;
  340. public int Stocker5WaferCount { get; set; } = 0;
  341. public int Stocker6WaferCount { get; set; } = 0;
  342. public int Stocker7WaferCount { get; set; } = 0;
  343. public int Stocker8WaferCount { get; set; } = 0;
  344. public int Stocker9WaferCount { get; set; } = 0;
  345. public int Stocker10WaferCount { get; set; } = 0;
  346. public int Stocker11WaferCount { get; set; } = 0;
  347. public int Stocker12WaferCount { get; set; } = 0;
  348. public int Stocker13WaferCount { get; set; } = 0;
  349. public int Stocker14WaferCount { get; set; } = 0;
  350. public int Stocker15WaferCount { get; set; } = 0;
  351. public int Stocker16WaferCount { get; set; } = 0;
  352. public int Stocker17WaferCount { get; set; } = 0;
  353. public int Stocker18WaferCount { get; set; } = 0;
  354. public int FIMS1WaferCount { get; set; } = 0;
  355. public int FIMS2WaferCount { get; set; } = 0;
  356. public int LP1WaferCount { get; set; } = 0;
  357. public int LP2WaferCount { get; set; } = 0;
  358. public int CarrierRobotWaferCount { get; set; } = 0;
  359. public int WaferRobotWaferCount { get; set; } = 0;
  360. public int PM1WaferCount { get; set; } = 0;
  361. #region StockerCarrierType
  362. private string GetStockerCarrierType(CarrierInfo carrierInfo)
  363. {
  364. if (carrierInfo != null && carrierInfo.Status == CarrierStatus.Normal)
  365. {
  366. if (carrierInfo.IsProcessed(carrierInfo.Name))
  367. {
  368. return "Process";
  369. }
  370. return carrierInfo.CarrierType.ToString();
  371. }
  372. return "";
  373. }
  374. public string Stocker1CarrierType
  375. {
  376. get
  377. {
  378. return GetStockerCarrierType(Stocker1CarrierData);
  379. }
  380. }
  381. public string Stocker2CarrierType
  382. {
  383. get
  384. {
  385. return GetStockerCarrierType(Stocker2CarrierData);
  386. }
  387. }
  388. public string Stocker3CarrierType
  389. {
  390. get
  391. {
  392. return GetStockerCarrierType(Stocker3CarrierData);
  393. }
  394. }
  395. public string Stocker4CarrierType
  396. {
  397. get
  398. {
  399. return GetStockerCarrierType(Stocker4CarrierData);
  400. }
  401. }
  402. public string Stocker5CarrierType
  403. {
  404. get
  405. {
  406. return GetStockerCarrierType(Stocker5CarrierData);
  407. }
  408. }
  409. public string Stocker6CarrierType
  410. {
  411. get
  412. {
  413. return GetStockerCarrierType(Stocker6CarrierData);
  414. }
  415. }
  416. public string Stocker7CarrierType
  417. {
  418. get
  419. {
  420. return GetStockerCarrierType(Stocker7CarrierData);
  421. }
  422. }
  423. public string Stocker8CarrierType
  424. {
  425. get
  426. {
  427. return GetStockerCarrierType(Stocker8CarrierData);
  428. }
  429. }
  430. public string Stocker9CarrierType
  431. {
  432. get
  433. {
  434. return GetStockerCarrierType(Stocker9CarrierData);
  435. }
  436. }
  437. public string Stocker10CarrierType
  438. {
  439. get
  440. {
  441. return GetStockerCarrierType(Stocker10CarrierData);
  442. }
  443. }
  444. public string Stocker11CarrierType
  445. {
  446. get
  447. {
  448. return GetStockerCarrierType(Stocker11CarrierData);
  449. }
  450. }
  451. public string Stocker12CarrierType
  452. {
  453. get
  454. {
  455. return GetStockerCarrierType(Stocker12CarrierData);
  456. }
  457. }
  458. public string Stocker13CarrierType
  459. {
  460. get
  461. {
  462. return GetStockerCarrierType(Stocker13CarrierData);
  463. }
  464. }
  465. public string Stocker14CarrierType
  466. {
  467. get
  468. {
  469. return GetStockerCarrierType(Stocker14CarrierData);
  470. }
  471. }
  472. public string Stocker15CarrierType
  473. {
  474. get
  475. {
  476. return GetStockerCarrierType(Stocker15CarrierData);
  477. }
  478. }
  479. public string Stocker16CarrierType
  480. {
  481. get
  482. {
  483. return GetStockerCarrierType(Stocker16CarrierData);
  484. }
  485. }
  486. public string Stocker17CarrierType
  487. {
  488. get
  489. {
  490. return GetStockerCarrierType(Stocker17CarrierData);
  491. }
  492. }
  493. public string Stocker18CarrierType
  494. {
  495. get
  496. {
  497. return GetStockerCarrierType(Stocker18CarrierData);
  498. }
  499. }
  500. #endregion
  501. private WaferInfo _waferRobotWafer1;
  502. public WaferInfo WaferRobotWafer1
  503. {
  504. get
  505. {
  506. return _waferRobotWafer1;
  507. }
  508. set
  509. {
  510. _waferRobotWafer1 = value;
  511. NotifyOfPropertyChange(nameof(WaferRobotWafer1));
  512. }
  513. }
  514. private WaferInfo _waferRobotWafer2;
  515. public WaferInfo WaferRobotWafer2
  516. {
  517. get
  518. {
  519. return _waferRobotWafer2;
  520. }
  521. set
  522. {
  523. _waferRobotWafer2 = value;
  524. NotifyOfPropertyChange(nameof(WaferRobotWafer2));
  525. }
  526. }
  527. [Subscription("CarrierRobot.Status")]
  528. public string CarrierRobotStatus { get; set; }
  529. [Subscription("CarrierRobot.SwapCycledCount")]
  530. public int SwapCycledCount { get; set; }
  531. [Subscription("CarrierRobot.CycleSwapCycledCount")]
  532. public int CycleSwapCycledCount { get; set; }
  533. [Subscription("WaferRobot.SwapCycledCount")]
  534. public int WaferRobotSwapCycledCount { get; set; }
  535. private Visibility _cycleCountVisibility;
  536. public Visibility CycleCountVisibility
  537. {
  538. get => _cycleCountVisibility;
  539. set
  540. {
  541. _cycleCountVisibility = value;
  542. NotifyOfPropertyChange(nameof(CycleCountVisibility));
  543. }
  544. }
  545. private int _cycleNumber { get; set; }
  546. private int _cycleSwapNumber { get; set; }
  547. public string CycleCountDisplay
  548. {
  549. get
  550. {
  551. if (CarrierRobotStatus == "Swaping")
  552. {
  553. return $"{SwapCycledCount + 1}/{_cycleNumber}";
  554. }
  555. if (CarrierRobotStatus == "CycleSwaping")
  556. {
  557. return $"{CycleSwapCycledCount}/{_cycleSwapNumber}";
  558. }
  559. return "--";
  560. }
  561. }
  562. private Visibility _waferRobotCycleCountVisibility;
  563. public Visibility WaferRobotCycleCountVisibility
  564. {
  565. get => _waferRobotCycleCountVisibility;
  566. set
  567. {
  568. _waferRobotCycleCountVisibility = value;
  569. NotifyOfPropertyChange(nameof(WaferRobotCycleCountVisibility));
  570. }
  571. }
  572. private int _waferRobotCycleNumber { get; set; }
  573. public string WaferRobotCycleCountDisplay
  574. {
  575. get
  576. {
  577. if (WaferRobotStatus == "Swaping")
  578. {
  579. return $"{WaferRobotSwapCycledCount + 1}/{_waferRobotCycleNumber}";
  580. }
  581. return "--";
  582. }
  583. }
  584. #endregion
  585. public bool IsEnableReturnWafer
  586. {
  587. get
  588. {
  589. return RtStatus == "Idle" || RtStatus == "AutoIdle";
  590. }
  591. }
  592. public bool PM1Installed { get; set; }
  593. public bool LP1Installed { get; set; }
  594. public bool LP2Installed { get; set; }
  595. public bool LP3Installed { get; set; }
  596. public bool LP4Installed { get; set; }
  597. public bool FIMS1Installed { get; set; }
  598. public bool FIMS2Installed { get; set; }
  599. private bool _stocker1Installed;
  600. public bool Stocker1Installed
  601. {
  602. get { return _stocker1Installed; }
  603. set { _stocker1Installed = value; this.NotifyOfPropertyChange(nameof(Stocker1Installed)); }
  604. }
  605. private bool _stocker2Installed;
  606. public bool Stocker2Installed
  607. {
  608. get { return _stocker2Installed; }
  609. set { _stocker2Installed = value; this.NotifyOfPropertyChange(nameof(Stocker2Installed)); }
  610. }
  611. private bool _stocker3Installed;
  612. public bool Stocker3Installed
  613. {
  614. get { return _stocker3Installed; }
  615. set { _stocker3Installed = value; this.NotifyOfPropertyChange(nameof(Stocker3Installed)); }
  616. }
  617. private bool _stocker4Installed;
  618. public bool Stocker4Installed
  619. {
  620. get { return _stocker4Installed; }
  621. set { _stocker4Installed = value; this.NotifyOfPropertyChange(nameof(Stocker4Installed)); }
  622. }
  623. private bool _stocker5Installed;
  624. public bool Stocker5Installed
  625. {
  626. get { return _stocker5Installed; }
  627. set { _stocker5Installed = value; this.NotifyOfPropertyChange(nameof(Stocker5Installed)); }
  628. }
  629. private bool _stocker6Installed;
  630. public bool Stocker6Installed
  631. {
  632. get { return _stocker6Installed; }
  633. set { _stocker6Installed = value; this.NotifyOfPropertyChange(nameof(Stocker6Installed)); }
  634. }
  635. private bool _stocker7Installed;
  636. public bool Stocker7Installed
  637. {
  638. get { return _stocker7Installed; }
  639. set { _stocker7Installed = value; this.NotifyOfPropertyChange(nameof(Stocker7Installed)); }
  640. }
  641. private bool _stocker8Installed;
  642. public bool Stocker8Installed
  643. {
  644. get { return _stocker8Installed; }
  645. set { _stocker8Installed = value; this.NotifyOfPropertyChange(nameof(Stocker8Installed)); }
  646. }
  647. private bool _stocker9Installed;
  648. public bool Stocker9Installed
  649. {
  650. get { return _stocker9Installed; }
  651. set { _stocker9Installed = value; this.NotifyOfPropertyChange(nameof(Stocker9Installed)); }
  652. }
  653. private bool _stocker10Installed;
  654. public bool Stocker10Installed
  655. {
  656. get { return _stocker10Installed; }
  657. set { _stocker10Installed = value; this.NotifyOfPropertyChange(nameof(Stocker10Installed)); }
  658. }
  659. private bool _stocker11Installed;
  660. public bool Stocker11Installed
  661. {
  662. get { return _stocker11Installed; }
  663. set { _stocker11Installed = value; this.NotifyOfPropertyChange(nameof(Stocker11Installed)); }
  664. }
  665. private bool _stocker12Installed;
  666. public bool Stocker12Installed
  667. {
  668. get { return _stocker12Installed; }
  669. set { _stocker12Installed = value; this.NotifyOfPropertyChange(nameof(Stocker12Installed)); }
  670. }
  671. private bool _stocker13Installed;
  672. public bool Stocker13Installed
  673. {
  674. get { return _stocker13Installed; }
  675. set { _stocker13Installed = value; this.NotifyOfPropertyChange(nameof(Stocker13Installed)); }
  676. }
  677. private bool _stocker14Installed;
  678. public bool Stocker14Installed
  679. {
  680. get { return _stocker14Installed; }
  681. set { _stocker14Installed = value; this.NotifyOfPropertyChange(nameof(Stocker14Installed)); }
  682. }
  683. private bool _stocker15Installed;
  684. public bool Stocker15Installed
  685. {
  686. get { return _stocker15Installed; }
  687. set { _stocker15Installed = value; this.NotifyOfPropertyChange(nameof(Stocker15Installed)); }
  688. }
  689. private bool _stocker16Installed;
  690. public bool Stocker16Installed
  691. {
  692. get { return _stocker16Installed; }
  693. set { _stocker16Installed = value; this.NotifyOfPropertyChange(nameof(Stocker16Installed)); }
  694. }
  695. private bool _stocker17Installed;
  696. public bool Stocker17Installed
  697. {
  698. get { return _stocker17Installed; }
  699. set { _stocker17Installed = value; this.NotifyOfPropertyChange(nameof(Stocker17Installed)); }
  700. }
  701. private bool _stocker18Installed;
  702. public bool Stocker18Installed
  703. {
  704. get { return _stocker18Installed; }
  705. set { _stocker18Installed = value; this.NotifyOfPropertyChange(nameof(Stocker18Installed)); }
  706. }
  707. public bool Stocker19Installed { get; set; }
  708. public bool Stocker20Installed { get; set; }
  709. public bool Stocker21Installed { get; set; }
  710. public bool Stocker1InstalledVisible { get; set; }
  711. public bool Stocker2InstalledVisible { get; set; }
  712. public bool Stocker3InstalledVisible { get; set; }
  713. public bool Stocker4InstalledVisible { get; set; }
  714. public bool Stocker5InstalledVisible { get; set; }
  715. public bool Stocker6InstalledVisible { get; set; }
  716. public bool Stocker7InstalledVisible { get; set; }
  717. public bool Stocker8InstalledVisible { get; set; }
  718. public bool Stocker9InstalledVisible { get; set; }
  719. public bool Stocker10InstalledVisible { get; set; }
  720. public bool Stocker11InstalledVisible { get; set; }
  721. public bool Stocker12InstalledVisible { get; set; }
  722. public bool Stocker13InstalledVisible { get; set; }
  723. public bool Stocker14InstalledVisible { get; set; }
  724. public bool Stocker15InstalledVisible { get; set; }
  725. public bool Stocker16InstalledVisible { get; set; }
  726. public bool Stocker17InstalledVisible { get; set; }
  727. public bool Stocker18InstalledVisible { get; set; }
  728. public bool Stocker19InstalledVisible { get; set; }
  729. public bool Stocker20InstalledVisible { get; set; }
  730. public bool Stocker21InstalledVisible { get; set; }
  731. private List<string> _PMList { get; set; } = new List<string>() { "PM1" };
  732. private List<string> _LPList { get; set; } = new List<string>() { "LP1", "LP2", "LP3", "LP4", };
  733. private List<string> _FIMSList { get; set; } = new List<string>() { "FIMS1", "FIMS2" };
  734. private List<string> _StockerList { get; set; } = new List<string>() { "Stocker1", "Stocker2", "Stocker3", "Stocker4", "Stocker5"
  735. , "Stocker6", "Stocker7", "Stocker8", "Stocker9", "Stocker10"
  736. , "Stocker11", "Stocker12", "Stocker13", "Stocker14", "Stocker15"
  737. , "Stocker16", "Stocker17", "Stocker18" };
  738. private int _boatSlotCount;
  739. private int _boatPWaferCount;
  740. public int BoatPWaferCount
  741. {
  742. get => _boatPWaferCount;
  743. set
  744. {
  745. _boatPWaferCount = value;
  746. NotifyOfPropertyChange(nameof(BoatPWaferCount));
  747. }
  748. }
  749. private int _boatM1WaferCount;
  750. public int BoatM1WaferCount
  751. {
  752. get => _boatM1WaferCount;
  753. set
  754. {
  755. _boatM1WaferCount = value;
  756. NotifyOfPropertyChange(nameof(BoatM1WaferCount));
  757. }
  758. }
  759. private int _boatM2WaferCount;
  760. public int BoatM2WaferCount
  761. {
  762. get => _boatM2WaferCount;
  763. set
  764. {
  765. _boatM2WaferCount = value;
  766. NotifyOfPropertyChange(nameof(BoatM2WaferCount));
  767. }
  768. }
  769. private int _boatSDWaferCount;
  770. public int BoatSDWaferCount
  771. {
  772. get => _boatSDWaferCount;
  773. set
  774. {
  775. _boatSDWaferCount = value;
  776. NotifyOfPropertyChange(nameof(BoatSDWaferCount));
  777. }
  778. }
  779. private int _boatEDWaferCount;
  780. public int BoatEDWaferCount
  781. {
  782. get => _boatEDWaferCount;
  783. set
  784. {
  785. _boatEDWaferCount = value;
  786. NotifyOfPropertyChange(nameof(BoatEDWaferCount));
  787. }
  788. }
  789. private int _boatEmptyWaferCount;
  790. public int BoatEmptyWaferCount
  791. {
  792. get => _boatEmptyWaferCount;
  793. set
  794. {
  795. _boatEmptyWaferCount = value;
  796. NotifyOfPropertyChange(nameof(BoatEmptyWaferCount));
  797. }
  798. }
  799. private string _boatAllWaferCount;
  800. public string BoatAllWaferCount
  801. {
  802. get => _boatAllWaferCount;
  803. set
  804. {
  805. _boatAllWaferCount = value;
  806. NotifyOfPropertyChange(nameof(BoatAllWaferCount));
  807. }
  808. }
  809. private List<string> _stockerWaferType;
  810. public List<string> StockerWaferType
  811. {
  812. get => _stockerWaferType;
  813. set
  814. {
  815. _stockerWaferType = value;
  816. NotifyOfPropertyChange(nameof(StockerWaferType));
  817. }
  818. }
  819. public Visibility IsStockerVisibility { get; set; }
  820. public Visibility IsLPVisibility { get; set; }
  821. public int LPPortCanvasTop { get; set; }
  822. public SelfCheckViewModel()
  823. {
  824. this.DisplayName = "SelfCheckViewModel";
  825. CreateCassetteCommand = new DelegateCommand<string>(CreateCassette);
  826. DeleteCassetteCommand = new DelegateCommand<string>(DeleteCassette);
  827. EnableTimer(true);
  828. }
  829. public void TestBoat()
  830. {
  831. if (BoatCurrentValue >= 1000)
  832. {
  833. BoatCurrentValue = 0;
  834. }
  835. else
  836. {
  837. BoatCurrentValue += 50;
  838. }
  839. }
  840. public Dictionary<string, StationPosition> StationPosition
  841. {
  842. get
  843. {
  844. return new Dictionary<string, StationPosition>()
  845. {
  846. { "ArmA.System", new StationPosition() {
  847. StartPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }
  848. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}}
  849. ,{ "Robot", new StationPosition() {
  850. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 180, Hand = 180 }
  851. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}}
  852. ,{"ArmA.Stocker1", new StationPosition(){
  853. StartPosition = new RobotPosition() { X=-230, Root = 0, Arm = 180, Hand = 180 }
  854. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  855. ,{"ArmA.Stocker2", new StationPosition(){
  856. StartPosition = new RobotPosition() { X=-230, Root = 0, Arm = 180, Hand = 180 }
  857. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  858. ,{"ArmA.Stocker3", new StationPosition(){
  859. StartPosition = new RobotPosition() { X=-230, Root = 0, Arm = 180, Hand = 180 }
  860. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  861. ,{"ArmA.Stocker4", new StationPosition(){
  862. StartPosition = new RobotPosition() { X=-230, Root = 0, Arm = 180, Hand = 180 }
  863. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  864. ,{ "ArmA.Stocker5", new StationPosition() {
  865. StartPosition = new RobotPosition() { X=-325, Root = 0, Arm = 180, Hand = 180 }
  866. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  867. ,{ "ArmA.Stocker6", new StationPosition() {
  868. StartPosition = new RobotPosition() { X=-325, Root = 0, Arm = 180, Hand = 180 }
  869. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  870. ,{ "ArmA.Stocker7", new StationPosition() {
  871. StartPosition = new RobotPosition() { X=-325, Root = 0, Arm = 180, Hand = 180 }
  872. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }} }
  873. ,{"ArmA.Stocker8", new StationPosition(){
  874. StartPosition = new RobotPosition() { X =-325, Root = 0, Arm = 180, Hand = 180 }
  875. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  876. ,{ "ArmA.Stocker9", new StationPosition() {
  877. StartPosition = new RobotPosition() { X=-415, Root = 0, Arm = 180, Hand = 180 }
  878. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  879. ,{ "ArmA.Stocker10", new StationPosition() {
  880. StartPosition = new RobotPosition() { X=-415, Root = 0, Arm = 180, Hand = 180 }
  881. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  882. ,{ "ArmA.Stocker11", new StationPosition() {
  883. StartPosition = new RobotPosition() { X=-415, Root = 0, Arm = 180, Hand = 180 }
  884. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  885. ,{ "ArmA.Stocker12", new StationPosition() {
  886. StartPosition = new RobotPosition() { X=-415, Root = 0, Arm = 180, Hand = 180 }
  887. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  888. ,{"ArmA.Stocker13", new StationPosition() {
  889. StartPosition = new RobotPosition() { X=-500, Root = 0, Arm = 180, Hand = 180 }
  890. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  891. ,{ "ArmA.Stocker14", new StationPosition() {
  892. StartPosition = new RobotPosition() { X=-500, Root = 0, Arm = 180, Hand = 180 }
  893. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  894. ,{ "ArmA.Stocker15", new StationPosition() {
  895. StartPosition = new RobotPosition() { X=-500, Root = 0, Arm = 180, Hand = 180 }
  896. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  897. ,{ "ArmA.Stocker16", new StationPosition() {
  898. StartPosition = new RobotPosition() { X=-500, Root = 0, Arm = 180, Hand = 180 }
  899. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  900. ,{"ArmA.Stocker17", new StationPosition(){
  901. StartPosition = new RobotPosition() { X = -310, Root = 180, Arm = 180, Hand = 180 }
  902. ,EndPosition = new RobotPosition() { Root = 180, Arm = -20, Hand = 0 }}}
  903. ,{"ArmA.Stocker18", new StationPosition(){
  904. StartPosition = new RobotPosition() { X = -310, Root = 180, Arm = 180, Hand = 180 }
  905. ,EndPosition = new RobotPosition() { Root = 180, Arm = 23, Hand = 0 }}}
  906. ,{"ArmA.FIMS1", new StationPosition(){
  907. StartPosition = new RobotPosition() { X = 35, Root = 0, Arm = 180, Hand = 180 }
  908. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  909. ,{"ArmA.FIMS2", new StationPosition(){
  910. StartPosition = new RobotPosition() { X = -95, Root = 0, Arm = 180, Hand = 180 }
  911. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  912. ,{"ArmA.LP1", new StationPosition(){
  913. StartPosition = new RobotPosition() { X = -210, Root = 180, Arm = 180, Hand = 180 }
  914. ,EndPosition = new RobotPosition() { Root = 180, Arm = -20, Hand = 0 }}}
  915. ,{"ArmA.LP2", new StationPosition(){
  916. StartPosition = new RobotPosition() { X = -210, Root = 180, Arm = 180, Hand = 180 }
  917. ,EndPosition = new RobotPosition() { Root = 180, Arm = 23, Hand = 0 }}}
  918. ,{"ArmA.LP3", new StationPosition(){
  919. StartPosition = new RobotPosition() { X = -453, Root = 180, Arm = 180, Hand = 180 }
  920. ,EndPosition = new RobotPosition() { Root = 180, Arm = -20, Hand = 0 }}}
  921. ,{"ArmA.LP4", new StationPosition(){
  922. StartPosition = new RobotPosition() { X = -453, Root = 180, Arm = 180, Hand = 180 }
  923. ,EndPosition = new RobotPosition() { Root = 180, Arm = 23, Hand = 0 }}}
  924. };
  925. }
  926. }
  927. public Dictionary<string, StationPosition> StationPosition2
  928. {
  929. get
  930. {
  931. return new Dictionary<string, StationPosition>()
  932. {
  933. { "ArmA.System", new StationPosition() {
  934. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 180, Hand = 180 }
  935. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}
  936. }
  937. ,{ "Robot", new StationPosition() {
  938. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 180, Hand = 180 }
  939. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}
  940. }
  941. ,{ "ArmA.FIMS1", new StationPosition() {
  942. StartPosition = new RobotPosition() { X=-20, Root = 180, Arm = 180, Hand = 180 }
  943. ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }}
  944. }
  945. ,{ "ArmA.FIMS2", new StationPosition() {
  946. StartPosition = new RobotPosition() { X=-168, Root = 180, Arm = 180, Hand = 180 }
  947. ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }}
  948. }
  949. ,{ "ArmA.PM1", new StationPosition() {
  950. StartPosition = new RobotPosition() { X=20, Root = 0, Arm = 180, Hand = 180 }
  951. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  952. }
  953. };
  954. }
  955. }
  956. public Dictionary<string, StationPosition> StationPosition3
  957. {
  958. get
  959. {
  960. return new Dictionary<string, StationPosition>()
  961. {
  962. { "HomePosition", new StationPosition() {
  963. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 0, Hand = 0 }
  964. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  965. },
  966. { "Position1", new StationPosition() {
  967. StartPosition = new RobotPosition() { X=-50, Root = 0, Arm = 0, Hand = 0 }
  968. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  969. },
  970. { "Position2", new StationPosition() {
  971. StartPosition = new RobotPosition() { X=-100, Root = 0, Arm = 0, Hand = 0 }
  972. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  973. },
  974. { "ProcessPosition", new StationPosition() {
  975. StartPosition = new RobotPosition() { X=-280, Root = 0, Arm = 0, Hand = 0 }
  976. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  977. }
  978. };
  979. }
  980. }
  981. public bool IsSimulateMode { get; set; }
  982. protected override void OnInitialize()
  983. {
  984. base.OnInitialize();
  985. //StockerWaferType = new List<string>();
  986. //for (int i = 1; i <= 18; i++)
  987. //{
  988. // var type = (string)QueryDataClient.Instance.Service.GetConfig($"System.Stocker.Stocker{i}WaferType").ToString().Replace("1", "").Replace("2", ""); ;
  989. // StockerWaferType.Add(type.ToString());
  990. //}
  991. #region GetModuleInstalled
  992. foreach (var item in _PMList)
  993. {
  994. var test = this.GetType().GetProperty($"{item}Installed");
  995. var test1 = this.GetType();
  996. this.GetType().GetProperty($"{item}Installed").SetValue(this, (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.Is{item}Installed"));
  997. }
  998. foreach (var item in _LPList)
  999. {
  1000. this.GetType().GetProperty($"{item}Installed").SetValue(this, (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.Is{item}Installed"));
  1001. }
  1002. foreach (var item in _FIMSList)
  1003. {
  1004. this.GetType().GetProperty($"{item}Installed").SetValue(this, (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.Is{item}Installed"));
  1005. }
  1006. foreach (var item in _StockerList)
  1007. {
  1008. this.GetType().GetProperty($"{item}Installed").SetValue(this, (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.Is{item}Installed"));
  1009. }
  1010. #endregion
  1011. base.InitFOUP();
  1012. //base.InitLL();
  1013. //base.InitTM();
  1014. //base.InitEFEM();
  1015. base.InitPM();
  1016. base.InitBuffer();
  1017. }
  1018. protected override void OnViewLoaded(object view)
  1019. {
  1020. base.OnViewLoaded(view);
  1021. }
  1022. protected override void OnActivate()
  1023. {
  1024. EnableTimer(true);
  1025. base.OnActivate();
  1026. _boatSlotCount = (int)QueryDataClient.Instance.Service.GetConfig("Boat.SlotCount");
  1027. BoatZMinValue = (int)QueryDataClient.Instance.Service.GetConfig("Boat.ZMinPosition");
  1028. BoatZMaxValue = (int)QueryDataClient.Instance.Service.GetConfig("Boat.ZMaxPosition");
  1029. IsSimulateMode = (bool)QueryDataClient.Instance.Service.GetConfig("System.IsSimulatorMode");
  1030. _cycleNumber = (int)QueryDataClient.Instance.Service.GetConfig("CarrierRobot.TransferModeNumber");
  1031. _cycleSwapNumber = (int)QueryDataClient.Instance.Service.GetConfig("CarrierRobot.RunToRunNumber");
  1032. _waferRobotCycleNumber = (int)QueryDataClient.Instance.Service.GetConfig("WaferRobot.TransferModeNumber");
  1033. CycleCountVisibility = (bool)QueryDataClient.Instance.Service.GetConfig("CarrierRobot.TransferMode") ? Visibility.Visible : Visibility.Hidden;
  1034. WaferRobotCycleCountVisibility = (bool)QueryDataClient.Instance.Service.GetConfig("WaferRobot.TransferMode") ? Visibility.Visible : Visibility.Hidden;
  1035. Stocker1Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker1Installed");
  1036. Stocker2Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker2Installed");
  1037. Stocker3Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker3Installed");
  1038. Stocker4Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker4Installed");
  1039. Stocker5Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker5Installed");
  1040. Stocker6Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker6Installed");
  1041. Stocker7Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker7Installed");
  1042. Stocker8Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker8Installed");
  1043. Stocker9Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker9Installed");
  1044. Stocker10Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker10Installed");
  1045. Stocker11Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker11Installed");
  1046. Stocker12Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker12Installed");
  1047. Stocker13Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker13Installed");
  1048. Stocker14Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker14Installed");
  1049. Stocker15Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker15Installed");
  1050. Stocker16Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker16Installed");
  1051. Stocker17Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker17Installed");
  1052. Stocker18Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker18Installed");
  1053. }
  1054. string[] moduleNames = new string[] { "Stocker1", "Stocker2", "Stocker3", "Stocker4", "Stocker5", "Stocker6", "Stocker7", "Stocker8", "Stocker9",
  1055. "Stocker10","Stocker11","Stocker12","Stocker13","Stocker14","Stocker15","Stocker16","Stocker17","Stocker18",
  1056. "FIMS1","FIMS2","CarrierRobot","WaferRobot","PM1"};
  1057. //string[] moduleNames = new string[] { "Stocker1", "Stocker2", "Stocker3", "Stocker4", "Stocker5", "Stocker6", "Stocker7", "Stocker8", "Stocker9",
  1058. // "Stocker10","Stocker11","Stocker12","Stocker13","Stocker14","Stocker15","Stocker16","Stocker17","Stocker18",
  1059. // "FIMS1","FIMS2","CarrierRobot","LP1","LP2","LP3","LP4"};
  1060. protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
  1061. {
  1062. base.InvokeAfterUpdateProperty(data);
  1063. //IsShowBoatElevatorRobot = RefreshBoatWafersTask();
  1064. // if (Stocker1CarrierData != null)
  1065. // Stocker1CarrierData = new CarrierInfo(10)
  1066. // { Status = CarrierStatus.Normal, HasWaferIn=true };
  1067. // Stocker1CassetteType = "ED";//(bool)QueryDataClient.Instance.Service.GetConfig("System.SetUp.IsStocker1Installed") && Stocker1CarrierData?.Status.ToString() == "Normal" ? Stocker1CarrierData?.CarrierType.ToString() : "";
  1068. foreach (var item in moduleNames)
  1069. {
  1070. if (ModuleManager.ModuleInfos.ContainsKey(item))
  1071. {
  1072. this.GetType().GetProperty($"{item}WaferCount").SetValue(this, ModuleManager.ModuleInfos[item].WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count());
  1073. }
  1074. }
  1075. if (ModuleManager.ModuleInfos.ContainsKey("WaferRobot"))
  1076. {
  1077. WaferInfo[] waferInfos = ModuleManager.ModuleInfos["WaferRobot"].WaferManager.Wafers.ToArray();
  1078. WaferRobotWafer1 = waferInfos[0];
  1079. WaferRobotWafer2 = waferInfos[1];
  1080. }
  1081. var isLoadPortPosition = (string)QueryDataClient.Instance.Service.GetConfig("LoadPort.LoadPortPosition");
  1082. if (isLoadPortPosition == "Upper")
  1083. {
  1084. IsStockerVisibility = Visibility.Hidden;
  1085. IsLPVisibility = Visibility.Visible;
  1086. LPPortCanvasTop = 5;
  1087. }
  1088. else
  1089. {
  1090. IsStockerVisibility = Visibility.Visible;
  1091. IsLPVisibility = Visibility.Hidden;
  1092. LPPortCanvasTop = 352;
  1093. }
  1094. RefreshBoatWafers();
  1095. }
  1096. private void RefreshBoatWafers()
  1097. {
  1098. var wafers = ModuleManager.ModuleInfos["PM1"].WaferManager.Wafers.Reverse().ToList();
  1099. int NumberP = 0, NumberM1 = 0, NumberM2 = 0, NumberSD = 0, NumberED = 0, NumberT = 0, NumberXD = 0;
  1100. for (int i = 0; i < wafers.Count; i++)
  1101. {
  1102. if (ModuleManager.ModuleInfos["PM1"].WaferManager.Wafers.Count > i)
  1103. {
  1104. var wafer = wafers[i];
  1105. if (wafer.WaferStatus != 0)//empty
  1106. {
  1107. switch (wafer.WaferType.ToString())
  1108. {
  1109. case "P":
  1110. NumberP++;
  1111. break;
  1112. case "M1":
  1113. NumberM1++;
  1114. break;
  1115. case "M2":
  1116. NumberM2++;
  1117. break;
  1118. case "SD":
  1119. NumberSD++;
  1120. break;
  1121. case "ED":
  1122. NumberED++;
  1123. break;
  1124. }
  1125. }
  1126. }
  1127. }
  1128. BoatPWaferCount = NumberP;
  1129. BoatM1WaferCount = NumberM1;
  1130. BoatM2WaferCount = NumberM2;
  1131. BoatSDWaferCount = NumberSD;
  1132. BoatEDWaferCount = NumberED;
  1133. BoatEmptyWaferCount = _boatSlotCount - BoatPWaferCount - BoatM1WaferCount - BoatM2WaferCount - BoatSDWaferCount - BoatEDWaferCount;
  1134. BoatAllWaferCount = $"{BoatPWaferCount + BoatM1WaferCount + BoatM2WaferCount + BoatSDWaferCount + BoatEDWaferCount}/{_boatSlotCount}";
  1135. }
  1136. private bool RefreshBoatWafersTask()
  1137. {
  1138. var wafers = ModuleManager.ModuleInfos["PM1"].WaferManager.Wafers.Reverse().ToList();
  1139. for (int i = 0; i < (int)QueryDataClient.Instance.Service.GetConfig("Boat.SlotCount"); i++)
  1140. {
  1141. if (ModuleManager.ModuleInfos["PM1"].WaferManager.Wafers.Count > i)
  1142. {
  1143. var wafer = wafers[i];
  1144. if (wafer.WaferStatus != 0)//empty
  1145. {
  1146. return true;
  1147. }
  1148. }
  1149. }
  1150. return false;
  1151. }
  1152. public void SwitchPage(string page)
  1153. {
  1154. }
  1155. public void Abort()
  1156. {
  1157. InvokeClient.Instance.Service.DoOperation("System.Abort");
  1158. }
  1159. public void CreateCassette(string module)
  1160. {
  1161. InvokeClient.Instance.Service.DoOperation("CreateCarrier", module, 0);
  1162. }
  1163. public void DeleteCassette(string module)
  1164. {
  1165. InvokeClient.Instance.Service.DoOperation("DeleteCarrier", module, 0);
  1166. }
  1167. public void Home(string module)
  1168. {
  1169. InvokeClient.Instance.Service.DoOperation($"{module}.Home");
  1170. }
  1171. public void HomeAll()
  1172. {
  1173. InvokeClient.Instance.Service.DoOperation("System.HomeAll");
  1174. }
  1175. public void CassetteIn()
  1176. {
  1177. InvokeClient.Instance.Service.DoOperation($"{ModuleName.CassetteRobot}.In");
  1178. }
  1179. public void CassetteOut()
  1180. {
  1181. InvokeClient.Instance.Service.DoOperation($"{ModuleName.CassetteRobot}.Out");
  1182. }
  1183. public void ShowSensors()
  1184. {
  1185. //WindowManager wm = new WindowManager();
  1186. //SensorsViewModel svm = new SensorsViewModel();
  1187. //wm.ShowDialogWithTitle(svm, null, "Sensor Information");
  1188. }
  1189. public void BoatWafers()
  1190. {
  1191. //WindowManager wm = new WindowManager();
  1192. //BoatWaferViewModel svm = new BoatWaferViewModel();
  1193. //wm.ShowDialogWithTitle(svm, null, "Boat Wafer");
  1194. }
  1195. public void WaferRobotWafers()
  1196. {
  1197. //WindowManager wm = new WindowManager();
  1198. //WaferRobotWaferViewModel svm = new WaferRobotWaferViewModel();
  1199. //wm.ShowDialogWithTitle(svm, null, "Wafer Robot Wafer");
  1200. }
  1201. public void StageWafers()
  1202. {
  1203. //WindowManager wm = new WindowManager();
  1204. //StageCassetteViewModel svm = new StageCassetteViewModel();
  1205. //wm.ShowDialogWithTitle(svm, null, "Stage Wafer");
  1206. }
  1207. public void CassetteRobotWafers()
  1208. {
  1209. //WindowManager wm = new WindowManager();
  1210. //CassetteRobotWaferViewModel svm = new CassetteRobotWaferViewModel();
  1211. //wm.ShowDialogWithTitle(svm, null, "Cassette Robot Wafer");
  1212. }
  1213. protected override void Poll()
  1214. {
  1215. if (GetView() != null)
  1216. {
  1217. //Application.Current.Dispatcher.Invoke(() =>
  1218. //{
  1219. // ((SelfCheckView)GetView()).ATMArmRobotTwo.Wafer1 = WaferRobotWafer1;
  1220. //}
  1221. //);
  1222. }
  1223. base.Poll();
  1224. }
  1225. public void DeleteWafer()
  1226. {
  1227. InvokeClient.Instance.Service.DoOperation("System.DeleteAllWafer");
  1228. }
  1229. public void DeleteCarrier()
  1230. {
  1231. InvokeClient.Instance.Service.DoOperation("System.DeleteAllCarrier");
  1232. }
  1233. public void Reset()
  1234. {
  1235. InvokeClient.Instance.Service.DoOperation("System.Reset");
  1236. }
  1237. public void PopupPage(string page)
  1238. {
  1239. //var windowManager = IoC.Get<IWindowManager>();
  1240. //switch (page)
  1241. //{
  1242. // case "SMIFA":
  1243. // {
  1244. // SMIFViewModel smifViewModel = new SMIFViewModel();
  1245. // (windowManager as WindowManager)?.ShowDialogWithTitle(smifViewModel, null, "SMIF Status");
  1246. // }
  1247. // break;
  1248. // case "SMIFB":
  1249. // {
  1250. // SMIFViewModel smifViewModel = new SMIFViewModel();
  1251. // (windowManager as WindowManager)?.ShowDialogWithTitle(smifViewModel, null, "SMIF Status");
  1252. // }
  1253. // break;
  1254. // case "CassetteRobot":
  1255. // CassetteRobotViewModel cassetteRobotViewModel = new CassetteRobotViewModel();
  1256. // (windowManager as WindowManager)?.ShowDialogWithTitle(cassetteRobotViewModel, null, "CassetteRobot Status");
  1257. // break;
  1258. // case "WaferRobot":
  1259. // WaferRobotViewModel waferRobotViewModel = new WaferRobotViewModel();
  1260. // (windowManager as WindowManager)?.ShowDialogWithTitle(waferRobotViewModel, null, "WaferRobot Status");
  1261. // break;
  1262. // case "Stage":
  1263. // StageSensorViewModel stageSensorViewModel = new StageSensorViewModel();
  1264. // (windowManager as WindowManager)?.ShowDialogWithTitle(stageSensorViewModel, null, "Stage Status");
  1265. // break;
  1266. // case "Stocker":
  1267. // StockerSensorViewModel stockerSensorViewModel = new StockerSensorViewModel();
  1268. // (windowManager as WindowManager)?.ShowDialogWithTitle(stockerSensorViewModel, null, "Stocker Status");
  1269. // break;
  1270. // case "Boat":
  1271. // BoatSensorViewModel boatSensorViewModel = new BoatSensorViewModel();
  1272. // (windowManager as WindowManager)?.ShowDialogWithTitle(boatSensorViewModel, null, "Boat Status");
  1273. // break;
  1274. // default:
  1275. // break;
  1276. //}
  1277. }
  1278. public void CanvasMouseLeftButtonDown(object sender)
  1279. {
  1280. //var windowManager = IoC.Get<IWindowManager>();
  1281. //Point pp = Mouse.GetPosition((IInputElement)sender);
  1282. //if ((pp.X > 80 && pp.X < 310 && pp.Y > 80 && pp.Y < 340) || (pp.X > 350 && pp.X < 550 && pp.Y > 80 && pp.Y < 400))
  1283. //{
  1284. // StockerSensorViewModel stockerSensorViewModel = new StockerSensorViewModel();
  1285. // (windowManager as WindowManager)?.ShowDialogWithTitle(stockerSensorViewModel, null, "Stocker Status");
  1286. //}
  1287. //else if (pp.X > 350 && pp.X < 500 && pp.Y > 410 && pp.Y < 625)
  1288. //{
  1289. // StageSensorViewModel stageSensorViewModel = new StageSensorViewModel();
  1290. // (windowManager as WindowManager)?.ShowDialogWithTitle(stageSensorViewModel, null, "Stage Status");
  1291. //}
  1292. //else if (pp.X > 590 && pp.X < 755 && pp.Y > 100 && pp.Y < 620)
  1293. //{
  1294. // BoatSensorViewModel boatSensorViewModel = new BoatSensorViewModel();
  1295. // (windowManager as WindowManager)?.ShowDialogWithTitle(boatSensorViewModel, null, "Boat Status");
  1296. //}
  1297. }
  1298. public void BoatModify()
  1299. {
  1300. var windowManager = IoC.Get<IWindowManager>();
  1301. BoatModifyViewModel boatModifyViewModel = new BoatModifyViewModel(ModuleName.PM1.ToString());
  1302. (windowManager as WindowManager)?.ShowDialogWithTitle(boatModifyViewModel, null, "Boat Wafer");
  1303. }
  1304. public void PopupModule(string module)
  1305. {
  1306. var windowManager = IoC.Get<IWindowManager>();
  1307. switch (module)
  1308. {
  1309. case "Init":
  1310. SelfCheckInitViewModel shelfCheckInitViewModel = new SelfCheckInitViewModel();
  1311. (windowManager as WindowManager)?.ShowDialogWithTitle(shelfCheckInitViewModel, null, "Init");
  1312. break;
  1313. case "ManualOperation":
  1314. SelfCheckManualOperationViewModel shelfCheckManualOperationViewModel = new SelfCheckManualOperationViewModel();
  1315. (windowManager as WindowManager)?.ShowDialogWithTitle(shelfCheckManualOperationViewModel, null, "Manual Operation");
  1316. break;
  1317. case "Modify":
  1318. SelfCheckModifyViewModel shelfCheckModifyViewModel = new SelfCheckModifyViewModel();
  1319. (windowManager as WindowManager)?.ShowDialogWithTitle(shelfCheckModifyViewModel, null, "Modify");
  1320. break;
  1321. //case "SensorStatus":
  1322. // SensorsViewModel sensorsViewModel = new SensorsViewModel();
  1323. // (windowManager as WindowManager)?.ShowDialogWithTitle(sensorsViewModel, null, "Sensor Status");
  1324. // break;
  1325. }
  1326. }
  1327. public void RobotCommand()
  1328. {
  1329. var windowManager = IoC.Get<IWindowManager>();
  1330. RobotCommandViewModel robotCommandViewModel = new RobotCommandViewModel();
  1331. (windowManager as WindowManager)?.ShowDialogWithTitle(robotCommandViewModel, null, "Modify");
  1332. }
  1333. public void CloseCmd()
  1334. {
  1335. ClientApp.Instance.SwitchPage("status", "main", null);
  1336. }
  1337. public void ReturnWafer()
  1338. {
  1339. InvokeClient.Instance.Service.DoOperation("System.ReturnAllWafer");
  1340. }
  1341. }
  1342. }