SelfCheckViewModel.cs 64 KB

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