SelfCheckViewModel.cs 63 KB

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