StatusViewModel.cs 80 KB

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