StatusViewModel.cs 80 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044
  1. using Aitex.Core.Common.DeviceData;
  2. using Aitex.Core.Util;
  3. using Caliburn.Micro;
  4. using Caliburn.Micro.Core;
  5. using MECF.Framework.Common.DataCenter;
  6. using MECF.Framework.Common.Equipment;
  7. using MECF.Framework.Common.OperationCenter;
  8. using MECF.Framework.UI.Client.ClientBase;
  9. using MECF.Framework.UI.Client.CenterViews.Configs.SystemConfig;
  10. using System.Collections.Generic;
  11. using System.Collections.ObjectModel;
  12. using System.Linq;
  13. using System.Windows;
  14. using System.Windows.Media;
  15. using FurnaceUI.Client;
  16. using FurnaceUI.Models;
  17. using FurnaceUI.Views.Jobs;
  18. using FurnaceUI.Views.Recipes;
  19. using FurnaceUI.Views.Editors;
  20. using MECF.Framework.Common.SubstrateTrackings;
  21. using FurnaceUI.Views.Status;
  22. using OpenSEMI.ClientBase;
  23. using MECF.Framework.UI.Client.CenterViews.Editors.Recipe;
  24. using FurnaceUI.Controls.Common;
  25. using MECF.Framework.Common.CommonData;
  26. using System;
  27. using MECF.Framework.Common.Jobs;
  28. using FurnaceUI.Common;
  29. using System.IO;
  30. namespace FurnaceUI.Views.Operations
  31. {
  32. public class StatusViewModel : FurnaceUIViewModelBase
  33. {
  34. #region Property
  35. private bool _isShowMFCBySetPoint = false;
  36. [Subscription("LP1.CurrentLotId")]
  37. public string LP1CurrentLotId { get; set; }
  38. [Subscription("LP1.WaitLotId")]
  39. public List<string> LP1WaitLotId { get; set; }
  40. [Subscription("LP2.CurrentLotId")]
  41. public string LP2CurrentLotId { get; set; }
  42. [Subscription("LP2.WaitLotId")]
  43. public List<string> LP2WaitLotId { get; set; }
  44. [Subscription("TransferState", "LP1")]
  45. public string TransferStateLp1 { get; set; }
  46. [Subscription("TransferState", "LP2")]
  47. public string TransferStateLp2 { get; set; }
  48. [Subscription("CarrierIDStatus", "LP1")]
  49. public string CarrierStatusLP1 { get; set; }
  50. [Subscription("CarrierIDStatus", "LP2")]
  51. public string CarrierStatusLP2 { get; set; }
  52. [Subscription("CarrierRobot.RobotMoveInfo")]
  53. public RobotMoveInfo CassetteRobotMoveInfo { get; set; }
  54. [Subscription("WaferRobot.RobotMoveInfo")]
  55. public RobotMoveInfo WaferRobotMoveInfo { get; set; }
  56. [Subscription("ProcessFlow.Status")]
  57. public string ProcessFlowStatus { get; set; }
  58. double _eDUseWarningLimit;
  59. double _eDUseAlarmLimit;
  60. SolidColorBrush _greenBk = new SolidColorBrush(Colors.LawnGreen);
  61. SolidColorBrush _redBk = new SolidColorBrush(Colors.Red);
  62. SolidColorBrush _transparentBk = new SolidColorBrush(Colors.Transparent);
  63. SolidColorBrush _orangeBk = new SolidColorBrush(Colors.Orange);
  64. SolidColorBrush _blackBk = new SolidColorBrush(Colors.Black);
  65. public SolidColorBrush StandbyBk
  66. {
  67. get
  68. {
  69. if (!IsPM1Process && !IsPM1PostProcess)
  70. return _transparentBk;
  71. return ProcessFlowStatus == "Standby" ? _greenBk : _transparentBk;
  72. }
  73. }
  74. public SolidColorBrush ReadyBk
  75. {
  76. get
  77. {
  78. if (!IsPM1Process && !IsPM1PostProcess)
  79. return _transparentBk;
  80. return (ProcessFlowStatus == "Standby" || ProcessFlowStatus == "Ready") ? _greenBk : _transparentBk;
  81. }
  82. }
  83. public SolidColorBrush EndBk
  84. {
  85. get
  86. {
  87. if (!IsPM1Process && !IsPM1PostProcess)
  88. return _transparentBk;
  89. return ProcessFlowStatus == "End" ? _greenBk : _transparentBk;
  90. }
  91. }
  92. public SolidColorBrush RunBk
  93. {
  94. get
  95. {
  96. if (!IsPM1Process && !IsPM1PostProcess)
  97. return _transparentBk;
  98. return (ProcessFlowStatus == "End" || ProcessFlowStatus == "Run") ? _greenBk : _transparentBk;
  99. }
  100. }
  101. public SolidColorBrush AbortBk
  102. {
  103. get
  104. {
  105. if (!IsPM1Process && !IsPM1PostProcess)
  106. return _transparentBk;
  107. return ProcessFlowStatus == "Abort" ? _redBk : _transparentBk;
  108. }
  109. }
  110. #region Job Staus
  111. [Subscription("System.Batch")]
  112. public string Batch { get; set; }
  113. [Subscription("System.TransferJobStatus")]
  114. public string TransferJobStatus { get; set; }
  115. public SolidColorBrush TransferJobBk
  116. {
  117. get
  118. {
  119. return TransferJobStatus == "Idle" || string.IsNullOrEmpty(TransferJobStatus) ? _transparentBk : _greenBk;
  120. }
  121. }
  122. [Subscription("System.ProcessJobStatus")]
  123. public string ProcessJobStatus { get; set; }
  124. [Subscription("System.Pause")]
  125. public bool IsPause { get; set; }
  126. public string ProcessJobsStatus
  127. {
  128. get
  129. {
  130. return (string.IsNullOrEmpty(Batch) || ProcessJobStatus == "Idle") ? ProcessJobStatus : $"{Batch} : {ProcessJobStatus}";
  131. }
  132. }
  133. public SolidColorBrush ProcessJobBk
  134. {
  135. get
  136. {
  137. if (IsPause)
  138. {
  139. return _orangeBk;
  140. }
  141. else
  142. {
  143. return ProcessJobStatus == "Idle" || string.IsNullOrEmpty(ProcessJobsStatus) ? _transparentBk : _greenBk;
  144. }
  145. return _transparentBk;
  146. }
  147. }
  148. #endregion
  149. #region SMIF
  150. [Subscription("LP1.Status")]
  151. public string LP1Status { get; set; }
  152. public string Lp1StatusBackground
  153. {
  154. get { return ModuleStatusBackground.GetStatusBackground(LP1Status); }
  155. }
  156. [Subscription("Boat.Status")]
  157. public string BoatStatus { get; set; }
  158. public string BoatStatusBackground
  159. {
  160. get { return ModuleStatusBackground.GetStatusBackground(BoatStatus); }
  161. }
  162. [Subscription("LP2.Status")]
  163. public string LP2Status { get; set; }
  164. public string LP2StatusBackground
  165. {
  166. get { return ModuleStatusBackground.GetStatusBackground(LP2Status); }
  167. }
  168. #endregion
  169. #region Stocker
  170. private List<ModuleName> _stokcers;
  171. private List<string> _stokcerWaferType;
  172. private int _cassetteSlot = 0;
  173. private ObservableCollection<string> _stockerSlots;
  174. public ObservableCollection<string> StockerSlots
  175. {
  176. get { return _stockerSlots; }
  177. set
  178. {
  179. _stockerSlots = value;
  180. NotifyOfPropertyChange("StockerSlots");
  181. }
  182. }
  183. private SolidColorBrush _WhiteFill = new SolidColorBrush(Colors.White);
  184. private SolidColorBrush _productionFill = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#bedadb"));
  185. private SolidColorBrush _SD_ED_M_Fill = new SolidColorBrush((Color)ColorConverter.ConvertFromString("LightGray"));
  186. private SolidColorBrush _waringFill = new SolidColorBrush(Colors.Yellow);
  187. private SolidColorBrush _alarmFill = new SolidColorBrush(Colors.Red);
  188. private List<SolidColorBrush> _stockerBackground = new List<SolidColorBrush>();
  189. public List<SolidColorBrush> StockerBackground
  190. {
  191. get => _stockerBackground;
  192. set
  193. {
  194. _stockerBackground = value;
  195. NotifyOfPropertyChange(nameof(StockerBackground));
  196. }
  197. }
  198. [Subscription("PM1.SensorStocker1.Value")]
  199. public bool SensorStation1Presence { get; set; }
  200. [Subscription("PM1.SensorStocker2.Value")]
  201. public bool SensorStation2Presence { get; set; }
  202. [Subscription("PM1.SensorStocker3.Value")]
  203. public bool SensorStation3Presence { get; set; }
  204. [Subscription("PM1.SensorStocker4.Value")]
  205. public bool SensorStation4Presence { get; set; }
  206. [Subscription("PM1.SensorStocker5.Value")]
  207. public bool SensorStation5Presence { get; set; }
  208. [Subscription("PM1.SensorStocker6.Value")]
  209. public bool SensorStation6Presence { get; set; }
  210. [Subscription("PM1.SensorStocker7.Value")]
  211. public bool SensorStation7Presence { get; set; }
  212. [Subscription("PM1.SensorStocker8.Value")]
  213. public bool SensorStation8Presence { get; set; }
  214. [Subscription("PM1.SensorStocker9.Value")]
  215. public bool SensorStation9Presence { get; set; }
  216. [Subscription("PM1.SensorStocker10.Value")]
  217. public bool SensorStation10Presence { get; set; }
  218. [Subscription("PM1.SensorStocker11.Value")]
  219. public bool SensorStation11Presence { get; set; }
  220. [Subscription("PM1.SensorStocker12.Value")]
  221. public bool SensorStation12Presence { get; set; }
  222. [Subscription("PM1.SensorStocker13.Value")]
  223. public bool SensorStation13Presence { get; set; }
  224. [Subscription("PM1.SensorStocker14.Value")]
  225. public bool SensorStation14Presence { get; set; }
  226. [Subscription("PM1.SensorStocker15.Value")]
  227. public bool SensorStation15Presence { get; set; }
  228. [Subscription("PM1.SensorStocker16.Value")]
  229. public bool SensorStation16Presence { get; set; }
  230. [Subscription("PM1.SensorStocker17.Value")]
  231. public bool SensorStation17Presence { get; set; }
  232. [Subscription("PM1.SensorStocker18.Value")]
  233. public bool SensorStation18Presence { get; set; }
  234. [Subscription("Stocker1.Carrier")]
  235. public CarrierInfo Stocker1CarrierData { get; set; }
  236. [Subscription("Stocker2.Carrier")]
  237. public CarrierInfo Stocker2CarrierData { get; set; }
  238. [Subscription("Stocker3.Carrier")]
  239. public CarrierInfo Stocker3CarrierData { get; set; }
  240. [Subscription("Stocker4.Carrier")]
  241. public CarrierInfo Stocker4CarrierData { get; set; }
  242. [Subscription("Stocker5.Carrier")]
  243. public CarrierInfo Stocker5CarrierData { get; set; }
  244. [Subscription("Stocker6.Carrier")]
  245. public CarrierInfo Stocker6CarrierData { get; set; }
  246. [Subscription("Stocker7.Carrier")]
  247. public CarrierInfo Stocker7CarrierData { get; set; }
  248. [Subscription("Stocker8.Carrier")]
  249. public CarrierInfo Stocker8CarrierData { get; set; }
  250. [Subscription("Stocker9.Carrier")]
  251. public CarrierInfo Stocker9CarrierData { get; set; }
  252. [Subscription("Stocker10.Carrier")]
  253. public CarrierInfo Stocker10CarrierData { get; set; }
  254. [Subscription("Stocker11.Carrier")]
  255. public CarrierInfo Stocker11CarrierData { get; set; }
  256. [Subscription("Stocker12.Carrier")]
  257. public CarrierInfo Stocker12CarrierData { get; set; }
  258. [Subscription("Stocker13.Carrier")]
  259. public CarrierInfo Stocker13CarrierData { get; set; }
  260. [Subscription("Stocker14.Carrier")]
  261. public CarrierInfo Stocker14CarrierData { get; set; }
  262. [Subscription("Stocker15.Carrier")]
  263. public CarrierInfo Stocker15CarrierData { get; set; }
  264. [Subscription("Stocker16.Carrier")]
  265. public CarrierInfo Stocker16CarrierData { get; set; }
  266. [Subscription("Stocker17.Carrier")]
  267. public CarrierInfo Stocker17CarrierData { get; set; }
  268. [Subscription("Stocker18.Carrier")]
  269. public CarrierInfo Stocker18CarrierData { get; set; }
  270. [Subscription("CarrierRobot.Carrier")]
  271. public CarrierInfo CassetteRobotCarrierData { get; set; }
  272. [Subscription("FIMS1.Carrier")]
  273. public CarrierInfo FIMS1CarrierData { get; set; }
  274. [Subscription("FIMS2.Carrier")]
  275. public CarrierInfo FIMS2CarrierData { get; set; }
  276. [Subscription("LP1.Carrier")]
  277. public CarrierInfo LP1CarrierData { get; set; }
  278. [Subscription("LP2.Carrier")]
  279. public CarrierInfo LP2CarrierData { get; set; }
  280. [Subscription("LP3.Carrier")]
  281. public CarrierInfo LP3CarrierData { get; set; }
  282. [Subscription("LP4.Carrier")]
  283. public CarrierInfo LP4CarrierData { get; set; }
  284. public int Stocker1WaferCount { get; set; } = 0;
  285. public int Stocker2WaferCount { get; set; } = 0;
  286. public int Stocker3WaferCount { get; set; } = 0;
  287. public int Stocker4WaferCount { get; set; } = 0;
  288. public int Stocker5WaferCount { get; set; } = 0;
  289. public int Stocker6WaferCount { get; set; } = 0;
  290. public int Stocker7WaferCount { get; set; } = 0;
  291. public int Stocker8WaferCount { get; set; } = 0;
  292. public int Stocker9WaferCount { get; set; } = 0;
  293. public int Stocker10WaferCount { get; set; } = 0;
  294. public int Stocker11WaferCount { get; set; } = 0;
  295. public int Stocker12WaferCount { get; set; } = 0;
  296. public int Stocker13WaferCount { get; set; } = 0;
  297. public int Stocker14WaferCount { get; set; } = 0;
  298. public int Stocker15WaferCount { get; set; } = 0;
  299. public int Stocker16WaferCount { get; set; } = 0;
  300. public int Stocker17WaferCount { get; set; } = 0;
  301. public int Stocker18WaferCount { get; set; } = 0;
  302. #endregion
  303. #region Heater
  304. [Subscription("System.HeaterU.DeviceData")]
  305. public AITHeaterData HeaterUData { get; set; }
  306. [Subscription("System.HeaterCU.DeviceData")]
  307. public AITHeaterData HeaterCUData { get; set; }
  308. [Subscription("System.HeaterC.DeviceData")]
  309. public AITHeaterData HeaterCData { get; set; }
  310. [Subscription("System.HeaterCL.DeviceData")]
  311. public AITHeaterData HeaterCLData { get; set; }
  312. [Subscription("System.HeaterL.DeviceData")]
  313. public AITHeaterData HeaterLData { get; set; }
  314. public AITHeaterData BottomHeaterData => HeaterLData;
  315. public AITHeaterData CenterBottomHeaterData => HeaterCLData;
  316. public AITHeaterData CenterHeaterData => HeaterCData;
  317. public AITHeaterData TopCenterHeaterData => HeaterCUData;
  318. public AITHeaterData TopHeaterData => HeaterUData;
  319. public int ControlMode => HeaterUData.ControlMode;
  320. #endregion
  321. #region Robot
  322. [Subscription("WaferRobot.Status")]
  323. public string WaferRobotStatus { get; set; }
  324. public string WaferRobotStatusBackground
  325. {
  326. get { return ModuleStatusBackground.GetStatusBackground(WaferRobotStatus); }
  327. }
  328. [Subscription("CarrierRobot.Status")]
  329. public string CarrierRobotStatus { get; set; }
  330. public string CarrierRobotStatusBackground
  331. {
  332. get { return ModuleStatusBackground.GetStatusBackground(CarrierRobotStatus); }
  333. }
  334. #endregion
  335. #region StockerCarrierType
  336. private string GetStockerCarrierType(CarrierInfo carrierInfo)
  337. {
  338. if (carrierInfo != null && carrierInfo.Status == CarrierStatus.Normal)
  339. {
  340. if (carrierInfo.IsProcessed(carrierInfo.Name))
  341. {
  342. return "Process";
  343. }
  344. return carrierInfo.CarrierType.ToString();
  345. }
  346. return "";
  347. }
  348. public string Stocker1CarrierType
  349. {
  350. get
  351. {
  352. return GetStockerCarrierType(Stocker1CarrierData);
  353. }
  354. }
  355. public string Stocker2CarrierType
  356. {
  357. get
  358. {
  359. return GetStockerCarrierType(Stocker2CarrierData);
  360. }
  361. }
  362. public string Stocker3CarrierType
  363. {
  364. get
  365. {
  366. return GetStockerCarrierType(Stocker3CarrierData);
  367. }
  368. }
  369. public string Stocker4CarrierType
  370. {
  371. get
  372. {
  373. return GetStockerCarrierType(Stocker4CarrierData);
  374. }
  375. }
  376. public string Stocker5CarrierType
  377. {
  378. get
  379. {
  380. return GetStockerCarrierType(Stocker5CarrierData);
  381. }
  382. }
  383. public string Stocker6CarrierType
  384. {
  385. get
  386. {
  387. return GetStockerCarrierType(Stocker6CarrierData);
  388. }
  389. }
  390. public string Stocker7CarrierType
  391. {
  392. get
  393. {
  394. return GetStockerCarrierType(Stocker7CarrierData);
  395. }
  396. }
  397. public string Stocker8CarrierType
  398. {
  399. get
  400. {
  401. return GetStockerCarrierType(Stocker8CarrierData);
  402. }
  403. }
  404. public string Stocker9CarrierType
  405. {
  406. get
  407. {
  408. return GetStockerCarrierType(Stocker9CarrierData);
  409. }
  410. }
  411. public string Stocker10CarrierType
  412. {
  413. get
  414. {
  415. return GetStockerCarrierType(Stocker10CarrierData);
  416. }
  417. }
  418. public string Stocker11CarrierType
  419. {
  420. get
  421. {
  422. return GetStockerCarrierType(Stocker11CarrierData);
  423. }
  424. }
  425. public string Stocker12CarrierType
  426. {
  427. get
  428. {
  429. return GetStockerCarrierType(Stocker12CarrierData);
  430. }
  431. }
  432. public string Stocker13CarrierType
  433. {
  434. get
  435. {
  436. return GetStockerCarrierType(Stocker13CarrierData);
  437. }
  438. }
  439. public string Stocker14CarrierType
  440. {
  441. get
  442. {
  443. return GetStockerCarrierType(Stocker14CarrierData);
  444. }
  445. }
  446. public string Stocker15CarrierType
  447. {
  448. get
  449. {
  450. return GetStockerCarrierType(Stocker15CarrierData);
  451. }
  452. }
  453. public string Stocker16CarrierType
  454. {
  455. get
  456. {
  457. return GetStockerCarrierType(Stocker16CarrierData);
  458. }
  459. }
  460. public string Stocker17CarrierType
  461. {
  462. get
  463. {
  464. return GetStockerCarrierType(Stocker17CarrierData);
  465. }
  466. }
  467. public string Stocker18CarrierType
  468. {
  469. get
  470. {
  471. return GetStockerCarrierType(Stocker18CarrierData);
  472. }
  473. }
  474. #endregion
  475. #region PM
  476. [Subscription("PM1.Status")]
  477. public string PM1Status { get; set; }
  478. [Subscription("PM1.RecipeBeginTime")]
  479. public DateTime PM1RecipeBeginTime { get; set; }
  480. [Subscription("PM1.RecipeStepName")]
  481. public string PM1RecipeStepName { get; set; }
  482. [Subscription("PM1.RecipeNextStepName")]
  483. public string PM1RecipeNextStepName { get; set; }
  484. [Subscription("PM1.RecipeStepNumber")]
  485. public int PM1RecipeStepNumber { get; set; }
  486. [Subscription("PM1.RecipeStepElapseTime")]
  487. public double PM1RecipeStepElapseTime { get; set; }
  488. [Subscription("PM1.RecipeStepTime")]
  489. public double PM1RecipeStepTime { get; set; }
  490. [Subscription("PM1.RecipeTotalElapseTime")]
  491. public double PM1RecipeTotalElapseTime { get; set; }
  492. [Subscription("PM1.RecipeTotalTime")]
  493. public double PM1RecipeTotalTime { get; set; }
  494. [Subscription("PM1.RecipeHoldTime")]
  495. public double PM1RecipeHoldTime { get; set; }
  496. [Subscription("PM1.RecipeHold")]
  497. public bool PM1RecipeHold { get; set; }
  498. [Subscription("PM1.RecipeHolded")]
  499. public bool PM1RecipeHolded { get; set; }
  500. [Subscription("PM1.RecipeWait")]
  501. public bool PM1RecipeWait { get; set; }
  502. [Subscription("PM1.NewShowTime")]
  503. public double PM1NewShowTime { get; set; }
  504. [Subscription("PM1.IsExecuteAbortRecipe")]
  505. public bool PM1IsExecuteAbortRecipe { get; set; }
  506. [Subscription("PM1.ExecRecipeType")]
  507. public string PM1ExecRecipeType { get; set; }
  508. [Subscription("PM1.LoopCountSet")]
  509. public int PM1LoopCountSet { get; set; }
  510. [Subscription("PM1.LoopCountCurrent")]
  511. public int PM1LoopCountCurrent { get; set; }
  512. [Subscription("PM1.IsLooping")]
  513. public bool PM1IsLooping { get; set; }
  514. [Subscription("Scheduler.CoolingTime")]
  515. public int CoolingTime { get; set; }
  516. [Subscription("Scheduler.CoolingRemainTime")]
  517. public int CoolingRemainTime { get; set; }
  518. public string LoopInfo
  519. {
  520. get
  521. {
  522. if (!IsPM1Process || !PM1IsLooping)
  523. return "--";
  524. return $"{PM1ExecRecipeType} : {PM1LoopCountCurrent} / {PM1LoopCountSet}";
  525. }
  526. }
  527. [Subscription("PM1.SubRecipeCurrentLoopCount")]
  528. public int PM1SubRecipeCurrentLoopCount { get; set; }
  529. [Subscription("PM1.ProcessSubRecipe")]
  530. public string ProcessSubRecipe { get; set; }
  531. [Subscription("PM1.ProcessAbortRecipe")]
  532. public string ProcessAbortRecipe { get; set; }
  533. [Subscription("PM1.SubRecipeLoopCount")]
  534. public int PM1SubRecipeLoopCount { get; set; }
  535. [Subscription("PM1.IsExecuteSubRecipe")]
  536. public bool PM1IsExecuteSubRecipe { get; set; }
  537. public string SubInfo
  538. {
  539. get
  540. {
  541. if (!IsPM1Process || !PM1IsExecuteSubRecipe)
  542. return "--";
  543. return $"{PM1ExecRecipeType} : {PM1SubRecipeCurrentLoopCount} / {PM1SubRecipeLoopCount}";
  544. }
  545. }
  546. public bool IsPM1Idle
  547. {
  548. get { return PM1Status == "Idle"; }
  549. }
  550. public bool IsPM1Process
  551. {
  552. get { return PM1Status == "Process"; }
  553. }
  554. public bool IsPM1PostProcess
  555. {
  556. get { return PM1Status == "PostProcess"; }
  557. }
  558. public bool IsPM1PreProcess
  559. {
  560. get { return PM1Status == "PreProcess"; }
  561. }
  562. public string PM1StepNumber
  563. {
  564. get
  565. {
  566. if (!IsPM1Process && !IsPM1PostProcess)
  567. return "--";
  568. return $"{PM1RecipeStepNumber}";
  569. }
  570. }
  571. public string PM1StepName
  572. {
  573. get
  574. {
  575. if (!IsPM1Process && !IsPM1PostProcess)
  576. return "--";
  577. return $"{PM1RecipeStepName}";
  578. }
  579. }
  580. public string PM1NextStepName
  581. {
  582. get
  583. {
  584. if (!IsPM1Process && !IsPM1PostProcess)
  585. return "--";
  586. return $"{PM1RecipeNextStepName}";
  587. }
  588. }
  589. public string PM1BeginTime
  590. {
  591. get
  592. {
  593. if (!IsPM1Process && !IsPM1PostProcess)
  594. return "--";
  595. return $"{PM1RecipeBeginTime.ToString("yyyy-MM-dd HH:mm:ss")}";
  596. }
  597. }
  598. private bool isCoolingFrist = false;
  599. private DateTime firstCoolingTime = DateTime.MinValue;
  600. public string PM1EndTime
  601. {
  602. get
  603. {
  604. if (LocalProcessJobs != null && LocalProcessJobs.Where(x => x.ProcessingState == EnumProcessingState.CoolingBeforeDischarge) != null)
  605. {
  606. if (!isCoolingFrist)
  607. {
  608. TimeSpan secondSpan = DateTime.Now - PM1RecipeBeginTime;
  609. firstCoolingTime = PM1RecipeBeginTime.AddSeconds(secondSpan.TotalSeconds + PM1RecipeTotalTime - PM1RecipeTotalElapseTime);
  610. isCoolingFrist = true;
  611. }
  612. }
  613. if (!IsPM1Process && !IsPM1PostProcess)
  614. return "--";
  615. if (isCoolingFrist)
  616. {
  617. isCoolingFrist = false;
  618. firstCoolingTime = DateTime.MinValue;
  619. }
  620. return $"{CalEndTime(PM1RecipeBeginTime, PM1RecipeTotalTime, PM1RecipeTotalElapseTime)}";
  621. }
  622. }
  623. public string PM1StepTime
  624. {
  625. get
  626. {
  627. if (!IsPM1Process && !IsPM1PostProcess)
  628. return "--";
  629. if (PM1RecipeHolded && PM1RecipeHoldTime > 0)
  630. return "--";
  631. return CalStepTime(PM1RecipeStepElapseTime, PM1RecipeStepTime);
  632. }
  633. }
  634. public string PM1RecipeTime
  635. {
  636. get
  637. {
  638. if (!IsPM1Process && !IsPM1PostProcess)
  639. return "--";
  640. return CalRecipeTime(PM1RecipeTotalElapseTime, PM1RecipeTotalTime);
  641. }
  642. }
  643. public string PM1HoldTime
  644. {
  645. get
  646. {
  647. if (!IsPM1Process && !IsPM1PostProcess)
  648. return "--";
  649. return CalHoldTime(PM1NewShowTime);
  650. }
  651. }
  652. public string PM1HoldName
  653. {
  654. get
  655. {
  656. return "Hold Time";
  657. }
  658. }
  659. public string HoldName
  660. {
  661. get
  662. {
  663. if (PM1RecipeHold)
  664. return "Continue";
  665. return "Hold";
  666. }
  667. }
  668. public string HoldWaitDisplay
  669. {
  670. get
  671. {
  672. if (PM1Status == "Idle")
  673. {
  674. return "";
  675. }
  676. else
  677. {
  678. if (PM1RecipeWait)
  679. return "W";
  680. if (PM1RecipeHolded)
  681. return "H";
  682. return "";
  683. }
  684. }
  685. }
  686. public SolidColorBrush HoldForeground
  687. {
  688. get
  689. {
  690. if (PM1RecipeHold)
  691. return _blackBk;
  692. return _redBk;
  693. }
  694. }
  695. [Subscription("PM1.SelectedRecipeName")]
  696. public string PM1SelectedRecipeName
  697. {
  698. get;
  699. set;
  700. }
  701. [Subscription("PM1.MainRecipeName")]
  702. public string PM1MainRecipeName
  703. {
  704. get;
  705. set;
  706. }
  707. public string PM1SelectedRecipeNameDisplay
  708. {
  709. get
  710. {
  711. if (string.IsNullOrEmpty(PM1SelectedRecipeName))
  712. return string.Empty;
  713. if (!IsPM1Process && !IsPM1PostProcess)
  714. return string.Empty;
  715. //return PM1SelectedRecipeName.Substring("Furnace\\Process\\".Length);
  716. return Path.GetFileName(PM1SelectedRecipeName);
  717. }
  718. }
  719. [Subscription("PM1.IsOnline")]
  720. public bool PM1IsOnline { get; set; }
  721. public bool PM1IsOffline
  722. {
  723. get { return !PM1IsOnline; }
  724. }
  725. public bool IsEnableEmergencyAbort
  726. {
  727. get
  728. {
  729. return PM1Status != "Init" && PM1Status != "Idle";
  730. }
  731. }
  732. private string CalStepTime(double elapseTime, double totalTime)
  733. {
  734. string stepTime = string.Empty;
  735. double remainingTime = totalTime - elapseTime;
  736. if (remainingTime < 0)
  737. remainingTime = 0;
  738. string strElapseTimeH = $"{(elapseTime / 3600).ToString().PadLeft(2, '0')}";
  739. string strElapseTimeM = $"{(elapseTime % 3600 / 60).ToString().PadLeft(2, '0')}";
  740. string strElapseTimeS = $"{(elapseTime % 60).ToString().PadLeft(2, '0')}";
  741. string strRemainingTimeH = $"{((int)(remainingTime / 3600)).ToString("f0").PadLeft(2, '0')}";
  742. string strRemainingTimeM = $"{((int)(remainingTime % 3600 / 60)).ToString("f0").PadLeft(2, '0')}";
  743. string strRemainingTimeS = $"{(remainingTime % 60).ToString("f1").PadLeft(2, '0')}";
  744. stepTime = $"{strRemainingTimeH}:{strRemainingTimeM}:{strRemainingTimeS}";
  745. return stepTime;
  746. }
  747. private string CalRecipeTime(double elapseTime, double totalTime)
  748. {
  749. string recipeTime = string.Empty;
  750. double remainingTime = totalTime - elapseTime;
  751. if (remainingTime < 0)
  752. remainingTime = 0;
  753. string strElapseTimeH = $"{(elapseTime / 3600).ToString("f0").PadLeft(2, '0')}";
  754. string strElapseTimeM = $"{(elapseTime % 3600 / 60).ToString("f0").PadLeft(2, '0')}";
  755. string strElapseTimeS = $"{(elapseTime % 60).ToString("f0").PadLeft(2, '0')}";
  756. string strRemainingTimeH = $"{((int)(remainingTime / 3600)).ToString("f0").PadLeft(2, '0')}";
  757. string strRemainingTimeM = $"{((int)(remainingTime % 3600 / 60)).ToString("f0").PadLeft(2, '0')}";
  758. string strRemainingTimeS = $"{(remainingTime % 60).ToString("f1").PadLeft(2, '0')}";
  759. recipeTime = $"{strRemainingTimeH}:{strRemainingTimeM}:{strRemainingTimeS}";
  760. return recipeTime;
  761. }
  762. private string CalHoldTime(double totalTime)
  763. {
  764. string holdTime = string.Empty;
  765. string strHoldTimeH = $"{((int)(totalTime / 3600)).ToString("f0").PadLeft(2, '0')}";
  766. string strHoldTimeM = $"{((int)(totalTime % 3600 / 60)).ToString("f0").PadLeft(2, '0')}";
  767. string strHoldTimeS = $"{(totalTime % 60).ToString("f1").PadLeft(2, '0')}";
  768. holdTime = $"{strHoldTimeH}:{strHoldTimeM}:{strHoldTimeS}";
  769. return holdTime;
  770. }
  771. private string _recipeProgress;
  772. public string RecipeProgress
  773. {
  774. get => _recipeProgress;
  775. set
  776. {
  777. _recipeProgress = value;
  778. NotifyOfPropertyChange(nameof(RecipeProgress));
  779. }
  780. }
  781. private int _recipeProgressValue;
  782. public int RecipeProgressValue
  783. {
  784. get => _recipeProgressValue;
  785. set
  786. {
  787. _recipeProgressValue = value;
  788. NotifyOfPropertyChange(nameof(RecipeProgressValue));
  789. }
  790. }
  791. #endregion
  792. #region Scheduler
  793. public bool IsRtInitialized
  794. {
  795. get
  796. {
  797. return RtStatus != "Init" && RtStatus != "Initializing";
  798. }
  799. }
  800. public bool IsRtRunning
  801. {
  802. get
  803. {
  804. return RtStatus != "Init" && RtStatus != "Idle" && RtStatus != "AutoIdle";
  805. }
  806. }
  807. public bool IsRtError
  808. {
  809. get
  810. {
  811. return RtStatus == "Error";
  812. }
  813. }
  814. public bool IsAuto
  815. {
  816. get { return RtStatus == "Auto_Running" || RtStatus == "Auto_Idle"; }
  817. }
  818. [Subscription("Rt.Status")]
  819. public string RtStatus { get; set; }
  820. public bool _isCycleMode;
  821. public Visibility IsCycleInfoVisibility
  822. {
  823. get { return _isCycleMode ? Visibility.Visible : Visibility.Collapsed; }
  824. }
  825. [Subscription("Scheduler.CycledCount")]
  826. public int CycledCount { get; set; }
  827. [Subscription("Scheduler.CycledWafer")]
  828. public int CycledWafer { get; set; }
  829. [Subscription("Scheduler.CycledTotalWafer")]
  830. public int TotalCycledWafer { get; set; }
  831. [Subscription("Scheduler.CycleSetPoint")]
  832. public int CycleSetPoint { get; set; }
  833. public string CycleCountDisplay
  834. {
  835. get { return (CycleSetPoint > 0 && (CycledCount > CycleSetPoint)) ? $"{CycledCount + 1}/{CycleSetPoint}" : $"{CycledCount}/{CycleSetPoint}"; }
  836. }
  837. [Subscription("Scheduler.ControlJobList")]
  838. public List<ControlJobInfo> LocalControlJobs
  839. {
  840. get;
  841. set;
  842. }
  843. [Subscription("Scheduler.ProcessJobList")]
  844. public List<ProcessJobInfo> LocalProcessJobs
  845. {
  846. get;
  847. set;
  848. }
  849. public string ControlJobStatus
  850. {
  851. get
  852. {
  853. if (LocalControlJobs == null || LocalControlJobs.Count == 0)
  854. return "";
  855. foreach (var cj in LocalControlJobs)
  856. {
  857. if (cj == null)
  858. continue;
  859. return cj.State.ToString();
  860. }
  861. return "";
  862. }
  863. }
  864. public string ProcessJob1ID
  865. {
  866. get
  867. {
  868. if (LocalProcessJobs == null || LocalProcessJobs.Count == 0)
  869. return "";
  870. var pj = LocalProcessJobs[0];
  871. return pj.Name;
  872. }
  873. }
  874. public string ProcessJob1StartTime
  875. {
  876. get
  877. {
  878. if (LocalProcessJobs == null || LocalProcessJobs.Count == 0)
  879. return "";
  880. var pj = LocalProcessJobs[0];
  881. return pj.BeginTime.ToString("yyyy-MM-dd HH:mm:ss");
  882. }
  883. }
  884. public string TotolProcessJob1EndTime
  885. {
  886. get
  887. {
  888. if (LocalProcessJobs == null || LocalProcessJobs.Count == 0)
  889. return "";
  890. var pj = LocalProcessJobs[0];
  891. var beginTime = pj.BeginTime;
  892. if (pj.BeginTime.Equals(DateTime.MinValue))
  893. {
  894. return "";
  895. }
  896. if (pj.ProcessingState == EnumProcessingState.CoolingBeforeDischarge && !firstCoolingTime.Equals(DateTime.MinValue))
  897. {
  898. return firstCoolingTime.AddSeconds(CoolingTime).ToString("yyyy-MM-dd HH:mm:ss");
  899. }
  900. else
  901. {
  902. if (!IsPM1Process && !IsPM1PostProcess)
  903. return "--";
  904. TimeSpan secondSpan = DateTime.Now - beginTime;
  905. var retime = beginTime.AddSeconds(CoolingTime + secondSpan.TotalSeconds + PM1RecipeTotalTime - PM1RecipeTotalElapseTime);
  906. return retime.ToString("yyyy-MM-dd HH:mm:ss");
  907. }
  908. }
  909. }
  910. public string ProcessJob1Status
  911. {
  912. get
  913. {
  914. if (LocalProcessJobs == null || LocalProcessJobs.Count == 0)
  915. return "";
  916. var pj = LocalProcessJobs[0];
  917. return pj.ProcessingState.ToString();
  918. }
  919. }
  920. public string TotolProcessJob2EndTime
  921. {
  922. get
  923. {
  924. if (LocalProcessJobs == null || LocalProcessJobs.Count <= 1)
  925. return "";
  926. var pj = LocalProcessJobs[1];
  927. var beginTime = pj.BeginTime;
  928. if (pj.BeginTime.Equals(DateTime.MinValue))
  929. {
  930. return "";
  931. }
  932. if (pj.ProcessingState == EnumProcessingState.CoolingBeforeDischarge && !firstCoolingTime.Equals(DateTime.MinValue))
  933. {
  934. return firstCoolingTime.AddSeconds(CoolingTime).ToString("yyyy-MM-dd HH:mm:ss");
  935. }
  936. else
  937. {
  938. if (!IsPM1Process && !IsPM1PostProcess)
  939. return "--";
  940. TimeSpan secondSpan = DateTime.Now - beginTime;
  941. var retime = beginTime.AddSeconds(CoolingTime + secondSpan.TotalSeconds + PM1RecipeTotalTime - PM1RecipeTotalElapseTime);
  942. return retime.ToString("yyyy-MM-dd HH:mm:ss");
  943. }
  944. }
  945. }
  946. public string ProcessJob2ID
  947. {
  948. get
  949. {
  950. if (LocalProcessJobs == null || LocalProcessJobs.Count <= 1)
  951. return "";
  952. var pj = LocalProcessJobs[1];
  953. return pj.Name;
  954. }
  955. }
  956. public string ProcessJob2StartTime
  957. {
  958. get
  959. {
  960. if (LocalProcessJobs == null || LocalProcessJobs.Count <= 1)
  961. return "";
  962. var pj = LocalProcessJobs[1];
  963. if (pj.BeginTime.Equals(DateTime.MinValue))
  964. {
  965. return "------";
  966. }
  967. return pj.BeginTime.ToString("yyyy-MM-dd HH:mm:ss");
  968. }
  969. }
  970. public string ProcessJob2Status
  971. {
  972. get
  973. {
  974. if (LocalProcessJobs == null || LocalProcessJobs.Count <= 1)
  975. return "";
  976. var pj = LocalProcessJobs[1];
  977. return pj.ProcessingState.ToString();
  978. }
  979. }
  980. #endregion
  981. #region Button Logic
  982. #endregion
  983. #region shutter
  984. [Subscription("AutoShutter.OpenCloseStatus")]
  985. public string AutoShutterOpenCloseStatus { get; set; }
  986. [Subscription("AutoShutter.UpDownStatus")]
  987. public string AutoShutterUpDownStatus { get; set; }
  988. public string AutoShutterStatus => $"{AutoShutterOpenCloseStatus}/{AutoShutterUpDownStatus}";
  989. #endregion
  990. #endregion
  991. public string DefaultUnit { get; set; }
  992. #region Gas
  993. [Subscription("PM1.MFCList")]
  994. public List<AITMfcData> MFCList { get; set; }
  995. #endregion
  996. [Subscription("CarrierRobot.Status")]
  997. public string CassetteRobotStatus { get; set; }
  998. private Visibility _isStocker1Visibility = Visibility.Collapsed;
  999. public Visibility IsStocker1Visibility
  1000. {
  1001. get { return _isStocker1Visibility; }
  1002. set { _isStocker1Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker1Visibility)); }
  1003. }
  1004. private Visibility _isStocker2Visibility = Visibility.Collapsed;
  1005. public Visibility IsStocker2Visibility
  1006. {
  1007. get { return _isStocker2Visibility; }
  1008. set { _isStocker2Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker2Visibility)); }
  1009. }
  1010. private Visibility _isStocker3Visibility = Visibility.Collapsed;
  1011. public Visibility IsStocker3Visibility
  1012. {
  1013. get { return _isStocker3Visibility; }
  1014. set { _isStocker3Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker3Visibility)); }
  1015. }
  1016. private Visibility _isStocker4Visibility = Visibility.Collapsed;
  1017. public Visibility IsStocker4Visibility
  1018. {
  1019. get { return _isStocker4Visibility; }
  1020. set { _isStocker4Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker4Visibility)); }
  1021. }
  1022. private Visibility _isStocker5Visibility = Visibility.Collapsed;
  1023. public Visibility IsStocker5Visibility
  1024. {
  1025. get { return _isStocker5Visibility; }
  1026. set { _isStocker5Visibility = value; this.NotifyOfPropertyChange(nameof(_isStocker5Visibility)); }
  1027. }
  1028. private Visibility _isStocker6Visibility = Visibility.Collapsed;
  1029. public Visibility IsStocker6Visibility
  1030. {
  1031. get { return _isStocker6Visibility; }
  1032. set { _isStocker6Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker6Visibility)); }
  1033. }
  1034. private Visibility _isStocker7Visibility = Visibility.Collapsed;
  1035. public Visibility IsStocker7Visibility
  1036. {
  1037. get { return _isStocker7Visibility; }
  1038. set { _isStocker7Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker7Visibility)); }
  1039. }
  1040. private Visibility _isStocker8Visibility = Visibility.Collapsed;
  1041. public Visibility IsStocker8Visibility
  1042. {
  1043. get { return _isStocker8Visibility; }
  1044. set { _isStocker8Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker8Visibility)); }
  1045. }
  1046. private Visibility _isStocker9Visibility = Visibility.Collapsed;
  1047. public Visibility IsStocker9Visibility
  1048. {
  1049. get { return _isStocker9Visibility; }
  1050. set { _isStocker9Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker9Visibility)); }
  1051. }
  1052. private Visibility _isStocker10Visibility = Visibility.Collapsed;
  1053. public Visibility IsStocker10Visibility
  1054. {
  1055. get { return _isStocker10Visibility; }
  1056. set { _isStocker10Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker10Visibility)); }
  1057. }
  1058. private Visibility _isStocker11Visibility = Visibility.Collapsed;
  1059. public Visibility IsStocker11Visibility
  1060. {
  1061. get { return _isStocker11Visibility; }
  1062. set { _isStocker11Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker11Visibility)); }
  1063. }
  1064. private Visibility _isStocker12Visibility = Visibility.Collapsed;
  1065. public Visibility IsStocker12Visibility
  1066. {
  1067. get { return _isStocker12Visibility; }
  1068. set { _isStocker12Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker12Visibility)); }
  1069. }
  1070. private Visibility _isStocker13Visibility = Visibility.Collapsed;
  1071. public Visibility IsStocker13Visibility
  1072. {
  1073. get { return _isStocker13Visibility; }
  1074. set { _isStocker13Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker13Visibility)); }
  1075. }
  1076. private Visibility _isStocker14Visibility = Visibility.Collapsed;
  1077. public Visibility IsStocker14Visibility
  1078. {
  1079. get { return _isStocker14Visibility; }
  1080. set { _isStocker14Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker14Visibility)); }
  1081. }
  1082. private Visibility _isStocker15Visibility = Visibility.Collapsed;
  1083. public Visibility IsStocker15Visibility
  1084. {
  1085. get { return _isStocker15Visibility; }
  1086. set { _isStocker15Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker15Visibility)); }
  1087. }
  1088. private Visibility _isStocker16Visibility = Visibility.Collapsed;
  1089. public Visibility IsStocker16Visibility
  1090. {
  1091. get { return _isStocker16Visibility; }
  1092. set { _isStocker16Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker16Visibility)); }
  1093. }
  1094. private Visibility _isStocker17Visibility = Visibility.Collapsed;
  1095. public Visibility IsStocker17Visibility
  1096. {
  1097. get { return _isStocker17Visibility; }
  1098. set { _isStocker17Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker17Visibility)); }
  1099. }
  1100. private Visibility _isStocker18Visibility = Visibility.Collapsed;
  1101. public Visibility IsStocker18Visibility
  1102. {
  1103. get { return _isStocker18Visibility; }
  1104. set { _isStocker18Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker18Visibility)); }
  1105. }
  1106. public Visibility IsStockerVisibility { get; set; }
  1107. public Visibility IsLPVisibility { get; set; }
  1108. [Subscription("PM1.APC.DeviceData")]
  1109. public AITAPCData APCData { get; set; }
  1110. [Subscription("PM1.ValveAV75.DeviceData")]
  1111. public AITValveData ValveAV75 { get; set; }
  1112. public int FIMS1WaferCount { get; set; } = 0;
  1113. public int FIMS2WaferCount { get; set; } = 0;
  1114. public int CarrierRobotWaferCount { get; set; } = 0;
  1115. public int WaferRobotWaferCount { get; set; } = 0;
  1116. public int PM1WaferCount { get; set; } = 0;
  1117. public string APCFeedbackView
  1118. {
  1119. get
  1120. {
  1121. if (ValveAV75 != null && ValveAV75.Feedback)
  1122. {
  1123. return APCData.Pressure1Feedback.ToString("F3");
  1124. }
  1125. return APCData.Pressure2Feedback.ToString("F1");
  1126. }
  1127. }
  1128. public Visibility APCPressureView
  1129. {
  1130. get
  1131. {
  1132. if (ValveAV75 != null && ValveAV75.Feedback)
  1133. {
  1134. return Visibility.Visible;
  1135. }
  1136. return Visibility.Collapsed;
  1137. }
  1138. }
  1139. public string WaferRobotAxleStatusPath
  1140. {
  1141. get
  1142. {
  1143. switch (WaferRobotStatus)
  1144. {
  1145. case "Homing":
  1146. case "Init":
  1147. return "/FurnaceUI;component/Resources/Images/Controls3/hg2y.png";
  1148. case "Idle":
  1149. case "InTransfer":
  1150. case "Loading":
  1151. case "Unloading":
  1152. case "Picking":
  1153. case "Placing":
  1154. return "/FurnaceUI;component/Resources/Images/Controls3/hg2g.png";
  1155. case "Error":
  1156. return "/FurnaceUI;component/Resources/Images/Controls3/hg2r.png";
  1157. default:
  1158. break;
  1159. }
  1160. return "/FurnaceUI;component/Resources/Images/Controls3/hg2g.png";
  1161. }
  1162. }
  1163. public string CassetteRobotAxleStatusPath
  1164. {
  1165. get
  1166. {
  1167. switch (CassetteRobotStatus)
  1168. {
  1169. case "Homing":
  1170. case "Init":
  1171. return "/FurnaceUI;component/Resources/Images/Controls3/hg1y.png";
  1172. case "Idle":
  1173. case "InTransfer":
  1174. case "Picking":
  1175. case "Placing":
  1176. return "/FurnaceUI;component/Resources/Images/Controls3/hg1g.png";
  1177. case "Error":
  1178. return "/FurnaceUI;component/Resources/Images/Controls3/hg1r.png";
  1179. default:
  1180. break;
  1181. }
  1182. return "/FurnaceUI;component/Resources/Images/Controls3/hg1g.png";
  1183. }
  1184. }
  1185. public StatusViewModel()
  1186. {
  1187. this.DisplayName = "MainStatusViewModel";
  1188. //ActiveUpdateData = true;
  1189. _stokcers = new List<ModuleName>()
  1190. {
  1191. ModuleName.Stocker1,
  1192. ModuleName.Stocker2,
  1193. ModuleName.Stocker3,
  1194. ModuleName.Stocker4,
  1195. ModuleName.Stocker5,
  1196. ModuleName.Stocker6,
  1197. ModuleName.Stocker7,
  1198. ModuleName.Stocker8,
  1199. ModuleName.Stocker9,
  1200. ModuleName.Stocker10,
  1201. ModuleName.Stocker11,
  1202. ModuleName.Stocker12,
  1203. ModuleName.Stocker13,
  1204. ModuleName.Stocker14,
  1205. ModuleName.Stocker15,
  1206. ModuleName.Stocker16,
  1207. ModuleName.Stocker17,
  1208. ModuleName.Stocker18,
  1209. };
  1210. StockerSlots = new ObservableCollection<string>()
  1211. {
  1212. "",
  1213. "",
  1214. "",
  1215. "",
  1216. "",
  1217. "",
  1218. "",
  1219. "",
  1220. "",
  1221. "",
  1222. "",
  1223. "",
  1224. "",
  1225. "",
  1226. "",
  1227. "",
  1228. "",
  1229. "",
  1230. "",
  1231. "",
  1232. "",
  1233. };
  1234. _stokcerWaferType = Enumerable.Repeat("", 21).ToList();
  1235. _eDUseWarningLimit = (int)QueryDataClient.Instance.Service.GetConfig("PM1.WaferCycleTime.EDCountWarning");
  1236. _eDUseAlarmLimit = (int)QueryDataClient.Instance.Service.GetConfig("PM1.WaferCycleTime.EDCountAlarm");
  1237. _stockerBackground = new List<SolidColorBrush>();
  1238. for (int i = 0; i < 21; i++)
  1239. {
  1240. _stockerBackground.Add(_WhiteFill);
  1241. }
  1242. }
  1243. protected override void OnInitialize()
  1244. {
  1245. base.OnInitialize();
  1246. base.InitFOUP();
  1247. base.InitLL();
  1248. base.InitTM();
  1249. base.InitEFEM();
  1250. base.InitPM();
  1251. base.InitBuffer();
  1252. }
  1253. protected override void OnActivate()
  1254. {
  1255. base.OnActivate();
  1256. DefaultUnit = (string)QueryDataClient.Instance.Service.GetConfig($"PM1.APC.PressureUnit");
  1257. _isCycleMode = (bool)QueryDataClient.Instance.Service.GetConfig("System.IsCycleMode");
  1258. _cassetteSlot = (int)QueryDataClient.Instance.Service.GetConfig("System.CassetteSlotCount");
  1259. for (int i = 0; i < _stokcers.Count; i++)
  1260. {
  1261. _stokcerWaferType[i] = (string)QueryDataClient.Instance.Service.GetConfig($"System.Stocker.{_stokcers[i]}WaferType");
  1262. }
  1263. IsStocker1Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker1Installed") ? Visibility.Visible : Visibility.Collapsed;
  1264. IsStocker2Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker2Installed") ? Visibility.Visible : Visibility.Collapsed;
  1265. IsStocker3Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker3Installed") ? Visibility.Visible : Visibility.Collapsed;
  1266. IsStocker4Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker4Installed") ? Visibility.Visible : Visibility.Collapsed;
  1267. IsStocker5Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker5Installed") ? Visibility.Visible : Visibility.Collapsed;
  1268. IsStocker6Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker6Installed") ? Visibility.Visible : Visibility.Collapsed;
  1269. IsStocker7Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker7Installed") ? Visibility.Visible : Visibility.Collapsed;
  1270. IsStocker8Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker8Installed") ? Visibility.Visible : Visibility.Collapsed;
  1271. IsStocker9Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker9Installed") ? Visibility.Visible : Visibility.Collapsed;
  1272. IsStocker10Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker10Installed") ? Visibility.Visible : Visibility.Collapsed;
  1273. IsStocker11Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker11Installed") ? Visibility.Visible : Visibility.Collapsed;
  1274. IsStocker12Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker12Installed") ? Visibility.Visible : Visibility.Collapsed;
  1275. IsStocker13Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker13Installed") ? Visibility.Visible : Visibility.Collapsed;
  1276. IsStocker14Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker14Installed") ? Visibility.Visible : Visibility.Collapsed;
  1277. IsStocker15Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker15Installed") ? Visibility.Visible : Visibility.Collapsed;
  1278. IsStocker16Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker16Installed") ? Visibility.Visible : Visibility.Collapsed;
  1279. IsStocker17Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker17Installed") ? Visibility.Visible : Visibility.Collapsed;
  1280. IsStocker18Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker18Installed") ? Visibility.Visible : Visibility.Collapsed;
  1281. }
  1282. protected override void OnViewLoaded(object view)
  1283. {
  1284. base.OnViewLoaded(view);
  1285. }
  1286. public List<AITMfcData> GasDataList
  1287. {
  1288. get
  1289. {
  1290. var _gasDataList = new List<AITMfcData>();
  1291. if (MFCList != null)
  1292. {
  1293. foreach (var item in MFCList)
  1294. {
  1295. if (item == null)
  1296. {
  1297. continue;
  1298. }
  1299. if (_isShowMFCBySetPoint)
  1300. {
  1301. if (item.SetPoint > 0)
  1302. {
  1303. _gasDataList.Add(item);
  1304. }
  1305. }
  1306. else
  1307. {
  1308. _gasDataList.Add(item);
  1309. }
  1310. }
  1311. }
  1312. return _gasDataList;
  1313. }
  1314. }
  1315. public void Start()
  1316. {
  1317. InvokeClient.Instance.Service.DoOperation("System.StartAutoRun");
  1318. }
  1319. public void Stop()
  1320. {
  1321. //InvokeClient.Instance.Service.DoOperation("System.StartAutoRun");
  1322. }
  1323. public void SwitchPage(string page)
  1324. {
  1325. var wm = IoC.Get<IWindowManager>();
  1326. switch (page)
  1327. {
  1328. case "Stocker":
  1329. ClientApp.Instance.SwitchPage("status", "stocker", null);
  1330. break;
  1331. case "TransferMain":
  1332. ClientApp.Instance.SwitchPage("status", "TransferMain", null);
  1333. break;
  1334. case "N2Purge":
  1335. ClientApp.Instance.SwitchPage("status", "N2PurgeStatus", null);
  1336. break;
  1337. case "Gas":
  1338. {
  1339. ClientApp.Instance.SwitchPage("status", "Gas", null);
  1340. //CGlobal.BoatWaferEditViewEnable = false;
  1341. ////var wm = IoC.Get<IWindowManager>();
  1342. //GasDetailViewModel gasDetailViewModel = new GasDetailViewModel();
  1343. //(wm as WindowManager)?.ShowDialogWithTitle(gasDetailViewModel, null, "Gas Detail");
  1344. }
  1345. break;
  1346. case "Temp":
  1347. ClientApp.Instance.SwitchPage("status", "temp", null);
  1348. break;
  1349. case "Pressure":
  1350. {
  1351. ClientApp.Instance.SwitchPage("status", "Pressure", null);
  1352. // var wm = IoC.Get<IWindowManager>();
  1353. //var viewPressureDetail = new PressureDetailViewModel();
  1354. //(wm as WindowManager)?.ShowDialogWithTitle(viewPressureDetail, null, "Pressure Detail");
  1355. }
  1356. break;
  1357. case "MainRecipe":
  1358. if (!string.IsNullOrEmpty(PM1MainRecipeName))
  1359. {
  1360. CGlobal.RecipeProcessEditViewEnable = false;
  1361. MECF.Framework.UI.Client.CenterViews.Editors.Recipe.CGlobal.RecipeProcessEditViewEnable = false;
  1362. // var wm = IoC.Get<IWindowManager>();
  1363. var viewProcessRecipeRecipeType = "Process";
  1364. var recipeName = PM1MainRecipeName;
  1365. if (PM1ExecRecipeType.Equals("Sub"))
  1366. {
  1367. recipeName = ProcessSubRecipe;
  1368. }
  1369. else
  1370. {
  1371. recipeName = PM1MainRecipeName;
  1372. }
  1373. if (PM1ExecRecipeType.Equals("Process") || PM1ExecRecipeType.Equals("Abort"))
  1374. {
  1375. viewProcessRecipeRecipeType = PM1ExecRecipeType;
  1376. }
  1377. else
  1378. {
  1379. viewProcessRecipeRecipeType = PM1ExecRecipeType.ToLower();
  1380. }
  1381. var viewProcessRecipe = new RecipeProcessEditViewModel($"Furnace\\{viewProcessRecipeRecipeType}", recipeName);
  1382. viewProcessRecipe.RecipeType = viewProcessRecipeRecipeType;
  1383. viewProcessRecipe.IndexNoDefault = PM1RecipeStepNumber;
  1384. viewProcessRecipe.SelectedStepName = PM1RecipeStepName;
  1385. (wm as WindowManager)?.ShowDialogWithTitle(viewProcessRecipe, null, $"View {viewProcessRecipeRecipeType} Recpie");
  1386. }
  1387. break;
  1388. case "PMCommand":
  1389. //if (!string.IsNullOrEmpty(PM1MainRecipeName))
  1390. //{
  1391. // var wm = IoC.Get<IWindowManager>();
  1392. var viewPMCommand = new PMCommandViewModel();
  1393. (wm as WindowManager)?.ShowDialogWithTitle(viewPMCommand, null, "PM Command");
  1394. //}
  1395. break;
  1396. case "LayoutRecipe":
  1397. {
  1398. CGlobal.BoatWaferEditViewEnable = false;
  1399. // var wm = IoC.Get<IWindowManager>();
  1400. var viewLayoutRecipe = new BoatWaferNoActionViewModel();
  1401. (wm as WindowManager)?.ShowDialogWithTitle(viewLayoutRecipe, null, "View Boat Wafer");
  1402. }
  1403. break;
  1404. case "Boat Elevator":
  1405. {
  1406. BoatElevatorParametersViewModel boatElevatorParametersViewModel = new BoatElevatorParametersViewModel();
  1407. (wm as WindowManager)?.ShowDialogWithTitle(boatElevatorParametersViewModel, null, "Boat Elevator Parameter Settings");
  1408. }
  1409. break;
  1410. case "CJStatus":
  1411. {
  1412. ClientApp.Instance.SwitchPage("status", "job", null);
  1413. //ControlJobStatusViewModel controlJobStatusViewModel = new ControlJobStatusViewModel();
  1414. //(wm as WindowManager)?.ShowDialogWithTitle(controlJobStatusViewModel, null, "CJ Status");
  1415. }
  1416. break;
  1417. case "PJStatus":
  1418. {
  1419. ProcessJobWithDrawingViewModel processJobWithDrawingViewModel = new ProcessJobWithDrawingViewModel();
  1420. (wm as WindowManager)?.ShowDialogWithTitle(processJobWithDrawingViewModel, null, "PJ Status");
  1421. }
  1422. break;
  1423. case "LoadPortState":
  1424. {
  1425. LoadPortStateViewModel loadPortStateViewModel = new LoadPortStateViewModel();
  1426. (wm as WindowManager)?.ShowDialogWithTitle(loadPortStateViewModel, null, "Load Port State");
  1427. }
  1428. break;
  1429. case "CarrierState":
  1430. {
  1431. CarrierStateViewModel carrierStateViewModel = new CarrierStateViewModel();
  1432. (wm as WindowManager)?.ShowDialogWithTitle(carrierStateViewModel, null, "Carrier State");
  1433. }
  1434. break;
  1435. case "Equipment Status":
  1436. {
  1437. EquipmentStatusViewModel equipmentStatusViewModel = new EquipmentStatusViewModel();
  1438. (wm as WindowManager)?.ShowDialogWithTitle(equipmentStatusViewModel, null, "Equipment Operation State");
  1439. }
  1440. break;
  1441. case "Load Unload State":
  1442. {
  1443. LoadUnloadStateViewModel loadUnloadStateViewModel = new LoadUnloadStateViewModel();
  1444. (wm as WindowManager)?.ShowDialogWithTitle(loadUnloadStateViewModel, null, "Load Unload State");
  1445. }
  1446. break;
  1447. case "Boat Detail":
  1448. {
  1449. BoatWaferViewModel boatWaferViewModel = new BoatWaferViewModel();
  1450. (wm as WindowManager)?.ShowDialogWithTitle(boatWaferViewModel, null, "Boat Detail");
  1451. }
  1452. break;
  1453. }
  1454. }
  1455. string[] moduleNames = new string[] { "Stocker1", "Stocker2", "Stocker3", "Stocker4", "Stocker5", "Stocker6", "Stocker7", "Stocker8", "Stocker9",
  1456. "Stocker10","Stocker11","Stocker12","Stocker13","Stocker14","Stocker15","Stocker16","Stocker17","Stocker18",
  1457. "FIMS1","FIMS2","CarrierRobot","WaferRobot","PM1"};
  1458. //string[] moduleNames = new string[] { "Stocker1", "Stocker2", "Stocker3", "Stocker4", "Stocker5", "Stocker6", "Stocker7", "Stocker8", "Stocker9",
  1459. // "Stocker10","Stocker11","Stocker12","Stocker13","Stocker14","Stocker15","Stocker16","Stocker17","Stocker18"};
  1460. protected override void InvokeBeforeUpdateProperty(Dictionary<string, object> data)
  1461. {
  1462. base.InvokeBeforeUpdateProperty(data);
  1463. _isShowMFCBySetPoint = (bool)QueryDataClient.Instance.Service.GetConfig($"System.ShowMFCBySetPoint");
  1464. }
  1465. protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
  1466. {
  1467. UpdateStockerSlots();
  1468. UpdateRecipeProgress();
  1469. var isLoadPortPosition = (string)QueryDataClient.Instance.Service.GetConfig("LoadPort.LoadPortPosition");
  1470. if (isLoadPortPosition == "Upper")
  1471. {
  1472. IsStockerVisibility = Visibility.Hidden;
  1473. IsLPVisibility = Visibility.Visible;
  1474. }
  1475. else
  1476. {
  1477. IsStockerVisibility = Visibility.Visible;
  1478. IsLPVisibility = Visibility.Hidden;
  1479. }
  1480. foreach (var item in moduleNames)
  1481. {
  1482. if (ModuleManager.ModuleInfos.ContainsKey(item))
  1483. {
  1484. this.GetType().GetProperty($"{item}WaferCount").SetValue(this, ModuleManager.ModuleInfos[item].WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count());
  1485. }
  1486. }
  1487. NotifyOfPropertyChange("IsStocker1Visibility");
  1488. }
  1489. private void UpdateStockerSlots()
  1490. {
  1491. for (int i = 0; i < _stokcers.Count; i++)
  1492. {
  1493. bool bHaveAbort = false;
  1494. var wafers = ModuleManager.ModuleInfos[_stokcers[i].ToString()].WaferManager.Wafers;
  1495. int waferNumber = 0;
  1496. string waferType = "";
  1497. SolidColorBrush _tempFill = _SD_ED_M_Fill;
  1498. if (wafers != null)
  1499. {
  1500. foreach (var wafer in wafers)
  1501. {
  1502. if (wafer.WaferStatus != 0)
  1503. {
  1504. waferNumber++;
  1505. waferType = wafer.WaferType.ToString();
  1506. if (wafer.WaferStatus == 5) // EnumWaferProcessStatus.Failed
  1507. bHaveAbort = true;
  1508. if (wafer.UseCount >= _eDUseWarningLimit)
  1509. {
  1510. _tempFill = _waringFill;
  1511. }
  1512. if (wafer.UseCount >= _eDUseAlarmLimit)
  1513. {
  1514. _tempFill = _alarmFill;
  1515. }
  1516. }
  1517. }
  1518. }
  1519. StockerSlots[i] = $"{_stokcerWaferType[i]}-{waferNumber}/{_cassetteSlot}";
  1520. if (_stokcerWaferType[i].Contains("P"))
  1521. {
  1522. if (waferNumber > 0)
  1523. {
  1524. if (bHaveAbort)
  1525. StockerBackground[i] = _redBk;
  1526. else
  1527. StockerBackground[i] = _productionFill;
  1528. }
  1529. else
  1530. {
  1531. StockerBackground[i] = _WhiteFill;
  1532. }
  1533. }
  1534. else
  1535. {
  1536. if (waferNumber > 0)
  1537. {
  1538. if (bHaveAbort)
  1539. StockerBackground[i] = _redBk;
  1540. else
  1541. {
  1542. StockerBackground[i] = _tempFill;
  1543. }
  1544. }
  1545. else
  1546. {
  1547. StockerBackground[i] = _WhiteFill;
  1548. }
  1549. }
  1550. }
  1551. }
  1552. private void UpdateRecipeProgress()
  1553. {
  1554. if (!IsPM1Process && !IsPM1PostProcess)
  1555. {
  1556. RecipeProgress = "";
  1557. RecipeProgressValue = 0;
  1558. return;
  1559. }
  1560. if (PM1RecipeTotalTime == 0)
  1561. {
  1562. RecipeProgress = "";
  1563. RecipeProgressValue = 0;
  1564. }
  1565. else
  1566. {
  1567. double totalTime = PM1RecipeTotalTime;
  1568. double elapseTime = PM1RecipeTotalElapseTime;
  1569. float percentage = (float)(elapseTime / totalTime * 100);
  1570. percentage = percentage > 100 ? 100 : percentage;
  1571. RecipeProgress = $"{percentage.ToString("f1")}%";
  1572. RecipeProgressValue = (int)(elapseTime / totalTime * 100);
  1573. }
  1574. }
  1575. public void CanvasMouseLeftButtonDown(object sender)
  1576. {
  1577. }
  1578. public Dictionary<string, StationPosition> StationPosition
  1579. {
  1580. get
  1581. {
  1582. return new Dictionary<string, StationPosition>()
  1583. {
  1584. { "ArmA.System", new StationPosition() {
  1585. StartPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }
  1586. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}}
  1587. ,{ "Robot", new StationPosition() {
  1588. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 180, Hand = 180 }
  1589. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}}
  1590. ,{"ArmA.Stocker1", new StationPosition() {
  1591. StartPosition = new RobotPosition() { X=-150, Root = 0, Arm = 180, Hand = 180 }
  1592. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  1593. ,{ "ArmA.Stocker2", new StationPosition() {
  1594. StartPosition = new RobotPosition() { X=-150, Root = 0, Arm = 180, Hand = 180 }
  1595. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1596. ,{ "ArmA.Stocker3", new StationPosition() {
  1597. StartPosition = new RobotPosition() { X=-150, Root = 0, Arm = 180, Hand = 180 }
  1598. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1599. ,{ "ArmA.Stocker4", new StationPosition() {
  1600. StartPosition = new RobotPosition() { X=-150, Root = 0, Arm = 180, Hand = 180 }
  1601. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1602. ,{"ArmA.Stocker5", new StationPosition(){
  1603. StartPosition = new RobotPosition() { X=-240, Root = 0, Arm = 180, Hand = 180 }
  1604. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  1605. ,{"ArmA.Stocker6", new StationPosition(){
  1606. StartPosition = new RobotPosition() { X=-240, Root = 0, Arm = 180, Hand = 180 }
  1607. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1608. ,{"ArmA.Stocker7", new StationPosition(){
  1609. StartPosition = new RobotPosition() { X=-240, Root = 0, Arm = 180, Hand = 180 }
  1610. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1611. ,{"ArmA.Stocker8", new StationPosition(){
  1612. StartPosition = new RobotPosition() { X=-240, Root = 0, Arm = 180, Hand = 180 }
  1613. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1614. ,{ "ArmA.Stocker9", new StationPosition() {
  1615. StartPosition = new RobotPosition() { X=-325, Root = 0, Arm = 180, Hand = 180 }
  1616. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  1617. ,{ "ArmA.Stocker10", new StationPosition() {
  1618. StartPosition = new RobotPosition() { X=-325, Root = 0, Arm = 180, Hand = 180 }
  1619. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1620. ,{ "ArmA.Stocker11", new StationPosition() {
  1621. StartPosition = new RobotPosition() { X=-325, Root = 0, Arm = 180, Hand = 180 }
  1622. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }} }
  1623. ,{"ArmA.Stocker12", new StationPosition(){
  1624. StartPosition = new RobotPosition() { X =-325, Root = 0, Arm = 180, Hand = 180 }
  1625. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1626. ,{ "ArmA.Stocker13", new StationPosition() {
  1627. StartPosition = new RobotPosition() { X=-415, Root = 0, Arm = 180, Hand = 180 }
  1628. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  1629. ,{ "ArmA.Stocker14", new StationPosition() {
  1630. StartPosition = new RobotPosition() { X=-415, Root = 0, Arm = 180, Hand = 180 }
  1631. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1632. ,{ "ArmA.Stocker15", new StationPosition() {
  1633. StartPosition = new RobotPosition() { X=-415, Root = 0, Arm = 180, Hand = 180 }
  1634. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1635. ,{ "ArmA.Stocker16", new StationPosition() {
  1636. StartPosition = new RobotPosition() { X=-415, Root = 0, Arm = 180, Hand = 180 }
  1637. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1638. ,{"ArmA.Stocker17", new StationPosition(){
  1639. StartPosition = new RobotPosition() { X = -250, Root = 180, Arm = 180, Hand = 180 }
  1640. ,EndPosition = new RobotPosition() { Root = 180, Arm = -20, Hand = 0 }}}
  1641. ,{"ArmA.Stocker18", new StationPosition(){
  1642. StartPosition = new RobotPosition() { X = -250, Root = 180, Arm = 180, Hand = 180 }
  1643. ,EndPosition = new RobotPosition() { Root = 180, Arm = 23, Hand = 0 }}}
  1644. ,{"ArmA.FIMS1", new StationPosition(){
  1645. StartPosition = new RobotPosition() { X = 35, Root = 0, Arm = 180, Hand = 180 }
  1646. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1647. ,{"ArmA.FIMS2", new StationPosition(){
  1648. StartPosition = new RobotPosition() { X = -95, Root = 0, Arm = 180, Hand = 180 }
  1649. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1650. ,{"ArmA.LP1", new StationPosition(){
  1651. StartPosition = new RobotPosition() { X = -90, Root = 180, Arm = 180, Hand = 180 }
  1652. ,EndPosition = new RobotPosition() { Root = 180, Arm = -20, Hand = 0 }}}
  1653. ,{"ArmA.LP2", new StationPosition(){
  1654. StartPosition = new RobotPosition() { X = -90, Root = 180, Arm = 180, Hand = 180 }
  1655. ,EndPosition = new RobotPosition() { Root = 180, Arm = 23, Hand = 0 }}}
  1656. ,{"ArmA.LP3", new StationPosition(){
  1657. StartPosition = new RobotPosition() { X = -365, Root = 180, Arm = 180, Hand = 180 }
  1658. ,EndPosition = new RobotPosition() { Root = 180, Arm = -20, Hand = 0 }}}
  1659. ,{"ArmA.LP4", new StationPosition(){
  1660. StartPosition = new RobotPosition() { X = -365, Root = 180, Arm = 180, Hand = 180 }
  1661. ,EndPosition = new RobotPosition() { Root = 180, Arm = 23, Hand = 0 }}}
  1662. };
  1663. }
  1664. }
  1665. public Dictionary<string, StationPosition> StationPosition2
  1666. {
  1667. get
  1668. {
  1669. return new Dictionary<string, StationPosition>()
  1670. {
  1671. { "ArmA.System", new StationPosition() {
  1672. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 180, Hand = 180 }
  1673. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}
  1674. }
  1675. ,{ "Robot", new StationPosition() {
  1676. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 180, Hand = 180 }
  1677. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}
  1678. }
  1679. ,{ "ArmA.FIMS1", new StationPosition() {
  1680. StartPosition = new RobotPosition() { X=-20, Root = 180, Arm = 180, Hand = 180 }
  1681. ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }}
  1682. }
  1683. ,{ "ArmA.FIMS2", new StationPosition() {
  1684. StartPosition = new RobotPosition() { X=-168, Root = 180, Arm = 180, Hand = 180 }
  1685. ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }}
  1686. }
  1687. ,{ "ArmA.PM1", new StationPosition() {
  1688. StartPosition = new RobotPosition() { X=-50, Root = 0, Arm = 180, Hand = 180 }
  1689. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  1690. }
  1691. };
  1692. }
  1693. }
  1694. public Dictionary<string, StationPosition> StationPosition3
  1695. {
  1696. get
  1697. {
  1698. return new Dictionary<string, StationPosition>()
  1699. {
  1700. { "HomePosition", new StationPosition() {
  1701. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 0, Hand = 0 }
  1702. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  1703. },
  1704. { "Position1", new StationPosition() {
  1705. StartPosition = new RobotPosition() { X=-50, Root = 0, Arm = 0, Hand = 0 }
  1706. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  1707. },
  1708. { "Position2", new StationPosition() {
  1709. StartPosition = new RobotPosition() { X=-100, Root = 0, Arm = 0, Hand = 0 }
  1710. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  1711. },
  1712. { "ProcessPosition", new StationPosition() {
  1713. StartPosition = new RobotPosition() { X=-280, Root = 0, Arm = 0, Hand = 0 }
  1714. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  1715. }
  1716. };
  1717. }
  1718. }
  1719. public void PopupPage(string page)
  1720. {
  1721. //var windowManager = IoC.Get<IWindowManager>();
  1722. var windowManager = new WindowManager();
  1723. switch (page)
  1724. {
  1725. case "PortStatus":
  1726. //LoadIOPortViewModel portStatusViewModel = new LoadIOPortViewModel();
  1727. //(windowManager as WindowManager)?.ShowDialogWithTitle(portStatusViewModel, null, "Port Status");
  1728. break;
  1729. case "JobStatus":
  1730. JOBStatusViewModel vm = new JOBStatusViewModel();
  1731. //bool? ret = windowManager.ShowDialog(vm);
  1732. (windowManager as WindowManager)?.ShowDialogWithTitle(vm, null, "Job Status View");
  1733. break;
  1734. default:
  1735. break;
  1736. }
  1737. }
  1738. public void StandbyFactor()
  1739. {
  1740. //if (!string.IsNullOrEmpty(PM1MainRecipeName))
  1741. {
  1742. var windowManager = IoC.Get<IWindowManager>();
  1743. StandbyFactorViewModel standbyFactorViewModel = new StandbyFactorViewModel();
  1744. standbyFactorViewModel.MainRecipeName = PM1MainRecipeName;
  1745. (windowManager as WindowManager)?.ShowDialogWithTitle(standbyFactorViewModel, null, "Standby Factor View");
  1746. }
  1747. }
  1748. public void Skip()
  1749. {
  1750. if (!DialogBox.Confirm("Ara you sure to skip current step?"))
  1751. return;
  1752. InvokeClient.Instance.Service.DoOperation($"PM1.RecipeSkipStep", "");
  1753. }
  1754. public void Jump()
  1755. {
  1756. //if (!DialogBox.Confirm("Ara you sure to jump current step?"))
  1757. // return;
  1758. //var recipes = new RecipeDataBase();
  1759. //recipes.PrefixPath = "Furnace\\Process";
  1760. //recipes.Name = PM1MainRecipeName;
  1761. //RecipeProvider _recipeProvider = new RecipeProvider();
  1762. //recipes.Clear();
  1763. //var recipeContent = _recipeProvider.LoadRecipe(recipes.PrefixPath, recipes.Name);
  1764. //if (string.IsNullOrEmpty(recipeContent))
  1765. //{
  1766. // MessageBox.Show($"{recipes.PrefixPath}\\{recipes.Name} is empty, please confirm the file is valid.");
  1767. // return;
  1768. //}
  1769. //recipes.RecipeChamberType = "OriginChamber";
  1770. //recipes.InitData(recipes.PrefixPath, recipes.Name, recipeContent, "PM1");
  1771. //var windowManager = IoC.Get<IWindowManager>();
  1772. //RecipeLoopSetViewModel recipeLoopSetViewModel = new RecipeLoopSetViewModel();
  1773. //recipeLoopSetViewModel.StepNames = new ObservableCollection<string>(recipes.Steps.OrderBy(x => x.StepNo).Where(x => x.StepNo != PM1RecipeStepNumber).Select(x => x.Name).ToList());
  1774. //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeLoopSetViewModel, null, "Jump"))
  1775. //{
  1776. // InvokeClient.Instance.Service.DoOperation($"PM1.RecipeJumpStep", recipeLoopSetViewModel.SelectedIndex);
  1777. //}
  1778. }
  1779. public void Hold()
  1780. {
  1781. if (HoldName == "Hold")
  1782. {
  1783. if (!DialogBox.Confirm("Ara you sure to hold current recipe?"))
  1784. return;
  1785. InvokeClient.Instance.Service.DoOperation($"PM1.RecipePause", "");
  1786. }
  1787. else
  1788. {
  1789. InvokeClient.Instance.Service.DoOperation($"PM1.RecipeContinue", "");
  1790. }
  1791. }
  1792. public void EmergencyAbort()
  1793. {
  1794. if (!DialogBox.Confirm("Ara you sure to execute EmergencyAbort?"))
  1795. return;
  1796. InvokeClient.Instance.Service.DoOperation("PM1.Abort");
  1797. }
  1798. private string CalEndTime(DateTime beginTime, double totalTime, double totalElapseTime)
  1799. {
  1800. TimeSpan secondSpan = DateTime.Now - beginTime;
  1801. return beginTime.AddSeconds(secondSpan.TotalSeconds + totalTime - totalElapseTime).ToString("yyyy-MM-dd HH:mm:ss");
  1802. }
  1803. }
  1804. }