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. [Subscription("CarrierRobot.Status")]
  122. public string CassetteRobotStatus { get; set; }
  123. public bool IsCassetteRobotInitialized
  124. {
  125. get
  126. {
  127. return CassetteRobotStatus != "Init" && CassetteRobotStatus != "Homing";
  128. }
  129. }
  130. [Subscription("WaferRobot.Status")]
  131. public string WaferRobotStatus { get; set; }
  132. [Subscription("LP1.Status")]
  133. public string LP1Status { get; set; }
  134. [Subscription("LP2.Status")]
  135. public string LP2Status { get; set; }
  136. [Subscription("LP3.Status")]
  137. public string LP3Status { get; set; }
  138. [Subscription("LP4.Status")]
  139. public string LP4Status { get; set; }
  140. [Subscription("BoatElevatorRobot.Status")]
  141. public string BoatElevatorRobotStatus { get; set; }
  142. private string _boatPosition;
  143. [Subscription("Boat.BoatPosition")]
  144. public string BoatPosition
  145. {
  146. get => _boatPosition;
  147. set
  148. {
  149. _boatPosition = value;
  150. NotifyOfPropertyChange(nameof(BoatPosition));
  151. }
  152. }
  153. [Subscription("Boat.BoatZCurrentPosition")]
  154. public int BoatCurrentValue { get; set; }
  155. private int _boatZMinValue;
  156. public int BoatZMinValue
  157. {
  158. get => _boatZMinValue;
  159. set
  160. {
  161. _boatZMinValue = value;
  162. NotifyOfPropertyChange(nameof(BoatZMinValue));
  163. }
  164. }
  165. private int _boatZMaxValue;
  166. public int BoatZMaxValue
  167. {
  168. get => _boatZMaxValue;
  169. set
  170. {
  171. _boatZMaxValue = value;
  172. NotifyOfPropertyChange(nameof(BoatZMaxValue));
  173. }
  174. }
  175. public bool IsWaferRobotInitialized
  176. {
  177. get
  178. {
  179. return WaferRobotStatus != "Init" && WaferRobotStatus != "Homing";
  180. }
  181. }
  182. public string WaferRobotAxleStatusPath
  183. {
  184. get
  185. {
  186. switch (WaferRobotStatus)
  187. {
  188. case "Homing":
  189. case "Init":
  190. return "/FurnaceUI;component/Resources/Images/Controls3/hg2y.png";
  191. case "Idle":
  192. case "InTransfer":
  193. case "Loading":
  194. case "Unloading":
  195. case "Picking":
  196. case "Placing":
  197. return "/FurnaceUI;component/Resources/Images/Controls3/hg2g.png";
  198. case "Error":
  199. return "/FurnaceUI;component/Resources/Images/Controls3/hg2r.png";
  200. default:
  201. break;
  202. }
  203. return "/FurnaceUI;component/Resources/Images/Controls3/hg2g.png";
  204. }
  205. }
  206. public string CassetteRobotAxleStatusPath
  207. {
  208. get
  209. {
  210. switch (CassetteRobotStatus)
  211. {
  212. case "Homing":
  213. case "Init":
  214. return "/FurnaceUI;component/Resources/Images/Controls3/hg1y.png";
  215. case "Idle":
  216. case "InTransfer":
  217. case "Picking":
  218. case "Placing":
  219. return "/FurnaceUI;component/Resources/Images/Controls3/hg1g.png";
  220. case "Error":
  221. return "/FurnaceUI;component/Resources/Images/Controls3/hg1r.png";
  222. default:
  223. break;
  224. }
  225. return "/FurnaceUI;component/Resources/Images/Controls3/hg1g.png";
  226. }
  227. }
  228. public string SMIFAStatusPath
  229. {
  230. get
  231. {
  232. switch (LP1Status)
  233. {
  234. case "Homing":
  235. case "Init":
  236. return "/FurnaceUI;component/Resources/Images/Controls/smif-yellow.png";
  237. case "Idle":
  238. case "InTransfer":
  239. case "Picking":
  240. case "Placing":
  241. return "/FurnaceUI;component/Resources/Images/Controls/smif-green.png";
  242. case "Error":
  243. return "/FurnaceUI;component/Resources/Images/Controls/smif-red.png";
  244. default:
  245. break;
  246. }
  247. return "/FurnaceUI;component/Resources/Images/Controls/smif-green.png";
  248. }
  249. }
  250. public string SMIFBStatusPath
  251. {
  252. get
  253. {
  254. switch (LP2Status)
  255. {
  256. case "Homing":
  257. case "Init":
  258. return "/FurnaceUI;component/Resources/Images/Controls/smif-yellow.png";
  259. case "Idle":
  260. case "InTransfer":
  261. case "Picking":
  262. case "Placing":
  263. return "/FurnaceUI;component/Resources/Images/Controls/smif-green.png";
  264. case "Error":
  265. return "/FurnaceUI;component/Resources/Images/Controls/smif-red.png";
  266. default:
  267. break;
  268. }
  269. return "/FurnaceUI;component/Resources/Images/Controls/smif-green.png";
  270. }
  271. }
  272. [Subscription("PM1.Status")]
  273. public string PM1Status { get; set; }
  274. public bool IsPM1Initialized
  275. {
  276. get
  277. {
  278. return PM1Status != "Init" && PM1Status != "Homing";
  279. }
  280. }
  281. private string _boatStatus;
  282. [Subscription("Boat.Status")]
  283. public string BoatStatus
  284. {
  285. get => _boatStatus;
  286. set
  287. {
  288. _boatStatus = value;
  289. NotifyOfPropertyChange(nameof(BoatStatus));
  290. }
  291. }
  292. public bool IsBoatInitialized
  293. {
  294. get
  295. {
  296. return BoatStatus != "Init" && BoatStatus != "Homing";
  297. }
  298. }
  299. [Subscription("System.IsInitialized")]
  300. public bool SystemIsInitialized { get; set; }
  301. [Subscription("Rt.Status")]
  302. public string RtStatus { get; set; }
  303. public bool IsAuto
  304. {
  305. get { return RtStatus == "AutoRunning" || RtStatus == "AutoIdle"; }
  306. }
  307. public bool IsRtRunning
  308. {
  309. get
  310. {
  311. return RtStatus != "Init" && RtStatus != "Idle" && RtStatus != "AutoIdle";
  312. }
  313. }
  314. public bool IsRtInitialized
  315. {
  316. get
  317. {
  318. return RtStatus != "Init" && RtStatus != "Initializing";
  319. }
  320. }
  321. public bool IsEnableInitialize
  322. {
  323. get { return !IsAuto && !IsRtRunning; }
  324. }
  325. private bool _isShowBoatElevatorRobot = true;
  326. public bool IsShowBoatElevatorRobot
  327. {
  328. get => _isShowBoatElevatorRobot;
  329. set
  330. {
  331. _isShowBoatElevatorRobot = value;
  332. NotifyOfPropertyChange(nameof(IsShowBoatElevatorRobot));
  333. }
  334. }
  335. public int Stocker1WaferCount { get; set; } = 0;
  336. public int Stocker2WaferCount { get; set; } = 0;
  337. public int Stocker3WaferCount { get; set; } = 0;
  338. public int Stocker4WaferCount { get; set; } = 0;
  339. public int Stocker5WaferCount { get; set; } = 0;
  340. public int Stocker6WaferCount { get; set; } = 0;
  341. public int Stocker7WaferCount { get; set; } = 0;
  342. public int Stocker8WaferCount { get; set; } = 0;
  343. public int Stocker9WaferCount { get; set; } = 0;
  344. public int Stocker10WaferCount { get; set; } = 0;
  345. public int Stocker11WaferCount { get; set; } = 0;
  346. public int Stocker12WaferCount { get; set; } = 0;
  347. public int Stocker13WaferCount { get; set; } = 0;
  348. public int Stocker14WaferCount { get; set; } = 0;
  349. public int Stocker15WaferCount { get; set; } = 0;
  350. public int Stocker16WaferCount { get; set; } = 0;
  351. public int Stocker17WaferCount { get; set; } = 0;
  352. public int Stocker18WaferCount { get; set; } = 0;
  353. public int FIMS1WaferCount { get; set; } = 0;
  354. public int FIMS2WaferCount { get; set; } = 0;
  355. public int LP1WaferCount { get; set; } = 0;
  356. public int LP2WaferCount { get; set; } = 0;
  357. public int CarrierRobotWaferCount { get; set; } = 0;
  358. public int WaferRobotWaferCount { get; set; } = 0;
  359. public int PM1WaferCount { get; set; } = 0;
  360. #region StockerCarrierType
  361. private string GetStockerCarrierType(CarrierInfo carrierInfo)
  362. {
  363. if (carrierInfo != null && carrierInfo.Status == CarrierStatus.Normal)
  364. {
  365. if (carrierInfo.IsProcessed(carrierInfo.Name))
  366. {
  367. return "Process";
  368. }
  369. return carrierInfo.CarrierType.ToString();
  370. }
  371. return "";
  372. }
  373. public string Stocker1CarrierType
  374. {
  375. get
  376. {
  377. return GetStockerCarrierType(Stocker1CarrierData);
  378. }
  379. }
  380. public string Stocker2CarrierType
  381. {
  382. get
  383. {
  384. return GetStockerCarrierType(Stocker2CarrierData);
  385. }
  386. }
  387. public string Stocker3CarrierType
  388. {
  389. get
  390. {
  391. return GetStockerCarrierType(Stocker3CarrierData);
  392. }
  393. }
  394. public string Stocker4CarrierType
  395. {
  396. get
  397. {
  398. return GetStockerCarrierType(Stocker4CarrierData);
  399. }
  400. }
  401. public string Stocker5CarrierType
  402. {
  403. get
  404. {
  405. return GetStockerCarrierType(Stocker5CarrierData);
  406. }
  407. }
  408. public string Stocker6CarrierType
  409. {
  410. get
  411. {
  412. return GetStockerCarrierType(Stocker6CarrierData);
  413. }
  414. }
  415. public string Stocker7CarrierType
  416. {
  417. get
  418. {
  419. return GetStockerCarrierType(Stocker7CarrierData);
  420. }
  421. }
  422. public string Stocker8CarrierType
  423. {
  424. get
  425. {
  426. return GetStockerCarrierType(Stocker8CarrierData);
  427. }
  428. }
  429. public string Stocker9CarrierType
  430. {
  431. get
  432. {
  433. return GetStockerCarrierType(Stocker9CarrierData);
  434. }
  435. }
  436. public string Stocker10CarrierType
  437. {
  438. get
  439. {
  440. return GetStockerCarrierType(Stocker10CarrierData);
  441. }
  442. }
  443. public string Stocker11CarrierType
  444. {
  445. get
  446. {
  447. return GetStockerCarrierType(Stocker11CarrierData);
  448. }
  449. }
  450. public string Stocker12CarrierType
  451. {
  452. get
  453. {
  454. return GetStockerCarrierType(Stocker12CarrierData);
  455. }
  456. }
  457. public string Stocker13CarrierType
  458. {
  459. get
  460. {
  461. return GetStockerCarrierType(Stocker13CarrierData);
  462. }
  463. }
  464. public string Stocker14CarrierType
  465. {
  466. get
  467. {
  468. return GetStockerCarrierType(Stocker14CarrierData);
  469. }
  470. }
  471. public string Stocker15CarrierType
  472. {
  473. get
  474. {
  475. return GetStockerCarrierType(Stocker15CarrierData);
  476. }
  477. }
  478. public string Stocker16CarrierType
  479. {
  480. get
  481. {
  482. return GetStockerCarrierType(Stocker16CarrierData);
  483. }
  484. }
  485. public string Stocker17CarrierType
  486. {
  487. get
  488. {
  489. return GetStockerCarrierType(Stocker17CarrierData);
  490. }
  491. }
  492. public string Stocker18CarrierType
  493. {
  494. get
  495. {
  496. return GetStockerCarrierType(Stocker18CarrierData);
  497. }
  498. }
  499. #endregion
  500. private WaferInfo _waferRobotWafer1;
  501. public WaferInfo WaferRobotWafer1
  502. {
  503. get
  504. {
  505. return _waferRobotWafer1;
  506. }
  507. set
  508. {
  509. _waferRobotWafer1 = value;
  510. NotifyOfPropertyChange(nameof(WaferRobotWafer1));
  511. }
  512. }
  513. private WaferInfo _waferRobotWafer2;
  514. public WaferInfo WaferRobotWafer2
  515. {
  516. get
  517. {
  518. return _waferRobotWafer2;
  519. }
  520. set
  521. {
  522. _waferRobotWafer2 = value;
  523. NotifyOfPropertyChange(nameof(WaferRobotWafer2));
  524. }
  525. }
  526. [Subscription("CarrierRobot.Status")]
  527. public string CarrierRobotStatus { get; set; }
  528. [Subscription("CarrierRobot.SwapCycledCount")]
  529. public int SwapCycledCount { get; set; }
  530. [Subscription("CarrierRobot.CycleSwapCycledCount")]
  531. public int CycleSwapCycledCount { get; set; }
  532. [Subscription("WaferRobot.SwapCycledCount")]
  533. public int WaferRobotSwapCycledCount { get; set; }
  534. private Visibility _cycleCountVisibility;
  535. public Visibility CycleCountVisibility
  536. {
  537. get => _cycleCountVisibility;
  538. set
  539. {
  540. _cycleCountVisibility = value;
  541. NotifyOfPropertyChange(nameof(CycleCountVisibility));
  542. }
  543. }
  544. private int _cycleNumber { get; set; }
  545. private int _cycleSwapNumber { get; set; }
  546. public string CycleCountDisplay
  547. {
  548. get
  549. {
  550. if (CarrierRobotStatus == "Swaping")
  551. {
  552. return $"{SwapCycledCount + 1}/{_cycleNumber}";
  553. }
  554. if (CarrierRobotStatus == "CycleSwaping")
  555. {
  556. return $"{CycleSwapCycledCount}/{_cycleSwapNumber}";
  557. }
  558. return "--";
  559. }
  560. }
  561. private Visibility _waferRobotCycleCountVisibility;
  562. public Visibility WaferRobotCycleCountVisibility
  563. {
  564. get => _waferRobotCycleCountVisibility;
  565. set
  566. {
  567. _waferRobotCycleCountVisibility = value;
  568. NotifyOfPropertyChange(nameof(WaferRobotCycleCountVisibility));
  569. }
  570. }
  571. private int _waferRobotCycleNumber { get; set; }
  572. public string WaferRobotCycleCountDisplay
  573. {
  574. get
  575. {
  576. if (WaferRobotStatus == "Swaping")
  577. {
  578. return $"{WaferRobotSwapCycledCount + 1}/{_waferRobotCycleNumber}";
  579. }
  580. return "--";
  581. }
  582. }
  583. #endregion
  584. public bool IsManagerPermission { get => this.Permission == 3; }
  585. public bool IsEnableReturnWafer
  586. {
  587. get
  588. {
  589. return IsManagerPermission && (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. EnableTimer(true);
  826. }
  827. public void TestBoat()
  828. {
  829. if (BoatCurrentValue >= 1000)
  830. {
  831. BoatCurrentValue = 0;
  832. }
  833. else
  834. {
  835. BoatCurrentValue += 50;
  836. }
  837. }
  838. public Dictionary<string, StationPosition> StationPosition
  839. {
  840. get
  841. {
  842. return new Dictionary<string, StationPosition>()
  843. {
  844. { "ArmA.System", new StationPosition() {
  845. StartPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }
  846. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}}
  847. ,{ "Robot", new StationPosition() {
  848. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 180, Hand = 180 }
  849. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}}
  850. ,{"ArmA.Stocker1", new StationPosition(){
  851. StartPosition = new RobotPosition() { X=-230, Root = 0, Arm = 180, Hand = 180 }
  852. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  853. ,{"ArmA.Stocker2", new StationPosition(){
  854. StartPosition = new RobotPosition() { X=-230, Root = 0, Arm = 180, Hand = 180 }
  855. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  856. ,{"ArmA.Stocker3", 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.Stocker4", 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.Stocker5", new StationPosition() {
  863. StartPosition = new RobotPosition() { X=-325, Root = 0, Arm = 180, Hand = 180 }
  864. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  865. ,{ "ArmA.Stocker6", new StationPosition() {
  866. StartPosition = new RobotPosition() { X=-325, Root = 0, Arm = 180, Hand = 180 }
  867. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  868. ,{ "ArmA.Stocker7", 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.Stocker8", 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.Stocker9", new StationPosition() {
  875. StartPosition = new RobotPosition() { X=-415, Root = 0, Arm = 180, Hand = 180 }
  876. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  877. ,{ "ArmA.Stocker10", new StationPosition() {
  878. StartPosition = new RobotPosition() { X=-415, Root = 0, Arm = 180, Hand = 180 }
  879. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  880. ,{ "ArmA.Stocker11", 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.Stocker12", 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.Stocker13", new StationPosition() {
  887. StartPosition = new RobotPosition() { X=-500, Root = 0, Arm = 180, Hand = 180 }
  888. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  889. ,{ "ArmA.Stocker14", new StationPosition() {
  890. StartPosition = new RobotPosition() { X=-500, Root = 0, Arm = 180, Hand = 180 }
  891. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  892. ,{ "ArmA.Stocker15", 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.Stocker16", 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.Stocker17", new StationPosition(){
  899. StartPosition = new RobotPosition() { X = -310, Root = 180, Arm = 180, Hand = 180 }
  900. ,EndPosition = new RobotPosition() { Root = 180, Arm = -20, Hand = 0 }}}
  901. ,{"ArmA.Stocker18", new StationPosition(){
  902. StartPosition = new RobotPosition() { X = -310, Root = 180, Arm = 180, Hand = 180 }
  903. ,EndPosition = new RobotPosition() { Root = 180, Arm = 23, Hand = 0 }}}
  904. ,{"ArmA.FIMS1", new StationPosition(){
  905. StartPosition = new RobotPosition() { X = 35, Root = 0, Arm = 180, Hand = 180 }
  906. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  907. ,{"ArmA.FIMS2", new StationPosition(){
  908. StartPosition = new RobotPosition() { X = -95, Root = 0, Arm = 180, Hand = 180 }
  909. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  910. ,{"ArmA.LP1", new StationPosition(){
  911. StartPosition = new RobotPosition() { X = -210, Root = 180, Arm = 180, Hand = 180 }
  912. ,EndPosition = new RobotPosition() { Root = 180, Arm = -20, Hand = 0 }}}
  913. ,{"ArmA.LP2", new StationPosition(){
  914. StartPosition = new RobotPosition() { X = -210, Root = 180, Arm = 180, Hand = 180 }
  915. ,EndPosition = new RobotPosition() { Root = 180, Arm = 23, Hand = 0 }}}
  916. ,{"ArmA.LP3", new StationPosition(){
  917. StartPosition = new RobotPosition() { X = -453, Root = 180, Arm = 180, Hand = 180 }
  918. ,EndPosition = new RobotPosition() { Root = 180, Arm = -20, Hand = 0 }}}
  919. ,{"ArmA.LP4", new StationPosition(){
  920. StartPosition = new RobotPosition() { X = -453, Root = 180, Arm = 180, Hand = 180 }
  921. ,EndPosition = new RobotPosition() { Root = 180, Arm = 23, Hand = 0 }}}
  922. };
  923. }
  924. }
  925. public Dictionary<string, StationPosition> StationPosition2
  926. {
  927. get
  928. {
  929. return new Dictionary<string, StationPosition>()
  930. {
  931. { "ArmA.System", new StationPosition() {
  932. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 180, Hand = 180 }
  933. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}
  934. }
  935. ,{ "Robot", new StationPosition() {
  936. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 180, Hand = 180 }
  937. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}
  938. }
  939. ,{ "ArmA.FIMS1", new StationPosition() {
  940. StartPosition = new RobotPosition() { X=-20, Root = 180, Arm = 180, Hand = 180 }
  941. ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }}
  942. }
  943. ,{ "ArmA.FIMS2", new StationPosition() {
  944. StartPosition = new RobotPosition() { X=-168, Root = 180, Arm = 180, Hand = 180 }
  945. ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }}
  946. }
  947. ,{ "ArmA.PM1", new StationPosition() {
  948. StartPosition = new RobotPosition() { X=20, Root = 0, Arm = 180, Hand = 180 }
  949. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  950. }
  951. };
  952. }
  953. }
  954. public Dictionary<string, StationPosition> StationPosition3
  955. {
  956. get
  957. {
  958. return new Dictionary<string, StationPosition>()
  959. {
  960. { "HomePosition", new StationPosition() {
  961. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 0, Hand = 0 }
  962. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  963. },
  964. { "Position1", new StationPosition() {
  965. StartPosition = new RobotPosition() { X=-50, Root = 0, Arm = 0, Hand = 0 }
  966. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  967. },
  968. { "Position2", new StationPosition() {
  969. StartPosition = new RobotPosition() { X=-100, Root = 0, Arm = 0, Hand = 0 }
  970. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  971. },
  972. { "ProcessPosition", new StationPosition() {
  973. StartPosition = new RobotPosition() { X=-280, Root = 0, Arm = 0, Hand = 0 }
  974. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  975. }
  976. };
  977. }
  978. }
  979. public bool IsSimulateMode { get; set; }
  980. [Subscription("PM1.RunningMode")]
  981. public bool RunningModeIsDebug { 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. if (waferInfos.Count() > 0)
  1079. {
  1080. WaferRobotWafer1 = waferInfos[0];
  1081. }
  1082. if (waferInfos.Count() > 1)
  1083. {
  1084. WaferRobotWafer2 = waferInfos[1];
  1085. }
  1086. }
  1087. var isLoadPortPosition = (string)QueryDataClient.Instance.Service.GetConfig("LoadPort.LoadPortPosition");
  1088. if (isLoadPortPosition == "Upper")
  1089. {
  1090. IsStockerVisibility = Visibility.Hidden;
  1091. IsLPVisibility = Visibility.Visible;
  1092. LPPortCanvasTop = 5;
  1093. }
  1094. else
  1095. {
  1096. IsStockerVisibility = Visibility.Visible;
  1097. IsLPVisibility = Visibility.Hidden;
  1098. LPPortCanvasTop = 352;
  1099. }
  1100. RefreshBoatWafers();
  1101. }
  1102. private void RefreshBoatWafers()
  1103. {
  1104. var wafers = ModuleManager.ModuleInfos["PM1"].WaferManager.Wafers.Reverse().ToList();
  1105. int NumberP = 0, NumberM1 = 0, NumberM2 = 0, NumberSD = 0, NumberED = 0, NumberT = 0, NumberXD = 0;
  1106. for (int i = 0; i < wafers.Count; i++)
  1107. {
  1108. if (ModuleManager.ModuleInfos["PM1"].WaferManager.Wafers.Count > i)
  1109. {
  1110. var wafer = wafers[i];
  1111. if (wafer.WaferStatus != 0)//empty
  1112. {
  1113. switch (wafer.WaferType.ToString())
  1114. {
  1115. case "P":
  1116. NumberP++;
  1117. break;
  1118. case "M1":
  1119. NumberM1++;
  1120. break;
  1121. case "M2":
  1122. NumberM2++;
  1123. break;
  1124. case "SD":
  1125. NumberSD++;
  1126. break;
  1127. case "ED":
  1128. NumberED++;
  1129. break;
  1130. }
  1131. }
  1132. }
  1133. }
  1134. BoatPWaferCount = NumberP;
  1135. BoatM1WaferCount = NumberM1;
  1136. BoatM2WaferCount = NumberM2;
  1137. BoatSDWaferCount = NumberSD;
  1138. BoatEDWaferCount = NumberED;
  1139. BoatEmptyWaferCount = _boatSlotCount - BoatPWaferCount - BoatM1WaferCount - BoatM2WaferCount - BoatSDWaferCount - BoatEDWaferCount;
  1140. BoatAllWaferCount = $"{BoatPWaferCount + BoatM1WaferCount + BoatM2WaferCount + BoatSDWaferCount + BoatEDWaferCount}/{_boatSlotCount}";
  1141. }
  1142. private bool RefreshBoatWafersTask()
  1143. {
  1144. var wafers = ModuleManager.ModuleInfos["PM1"].WaferManager.Wafers.Reverse().ToList();
  1145. for (int i = 0; i < (int)QueryDataClient.Instance.Service.GetConfig("Boat.SlotCount"); i++)
  1146. {
  1147. if (ModuleManager.ModuleInfos["PM1"].WaferManager.Wafers.Count > i)
  1148. {
  1149. var wafer = wafers[i];
  1150. if (wafer.WaferStatus != 0)//empty
  1151. {
  1152. return true;
  1153. }
  1154. }
  1155. }
  1156. return false;
  1157. }
  1158. public void SwitchPage(string page)
  1159. {
  1160. }
  1161. public void Abort()
  1162. {
  1163. InvokeClient.Instance.Service.DoOperation("System.Abort");
  1164. }
  1165. public void Home(string module)
  1166. {
  1167. InvokeClient.Instance.Service.DoOperation($"{module}.Home");
  1168. }
  1169. public void HomeAll()
  1170. {
  1171. InvokeClient.Instance.Service.DoOperation("System.HomeAll");
  1172. }
  1173. public void CassetteIn()
  1174. {
  1175. InvokeClient.Instance.Service.DoOperation($"{ModuleName.CassetteRobot}.In");
  1176. }
  1177. public void CassetteOut()
  1178. {
  1179. InvokeClient.Instance.Service.DoOperation($"{ModuleName.CassetteRobot}.Out");
  1180. }
  1181. public void ShowSensors()
  1182. {
  1183. //WindowManager wm = new WindowManager();
  1184. //SensorsViewModel svm = new SensorsViewModel();
  1185. //wm.ShowDialogWithTitle(svm, null, "Sensor Information");
  1186. }
  1187. public void BoatWafers()
  1188. {
  1189. //WindowManager wm = new WindowManager();
  1190. //BoatWaferViewModel svm = new BoatWaferViewModel();
  1191. //wm.ShowDialogWithTitle(svm, null, "Boat Wafer");
  1192. }
  1193. public void WaferRobotWafers()
  1194. {
  1195. //WindowManager wm = new WindowManager();
  1196. //WaferRobotWaferViewModel svm = new WaferRobotWaferViewModel();
  1197. //wm.ShowDialogWithTitle(svm, null, "Wafer Robot Wafer");
  1198. }
  1199. public void StageWafers()
  1200. {
  1201. //WindowManager wm = new WindowManager();
  1202. //StageCassetteViewModel svm = new StageCassetteViewModel();
  1203. //wm.ShowDialogWithTitle(svm, null, "Stage Wafer");
  1204. }
  1205. public void CassetteRobotWafers()
  1206. {
  1207. //WindowManager wm = new WindowManager();
  1208. //CassetteRobotWaferViewModel svm = new CassetteRobotWaferViewModel();
  1209. //wm.ShowDialogWithTitle(svm, null, "Cassette Robot Wafer");
  1210. }
  1211. protected override void Poll()
  1212. {
  1213. if (GetView() != null)
  1214. {
  1215. //Application.Current.Dispatcher.Invoke(() =>
  1216. //{
  1217. // ((SelfCheckView)GetView()).ATMArmRobotTwo.Wafer1 = WaferRobotWafer1;
  1218. //}
  1219. //);
  1220. }
  1221. base.Poll();
  1222. }
  1223. public void DeleteWafer()
  1224. {
  1225. InvokeClient.Instance.Service.DoOperation("System.DeleteAllWafer");
  1226. }
  1227. public void DeleteCarrier()
  1228. {
  1229. InvokeClient.Instance.Service.DoOperation("System.DeleteAllCarrier");
  1230. }
  1231. public void Reset()
  1232. {
  1233. InvokeClient.Instance.Service.DoOperation("System.Reset");
  1234. }
  1235. public void ManualOperation(string deviceName)
  1236. {
  1237. var windowManager = IoC.Get<IWindowManager>();
  1238. switch (deviceName)
  1239. {
  1240. case "LP1":
  1241. {
  1242. LPSensorViewModel lpViewModel = new LPSensorViewModel();
  1243. lpViewModel.LP1BorderVisibility = true;
  1244. lpViewModel.LP2BorderVisibility = false;
  1245. lpViewModel.LP3BorderVisibility = false;
  1246. lpViewModel.LP4BorderVisibility = false;
  1247. lpViewModel.TabSelectIndex = 0;
  1248. (windowManager as WindowManager)?.ShowDialogWithTitle(lpViewModel, this, null, "LP1 Manual");
  1249. }
  1250. break;
  1251. case "LP2":
  1252. {
  1253. LPSensorViewModel lpViewModel = new LPSensorViewModel();
  1254. lpViewModel.LP1BorderVisibility = false;
  1255. lpViewModel.LP2BorderVisibility = true;
  1256. lpViewModel.LP3BorderVisibility = false;
  1257. lpViewModel.LP4BorderVisibility = false;
  1258. lpViewModel.TabSelectIndex = 1;
  1259. (windowManager as WindowManager)?.ShowDialogWithTitle(lpViewModel, this, null, "LP2 Manual");
  1260. }
  1261. break;
  1262. case "LP3":
  1263. {
  1264. LPSensorViewModel lpViewModel = new LPSensorViewModel();
  1265. lpViewModel.LP1BorderVisibility = false;
  1266. lpViewModel.LP2BorderVisibility = false;
  1267. lpViewModel.LP3BorderVisibility = true;
  1268. lpViewModel.LP4BorderVisibility = false;
  1269. lpViewModel.TabSelectIndex = 2;
  1270. (windowManager as WindowManager)?.ShowDialogWithTitle(lpViewModel, this, null, "LP3 Manual");
  1271. }
  1272. break;
  1273. case "LP4":
  1274. {
  1275. LPSensorViewModel lpViewModel = new LPSensorViewModel();
  1276. lpViewModel.LP1BorderVisibility = false;
  1277. lpViewModel.LP2BorderVisibility = false;
  1278. lpViewModel.LP3BorderVisibility = false;
  1279. lpViewModel.LP4BorderVisibility = true;
  1280. lpViewModel.TabSelectIndex = 3;
  1281. (windowManager as WindowManager)?.ShowDialogWithTitle(lpViewModel, this, null, "LP4 Manual");
  1282. }
  1283. break;
  1284. case "FIMS1":
  1285. case "FIMS2":
  1286. {
  1287. FIMSSensorViewModel fimsSensorViewModel = new FIMSSensorViewModel();
  1288. (windowManager as WindowManager)?.ShowDialogWithTitle(fimsSensorViewModel, this, null, "FIMS Manual");
  1289. }
  1290. break;
  1291. default:
  1292. break;
  1293. }
  1294. }
  1295. public void PopupPage(string page)
  1296. {
  1297. var windowManager = IoC.Get<IWindowManager>();
  1298. switch (page)
  1299. {
  1300. case "SMIFA":
  1301. {
  1302. SMIFViewModel smifViewModel = new SMIFViewModel();
  1303. (windowManager as WindowManager)?.ShowDialogWithTitle(smifViewModel, this, null, "SMIF Status");
  1304. }
  1305. break;
  1306. case "SMIFB":
  1307. {
  1308. SMIFViewModel smifViewModel = new SMIFViewModel();
  1309. (windowManager as WindowManager)?.ShowDialogWithTitle(smifViewModel, this, null, "SMIF Status");
  1310. }
  1311. break;
  1312. case "CassetteRobot":
  1313. CassetteRobotViewModel cassetteRobotViewModel = new CassetteRobotViewModel();
  1314. cassetteRobotViewModel.SystemName = "SMIFA";
  1315. (windowManager as WindowManager)?.ShowDialogWithTitle(cassetteRobotViewModel, this, null, "CassetteRobot Status");
  1316. break;
  1317. case "WaferRobot":
  1318. WaferRobotViewModel waferRobotViewModel = new WaferRobotViewModel();
  1319. (windowManager as WindowManager)?.ShowDialogWithTitle(waferRobotViewModel, this, null, "WaferRobot Status");
  1320. break;
  1321. case "Stage":
  1322. StageSensorViewModel stageSensorViewModel = new StageSensorViewModel();
  1323. (windowManager as WindowManager)?.ShowDialogWithTitle(stageSensorViewModel, this, null, "Stage Status");
  1324. break;
  1325. case "Stocker":
  1326. StockerSensorViewModel stockerSensorViewModel = new StockerSensorViewModel();
  1327. (windowManager as WindowManager)?.ShowDialogWithTitle(stockerSensorViewModel, this, null, "Stocker Status");
  1328. break;
  1329. case "Boat":
  1330. BoatSensorViewModel boatSensorViewModel = new BoatSensorViewModel();
  1331. (windowManager as WindowManager)?.ShowDialogWithTitle(boatSensorViewModel, this, null, "Boat Status");
  1332. break;
  1333. default:
  1334. break;
  1335. }
  1336. }
  1337. public void CanvasMouseLeftButtonDown(object sender)
  1338. {
  1339. //var windowManager = IoC.Get<IWindowManager>();
  1340. //Point pp = Mouse.GetPosition((IInputElement)sender);
  1341. //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))
  1342. //{
  1343. // StockerSensorViewModel stockerSensorViewModel = new StockerSensorViewModel();
  1344. // (windowManager as WindowManager)?.ShowDialogWithTitle(stockerSensorViewModel, null, "Stocker Status");
  1345. //}
  1346. //else if (pp.X > 350 && pp.X < 500 && pp.Y > 410 && pp.Y < 625)
  1347. //{
  1348. // StageSensorViewModel stageSensorViewModel = new StageSensorViewModel();
  1349. // (windowManager as WindowManager)?.ShowDialogWithTitle(stageSensorViewModel, null, "Stage Status");
  1350. //}
  1351. //else if (pp.X > 590 && pp.X < 755 && pp.Y > 100 && pp.Y < 620)
  1352. //{
  1353. // BoatSensorViewModel boatSensorViewModel = new BoatSensorViewModel();
  1354. // (windowManager as WindowManager)?.ShowDialogWithTitle(boatSensorViewModel, null, "Boat Status");
  1355. //}
  1356. }
  1357. public void BoatModify()
  1358. {
  1359. var windowManager = IoC.Get<IWindowManager>();
  1360. BoatModifyViewModel boatModifyViewModel = new BoatModifyViewModel(ModuleName.PM1.ToString());
  1361. (windowManager as WindowManager)?.ShowDialogWithTitle(boatModifyViewModel, this, null, "Boat Wafer");
  1362. }
  1363. public void PopupModule(string module)
  1364. {
  1365. var windowManager = IoC.Get<IWindowManager>();
  1366. switch (module)
  1367. {
  1368. case "Init":
  1369. SelfCheckInitViewModel shelfCheckInitViewModel = new SelfCheckInitViewModel();
  1370. (windowManager as WindowManager)?.ShowDialogWithTitle(shelfCheckInitViewModel, this, null, "Init");
  1371. break;
  1372. case "ManualOperation":
  1373. SelfCheckManualOperationViewModel shelfCheckManualOperationViewModel = new SelfCheckManualOperationViewModel();
  1374. (windowManager as WindowManager)?.ShowDialogWithTitle(shelfCheckManualOperationViewModel, this, null, "Manual Operation");
  1375. break;
  1376. case "Modify":
  1377. SelfCheckModifyViewModel shelfCheckModifyViewModel = new SelfCheckModifyViewModel();
  1378. (windowManager as WindowManager)?.ShowDialogWithTitle(shelfCheckModifyViewModel, this, null, "Modify");
  1379. break;
  1380. //case "SensorStatus":
  1381. // SensorsViewModel sensorsViewModel = new SensorsViewModel();
  1382. // (windowManager as WindowManager)?.ShowDialogWithTitle(sensorsViewModel, null, "Sensor Status");
  1383. // break;
  1384. }
  1385. }
  1386. public void RobotCommand()
  1387. {
  1388. var windowManager = IoC.Get<IWindowManager>();
  1389. RobotCommandViewModel robotCommandViewModel = new RobotCommandViewModel();
  1390. (windowManager as WindowManager)?.ShowDialogWithTitle(robotCommandViewModel, this, null, "Modify");
  1391. }
  1392. public void CloseCmd()
  1393. {
  1394. ClientApp.Instance.SwitchPage("status", "main", null);
  1395. }
  1396. public void ReturnWafer()
  1397. {
  1398. InvokeClient.Instance.Service.DoOperation("System.ReturnAllWafer");
  1399. }
  1400. }
  1401. }