SelfCheckViewModel.cs 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559
  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. if (waferInfos.Count() > 0)
  1083. {
  1084. WaferRobotWafer1 = waferInfos[0];
  1085. }
  1086. if (waferInfos.Count() > 1)
  1087. {
  1088. WaferRobotWafer2 = waferInfos[1];
  1089. }
  1090. }
  1091. var isLoadPortPosition = (string)QueryDataClient.Instance.Service.GetConfig("LoadPort.LoadPortPosition");
  1092. if (isLoadPortPosition == "Upper")
  1093. {
  1094. IsStockerVisibility = Visibility.Hidden;
  1095. IsLPVisibility = Visibility.Visible;
  1096. LPPortCanvasTop = 5;
  1097. }
  1098. else
  1099. {
  1100. IsStockerVisibility = Visibility.Visible;
  1101. IsLPVisibility = Visibility.Hidden;
  1102. LPPortCanvasTop = 352;
  1103. }
  1104. RefreshBoatWafers();
  1105. }
  1106. private void RefreshBoatWafers()
  1107. {
  1108. var wafers = ModuleManager.ModuleInfos["PM1"].WaferManager.Wafers.Reverse().ToList();
  1109. int NumberP = 0, NumberM1 = 0, NumberM2 = 0, NumberSD = 0, NumberED = 0, NumberT = 0, NumberXD = 0;
  1110. for (int i = 0; i < wafers.Count; i++)
  1111. {
  1112. if (ModuleManager.ModuleInfos["PM1"].WaferManager.Wafers.Count > i)
  1113. {
  1114. var wafer = wafers[i];
  1115. if (wafer.WaferStatus != 0)//empty
  1116. {
  1117. switch (wafer.WaferType.ToString())
  1118. {
  1119. case "P":
  1120. NumberP++;
  1121. break;
  1122. case "M1":
  1123. NumberM1++;
  1124. break;
  1125. case "M2":
  1126. NumberM2++;
  1127. break;
  1128. case "SD":
  1129. NumberSD++;
  1130. break;
  1131. case "ED":
  1132. NumberED++;
  1133. break;
  1134. }
  1135. }
  1136. }
  1137. }
  1138. BoatPWaferCount = NumberP;
  1139. BoatM1WaferCount = NumberM1;
  1140. BoatM2WaferCount = NumberM2;
  1141. BoatSDWaferCount = NumberSD;
  1142. BoatEDWaferCount = NumberED;
  1143. BoatEmptyWaferCount = _boatSlotCount - BoatPWaferCount - BoatM1WaferCount - BoatM2WaferCount - BoatSDWaferCount - BoatEDWaferCount;
  1144. BoatAllWaferCount = $"{BoatPWaferCount + BoatM1WaferCount + BoatM2WaferCount + BoatSDWaferCount + BoatEDWaferCount}/{_boatSlotCount}";
  1145. }
  1146. private bool RefreshBoatWafersTask()
  1147. {
  1148. var wafers = ModuleManager.ModuleInfos["PM1"].WaferManager.Wafers.Reverse().ToList();
  1149. for (int i = 0; i < (int)QueryDataClient.Instance.Service.GetConfig("Boat.SlotCount"); i++)
  1150. {
  1151. if (ModuleManager.ModuleInfos["PM1"].WaferManager.Wafers.Count > i)
  1152. {
  1153. var wafer = wafers[i];
  1154. if (wafer.WaferStatus != 0)//empty
  1155. {
  1156. return true;
  1157. }
  1158. }
  1159. }
  1160. return false;
  1161. }
  1162. public void SwitchPage(string page)
  1163. {
  1164. }
  1165. public void Abort()
  1166. {
  1167. InvokeClient.Instance.Service.DoOperation("System.Abort");
  1168. }
  1169. public void CreateCassette(string module)
  1170. {
  1171. InvokeClient.Instance.Service.DoOperation("CreateCarrier", module, 0);
  1172. }
  1173. public void DeleteCassette(string module)
  1174. {
  1175. InvokeClient.Instance.Service.DoOperation("DeleteCarrier", module, 0);
  1176. }
  1177. public void Home(string module)
  1178. {
  1179. InvokeClient.Instance.Service.DoOperation($"{module}.Home");
  1180. }
  1181. public void HomeAll()
  1182. {
  1183. InvokeClient.Instance.Service.DoOperation("System.HomeAll");
  1184. }
  1185. public void CassetteIn()
  1186. {
  1187. InvokeClient.Instance.Service.DoOperation($"{ModuleName.CassetteRobot}.In");
  1188. }
  1189. public void CassetteOut()
  1190. {
  1191. InvokeClient.Instance.Service.DoOperation($"{ModuleName.CassetteRobot}.Out");
  1192. }
  1193. public void ShowSensors()
  1194. {
  1195. //WindowManager wm = new WindowManager();
  1196. //SensorsViewModel svm = new SensorsViewModel();
  1197. //wm.ShowDialogWithTitle(svm, null, "Sensor Information");
  1198. }
  1199. public void BoatWafers()
  1200. {
  1201. //WindowManager wm = new WindowManager();
  1202. //BoatWaferViewModel svm = new BoatWaferViewModel();
  1203. //wm.ShowDialogWithTitle(svm, null, "Boat Wafer");
  1204. }
  1205. public void WaferRobotWafers()
  1206. {
  1207. //WindowManager wm = new WindowManager();
  1208. //WaferRobotWaferViewModel svm = new WaferRobotWaferViewModel();
  1209. //wm.ShowDialogWithTitle(svm, null, "Wafer Robot Wafer");
  1210. }
  1211. public void StageWafers()
  1212. {
  1213. //WindowManager wm = new WindowManager();
  1214. //StageCassetteViewModel svm = new StageCassetteViewModel();
  1215. //wm.ShowDialogWithTitle(svm, null, "Stage Wafer");
  1216. }
  1217. public void CassetteRobotWafers()
  1218. {
  1219. //WindowManager wm = new WindowManager();
  1220. //CassetteRobotWaferViewModel svm = new CassetteRobotWaferViewModel();
  1221. //wm.ShowDialogWithTitle(svm, null, "Cassette Robot Wafer");
  1222. }
  1223. protected override void Poll()
  1224. {
  1225. if (GetView() != null)
  1226. {
  1227. //Application.Current.Dispatcher.Invoke(() =>
  1228. //{
  1229. // ((SelfCheckView)GetView()).ATMArmRobotTwo.Wafer1 = WaferRobotWafer1;
  1230. //}
  1231. //);
  1232. }
  1233. base.Poll();
  1234. }
  1235. public void DeleteWafer()
  1236. {
  1237. InvokeClient.Instance.Service.DoOperation("System.DeleteAllWafer");
  1238. }
  1239. public void DeleteCarrier()
  1240. {
  1241. InvokeClient.Instance.Service.DoOperation("System.DeleteAllCarrier");
  1242. }
  1243. public void Reset()
  1244. {
  1245. InvokeClient.Instance.Service.DoOperation("System.Reset");
  1246. }
  1247. public void ManualOperation(string deviceName)
  1248. {
  1249. var windowManager = IoC.Get<IWindowManager>();
  1250. switch (deviceName)
  1251. {
  1252. case "LP1":
  1253. {
  1254. LPSensorViewModel lpViewModel = new LPSensorViewModel();
  1255. lpViewModel.LP1BorderVisibility = true;
  1256. lpViewModel.LP2BorderVisibility = false;
  1257. lpViewModel.LP3BorderVisibility = false;
  1258. lpViewModel.LP4BorderVisibility = false;
  1259. lpViewModel.TabSelectIndex = 0;
  1260. (windowManager as WindowManager)?.ShowDialogWithTitle(lpViewModel, this, null, "LP1 Manual");
  1261. }
  1262. break;
  1263. case "LP2":
  1264. {
  1265. LPSensorViewModel lpViewModel = new LPSensorViewModel();
  1266. lpViewModel.LP1BorderVisibility = false;
  1267. lpViewModel.LP2BorderVisibility = true;
  1268. lpViewModel.LP3BorderVisibility = false;
  1269. lpViewModel.LP4BorderVisibility = false;
  1270. lpViewModel.TabSelectIndex = 1;
  1271. (windowManager as WindowManager)?.ShowDialogWithTitle(lpViewModel, this, null, "LP2 Manual");
  1272. }
  1273. break;
  1274. case "LP3":
  1275. {
  1276. LPSensorViewModel lpViewModel = new LPSensorViewModel();
  1277. lpViewModel.LP1BorderVisibility = false;
  1278. lpViewModel.LP2BorderVisibility = false;
  1279. lpViewModel.LP3BorderVisibility = true;
  1280. lpViewModel.LP4BorderVisibility = false;
  1281. lpViewModel.TabSelectIndex = 2;
  1282. (windowManager as WindowManager)?.ShowDialogWithTitle(lpViewModel, this, null, "LP3 Manual");
  1283. }
  1284. break;
  1285. case "LP4":
  1286. {
  1287. LPSensorViewModel lpViewModel = new LPSensorViewModel();
  1288. lpViewModel.LP1BorderVisibility = false;
  1289. lpViewModel.LP2BorderVisibility = false;
  1290. lpViewModel.LP3BorderVisibility = false;
  1291. lpViewModel.LP4BorderVisibility = true;
  1292. lpViewModel.TabSelectIndex = 3;
  1293. (windowManager as WindowManager)?.ShowDialogWithTitle(lpViewModel, this, null, "LP4 Manual");
  1294. }
  1295. break;
  1296. case "FIMS1":
  1297. case "FIMS2":
  1298. {
  1299. FIMSSensorViewModel fimsSensorViewModel = new FIMSSensorViewModel();
  1300. (windowManager as WindowManager)?.ShowDialogWithTitle(fimsSensorViewModel, this, null, "FIMS Manual");
  1301. }
  1302. break;
  1303. default:
  1304. break;
  1305. }
  1306. }
  1307. public void PopupPage(string page)
  1308. {
  1309. var windowManager = IoC.Get<IWindowManager>();
  1310. switch (page)
  1311. {
  1312. case "SMIFA":
  1313. {
  1314. SMIFViewModel smifViewModel = new SMIFViewModel();
  1315. (windowManager as WindowManager)?.ShowDialogWithTitle(smifViewModel, this, null, "SMIF Status");
  1316. }
  1317. break;
  1318. case "SMIFB":
  1319. {
  1320. SMIFViewModel smifViewModel = new SMIFViewModel();
  1321. (windowManager as WindowManager)?.ShowDialogWithTitle(smifViewModel, this, null, "SMIF Status");
  1322. }
  1323. break;
  1324. case "CassetteRobot":
  1325. CassetteRobotViewModel cassetteRobotViewModel = new CassetteRobotViewModel();
  1326. cassetteRobotViewModel.SystemName = "SMIFA";
  1327. (windowManager as WindowManager)?.ShowDialogWithTitle(cassetteRobotViewModel, this, null, "CassetteRobot Status");
  1328. break;
  1329. case "WaferRobot":
  1330. WaferRobotViewModel waferRobotViewModel = new WaferRobotViewModel();
  1331. (windowManager as WindowManager)?.ShowDialogWithTitle(waferRobotViewModel, this, null, "WaferRobot Status");
  1332. break;
  1333. case "Stage":
  1334. StageSensorViewModel stageSensorViewModel = new StageSensorViewModel();
  1335. (windowManager as WindowManager)?.ShowDialogWithTitle(stageSensorViewModel, this, null, "Stage Status");
  1336. break;
  1337. case "Stocker":
  1338. StockerSensorViewModel stockerSensorViewModel = new StockerSensorViewModel();
  1339. (windowManager as WindowManager)?.ShowDialogWithTitle(stockerSensorViewModel, this, null, "Stocker Status");
  1340. break;
  1341. case "Boat":
  1342. BoatSensorViewModel boatSensorViewModel = new BoatSensorViewModel();
  1343. (windowManager as WindowManager)?.ShowDialogWithTitle(boatSensorViewModel, this, null, "Boat Status");
  1344. break;
  1345. default:
  1346. break;
  1347. }
  1348. }
  1349. public void CanvasMouseLeftButtonDown(object sender)
  1350. {
  1351. //var windowManager = IoC.Get<IWindowManager>();
  1352. //Point pp = Mouse.GetPosition((IInputElement)sender);
  1353. //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))
  1354. //{
  1355. // StockerSensorViewModel stockerSensorViewModel = new StockerSensorViewModel();
  1356. // (windowManager as WindowManager)?.ShowDialogWithTitle(stockerSensorViewModel, null, "Stocker Status");
  1357. //}
  1358. //else if (pp.X > 350 && pp.X < 500 && pp.Y > 410 && pp.Y < 625)
  1359. //{
  1360. // StageSensorViewModel stageSensorViewModel = new StageSensorViewModel();
  1361. // (windowManager as WindowManager)?.ShowDialogWithTitle(stageSensorViewModel, null, "Stage Status");
  1362. //}
  1363. //else if (pp.X > 590 && pp.X < 755 && pp.Y > 100 && pp.Y < 620)
  1364. //{
  1365. // BoatSensorViewModel boatSensorViewModel = new BoatSensorViewModel();
  1366. // (windowManager as WindowManager)?.ShowDialogWithTitle(boatSensorViewModel, null, "Boat Status");
  1367. //}
  1368. }
  1369. public void BoatModify()
  1370. {
  1371. var windowManager = IoC.Get<IWindowManager>();
  1372. BoatModifyViewModel boatModifyViewModel = new BoatModifyViewModel(ModuleName.PM1.ToString());
  1373. (windowManager as WindowManager)?.ShowDialogWithTitle(boatModifyViewModel, this, null, "Boat Wafer");
  1374. }
  1375. public void PopupModule(string module)
  1376. {
  1377. var windowManager = IoC.Get<IWindowManager>();
  1378. switch (module)
  1379. {
  1380. case "Init":
  1381. SelfCheckInitViewModel shelfCheckInitViewModel = new SelfCheckInitViewModel();
  1382. (windowManager as WindowManager)?.ShowDialogWithTitle(shelfCheckInitViewModel, this, null, "Init");
  1383. break;
  1384. case "ManualOperation":
  1385. SelfCheckManualOperationViewModel shelfCheckManualOperationViewModel = new SelfCheckManualOperationViewModel();
  1386. (windowManager as WindowManager)?.ShowDialogWithTitle(shelfCheckManualOperationViewModel, this, null, "Manual Operation");
  1387. break;
  1388. case "Modify":
  1389. SelfCheckModifyViewModel shelfCheckModifyViewModel = new SelfCheckModifyViewModel();
  1390. (windowManager as WindowManager)?.ShowDialogWithTitle(shelfCheckModifyViewModel, this, null, "Modify");
  1391. break;
  1392. //case "SensorStatus":
  1393. // SensorsViewModel sensorsViewModel = new SensorsViewModel();
  1394. // (windowManager as WindowManager)?.ShowDialogWithTitle(sensorsViewModel, null, "Sensor Status");
  1395. // break;
  1396. }
  1397. }
  1398. public void RobotCommand()
  1399. {
  1400. var windowManager = IoC.Get<IWindowManager>();
  1401. RobotCommandViewModel robotCommandViewModel = new RobotCommandViewModel();
  1402. (windowManager as WindowManager)?.ShowDialogWithTitle(robotCommandViewModel, this, null, "Modify");
  1403. }
  1404. public void CloseCmd()
  1405. {
  1406. ClientApp.Instance.SwitchPage("status", "main", null);
  1407. }
  1408. public void ReturnWafer()
  1409. {
  1410. InvokeClient.Instance.Service.DoOperation("System.ReturnAllWafer");
  1411. }
  1412. }
  1413. }