SelfCheckViewModel.cs 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551
  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 IsManagerPermission { get => this.Permission == 3; }
  587. public bool IsEnableReturnWafer
  588. {
  589. get
  590. {
  591. return IsManagerPermission&&(RtStatus == "Idle" || RtStatus == "AutoIdle");
  592. }
  593. }
  594. public bool PM1Installed { get; set; }
  595. public bool LP1Installed { get; set; }
  596. public bool LP2Installed { get; set; }
  597. public bool LP3Installed { get; set; }
  598. public bool LP4Installed { get; set; }
  599. public bool FIMS1Installed { get; set; }
  600. public bool FIMS2Installed { get; set; }
  601. private bool _stocker1Installed;
  602. public bool Stocker1Installed
  603. {
  604. get { return _stocker1Installed; }
  605. set { _stocker1Installed = value; this.NotifyOfPropertyChange(nameof(Stocker1Installed)); }
  606. }
  607. private bool _stocker2Installed;
  608. public bool Stocker2Installed
  609. {
  610. get { return _stocker2Installed; }
  611. set { _stocker2Installed = value; this.NotifyOfPropertyChange(nameof(Stocker2Installed)); }
  612. }
  613. private bool _stocker3Installed;
  614. public bool Stocker3Installed
  615. {
  616. get { return _stocker3Installed; }
  617. set { _stocker3Installed = value; this.NotifyOfPropertyChange(nameof(Stocker3Installed)); }
  618. }
  619. private bool _stocker4Installed;
  620. public bool Stocker4Installed
  621. {
  622. get { return _stocker4Installed; }
  623. set { _stocker4Installed = value; this.NotifyOfPropertyChange(nameof(Stocker4Installed)); }
  624. }
  625. private bool _stocker5Installed;
  626. public bool Stocker5Installed
  627. {
  628. get { return _stocker5Installed; }
  629. set { _stocker5Installed = value; this.NotifyOfPropertyChange(nameof(Stocker5Installed)); }
  630. }
  631. private bool _stocker6Installed;
  632. public bool Stocker6Installed
  633. {
  634. get { return _stocker6Installed; }
  635. set { _stocker6Installed = value; this.NotifyOfPropertyChange(nameof(Stocker6Installed)); }
  636. }
  637. private bool _stocker7Installed;
  638. public bool Stocker7Installed
  639. {
  640. get { return _stocker7Installed; }
  641. set { _stocker7Installed = value; this.NotifyOfPropertyChange(nameof(Stocker7Installed)); }
  642. }
  643. private bool _stocker8Installed;
  644. public bool Stocker8Installed
  645. {
  646. get { return _stocker8Installed; }
  647. set { _stocker8Installed = value; this.NotifyOfPropertyChange(nameof(Stocker8Installed)); }
  648. }
  649. private bool _stocker9Installed;
  650. public bool Stocker9Installed
  651. {
  652. get { return _stocker9Installed; }
  653. set { _stocker9Installed = value; this.NotifyOfPropertyChange(nameof(Stocker9Installed)); }
  654. }
  655. private bool _stocker10Installed;
  656. public bool Stocker10Installed
  657. {
  658. get { return _stocker10Installed; }
  659. set { _stocker10Installed = value; this.NotifyOfPropertyChange(nameof(Stocker10Installed)); }
  660. }
  661. private bool _stocker11Installed;
  662. public bool Stocker11Installed
  663. {
  664. get { return _stocker11Installed; }
  665. set { _stocker11Installed = value; this.NotifyOfPropertyChange(nameof(Stocker11Installed)); }
  666. }
  667. private bool _stocker12Installed;
  668. public bool Stocker12Installed
  669. {
  670. get { return _stocker12Installed; }
  671. set { _stocker12Installed = value; this.NotifyOfPropertyChange(nameof(Stocker12Installed)); }
  672. }
  673. private bool _stocker13Installed;
  674. public bool Stocker13Installed
  675. {
  676. get { return _stocker13Installed; }
  677. set { _stocker13Installed = value; this.NotifyOfPropertyChange(nameof(Stocker13Installed)); }
  678. }
  679. private bool _stocker14Installed;
  680. public bool Stocker14Installed
  681. {
  682. get { return _stocker14Installed; }
  683. set { _stocker14Installed = value; this.NotifyOfPropertyChange(nameof(Stocker14Installed)); }
  684. }
  685. private bool _stocker15Installed;
  686. public bool Stocker15Installed
  687. {
  688. get { return _stocker15Installed; }
  689. set { _stocker15Installed = value; this.NotifyOfPropertyChange(nameof(Stocker15Installed)); }
  690. }
  691. private bool _stocker16Installed;
  692. public bool Stocker16Installed
  693. {
  694. get { return _stocker16Installed; }
  695. set { _stocker16Installed = value; this.NotifyOfPropertyChange(nameof(Stocker16Installed)); }
  696. }
  697. private bool _stocker17Installed;
  698. public bool Stocker17Installed
  699. {
  700. get { return _stocker17Installed; }
  701. set { _stocker17Installed = value; this.NotifyOfPropertyChange(nameof(Stocker17Installed)); }
  702. }
  703. private bool _stocker18Installed;
  704. public bool Stocker18Installed
  705. {
  706. get { return _stocker18Installed; }
  707. set { _stocker18Installed = value; this.NotifyOfPropertyChange(nameof(Stocker18Installed)); }
  708. }
  709. public bool Stocker19Installed { get; set; }
  710. public bool Stocker20Installed { get; set; }
  711. public bool Stocker21Installed { get; set; }
  712. public bool Stocker1InstalledVisible { get; set; }
  713. public bool Stocker2InstalledVisible { get; set; }
  714. public bool Stocker3InstalledVisible { get; set; }
  715. public bool Stocker4InstalledVisible { get; set; }
  716. public bool Stocker5InstalledVisible { get; set; }
  717. public bool Stocker6InstalledVisible { get; set; }
  718. public bool Stocker7InstalledVisible { get; set; }
  719. public bool Stocker8InstalledVisible { get; set; }
  720. public bool Stocker9InstalledVisible { get; set; }
  721. public bool Stocker10InstalledVisible { get; set; }
  722. public bool Stocker11InstalledVisible { get; set; }
  723. public bool Stocker12InstalledVisible { get; set; }
  724. public bool Stocker13InstalledVisible { get; set; }
  725. public bool Stocker14InstalledVisible { get; set; }
  726. public bool Stocker15InstalledVisible { get; set; }
  727. public bool Stocker16InstalledVisible { get; set; }
  728. public bool Stocker17InstalledVisible { get; set; }
  729. public bool Stocker18InstalledVisible { get; set; }
  730. public bool Stocker19InstalledVisible { get; set; }
  731. public bool Stocker20InstalledVisible { get; set; }
  732. public bool Stocker21InstalledVisible { get; set; }
  733. private List<string> _PMList { get; set; } = new List<string>() { "PM1" };
  734. private List<string> _LPList { get; set; } = new List<string>() { "LP1", "LP2", "LP3", "LP4", };
  735. private List<string> _FIMSList { get; set; } = new List<string>() { "FIMS1", "FIMS2" };
  736. private List<string> _StockerList { get; set; } = new List<string>() { "Stocker1", "Stocker2", "Stocker3", "Stocker4", "Stocker5"
  737. , "Stocker6", "Stocker7", "Stocker8", "Stocker9", "Stocker10"
  738. , "Stocker11", "Stocker12", "Stocker13", "Stocker14", "Stocker15"
  739. , "Stocker16", "Stocker17", "Stocker18" };
  740. private int _boatSlotCount;
  741. private int _boatPWaferCount;
  742. public int BoatPWaferCount
  743. {
  744. get => _boatPWaferCount;
  745. set
  746. {
  747. _boatPWaferCount = value;
  748. NotifyOfPropertyChange(nameof(BoatPWaferCount));
  749. }
  750. }
  751. private int _boatM1WaferCount;
  752. public int BoatM1WaferCount
  753. {
  754. get => _boatM1WaferCount;
  755. set
  756. {
  757. _boatM1WaferCount = value;
  758. NotifyOfPropertyChange(nameof(BoatM1WaferCount));
  759. }
  760. }
  761. private int _boatM2WaferCount;
  762. public int BoatM2WaferCount
  763. {
  764. get => _boatM2WaferCount;
  765. set
  766. {
  767. _boatM2WaferCount = value;
  768. NotifyOfPropertyChange(nameof(BoatM2WaferCount));
  769. }
  770. }
  771. private int _boatSDWaferCount;
  772. public int BoatSDWaferCount
  773. {
  774. get => _boatSDWaferCount;
  775. set
  776. {
  777. _boatSDWaferCount = value;
  778. NotifyOfPropertyChange(nameof(BoatSDWaferCount));
  779. }
  780. }
  781. private int _boatEDWaferCount;
  782. public int BoatEDWaferCount
  783. {
  784. get => _boatEDWaferCount;
  785. set
  786. {
  787. _boatEDWaferCount = value;
  788. NotifyOfPropertyChange(nameof(BoatEDWaferCount));
  789. }
  790. }
  791. private int _boatEmptyWaferCount;
  792. public int BoatEmptyWaferCount
  793. {
  794. get => _boatEmptyWaferCount;
  795. set
  796. {
  797. _boatEmptyWaferCount = value;
  798. NotifyOfPropertyChange(nameof(BoatEmptyWaferCount));
  799. }
  800. }
  801. private string _boatAllWaferCount;
  802. public string BoatAllWaferCount
  803. {
  804. get => _boatAllWaferCount;
  805. set
  806. {
  807. _boatAllWaferCount = value;
  808. NotifyOfPropertyChange(nameof(BoatAllWaferCount));
  809. }
  810. }
  811. private List<string> _stockerWaferType;
  812. public List<string> StockerWaferType
  813. {
  814. get => _stockerWaferType;
  815. set
  816. {
  817. _stockerWaferType = value;
  818. NotifyOfPropertyChange(nameof(StockerWaferType));
  819. }
  820. }
  821. public Visibility IsStockerVisibility { get; set; }
  822. public Visibility IsLPVisibility { get; set; }
  823. public int LPPortCanvasTop { get; set; }
  824. public SelfCheckViewModel()
  825. {
  826. this.DisplayName = "SelfCheckViewModel";
  827. CreateCassetteCommand = new DelegateCommand<string>(CreateCassette);
  828. DeleteCassetteCommand = new DelegateCommand<string>(DeleteCassette);
  829. EnableTimer(true);
  830. }
  831. public void TestBoat()
  832. {
  833. if (BoatCurrentValue >= 1000)
  834. {
  835. BoatCurrentValue = 0;
  836. }
  837. else
  838. {
  839. BoatCurrentValue += 50;
  840. }
  841. }
  842. public Dictionary<string, StationPosition> StationPosition
  843. {
  844. get
  845. {
  846. return new Dictionary<string, StationPosition>()
  847. {
  848. { "ArmA.System", new StationPosition() {
  849. StartPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }
  850. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}}
  851. ,{ "Robot", new StationPosition() {
  852. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 180, Hand = 180 }
  853. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}}
  854. ,{"ArmA.Stocker1", new StationPosition(){
  855. StartPosition = new RobotPosition() { X=-230, Root = 0, Arm = 180, Hand = 180 }
  856. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  857. ,{"ArmA.Stocker2", new StationPosition(){
  858. StartPosition = new RobotPosition() { X=-230, Root = 0, Arm = 180, Hand = 180 }
  859. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  860. ,{"ArmA.Stocker3", new StationPosition(){
  861. StartPosition = new RobotPosition() { X=-230, Root = 0, Arm = 180, Hand = 180 }
  862. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  863. ,{"ArmA.Stocker4", new StationPosition(){
  864. StartPosition = new RobotPosition() { X=-230, Root = 0, Arm = 180, Hand = 180 }
  865. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  866. ,{ "ArmA.Stocker5", new StationPosition() {
  867. StartPosition = new RobotPosition() { X=-325, Root = 0, Arm = 180, Hand = 180 }
  868. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  869. ,{ "ArmA.Stocker6", new StationPosition() {
  870. StartPosition = new RobotPosition() { X=-325, Root = 0, Arm = 180, Hand = 180 }
  871. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  872. ,{ "ArmA.Stocker7", new StationPosition() {
  873. StartPosition = new RobotPosition() { X=-325, Root = 0, Arm = 180, Hand = 180 }
  874. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }} }
  875. ,{"ArmA.Stocker8", new StationPosition(){
  876. StartPosition = new RobotPosition() { X =-325, Root = 0, Arm = 180, Hand = 180 }
  877. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  878. ,{ "ArmA.Stocker9", new StationPosition() {
  879. StartPosition = new RobotPosition() { X=-415, Root = 0, Arm = 180, Hand = 180 }
  880. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  881. ,{ "ArmA.Stocker10", new StationPosition() {
  882. StartPosition = new RobotPosition() { X=-415, Root = 0, Arm = 180, Hand = 180 }
  883. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  884. ,{ "ArmA.Stocker11", new StationPosition() {
  885. StartPosition = new RobotPosition() { X=-415, Root = 0, Arm = 180, Hand = 180 }
  886. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  887. ,{ "ArmA.Stocker12", new StationPosition() {
  888. StartPosition = new RobotPosition() { X=-415, Root = 0, Arm = 180, Hand = 180 }
  889. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  890. ,{"ArmA.Stocker13", new StationPosition() {
  891. StartPosition = new RobotPosition() { X=-500, Root = 0, Arm = 180, Hand = 180 }
  892. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  893. ,{ "ArmA.Stocker14", new StationPosition() {
  894. StartPosition = new RobotPosition() { X=-500, Root = 0, Arm = 180, Hand = 180 }
  895. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  896. ,{ "ArmA.Stocker15", new StationPosition() {
  897. StartPosition = new RobotPosition() { X=-500, Root = 0, Arm = 180, Hand = 180 }
  898. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  899. ,{ "ArmA.Stocker16", new StationPosition() {
  900. StartPosition = new RobotPosition() { X=-500, Root = 0, Arm = 180, Hand = 180 }
  901. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  902. ,{"ArmA.Stocker17", new StationPosition(){
  903. StartPosition = new RobotPosition() { X = -310, Root = 180, Arm = 180, Hand = 180 }
  904. ,EndPosition = new RobotPosition() { Root = 180, Arm = -20, Hand = 0 }}}
  905. ,{"ArmA.Stocker18", new StationPosition(){
  906. StartPosition = new RobotPosition() { X = -310, Root = 180, Arm = 180, Hand = 180 }
  907. ,EndPosition = new RobotPosition() { Root = 180, Arm = 23, Hand = 0 }}}
  908. ,{"ArmA.FIMS1", new StationPosition(){
  909. StartPosition = new RobotPosition() { X = 35, Root = 0, Arm = 180, Hand = 180 }
  910. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  911. ,{"ArmA.FIMS2", new StationPosition(){
  912. StartPosition = new RobotPosition() { X = -95, Root = 0, Arm = 180, Hand = 180 }
  913. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  914. ,{"ArmA.LP1", new StationPosition(){
  915. StartPosition = new RobotPosition() { X = -210, Root = 180, Arm = 180, Hand = 180 }
  916. ,EndPosition = new RobotPosition() { Root = 180, Arm = -20, Hand = 0 }}}
  917. ,{"ArmA.LP2", new StationPosition(){
  918. StartPosition = new RobotPosition() { X = -210, Root = 180, Arm = 180, Hand = 180 }
  919. ,EndPosition = new RobotPosition() { Root = 180, Arm = 23, Hand = 0 }}}
  920. ,{"ArmA.LP3", new StationPosition(){
  921. StartPosition = new RobotPosition() { X = -453, Root = 180, Arm = 180, Hand = 180 }
  922. ,EndPosition = new RobotPosition() { Root = 180, Arm = -20, Hand = 0 }}}
  923. ,{"ArmA.LP4", new StationPosition(){
  924. StartPosition = new RobotPosition() { X = -453, Root = 180, Arm = 180, Hand = 180 }
  925. ,EndPosition = new RobotPosition() { Root = 180, Arm = 23, Hand = 0 }}}
  926. };
  927. }
  928. }
  929. public Dictionary<string, StationPosition> StationPosition2
  930. {
  931. get
  932. {
  933. return new Dictionary<string, StationPosition>()
  934. {
  935. { "ArmA.System", 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. ,{ "Robot", new StationPosition() {
  940. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 180, Hand = 180 }
  941. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}
  942. }
  943. ,{ "ArmA.FIMS1", new StationPosition() {
  944. StartPosition = new RobotPosition() { X=-20, Root = 180, Arm = 180, Hand = 180 }
  945. ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }}
  946. }
  947. ,{ "ArmA.FIMS2", new StationPosition() {
  948. StartPosition = new RobotPosition() { X=-168, Root = 180, Arm = 180, Hand = 180 }
  949. ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }}
  950. }
  951. ,{ "ArmA.PM1", new StationPosition() {
  952. StartPosition = new RobotPosition() { X=20, Root = 0, Arm = 180, Hand = 180 }
  953. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  954. }
  955. };
  956. }
  957. }
  958. public Dictionary<string, StationPosition> StationPosition3
  959. {
  960. get
  961. {
  962. return new Dictionary<string, StationPosition>()
  963. {
  964. { "HomePosition", new StationPosition() {
  965. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 0, Hand = 0 }
  966. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  967. },
  968. { "Position1", new StationPosition() {
  969. StartPosition = new RobotPosition() { X=-50, Root = 0, Arm = 0, Hand = 0 }
  970. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  971. },
  972. { "Position2", new StationPosition() {
  973. StartPosition = new RobotPosition() { X=-100, Root = 0, Arm = 0, Hand = 0 }
  974. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  975. },
  976. { "ProcessPosition", new StationPosition() {
  977. StartPosition = new RobotPosition() { X=-280, Root = 0, Arm = 0, Hand = 0 }
  978. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  979. }
  980. };
  981. }
  982. }
  983. public bool IsSimulateMode { get; set; }
  984. [Subscription("PM1.RunningMode")]
  985. public bool RunningModeIsDebug { get; set; }
  986. protected override void OnInitialize()
  987. {
  988. base.OnInitialize();
  989. //StockerWaferType = new List<string>();
  990. //for (int i = 1; i <= 18; i++)
  991. //{
  992. // var type = (string)QueryDataClient.Instance.Service.GetConfig($"System.Stocker.Stocker{i}WaferType").ToString().Replace("1", "").Replace("2", ""); ;
  993. // StockerWaferType.Add(type.ToString());
  994. //}
  995. #region GetModuleInstalled
  996. foreach (var item in _PMList)
  997. {
  998. var test = this.GetType().GetProperty($"{item}Installed");
  999. var test1 = this.GetType();
  1000. this.GetType().GetProperty($"{item}Installed").SetValue(this, (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.Is{item}Installed"));
  1001. }
  1002. foreach (var item in _LPList)
  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 _FIMSList)
  1007. {
  1008. this.GetType().GetProperty($"{item}Installed").SetValue(this, (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.Is{item}Installed"));
  1009. }
  1010. foreach (var item in _StockerList)
  1011. {
  1012. this.GetType().GetProperty($"{item}Installed").SetValue(this, (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.Is{item}Installed"));
  1013. }
  1014. #endregion
  1015. base.InitFOUP();
  1016. //base.InitLL();
  1017. //base.InitTM();
  1018. //base.InitEFEM();
  1019. base.InitPM();
  1020. base.InitBuffer();
  1021. }
  1022. protected override void OnViewLoaded(object view)
  1023. {
  1024. base.OnViewLoaded(view);
  1025. }
  1026. protected override void OnActivate()
  1027. {
  1028. EnableTimer(true);
  1029. base.OnActivate();
  1030. _boatSlotCount = (int)QueryDataClient.Instance.Service.GetConfig("Boat.SlotCount");
  1031. BoatZMinValue = (int)QueryDataClient.Instance.Service.GetConfig("Boat.ZMinPosition");
  1032. BoatZMaxValue = (int)QueryDataClient.Instance.Service.GetConfig("Boat.ZMaxPosition");
  1033. IsSimulateMode = (bool)QueryDataClient.Instance.Service.GetConfig("System.IsSimulatorMode");
  1034. _cycleNumber = (int)QueryDataClient.Instance.Service.GetConfig("CarrierRobot.TransferModeNumber");
  1035. _cycleSwapNumber = (int)QueryDataClient.Instance.Service.GetConfig("CarrierRobot.RunToRunNumber");
  1036. _waferRobotCycleNumber = (int)QueryDataClient.Instance.Service.GetConfig("WaferRobot.TransferModeNumber");
  1037. CycleCountVisibility = (bool)QueryDataClient.Instance.Service.GetConfig("CarrierRobot.TransferMode") ? Visibility.Visible : Visibility.Hidden;
  1038. WaferRobotCycleCountVisibility = (bool)QueryDataClient.Instance.Service.GetConfig("WaferRobot.TransferMode") ? Visibility.Visible : Visibility.Hidden;
  1039. Stocker1Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker1Installed");
  1040. Stocker2Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker2Installed");
  1041. Stocker3Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker3Installed");
  1042. Stocker4Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker4Installed");
  1043. Stocker5Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker5Installed");
  1044. Stocker6Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker6Installed");
  1045. Stocker7Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker7Installed");
  1046. Stocker8Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker8Installed");
  1047. Stocker9Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker9Installed");
  1048. Stocker10Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker10Installed");
  1049. Stocker11Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker11Installed");
  1050. Stocker12Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker12Installed");
  1051. Stocker13Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker13Installed");
  1052. Stocker14Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker14Installed");
  1053. Stocker15Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker15Installed");
  1054. Stocker16Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker16Installed");
  1055. Stocker17Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker17Installed");
  1056. Stocker18Installed = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker18Installed");
  1057. }
  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","WaferRobot","PM1"};
  1061. //string[] moduleNames = new string[] { "Stocker1", "Stocker2", "Stocker3", "Stocker4", "Stocker5", "Stocker6", "Stocker7", "Stocker8", "Stocker9",
  1062. // "Stocker10","Stocker11","Stocker12","Stocker13","Stocker14","Stocker15","Stocker16","Stocker17","Stocker18",
  1063. // "FIMS1","FIMS2","CarrierRobot","LP1","LP2","LP3","LP4"};
  1064. protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
  1065. {
  1066. base.InvokeAfterUpdateProperty(data);
  1067. //IsShowBoatElevatorRobot = RefreshBoatWafersTask();
  1068. // if (Stocker1CarrierData != null)
  1069. // Stocker1CarrierData = new CarrierInfo(10)
  1070. // { Status = CarrierStatus.Normal, HasWaferIn=true };
  1071. // Stocker1CassetteType = "ED";//(bool)QueryDataClient.Instance.Service.GetConfig("System.SetUp.IsStocker1Installed") && Stocker1CarrierData?.Status.ToString() == "Normal" ? Stocker1CarrierData?.CarrierType.ToString() : "";
  1072. foreach (var item in moduleNames)
  1073. {
  1074. if (ModuleManager.ModuleInfos.ContainsKey(item))
  1075. {
  1076. this.GetType().GetProperty($"{item}WaferCount").SetValue(this, ModuleManager.ModuleInfos[item].WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count());
  1077. }
  1078. }
  1079. if (ModuleManager.ModuleInfos.ContainsKey("WaferRobot"))
  1080. {
  1081. WaferInfo[] waferInfos = ModuleManager.ModuleInfos["WaferRobot"].WaferManager.Wafers.ToArray();
  1082. WaferRobotWafer1 = waferInfos[0];
  1083. WaferRobotWafer2 = waferInfos[1];
  1084. }
  1085. var isLoadPortPosition = (string)QueryDataClient.Instance.Service.GetConfig("LoadPort.LoadPortPosition");
  1086. if (isLoadPortPosition == "Upper")
  1087. {
  1088. IsStockerVisibility = Visibility.Hidden;
  1089. IsLPVisibility = Visibility.Visible;
  1090. LPPortCanvasTop = 5;
  1091. }
  1092. else
  1093. {
  1094. IsStockerVisibility = Visibility.Visible;
  1095. IsLPVisibility = Visibility.Hidden;
  1096. LPPortCanvasTop = 352;
  1097. }
  1098. RefreshBoatWafers();
  1099. }
  1100. private void RefreshBoatWafers()
  1101. {
  1102. var wafers = ModuleManager.ModuleInfos["PM1"].WaferManager.Wafers.Reverse().ToList();
  1103. int NumberP = 0, NumberM1 = 0, NumberM2 = 0, NumberSD = 0, NumberED = 0, NumberT = 0, NumberXD = 0;
  1104. for (int i = 0; i < wafers.Count; i++)
  1105. {
  1106. if (ModuleManager.ModuleInfos["PM1"].WaferManager.Wafers.Count > i)
  1107. {
  1108. var wafer = wafers[i];
  1109. if (wafer.WaferStatus != 0)//empty
  1110. {
  1111. switch (wafer.WaferType.ToString())
  1112. {
  1113. case "P":
  1114. NumberP++;
  1115. break;
  1116. case "M1":
  1117. NumberM1++;
  1118. break;
  1119. case "M2":
  1120. NumberM2++;
  1121. break;
  1122. case "SD":
  1123. NumberSD++;
  1124. break;
  1125. case "ED":
  1126. NumberED++;
  1127. break;
  1128. }
  1129. }
  1130. }
  1131. }
  1132. BoatPWaferCount = NumberP;
  1133. BoatM1WaferCount = NumberM1;
  1134. BoatM2WaferCount = NumberM2;
  1135. BoatSDWaferCount = NumberSD;
  1136. BoatEDWaferCount = NumberED;
  1137. BoatEmptyWaferCount = _boatSlotCount - BoatPWaferCount - BoatM1WaferCount - BoatM2WaferCount - BoatSDWaferCount - BoatEDWaferCount;
  1138. BoatAllWaferCount = $"{BoatPWaferCount + BoatM1WaferCount + BoatM2WaferCount + BoatSDWaferCount + BoatEDWaferCount}/{_boatSlotCount}";
  1139. }
  1140. private bool RefreshBoatWafersTask()
  1141. {
  1142. var wafers = ModuleManager.ModuleInfos["PM1"].WaferManager.Wafers.Reverse().ToList();
  1143. for (int i = 0; i < (int)QueryDataClient.Instance.Service.GetConfig("Boat.SlotCount"); i++)
  1144. {
  1145. if (ModuleManager.ModuleInfos["PM1"].WaferManager.Wafers.Count > i)
  1146. {
  1147. var wafer = wafers[i];
  1148. if (wafer.WaferStatus != 0)//empty
  1149. {
  1150. return true;
  1151. }
  1152. }
  1153. }
  1154. return false;
  1155. }
  1156. public void SwitchPage(string page)
  1157. {
  1158. }
  1159. public void Abort()
  1160. {
  1161. InvokeClient.Instance.Service.DoOperation("System.Abort");
  1162. }
  1163. public void CreateCassette(string module)
  1164. {
  1165. InvokeClient.Instance.Service.DoOperation("CreateCarrier", module, 0);
  1166. }
  1167. public void DeleteCassette(string module)
  1168. {
  1169. InvokeClient.Instance.Service.DoOperation("DeleteCarrier", module, 0);
  1170. }
  1171. public void Home(string module)
  1172. {
  1173. InvokeClient.Instance.Service.DoOperation($"{module}.Home");
  1174. }
  1175. public void HomeAll()
  1176. {
  1177. InvokeClient.Instance.Service.DoOperation("System.HomeAll");
  1178. }
  1179. public void CassetteIn()
  1180. {
  1181. InvokeClient.Instance.Service.DoOperation($"{ModuleName.CassetteRobot}.In");
  1182. }
  1183. public void CassetteOut()
  1184. {
  1185. InvokeClient.Instance.Service.DoOperation($"{ModuleName.CassetteRobot}.Out");
  1186. }
  1187. public void ShowSensors()
  1188. {
  1189. //WindowManager wm = new WindowManager();
  1190. //SensorsViewModel svm = new SensorsViewModel();
  1191. //wm.ShowDialogWithTitle(svm, null, "Sensor Information");
  1192. }
  1193. public void BoatWafers()
  1194. {
  1195. //WindowManager wm = new WindowManager();
  1196. //BoatWaferViewModel svm = new BoatWaferViewModel();
  1197. //wm.ShowDialogWithTitle(svm, null, "Boat Wafer");
  1198. }
  1199. public void WaferRobotWafers()
  1200. {
  1201. //WindowManager wm = new WindowManager();
  1202. //WaferRobotWaferViewModel svm = new WaferRobotWaferViewModel();
  1203. //wm.ShowDialogWithTitle(svm, null, "Wafer Robot Wafer");
  1204. }
  1205. public void StageWafers()
  1206. {
  1207. //WindowManager wm = new WindowManager();
  1208. //StageCassetteViewModel svm = new StageCassetteViewModel();
  1209. //wm.ShowDialogWithTitle(svm, null, "Stage Wafer");
  1210. }
  1211. public void CassetteRobotWafers()
  1212. {
  1213. //WindowManager wm = new WindowManager();
  1214. //CassetteRobotWaferViewModel svm = new CassetteRobotWaferViewModel();
  1215. //wm.ShowDialogWithTitle(svm, null, "Cassette Robot Wafer");
  1216. }
  1217. protected override void Poll()
  1218. {
  1219. if (GetView() != null)
  1220. {
  1221. //Application.Current.Dispatcher.Invoke(() =>
  1222. //{
  1223. // ((SelfCheckView)GetView()).ATMArmRobotTwo.Wafer1 = WaferRobotWafer1;
  1224. //}
  1225. //);
  1226. }
  1227. base.Poll();
  1228. }
  1229. public void DeleteWafer()
  1230. {
  1231. InvokeClient.Instance.Service.DoOperation("System.DeleteAllWafer");
  1232. }
  1233. public void DeleteCarrier()
  1234. {
  1235. InvokeClient.Instance.Service.DoOperation("System.DeleteAllCarrier");
  1236. }
  1237. public void Reset()
  1238. {
  1239. InvokeClient.Instance.Service.DoOperation("System.Reset");
  1240. }
  1241. public void ManualOperation(string deviceName)
  1242. {
  1243. var windowManager = IoC.Get<IWindowManager>();
  1244. switch (deviceName)
  1245. {
  1246. case "LP1":
  1247. {
  1248. LPSensorViewModel lpViewModel = new LPSensorViewModel();
  1249. lpViewModel.LP1BorderVisibility = true;
  1250. lpViewModel.LP2BorderVisibility = false;
  1251. lpViewModel.LP3BorderVisibility = false;
  1252. lpViewModel.LP4BorderVisibility = false;
  1253. lpViewModel.TabSelectIndex = 0;
  1254. (windowManager as WindowManager)?.ShowDialogWithTitle(lpViewModel,this, null, "LP1 Manual");
  1255. }
  1256. break;
  1257. case "LP2":
  1258. {
  1259. LPSensorViewModel lpViewModel = new LPSensorViewModel();
  1260. lpViewModel.LP1BorderVisibility = false;
  1261. lpViewModel.LP2BorderVisibility = true;
  1262. lpViewModel.LP3BorderVisibility = false;
  1263. lpViewModel.LP4BorderVisibility = false;
  1264. lpViewModel.TabSelectIndex =1;
  1265. (windowManager as WindowManager)?.ShowDialogWithTitle(lpViewModel,this, null, "LP2 Manual");
  1266. }
  1267. break;
  1268. case "LP3":
  1269. {
  1270. LPSensorViewModel lpViewModel = new LPSensorViewModel();
  1271. lpViewModel.LP1BorderVisibility = false;
  1272. lpViewModel.LP2BorderVisibility = false;
  1273. lpViewModel.LP3BorderVisibility = true;
  1274. lpViewModel.LP4BorderVisibility = false;
  1275. lpViewModel.TabSelectIndex = 2;
  1276. (windowManager as WindowManager)?.ShowDialogWithTitle(lpViewModel,this, null, "LP3 Manual");
  1277. }
  1278. break;
  1279. case "LP4":
  1280. {
  1281. LPSensorViewModel lpViewModel = new LPSensorViewModel();
  1282. lpViewModel.LP1BorderVisibility = false;
  1283. lpViewModel.LP2BorderVisibility = false;
  1284. lpViewModel.LP3BorderVisibility = false;
  1285. lpViewModel.LP4BorderVisibility = true;
  1286. lpViewModel.TabSelectIndex = 3;
  1287. (windowManager as WindowManager)?.ShowDialogWithTitle(lpViewModel,this, null, "LP4 Manual");
  1288. }
  1289. break;
  1290. case "FIMS1":
  1291. case "FIMS2":
  1292. {
  1293. FIMSSensorViewModel fimsSensorViewModel = new FIMSSensorViewModel();
  1294. (windowManager as WindowManager)?.ShowDialogWithTitle(fimsSensorViewModel,this, null, "FIMS Manual");
  1295. }
  1296. break;
  1297. default:
  1298. break;
  1299. }
  1300. }
  1301. public void PopupPage(string page)
  1302. {
  1303. var windowManager = IoC.Get<IWindowManager>();
  1304. switch (page)
  1305. {
  1306. case "SMIFA":
  1307. {
  1308. SMIFViewModel smifViewModel = new SMIFViewModel();
  1309. (windowManager as WindowManager)?.ShowDialogWithTitle(smifViewModel,this, null, "SMIF Status");
  1310. }
  1311. break;
  1312. case "SMIFB":
  1313. {
  1314. SMIFViewModel smifViewModel = new SMIFViewModel();
  1315. (windowManager as WindowManager)?.ShowDialogWithTitle(smifViewModel,this, null, "SMIF Status");
  1316. }
  1317. break;
  1318. case "CassetteRobot":
  1319. CassetteRobotViewModel cassetteRobotViewModel = new CassetteRobotViewModel();
  1320. cassetteRobotViewModel.SystemName = "SMIFA";
  1321. (windowManager as WindowManager)?.ShowDialogWithTitle(cassetteRobotViewModel,this, null, "CassetteRobot Status");
  1322. break;
  1323. case "WaferRobot":
  1324. WaferRobotViewModel waferRobotViewModel = new WaferRobotViewModel();
  1325. (windowManager as WindowManager)?.ShowDialogWithTitle(waferRobotViewModel,this, null, "WaferRobot Status");
  1326. break;
  1327. case "Stage":
  1328. StageSensorViewModel stageSensorViewModel = new StageSensorViewModel();
  1329. (windowManager as WindowManager)?.ShowDialogWithTitle(stageSensorViewModel,this, null, "Stage Status");
  1330. break;
  1331. case "Stocker":
  1332. StockerSensorViewModel stockerSensorViewModel = new StockerSensorViewModel();
  1333. (windowManager as WindowManager)?.ShowDialogWithTitle(stockerSensorViewModel,this, null, "Stocker Status");
  1334. break;
  1335. case "Boat":
  1336. BoatSensorViewModel boatSensorViewModel = new BoatSensorViewModel();
  1337. (windowManager as WindowManager)?.ShowDialogWithTitle(boatSensorViewModel,this, null, "Boat Status");
  1338. break;
  1339. default:
  1340. break;
  1341. }
  1342. }
  1343. public void CanvasMouseLeftButtonDown(object sender)
  1344. {
  1345. //var windowManager = IoC.Get<IWindowManager>();
  1346. //Point pp = Mouse.GetPosition((IInputElement)sender);
  1347. //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))
  1348. //{
  1349. // StockerSensorViewModel stockerSensorViewModel = new StockerSensorViewModel();
  1350. // (windowManager as WindowManager)?.ShowDialogWithTitle(stockerSensorViewModel, null, "Stocker Status");
  1351. //}
  1352. //else if (pp.X > 350 && pp.X < 500 && pp.Y > 410 && pp.Y < 625)
  1353. //{
  1354. // StageSensorViewModel stageSensorViewModel = new StageSensorViewModel();
  1355. // (windowManager as WindowManager)?.ShowDialogWithTitle(stageSensorViewModel, null, "Stage Status");
  1356. //}
  1357. //else if (pp.X > 590 && pp.X < 755 && pp.Y > 100 && pp.Y < 620)
  1358. //{
  1359. // BoatSensorViewModel boatSensorViewModel = new BoatSensorViewModel();
  1360. // (windowManager as WindowManager)?.ShowDialogWithTitle(boatSensorViewModel, null, "Boat Status");
  1361. //}
  1362. }
  1363. public void BoatModify()
  1364. {
  1365. var windowManager = IoC.Get<IWindowManager>();
  1366. BoatModifyViewModel boatModifyViewModel = new BoatModifyViewModel(ModuleName.PM1.ToString());
  1367. (windowManager as WindowManager)?.ShowDialogWithTitle(boatModifyViewModel,this, null, "Boat Wafer");
  1368. }
  1369. public void PopupModule(string module)
  1370. {
  1371. var windowManager = IoC.Get<IWindowManager>();
  1372. switch (module)
  1373. {
  1374. case "Init":
  1375. SelfCheckInitViewModel shelfCheckInitViewModel = new SelfCheckInitViewModel();
  1376. (windowManager as WindowManager)?.ShowDialogWithTitle(shelfCheckInitViewModel,this, null, "Init");
  1377. break;
  1378. case "ManualOperation":
  1379. SelfCheckManualOperationViewModel shelfCheckManualOperationViewModel = new SelfCheckManualOperationViewModel();
  1380. (windowManager as WindowManager)?.ShowDialogWithTitle(shelfCheckManualOperationViewModel,this, null, "Manual Operation");
  1381. break;
  1382. case "Modify":
  1383. SelfCheckModifyViewModel shelfCheckModifyViewModel = new SelfCheckModifyViewModel();
  1384. (windowManager as WindowManager)?.ShowDialogWithTitle(shelfCheckModifyViewModel,this, null, "Modify");
  1385. break;
  1386. //case "SensorStatus":
  1387. // SensorsViewModel sensorsViewModel = new SensorsViewModel();
  1388. // (windowManager as WindowManager)?.ShowDialogWithTitle(sensorsViewModel, null, "Sensor Status");
  1389. // break;
  1390. }
  1391. }
  1392. public void RobotCommand()
  1393. {
  1394. var windowManager = IoC.Get<IWindowManager>();
  1395. RobotCommandViewModel robotCommandViewModel = new RobotCommandViewModel();
  1396. (windowManager as WindowManager)?.ShowDialogWithTitle(robotCommandViewModel,this, null, "Modify");
  1397. }
  1398. public void CloseCmd()
  1399. {
  1400. ClientApp.Instance.SwitchPage("status", "main", null);
  1401. }
  1402. public void ReturnWafer()
  1403. {
  1404. InvokeClient.Instance.Service.DoOperation("System.ReturnAllWafer");
  1405. }
  1406. }
  1407. }