MainframeViewModel.cs 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064
  1. using System.Collections.Generic;
  2. using System.Windows;
  3. using Aitex.Core.Common.DeviceData;
  4. using Aitex.Core.RT.Event;
  5. using Aitex.Core.Util;
  6. using Aitex.Sorter.Common;
  7. using MECF.Framework.Common.CommonData;
  8. using MECF.Framework.Common.DataCenter;
  9. using MECF.Framework.Common.OperationCenter;
  10. namespace EfemDualUI.Views.Platforms.Mainframes
  11. {
  12. public class MainframeViewModel : LocalUIViewModelBase
  13. {
  14. #region Properties
  15. public List<string> InstallPMs { get; set; }
  16. private int _PickSelectPM = 0;
  17. public int PickSelectPM
  18. {
  19. get { return _PickSelectPM; }
  20. set { _PickSelectPM = value; NotifyOfPropertyChange("PickSelectPM"); }
  21. }
  22. private int _PlaceSelectPM = 0;
  23. public int PlaceSelectPM
  24. {
  25. get { return _PlaceSelectPM; }
  26. set { _PlaceSelectPM = value; NotifyOfPropertyChange("PlaceSelectPM"); }
  27. }
  28. public FoupDoorState LLAATMDoorState
  29. {
  30. get
  31. {
  32. if (LLAIsDoorOpened && !LLAIsDoorClosed) return FoupDoorState.Open;
  33. if (!LLAIsDoorOpened && LLAIsDoorClosed) return FoupDoorState.Close;
  34. return FoupDoorState.Unknown;
  35. }
  36. }
  37. public FoupDoorState LLASlitValveState
  38. {
  39. get
  40. {
  41. if (LLASlitValveOpenFeedback && !LLASlitValveCloseFeedback) return FoupDoorState.Open;
  42. if (!LLASlitValveOpenFeedback && LLASlitValveCloseFeedback) return FoupDoorState.Close;
  43. return FoupDoorState.Unknown;
  44. }
  45. }
  46. public FoupDoorState LLBATMDoorState
  47. {
  48. get
  49. {
  50. if (LLBIsDoorOpened && !LLBIsDoorClosed) return FoupDoorState.Open;
  51. if (!LLBIsDoorOpened && LLBIsDoorClosed) return FoupDoorState.Close;
  52. return FoupDoorState.Unknown;
  53. }
  54. }
  55. public FoupDoorState LLBSlitValveState
  56. {
  57. get
  58. {
  59. if (LLBSlitValveOpenFeedback && !LLBSlitValveCloseFeedback) return FoupDoorState.Open;
  60. if (!LLBSlitValveOpenFeedback && LLBSlitValveCloseFeedback) return FoupDoorState.Close;
  61. return FoupDoorState.Unknown;
  62. }
  63. }
  64. public FoupDoorState PMASlitValveState
  65. {
  66. get
  67. {
  68. if (PMASlitValveOpenFeedback && !PMASlitValveCloseFeedback) return FoupDoorState.Open;
  69. if (!PMASlitValveOpenFeedback && PMASlitValveCloseFeedback) return FoupDoorState.Close;
  70. return FoupDoorState.Unknown;
  71. }
  72. }
  73. public FoupDoorState PMBSlitValveState
  74. {
  75. get
  76. {
  77. if (PMBSlitValveOpenFeedback && !PMBSlitValveCloseFeedback) return FoupDoorState.Open;
  78. if (!PMBSlitValveOpenFeedback && PMBSlitValveCloseFeedback) return FoupDoorState.Close;
  79. return FoupDoorState.Unknown;
  80. }
  81. }
  82. public FoupDoorState PMCSlitValveState
  83. {
  84. get
  85. {
  86. if (PMCSlitValveOpenFeedback && !PMCSlitValveCloseFeedback) return FoupDoorState.Open;
  87. if (!PMCSlitValveOpenFeedback && PMCSlitValveCloseFeedback) return FoupDoorState.Close;
  88. return FoupDoorState.Unknown;
  89. }
  90. }
  91. [Subscription("IsAutoMode")]
  92. public bool IsAutoMode { get; set; }
  93. [Subscription("System.HeaterBuffer.DeviceData")]
  94. public AITHeaterData HeaterBuffer { get; set; }
  95. public bool PMASlitValveOpenFeedback1 { get { return PMASlitDoor1.OpenFeedback; } }
  96. [Subscription("PMA.SlitDoor1.DeviceData")]
  97. public AITCylinderData PMASlitDoor1
  98. {
  99. get;
  100. set;
  101. }
  102. public bool PMASlitValveOpenFeedback2 { get { return PMASlitDoor2.OpenFeedback; } }
  103. [Subscription("PMA.SlitDoor2.DeviceData")]
  104. public AITCylinderData PMASlitDoor2
  105. {
  106. get;
  107. set;
  108. }
  109. public bool PMBSlitValveOpenFeedback1 { get { return PMBSlitDoor1.OpenFeedback; } }
  110. [Subscription("PMB.SlitDoor1.DeviceData")]
  111. public AITCylinderData PMBSlitDoor1
  112. {
  113. get;
  114. set;
  115. }
  116. public bool PMBSlitValveOpenFeedback2 { get { return PMBSlitDoor2.OpenFeedback; } }
  117. [Subscription("PMB.SlitDoor2.DeviceData")]
  118. public AITCylinderData PMBSlitDoor2
  119. {
  120. get;
  121. set;
  122. }
  123. [Subscription("TMRobot.IsInterlockValid")]
  124. public bool IsInterlockValid
  125. {
  126. get;
  127. set;
  128. }
  129. [Subscription("TMRobot.CmdBladeTarget")]
  130. public string TMRobotBladeTarget
  131. {
  132. get;
  133. set;
  134. }
  135. [Subscription("TMRobot.CmdBlade1Extend")]
  136. public string TMArmAExtended
  137. {
  138. get;
  139. set;
  140. }
  141. [Subscription("TMRobot.CmdBlade2Extend")]
  142. public string TMArmBExtended
  143. {
  144. get;
  145. set;
  146. }
  147. [Subscription("TMRobot.RobotMoveInfo")]
  148. public RobotMoveInfo TmRobotMoveInfo
  149. {
  150. get;
  151. set;
  152. }
  153. [Subscription("TMRobot.ModuleWaferList")]
  154. public Aitex.Core.Common.WaferInfo[] TMRobotWafers { get; set; }
  155. [Subscription("LLA.Status")]
  156. public string LLAStatus { get; set; }
  157. public bool IsLLANotInit => LLAStatus == "Init";
  158. [Subscription("LLA.IsOnline")]
  159. public bool LLAIsOnline { get; set; }
  160. public string LLAOnlineMode => LLAIsOnline ? "Online" : "Offline";
  161. public bool IsLLAEnableManualOperation => LLAStatus == "Idle";
  162. public bool IsLLAOnlineButtonEnable => !LLAIsOnline;
  163. public bool IsLLAOfflineButtonEnable => LLAIsOnline;
  164. [Subscription("LLA.ChamberPressure")]
  165. public double LLAChamberPressure { get; set; }
  166. [Subscription("LLA.IsAtm")]
  167. public bool LLAIsAtmFeedback { get; set; }
  168. [Subscription("LLA.IsVacuum")]
  169. public bool LLAIsVacuumFeedback { get; set; }
  170. [Subscription("System.LLA.SlitDoor.OpenFeedback")]
  171. public bool LLAIsDoorOpened { get; set; }
  172. [Subscription("System.LLA.SlitDoor.CloseFeedback")]
  173. public bool LLAIsDoorClosed { get; set; }
  174. [Subscription("System.LLA.ChamberPressure.DeviceData")]
  175. public AITPressureMeterData LLAPressureMeterData { get; set; }
  176. [Subscription("System.LL.ForelinePressure.DeviceData")]
  177. public AITPressureMeterData LLForelinePressureMeterData { get; set; }
  178. [Subscription("System.LLA.FastVentValve.DeviceData")]
  179. public AITValveData LLAFastVentValveData { get; set; }
  180. [Subscription("System.LLA.SlowVentValve.DeviceData")]
  181. public AITValveData LLASlowVentValveData { get; set; }
  182. [Subscription("System.LLA.FastPumpValve.DeviceData")]
  183. public AITValveData LLAFastPumpValveData { get; set; }
  184. [Subscription("System.LLA.SlowPumpValve.DeviceData")]
  185. public AITValveData LLASlowPumpValveData { get; set; }
  186. [Subscription("System.LLA.SensorDoorOpened.DeviceData")]
  187. public AITSensorData LLADoorOpenData { get; set; }
  188. [Subscription("System.LLA.SensorDoorClosed.DeviceData")]
  189. public AITSensorData LLADoorCloseData { get; set; }
  190. [Subscription("LLB.Status")]
  191. public string LLBStatus { get; set; }
  192. public bool IsLLBNotInit => LLBStatus == "Init";
  193. [Subscription("LLB.IsOnline")]
  194. public bool LLBIsOnline { get; set; }
  195. public string LLBOnlineMode => LLBIsOnline ? "Online" : "Offline";
  196. public bool IsLLBEnableManualOperation => LLBStatus == "Idle";
  197. public bool IsLLBOnlineButtonEnable => !LLBIsOnline;
  198. public bool IsLLBOfflineButtonEnable => LLBIsOnline;
  199. [Subscription("LLB.ChamberPressure")]
  200. public double LLBChamberPressure { get; set; }
  201. [Subscription("LLB.IsAtm")]
  202. public bool LLBIsAtmFeedback { get; set; }
  203. [Subscription("LLB.IsVacuum")]
  204. public bool LLBIsVacuumFeedback { get; set; }
  205. [Subscription("System.LLB.SlitDoor.OpenFeedback")]
  206. public bool LLBIsDoorOpened { get; set; }
  207. [Subscription("System.LLB.SlitDoor.CloseFeedback")]
  208. public bool LLBIsDoorClosed { get; set; }
  209. [Subscription("System.LLB.ChamberPressure.DeviceData")]
  210. public AITPressureMeterData LLBPressureMeterData { get; set; }
  211. [Subscription("System.LLB.FastVentValve.DeviceData")]
  212. public AITValveData LLBFastVentValveData { get; set; }
  213. [Subscription("System.LLB.SlowVentValve.DeviceData")]
  214. public AITValveData LLBSlowVentValveData { get; set; }
  215. [Subscription("System.LLB.FastPumpValve.DeviceData")]
  216. public AITValveData LLBFastPumpValveData { get; set; }
  217. [Subscription("System.LLB.SlowPumpValve.DeviceData")]
  218. public AITValveData LLBSlowPumpValveData { get; set; }
  219. [Subscription("System.LLB.SensorDoorOpened.DeviceData")]
  220. public AITSensorData LLBDoorOpenData { get; set; }
  221. [Subscription("System.LLB.SensorDoorClosed.DeviceData")]
  222. public AITSensorData LLBDoorCloseData { get; set; }
  223. [Subscription("System.LL.SensorForelineVacSW.DeviceData")]
  224. public AITSensorData LLForelineVacSWData { get; set; }
  225. [Subscription("TM.Status")]
  226. public string TMStatus { get; set; }
  227. [Subscription("TM.TMRobot.State")]
  228. public string TMRobotStatus { get; set; }
  229. public bool IsTMNotInit => TMStatus == "Init";
  230. [Subscription("TM.ChamberPressure")]
  231. public double TMChamberPressure { get; set; }
  232. [Subscription("TM.IsOnline")]
  233. public bool TMIsOnline { get; set; }
  234. public string TMOnlineMode => TMIsOnline ? "Online" : "Offline";
  235. public bool IsTMEnableManualOperation => !TMIsOnline && TMStatus == "Idle";
  236. public bool IsTMOnlineButtonEnable => !TMIsOnline && TMStatus == "Idle";
  237. public bool IsTMOfflineButtonEnable => TMIsOnline && TMStatus == "Idle";
  238. [Subscription("FFU.FFU1Speed")]
  239. public int FFUCurrentSpeed { get; set; }
  240. private int _FFUSetSpeed;
  241. public int FFUSetSpeed
  242. {
  243. get { return _FFUSetSpeed; }
  244. set { _FFUSetSpeed = value; NotifyOfPropertyChange("FFUSetSpeed"); }
  245. }
  246. [Subscription("TM.IsAtm")]
  247. public bool IsTMAtmFeedback { get; set; }
  248. [Subscription("TM.IsVacuum")]
  249. public bool IsTMVacuumFeedback { get; set; }
  250. [Subscription("System.TM.SensorForelineVacSW.DeviceData")]
  251. public AITSensorData TMForelineVacSWData { get; set; }
  252. [Subscription("System.TM.FastVentValve.DeviceData")]
  253. public AITValveData TMVentValveData { get; set; }
  254. [Subscription("System.TM.N2BallastValve.DeviceData")]
  255. public AITValveData TMN2BallastValveData { get; set; }
  256. [Subscription("System.TM.FastPumpValve.DeviceData")]
  257. public AITValveData TMFastPumpValveData { get; set; }
  258. [Subscription("System.TM.SlowPumpValve.DeviceData")]
  259. public AITValveData TMSlowPumpValveData { get; set; }
  260. [Subscription("System.TM.ChamberPressure.DeviceData")]
  261. public AITPressureMeterData TMPressureMeterData { get; set; }
  262. [Subscription("System.TM.ForelinePressure.DeviceData")]
  263. public AITPressureMeterData TMForelinePressureMeterData { get; set; }
  264. [Subscription("System.PMA.SlitValve.OpenFeedback")]
  265. public bool PMASlitValveOpenFeedback { get; set; }
  266. [Subscription("System.PMA.SlitValve.CloseFeedback")]
  267. public bool PMASlitValveCloseFeedback { get; set; }
  268. [Subscription("System.PMB.SlitValve.OpenFeedback")]
  269. public bool PMBSlitValveOpenFeedback { get; set; }
  270. [Subscription("System.PMB.SlitValve.CloseFeedback")]
  271. public bool PMBSlitValveCloseFeedback { get; set; }
  272. [Subscription("System.PMC.SlitValve.OpenFeedback")]
  273. public bool PMCSlitValveOpenFeedback { get; set; }
  274. [Subscription("System.PMC.SlitValve.CloseFeedback")]
  275. public bool PMCSlitValveCloseFeedback { get; set; }
  276. [Subscription("System.LLA.SlitValve.OpenFeedback")]
  277. public bool LLASlitValveOpenFeedback { get; set; }
  278. [Subscription("System.LLA.SlitValve.CloseFeedback")]
  279. public bool LLASlitValveCloseFeedback { get; set; }
  280. [Subscription("System.LLB.SlitValve.OpenFeedback")]
  281. public bool LLBSlitValveOpenFeedback { get; set; }
  282. [Subscription("System.LLB.SlitValve.CloseFeedback")]
  283. public bool LLBSlitValveCloseFeedback { get; set; }
  284. [Subscription("LL.DryPump.DeviceData")]
  285. public AITPumpData LLPumpDeviceData { get; set; }
  286. [Subscription("TM.DryPump.DeviceData")]
  287. public AITPumpData TMPumpDeviceData { get; set; }
  288. public bool EnableServiceControl { get; set; }
  289. [Subscription("TM.MfcTmPurge.DeviceData")]
  290. public AITMfcData TMPurgeMfcData { get; set; }
  291. [Subscription("TMCylce.RemainedCycleCount")]
  292. public int RemainedCycleCount { get; set; }
  293. public string TMStatusBackground
  294. {
  295. get { return GetUnitStatusBackground(TMStatus); }
  296. }
  297. public bool IsTmDryPumpStandalone { get; set; }
  298. public bool IsTmPurgeEnabled { get; set; }
  299. private string _extendSelectedModule;
  300. public string ExtendSelectedModule
  301. {
  302. get
  303. {
  304. return _extendSelectedModule;
  305. }
  306. set
  307. {
  308. _extendSelectedModule = value;
  309. ExtendSlots = GetSlotsByModule(_extendSelectedModule);
  310. ExtendSelectedSlot = 1;
  311. NotifyOfPropertyChange("ExtendSelectedModule");
  312. }
  313. }
  314. private int _extendSelectedSlot;
  315. public int ExtendSelectedSlot
  316. {
  317. get { return _extendSelectedSlot; }
  318. set { _extendSelectedSlot = value; NotifyOfPropertyChange("ExtendSelectedSlot"); }
  319. }
  320. private string _extendSelectedBlade;
  321. public string ExtendSelectedBlade
  322. {
  323. get { return _extendSelectedBlade; }
  324. set { _extendSelectedBlade = value; NotifyOfPropertyChange("ExtendSelectedBlade"); }
  325. }
  326. private List<int> _extendSlots;
  327. public List<int> ExtendSlots
  328. {
  329. get { return _extendSlots; }
  330. set { _extendSlots = value; NotifyOfPropertyChange("ExtendSlots"); }
  331. }
  332. private string _retractSelectedModule;
  333. public string RetractSelectedModule
  334. {
  335. get
  336. {
  337. return _retractSelectedModule;
  338. }
  339. set
  340. {
  341. _retractSelectedModule = value;
  342. RetractSlots = GetSlotsByModule(_retractSelectedModule);
  343. RetractSelectedSlot = 1;
  344. NotifyOfPropertyChange("RetractSelectedModule");
  345. }
  346. }
  347. private int _retractSelectedSlot;
  348. public int RetractSelectedSlot
  349. {
  350. get { return _retractSelectedSlot; }
  351. set { _retractSelectedSlot = value; NotifyOfPropertyChange("RetractSelectedSlot"); }
  352. }
  353. private string _retractSelectedBlade;
  354. public string RetractSelectedBlade
  355. {
  356. get { return _retractSelectedBlade; }
  357. set { _retractSelectedBlade = value; NotifyOfPropertyChange("RetractSelectedBlade"); }
  358. }
  359. private List<int> _retractSlots;
  360. public List<int> RetractSlots
  361. {
  362. get { return _retractSlots; }
  363. set { _retractSlots = value; NotifyOfPropertyChange("RetractSlots"); }
  364. }
  365. private List<int> _slots = new List<int>() { 8, 8, 2, 2, 2, 2 };
  366. private List<string> _modules = new List<string>() { "LLA", "LLB", "PMA", "PMB" };
  367. private List<string> _blades = new List<string>() { "BladeA", "BladeB" };
  368. private List<string> _transfers = new List<string>() { "Pick", "Place" };
  369. private List<string> _tmcycleorigin = new List<string>() { "LLA", "LLB" };
  370. private List<string> _tmcycleto = new List<string>() { "LLA", "LLB" };
  371. public List<string> TMCycleOrigin
  372. {
  373. get { return _tmcycleorigin; }
  374. set { _tmcycleorigin = value; NotifyOfPropertyChange("TMCycleOrigin"); }
  375. }
  376. public List<string> TMCycleTo
  377. {
  378. get { return _tmcycleto; }
  379. set { _tmcycleto = value; NotifyOfPropertyChange("TMCycleTo"); }
  380. }
  381. public List<string> Modules
  382. {
  383. get { return _modules; }
  384. set { _modules = value; NotifyOfPropertyChange("Modules"); }
  385. }
  386. public List<string> Blades
  387. {
  388. get { return _blades; }
  389. set { _blades = value; NotifyOfPropertyChange("Blades"); }
  390. }
  391. public List<string> Transfers
  392. {
  393. get { return _transfers; }
  394. set { _transfers = value; NotifyOfPropertyChange("Transfers"); }
  395. }
  396. private bool _TMCycleEnable;
  397. public bool TMCycleEnable
  398. {
  399. get { return _TMCycleEnable; }
  400. set { _TMCycleEnable = value; NotifyOfPropertyChange("TMCycleEnable"); }
  401. }
  402. private string _TMCycleCount;
  403. public string TMCycleCount
  404. {
  405. get { return _TMCycleCount; }
  406. set { _TMCycleCount = value; NotifyOfPropertyChange("TMCycleCount"); }
  407. }
  408. private string _SelectedTMCycleOrigin;
  409. public string SelectedTMCycleOrigin
  410. {
  411. get { return _SelectedTMCycleOrigin; }
  412. set { _SelectedTMCycleOrigin = value; NotifyOfPropertyChange("SelectedTMCycleOrigin"); }
  413. }
  414. private string _SelectedTMCycleTo;
  415. public string SelectedTMCycleTo
  416. {
  417. get { return _SelectedTMCycleTo; }
  418. set { _SelectedTMCycleTo = value; NotifyOfPropertyChange("SelectedTMCycleTo"); }
  419. }
  420. private bool _TMCyclePMASelected;
  421. public bool TMCyclePMASelected
  422. {
  423. get { return _TMCyclePMASelected; }
  424. set { _TMCyclePMASelected = value; NotifyOfPropertyChange("TMCyclePMASelected"); }
  425. }
  426. private bool _TMCyclePMBSelected;
  427. public bool TMCyclePMBSelected
  428. {
  429. get { return _TMCyclePMBSelected; }
  430. set { _TMCyclePMBSelected = value; NotifyOfPropertyChange("TMCyclePMBSelected"); }
  431. }
  432. private string _pickSelectedModule;
  433. public string PickSelectedModule
  434. {
  435. get
  436. {
  437. return _pickSelectedModule;
  438. }
  439. set
  440. {
  441. _pickSelectedModule = value;
  442. PickSlots = GetSlotsByModule(_pickSelectedModule);
  443. PickSelectedSlot = 1;
  444. NotifyOfPropertyChange("PickSelectedModule");
  445. }
  446. }
  447. private int _pickSelectedSlot;
  448. public int PickSelectedSlot
  449. {
  450. get { return _pickSelectedSlot; }
  451. set { _pickSelectedSlot = value; NotifyOfPropertyChange("PickSelectedSlot"); }
  452. }
  453. private string _pickSelectedBlade;
  454. public string PickSelectedBlade
  455. {
  456. get { return _pickSelectedBlade; }
  457. set { _pickSelectedBlade = value; NotifyOfPropertyChange("PickSelectedBlade"); }
  458. }
  459. private List<int> _pickSlots;
  460. public List<int> PickSlots
  461. {
  462. get { return _pickSlots; }
  463. set { _pickSlots = value; NotifyOfPropertyChange("PickSlots"); }
  464. }
  465. private string _placeSelectedModule;
  466. public string PlaceSelectedModule
  467. {
  468. get
  469. {
  470. return _placeSelectedModule;
  471. }
  472. set
  473. {
  474. _placeSelectedModule = value;
  475. PlaceSlots = GetSlotsByModule(_placeSelectedModule);
  476. PlaceSelectedSlot = 1;
  477. NotifyOfPropertyChange("PlaceSelectedModule");
  478. }
  479. }
  480. private int _placeSelectedSlot;
  481. public int PlaceSelectedSlot
  482. {
  483. get { return _placeSelectedSlot; }
  484. set { _placeSelectedSlot = value; NotifyOfPropertyChange("PlaceSelectedSlot"); }
  485. }
  486. private string _placeSelectedBlade;
  487. public string PlaceSelectedBlade
  488. {
  489. get { return _placeSelectedBlade; }
  490. set { _placeSelectedBlade = value; NotifyOfPropertyChange("PlaceSelectedBlade"); }
  491. }
  492. private List<int> _placeSlots;
  493. public List<int> PlaceSlots
  494. {
  495. get { return _placeSlots; }
  496. set { _placeSlots = value; NotifyOfPropertyChange("PlaceSlots"); }
  497. }
  498. private string _pm1SelectedTransfer;
  499. public string PM1SelectedTransfer
  500. {
  501. get
  502. {
  503. return _pm1SelectedTransfer;
  504. }
  505. set
  506. {
  507. _pm1SelectedTransfer = value;
  508. NotifyOfPropertyChange("PM1SelectedTransfer");
  509. }
  510. }
  511. private string _pm2SelectedTransfer;
  512. public string PM2SelectedTransfer
  513. {
  514. get
  515. {
  516. return _pm2SelectedTransfer;
  517. }
  518. set
  519. {
  520. _pm2SelectedTransfer = value;
  521. NotifyOfPropertyChange("PM2SelectedTransfer");
  522. }
  523. }
  524. private string _pm3SelectedTransfer;
  525. public string PM3SelectedTransfer
  526. {
  527. get
  528. {
  529. return _pm3SelectedTransfer;
  530. }
  531. set
  532. {
  533. _pm3SelectedTransfer = value;
  534. NotifyOfPropertyChange("PM3SelectedTransfer");
  535. }
  536. }
  537. private string _pm4SelectedTransfer;
  538. public string PM4SelectedTransfer
  539. {
  540. get
  541. {
  542. return _pm4SelectedTransfer;
  543. }
  544. set
  545. {
  546. _pm4SelectedTransfer = value;
  547. NotifyOfPropertyChange("PM4SelectedTransfer");
  548. }
  549. }
  550. [Subscription("PMA.IsPickEnable")]
  551. public bool PM1PickEnable { get; set; }
  552. [Subscription("PMA.IsPlaceEnable")]
  553. public bool PM1PlaceEnable { get; set; }
  554. [Subscription("PMA.IsOnline")]
  555. public bool PM1IsOnline { get; set; }
  556. public bool PM1IsOffline
  557. {
  558. get { return !PM1IsOnline; }
  559. }
  560. public bool PM1TransferEnable
  561. {
  562. get { return _pm1SelectedTransfer == "Pick" ? PM1PickEnable : PM1PlaceEnable; }
  563. }
  564. [Subscription("PMB.IsPickEnable")]
  565. public bool PM2PickEnable { get; set; }
  566. [Subscription("PMB.IsPlaceEnable")]
  567. public bool PM2PlaceEnable { get; set; }
  568. [Subscription("PMB.IsOnline")]
  569. public bool PM2IsOnline { get; set; }
  570. public bool PM2IsOffline
  571. {
  572. get { return !PM2IsOnline; }
  573. }
  574. public bool PM2TransferEnable
  575. {
  576. get { return _pm2SelectedTransfer == "Pick" ? PM2PickEnable : PM2PlaceEnable; }
  577. }
  578. [Subscription("PMC.IsPickEnable")]
  579. public bool PM3PickEnable { get; set; }
  580. [Subscription("PMC.IsPlaceEnable")]
  581. public bool PM3PlaceEnable { get; set; }
  582. [Subscription("PMC.IsOnline")]
  583. public bool PM3IsOnline { get; set; }
  584. public bool PM3IsOffline
  585. {
  586. get { return !PM3IsOnline; }
  587. }
  588. public bool PM3TransferEnable
  589. {
  590. get { return _pm3SelectedTransfer == "Pick" ? PM3PickEnable : PM3PlaceEnable; }
  591. }
  592. #endregion Properties
  593. #region Functions
  594. public MainframeViewModel()
  595. {
  596. this.DisplayName = "TM";
  597. }
  598. protected override void OnInitialize()
  599. {
  600. base.OnInitialize();
  601. base.InitLL();
  602. base.InitTM();
  603. base.InitEFEM();
  604. base.InitPM();
  605. //InstallPMs = new List<string>() { PMA.ModuleID, PMB.ModuleID, PMC.ModuleID, PMD.ModuleID };
  606. ExtendSelectedModule = "VCEA";
  607. RetractSelectedModule = "VCEA";
  608. PickSelectedModule = "VCEA";
  609. PlaceSelectedModule = "VCEA";
  610. ExtendSelectedBlade = "BladeA";
  611. RetractSelectedBlade = "BladeA";
  612. PickSelectedBlade = "BladeA";
  613. PlaceSelectedBlade = "BladeA";
  614. PM1SelectedTransfer = "Pick";
  615. PM2SelectedTransfer = "Pick";
  616. PM3SelectedTransfer = "Pick";
  617. PM4SelectedTransfer = "Pick";
  618. ActiveUpdateData = true;
  619. }
  620. private List<int> GetSlotsByModule(string module)
  621. {
  622. List<int> slots = new List<int>();
  623. int i = _modules.IndexOf(module);
  624. int num = 0;
  625. if (i >= 0 && i < _slots.Count)
  626. num = _slots[i];
  627. int j = 0;
  628. while (j < num)
  629. {
  630. slots.Add(j + 1);
  631. j++;
  632. }
  633. return slots;
  634. }
  635. protected override void OnActivate()
  636. {
  637. base.OnActivate();
  638. var serviceMode = QueryDataClient.Instance.Service.GetConfig("System.IsServiceControlMode");
  639. EnableServiceControl = (bool)serviceMode;
  640. //IsTmDryPumpStandalone = (bool)QueryDataClient.Instance.Service.GetConfig("TM.IsDryPumpStandalone");
  641. //IsTmPurgeEnabled = (bool)QueryDataClient.Instance.Service.GetConfig("TM.IsPurgeEnabled");
  642. //_isLP1Visibility = (bool)QueryDataClient.Instance.Service.GetConfig("System.SetUp.LP1.IsInstalled");
  643. //_isLP2Visibility = (bool)QueryDataClient.Instance.Service.GetConfig("System.SetUp.LP2.IsInstalled");
  644. //_isLP3Visibility = (bool)QueryDataClient.Instance.Service.GetConfig("System.SetUp.LP3.IsInstalled");
  645. _isLLAVisibility = (bool)QueryDataClient.Instance.Service.GetConfig("System.SetUp.LLA.IsInstalled");
  646. _isLLBVisibility = (bool)QueryDataClient.Instance.Service.GetConfig("System.SetUp.LLB.IsInstalled");
  647. //_isAlignerVisibility = (bool)QueryDataClient.Instance.Service.GetConfig("System.SetUp.Aligner.IsInstalled");
  648. _isPMAVisibility = (bool)QueryDataClient.Instance.Service.GetConfig("System.SetUp.PMA.IsInstalled");
  649. _isPMBVisibility = (bool)QueryDataClient.Instance.Service.GetConfig("System.SetUp.PMB.IsInstalled");
  650. _isPMCVisibility = (bool)QueryDataClient.Instance.Service.GetConfig("System.SetUp.PMC.IsInstalled");
  651. }
  652. //public bool _isLP1Visibility;
  653. //public Visibility IsLP1Visibility
  654. //{
  655. // get { return _isLP1Visibility ? Visibility.Visible : Visibility.Hidden; }
  656. //}
  657. //public bool _isLP2Visibility;
  658. //public Visibility IsLP2Visibility
  659. //{
  660. // get { return _isLP2Visibility ? Visibility.Visible : Visibility.Hidden; }
  661. //}
  662. //public bool _isLP3Visibility;
  663. //public Visibility IsLP3Visibility
  664. //{
  665. // get { return _isLP3Visibility ? Visibility.Visible : Visibility.Hidden; }
  666. //}
  667. public bool _isPMAVisibility;
  668. public Visibility IsPMAVisibility
  669. {
  670. get { return _isPMAVisibility ? Visibility.Visible : Visibility.Hidden; }
  671. }
  672. public bool _isPMBVisibility;
  673. public Visibility IsPMBVisibility
  674. {
  675. get { return _isPMBVisibility ? Visibility.Visible : Visibility.Hidden; }
  676. }
  677. public bool _isPMCVisibility;
  678. public Visibility IsPMCVisibility
  679. {
  680. get { return _isPMCVisibility ? Visibility.Visible : Visibility.Hidden; }
  681. }
  682. public bool _isLLAVisibility;
  683. public Visibility IsLLAVisibility
  684. {
  685. get { return _isLLAVisibility ? Visibility.Visible : Visibility.Hidden; }
  686. }
  687. public bool _isLLBVisibility;
  688. public Visibility IsLLBVisibility
  689. {
  690. get { return _isLLBVisibility ? Visibility.Visible : Visibility.Hidden; }
  691. }
  692. //public bool _isAlignerVisibility;
  693. //public Visibility IsAlignerVisibility
  694. //{
  695. // get { return _isAlignerVisibility ? Visibility.Visible : Visibility.Hidden; }
  696. //}
  697. protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
  698. {
  699. //VCEA.IsOnline = VCEAIsOnline;
  700. //VCEB.IsOnline = VCEBIsOnline;
  701. }
  702. #region TM Robot
  703. public void TMRobot_Home()
  704. {
  705. //TMProvider.Instance.TMRobot_Home();
  706. }
  707. public void TMRobot_Retract()
  708. {
  709. //TMProvider.Instance.TMRobot_Retract(RetractSelectedModule, RetractSelectedSlot - 1, RetractSelectedBlade == "BladeA" ? 0 : 1);
  710. }
  711. public void TMRobot_Extend()
  712. {
  713. //TMProvider.Instance.TMRobot_Extend(ExtendSelectedModule, ExtendSelectedSlot - 1, ExtendSelectedBlade == "BladeA" ? 0 : 1);
  714. }
  715. public void TMRobot_Pick()
  716. {
  717. InvokeClient.Instance.Service.DoOperation($"TM.Pick", PickSelectedModule, PickSelectedSlot - 1, PickSelectedBlade == "BladeA" ? 0 : 1, (double)0, (double)0, false);
  718. //TMProvider.Instance.TMRobot_Pick(PickSelectedModule, PickSelectedSlot - 1, PickSelectedBlade == "BladeA" ? 0 : 1);
  719. }
  720. public void TMRobot_Place()
  721. {
  722. InvokeClient.Instance.Service.DoOperation($"TM.Place", PlaceSelectedModule, PlaceSelectedSlot - 1, PlaceSelectedBlade == "BladeA" ? 0 : 1, (double)0, (double)0, false);
  723. //TMProvider.Instance.TMRobot_Place(PlaceSelectedModule, PlaceSelectedSlot - 1, PlaceSelectedBlade == "BladeA" ? 0 : 1);
  724. }
  725. public void TMRobot_SetInterlockValid()
  726. {
  727. InvokeClient.Instance.Service.DoOperation($"TMRobot.SetParameter", "InterlockValid", true);
  728. }
  729. public void TMRobot_SetInterlockInvalid()
  730. {
  731. InvokeClient.Instance.Service.DoOperation($"TMRobot.SetParameter", "InterlockValid", false);
  732. }
  733. #endregion TM Robot
  734. public void SetFFUSpeed()
  735. {
  736. InvokeClient.Instance.Service.DoOperation($"FFU.SetSpeed", FFUSetSpeed.ToString());
  737. }
  738. public void Reset(string module)
  739. {
  740. InvokeClient.Instance.Service.DoOperation($"{module}.Reset");
  741. //TMProvider.Instance.Reset(module);
  742. }
  743. public void Home(string module)
  744. {
  745. InvokeClient.Instance.Service.DoOperation($"{module}.Home");
  746. //TMProvider.Instance.Home(module);
  747. }
  748. public void Load(string module)
  749. {
  750. //TMProvider.Instance.Load(module);
  751. }
  752. public void Unload(string module)
  753. {
  754. //TMProvider.Instance.Unload(module);
  755. }
  756. public void Map(string module)
  757. {
  758. //TMProvider.Instance.Map(module);
  759. }
  760. public void Pump(string module)
  761. {
  762. //TMProvider.Instance.Pump(module);
  763. }
  764. public void Vent(string module)
  765. {
  766. //TMProvider.Instance.Vent(module);
  767. }
  768. public void LiftUp(string module)
  769. {
  770. //TMProvider.Instance.LiftUp(module);
  771. }
  772. public void LiftDown(string module)
  773. {
  774. //TMProvider.Instance.LiftDown(module);
  775. }
  776. public void OpenDoor(string module)
  777. {
  778. //TMProvider.Instance.OpenDoor(module);
  779. }
  780. public void CloseDoor(string module)
  781. {
  782. //TMProvider.Instance.CloseDoor(module);
  783. }
  784. public void OpenSlitValve(string module)
  785. {
  786. //TMProvider.Instance.OpenSlitValve(module);
  787. }
  788. public void CloseSlitValve(string module)
  789. {
  790. //TMProvider.Instance.CloseSlitValve(module);
  791. }
  792. public void Abort(string module)
  793. {
  794. InvokeClient.Instance.Service.DoOperation($"{module}.Abort");
  795. //TMProvider.Instance.Abort(module);
  796. }
  797. public void PrepareTransfer(string module, string type)
  798. {
  799. //TMProvider.Instance.PrepareTransfer(module, type);
  800. }
  801. public void TransferHandoff(string module, string type)
  802. {
  803. //TMProvider.Instance.TransferHandoff(module, type);
  804. }
  805. public void SetOnline(string module)
  806. {
  807. InvokeClient.Instance.Service.DoOperation($"{module}.SetOnline");
  808. }
  809. public void SetOffline(string module)
  810. {
  811. InvokeClient.Instance.Service.DoOperation($"{module}.SetOffline");
  812. }
  813. public void LoadLockHome(string module)
  814. {
  815. InvokeClient.Instance.Service.DoOperation($"{module}.Home");
  816. }
  817. public void LoadLockAbort(string module)
  818. {
  819. InvokeClient.Instance.Service.DoOperation($"{module}.Abort");
  820. }
  821. public void LoadLockReset(string module)
  822. {
  823. InvokeClient.Instance.Service.DoOperation($"{module}.Reset");
  824. }
  825. public void TMCycleStart()
  826. {
  827. int tmCycleCount = 1;
  828. if (TMCycleEnable && !int.TryParse(TMCycleCount, out tmCycleCount))
  829. {
  830. EV.PostWarningLog("TMCycle", $"param set error : {TMCycleCount}");
  831. return;
  832. }
  833. List<string> CycleRoutine = new List<string>();
  834. CycleRoutine.Add(SelectedTMCycleOrigin);
  835. if (TMCyclePMASelected)
  836. {
  837. CycleRoutine.Add("PMA");
  838. }
  839. if (TMCyclePMBSelected)
  840. {
  841. CycleRoutine.Add("PMB");
  842. }
  843. CycleRoutine.Add(SelectedTMCycleTo);
  844. InvokeClient.Instance.Service.DoOperation("System.TMCycleStart", CycleRoutine.ToArray(), tmCycleCount);
  845. }
  846. public void TMCyclePause()
  847. {
  848. InvokeClient.Instance.Service.DoOperation("System.TMCyclePause");
  849. }
  850. public void TMCycleResume()
  851. {
  852. InvokeClient.Instance.Service.DoOperation("System.TMCycleResume");
  853. }
  854. public void TMCycleAbort()
  855. {
  856. InvokeClient.Instance.Service.DoOperation("System.Abort");
  857. }
  858. #endregion Functions
  859. }
  860. }