SelfCheckViewModel.cs 64 KB

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