StatusViewModel.cs 81 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091
  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.N2PurgeLimitData")]
  38. public float N2PurgeLimitData { 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. if (PM1IsExecuteSubRecipe && !string.IsNullOrEmpty(ProcessSubRecipe))
  724. {
  725. return Path.GetFileName(ProcessSubRecipe);
  726. }
  727. //return PM1SelectedRecipeName.Substring("Furnace\\Process\\".Length);
  728. return Path.GetFileName(PM1SelectedRecipeName);
  729. }
  730. }
  731. [Subscription("PM1.IsOnline")]
  732. public bool PM1IsOnline { get; set; }
  733. public bool PM1IsOffline
  734. {
  735. get { return !PM1IsOnline; }
  736. }
  737. public bool IsEnableEmergencyAbort
  738. {
  739. get
  740. {
  741. return PM1Status != "Init" && PM1Status != "Idle";
  742. }
  743. }
  744. private string CalStepTime(double elapseTime, double totalTime)
  745. {
  746. string stepTime = string.Empty;
  747. double remainingTime = totalTime - elapseTime;
  748. if (remainingTime < 0)
  749. remainingTime = 0;
  750. string strElapseTimeH = $"{(elapseTime / 3600).ToString().PadLeft(2, '0')}";
  751. string strElapseTimeM = $"{(elapseTime % 3600 / 60).ToString().PadLeft(2, '0')}";
  752. string strElapseTimeS = $"{(elapseTime % 60).ToString().PadLeft(2, '0')}";
  753. string strRemainingTimeH = $"{((int)(remainingTime / 3600)).ToString("f0").PadLeft(2, '0')}";
  754. string strRemainingTimeM = $"{((int)(remainingTime % 3600 / 60)).ToString("f0").PadLeft(2, '0')}";
  755. string strRemainingTimeS = $"{(remainingTime % 60).ToString("f1").PadLeft(2, '0')}";
  756. stepTime = $"{strRemainingTimeH}:{strRemainingTimeM}:{strRemainingTimeS}";
  757. return stepTime;
  758. }
  759. private string CalRecipeTime(double elapseTime, double totalTime)
  760. {
  761. string recipeTime = string.Empty;
  762. double remainingTime = totalTime - elapseTime;
  763. if (remainingTime < 0)
  764. remainingTime = 0;
  765. string strElapseTimeH = $"{(elapseTime / 3600).ToString("f0").PadLeft(2, '0')}";
  766. string strElapseTimeM = $"{(elapseTime % 3600 / 60).ToString("f0").PadLeft(2, '0')}";
  767. string strElapseTimeS = $"{(elapseTime % 60).ToString("f0").PadLeft(2, '0')}";
  768. string strRemainingTimeH = $"{((int)(remainingTime / 3600)).ToString("f0").PadLeft(2, '0')}";
  769. string strRemainingTimeM = $"{((int)(remainingTime % 3600 / 60)).ToString("f0").PadLeft(2, '0')}";
  770. string strRemainingTimeS = $"{(remainingTime % 60).ToString("f1").PadLeft(2, '0')}";
  771. recipeTime = $"{strRemainingTimeH}:{strRemainingTimeM}:{strRemainingTimeS}";
  772. return recipeTime;
  773. }
  774. private string CalHoldTime(double totalTime)
  775. {
  776. string holdTime = string.Empty;
  777. string strHoldTimeH = $"{((int)(totalTime / 3600)).ToString("f0").PadLeft(2, '0')}";
  778. string strHoldTimeM = $"{((int)(totalTime % 3600 / 60)).ToString("f0").PadLeft(2, '0')}";
  779. string strHoldTimeS = $"{(totalTime % 60).ToString("f1").PadLeft(2, '0')}";
  780. holdTime = $"{strHoldTimeH}:{strHoldTimeM}:{strHoldTimeS}";
  781. return holdTime;
  782. }
  783. private string _recipeProgress;
  784. public string RecipeProgress
  785. {
  786. get => _recipeProgress;
  787. set
  788. {
  789. _recipeProgress = value;
  790. NotifyOfPropertyChange(nameof(RecipeProgress));
  791. }
  792. }
  793. private int _recipeProgressValue;
  794. public int RecipeProgressValue
  795. {
  796. get => _recipeProgressValue;
  797. set
  798. {
  799. _recipeProgressValue = value;
  800. NotifyOfPropertyChange(nameof(RecipeProgressValue));
  801. }
  802. }
  803. #endregion
  804. #region Scheduler
  805. public bool IsRtInitialized
  806. {
  807. get
  808. {
  809. return RtStatus != "Init" && RtStatus != "Initializing";
  810. }
  811. }
  812. public bool IsRtRunning
  813. {
  814. get
  815. {
  816. return RtStatus != "Init" && RtStatus != "Idle" && RtStatus != "AutoIdle";
  817. }
  818. }
  819. public bool IsRtError
  820. {
  821. get
  822. {
  823. return RtStatus == "Error";
  824. }
  825. }
  826. public bool IsAuto
  827. {
  828. get { return RtStatus == "Auto_Running" || RtStatus == "Auto_Idle"; }
  829. }
  830. [Subscription("Rt.Status")]
  831. public string RtStatus { get; set; }
  832. public bool _isCycleMode;
  833. public Visibility IsCycleInfoVisibility
  834. {
  835. get { return _isCycleMode ? Visibility.Visible : Visibility.Collapsed; }
  836. }
  837. [Subscription("Scheduler.CycledCount")]
  838. public int CycledCount { get; set; }
  839. [Subscription("Scheduler.CycledWafer")]
  840. public int CycledWafer { get; set; }
  841. [Subscription("Scheduler.CycledTotalWafer")]
  842. public int TotalCycledWafer { get; set; }
  843. [Subscription("Scheduler.CycleSetPoint")]
  844. public int CycleSetPoint { get; set; }
  845. public string CycleCountDisplay
  846. {
  847. get { return (CycleSetPoint > 0 && (CycledCount > CycleSetPoint)) ? $"{CycledCount + 1}/{CycleSetPoint}" : $"{CycledCount}/{CycleSetPoint}"; }
  848. }
  849. [Subscription("Scheduler.ControlJobList")]
  850. public List<ControlJobInfo> LocalControlJobs
  851. {
  852. get;
  853. set;
  854. }
  855. [Subscription("Scheduler.ProcessJobList")]
  856. public List<ProcessJobInfo> LocalProcessJobs
  857. {
  858. get;
  859. set;
  860. }
  861. public string ControlJobStatus
  862. {
  863. get
  864. {
  865. if (LocalControlJobs == null || LocalControlJobs.Count == 0)
  866. return "";
  867. foreach (var cj in LocalControlJobs)
  868. {
  869. if (cj == null)
  870. continue;
  871. return cj.State.ToString();
  872. }
  873. return "";
  874. }
  875. }
  876. public string ControlJob1ID
  877. {
  878. get
  879. {
  880. if (LocalControlJobs == null || LocalControlJobs.Count == 0)
  881. return "";
  882. var cj = LocalControlJobs[0];
  883. return cj.Name;
  884. }
  885. }
  886. public string ControlJob2ID
  887. {
  888. get
  889. {
  890. if (LocalControlJobs == null || LocalControlJobs.Count <= 1)
  891. return "";
  892. var cj = LocalControlJobs[1];
  893. return cj.Name;
  894. }
  895. }
  896. public string ProcessJob1ID
  897. {
  898. get
  899. {
  900. if (LocalProcessJobs == null || LocalProcessJobs.Count == 0)
  901. return "";
  902. var pj = LocalProcessJobs[0];
  903. return pj.Name;
  904. }
  905. }
  906. public string ProcessJob1StartTime
  907. {
  908. get
  909. {
  910. if (LocalProcessJobs == null || LocalProcessJobs.Count == 0)
  911. return "";
  912. var pj = LocalProcessJobs[0];
  913. return pj.BeginTime.ToString("yyyy-MM-dd HH:mm:ss");
  914. }
  915. }
  916. public string TotolProcessJob1EndTime
  917. {
  918. get
  919. {
  920. if (LocalProcessJobs == null || LocalProcessJobs.Count == 0)
  921. return "";
  922. var pj = LocalProcessJobs[0];
  923. var beginTime = pj.BeginTime;
  924. if (pj.BeginTime.Equals(DateTime.MinValue))
  925. {
  926. return "";
  927. }
  928. if (pj.ProcessingState == EnumProcessingState.CoolingBeforeDischarge && !firstCoolingTime.Equals(DateTime.MinValue))
  929. {
  930. return firstCoolingTime.AddSeconds(CoolingTime).ToString("yyyy-MM-dd HH:mm:ss");
  931. }
  932. else
  933. {
  934. if (!IsPM1Process && !IsPM1PostProcess)
  935. return "--";
  936. TimeSpan secondSpan = DateTime.Now - beginTime;
  937. var retime = beginTime.AddSeconds(CoolingTime + secondSpan.TotalSeconds + PM1RecipeTotalTime - PM1RecipeTotalElapseTime);
  938. return retime.ToString("yyyy-MM-dd HH:mm:ss");
  939. }
  940. }
  941. }
  942. public string ProcessJob1Status
  943. {
  944. get
  945. {
  946. if (LocalProcessJobs == null || LocalProcessJobs.Count == 0)
  947. return "";
  948. var pj = LocalProcessJobs[0];
  949. return pj.ProcessingState.ToString();
  950. }
  951. }
  952. public string TotolProcessJob2EndTime
  953. {
  954. get
  955. {
  956. if (LocalProcessJobs == null || LocalProcessJobs.Count <= 1)
  957. return "";
  958. var pj = LocalProcessJobs[1];
  959. var beginTime = pj.BeginTime;
  960. if (pj.BeginTime.Equals(DateTime.MinValue))
  961. {
  962. return "";
  963. }
  964. if (pj.ProcessingState == EnumProcessingState.CoolingBeforeDischarge && !firstCoolingTime.Equals(DateTime.MinValue))
  965. {
  966. return firstCoolingTime.AddSeconds(CoolingTime).ToString("yyyy-MM-dd HH:mm:ss");
  967. }
  968. else
  969. {
  970. if (!IsPM1Process && !IsPM1PostProcess)
  971. return "--";
  972. TimeSpan secondSpan = DateTime.Now - beginTime;
  973. var retime = beginTime.AddSeconds(CoolingTime + secondSpan.TotalSeconds + PM1RecipeTotalTime - PM1RecipeTotalElapseTime);
  974. return retime.ToString("yyyy-MM-dd HH:mm:ss");
  975. }
  976. }
  977. }
  978. public string ProcessJob2ID
  979. {
  980. get
  981. {
  982. if (LocalProcessJobs == null || LocalProcessJobs.Count <= 1)
  983. return "";
  984. var pj = LocalProcessJobs[1];
  985. return pj.Name;
  986. }
  987. }
  988. public string ProcessJob2StartTime
  989. {
  990. get
  991. {
  992. if (LocalProcessJobs == null || LocalProcessJobs.Count <= 1)
  993. return "";
  994. var pj = LocalProcessJobs[1];
  995. if (pj.BeginTime.Equals(DateTime.MinValue))
  996. {
  997. return "------";
  998. }
  999. return pj.BeginTime.ToString("yyyy-MM-dd HH:mm:ss");
  1000. }
  1001. }
  1002. public string ProcessJob2Status
  1003. {
  1004. get
  1005. {
  1006. if (LocalProcessJobs == null || LocalProcessJobs.Count <= 1)
  1007. return "";
  1008. var pj = LocalProcessJobs[1];
  1009. return pj.ProcessingState.ToString();
  1010. }
  1011. }
  1012. #endregion
  1013. #region Button Logic
  1014. #endregion
  1015. #region shutter
  1016. [Subscription("AutoShutter.OpenCloseStatus")]
  1017. public string AutoShutterOpenCloseStatus { get; set; }
  1018. [Subscription("AutoShutter.UpDownStatus")]
  1019. public string AutoShutterUpDownStatus { get; set; }
  1020. public string AutoShutterStatus => $"{AutoShutterOpenCloseStatus}/{AutoShutterUpDownStatus}";
  1021. #endregion
  1022. #endregion
  1023. public string DefaultUnit { get; set; }
  1024. [Subscription("PM1.N2PurgeMode")]
  1025. public string N2PurgeMode { get; set; }
  1026. #region Gas
  1027. [Subscription("PM1.MFCList")]
  1028. public List<AITMfcData> MFCList { get; set; }
  1029. #endregion
  1030. [Subscription("CarrierRobot.Status")]
  1031. public string CassetteRobotStatus { get; set; }
  1032. private Visibility _isStocker1Visibility = Visibility.Collapsed;
  1033. public Visibility IsStocker1Visibility
  1034. {
  1035. get { return _isStocker1Visibility; }
  1036. set { _isStocker1Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker1Visibility)); }
  1037. }
  1038. private Visibility _isStocker2Visibility = Visibility.Collapsed;
  1039. public Visibility IsStocker2Visibility
  1040. {
  1041. get { return _isStocker2Visibility; }
  1042. set { _isStocker2Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker2Visibility)); }
  1043. }
  1044. private Visibility _isStocker3Visibility = Visibility.Collapsed;
  1045. public Visibility IsStocker3Visibility
  1046. {
  1047. get { return _isStocker3Visibility; }
  1048. set { _isStocker3Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker3Visibility)); }
  1049. }
  1050. private Visibility _isStocker4Visibility = Visibility.Collapsed;
  1051. public Visibility IsStocker4Visibility
  1052. {
  1053. get { return _isStocker4Visibility; }
  1054. set { _isStocker4Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker4Visibility)); }
  1055. }
  1056. private Visibility _isStocker5Visibility = Visibility.Collapsed;
  1057. public Visibility IsStocker5Visibility
  1058. {
  1059. get { return _isStocker5Visibility; }
  1060. set { _isStocker5Visibility = value; this.NotifyOfPropertyChange(nameof(_isStocker5Visibility)); }
  1061. }
  1062. private Visibility _isStocker6Visibility = Visibility.Collapsed;
  1063. public Visibility IsStocker6Visibility
  1064. {
  1065. get { return _isStocker6Visibility; }
  1066. set { _isStocker6Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker6Visibility)); }
  1067. }
  1068. private Visibility _isStocker7Visibility = Visibility.Collapsed;
  1069. public Visibility IsStocker7Visibility
  1070. {
  1071. get { return _isStocker7Visibility; }
  1072. set { _isStocker7Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker7Visibility)); }
  1073. }
  1074. private Visibility _isStocker8Visibility = Visibility.Collapsed;
  1075. public Visibility IsStocker8Visibility
  1076. {
  1077. get { return _isStocker8Visibility; }
  1078. set { _isStocker8Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker8Visibility)); }
  1079. }
  1080. private Visibility _isStocker9Visibility = Visibility.Collapsed;
  1081. public Visibility IsStocker9Visibility
  1082. {
  1083. get { return _isStocker9Visibility; }
  1084. set { _isStocker9Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker9Visibility)); }
  1085. }
  1086. private Visibility _isStocker10Visibility = Visibility.Collapsed;
  1087. public Visibility IsStocker10Visibility
  1088. {
  1089. get { return _isStocker10Visibility; }
  1090. set { _isStocker10Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker10Visibility)); }
  1091. }
  1092. private Visibility _isStocker11Visibility = Visibility.Collapsed;
  1093. public Visibility IsStocker11Visibility
  1094. {
  1095. get { return _isStocker11Visibility; }
  1096. set { _isStocker11Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker11Visibility)); }
  1097. }
  1098. private Visibility _isStocker12Visibility = Visibility.Collapsed;
  1099. public Visibility IsStocker12Visibility
  1100. {
  1101. get { return _isStocker12Visibility; }
  1102. set { _isStocker12Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker12Visibility)); }
  1103. }
  1104. private Visibility _isStocker13Visibility = Visibility.Collapsed;
  1105. public Visibility IsStocker13Visibility
  1106. {
  1107. get { return _isStocker13Visibility; }
  1108. set { _isStocker13Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker13Visibility)); }
  1109. }
  1110. private Visibility _isStocker14Visibility = Visibility.Collapsed;
  1111. public Visibility IsStocker14Visibility
  1112. {
  1113. get { return _isStocker14Visibility; }
  1114. set { _isStocker14Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker14Visibility)); }
  1115. }
  1116. private Visibility _isStocker15Visibility = Visibility.Collapsed;
  1117. public Visibility IsStocker15Visibility
  1118. {
  1119. get { return _isStocker15Visibility; }
  1120. set { _isStocker15Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker15Visibility)); }
  1121. }
  1122. private Visibility _isStocker16Visibility = Visibility.Collapsed;
  1123. public Visibility IsStocker16Visibility
  1124. {
  1125. get { return _isStocker16Visibility; }
  1126. set { _isStocker16Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker16Visibility)); }
  1127. }
  1128. private Visibility _isStocker17Visibility = Visibility.Collapsed;
  1129. public Visibility IsStocker17Visibility
  1130. {
  1131. get { return _isStocker17Visibility; }
  1132. set { _isStocker17Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker17Visibility)); }
  1133. }
  1134. private Visibility _isStocker18Visibility = Visibility.Collapsed;
  1135. public Visibility IsStocker18Visibility
  1136. {
  1137. get { return _isStocker18Visibility; }
  1138. set { _isStocker18Visibility = value; this.NotifyOfPropertyChange(nameof(IsStocker18Visibility)); }
  1139. }
  1140. public Visibility IsStockerVisibility { get; set; }
  1141. public Visibility IsLPVisibility { get; set; }
  1142. [Subscription("PM1.APC.DeviceData")]
  1143. public AITAPCData APCData { get; set; }
  1144. [Subscription("PM1.ValveAV75.DeviceData")]
  1145. public AITValveData ValveAV75 { get; set; }
  1146. public int FIMS1WaferCount { get; set; } = 0;
  1147. public int FIMS2WaferCount { get; set; } = 0;
  1148. public int CarrierRobotWaferCount { get; set; } = 0;
  1149. public int WaferRobotWaferCount { get; set; } = 0;
  1150. public int PM1WaferCount { get; set; } = 0;
  1151. public string APCFeedbackView
  1152. {
  1153. get
  1154. {
  1155. if (ValveAV75 != null && ValveAV75.Feedback)
  1156. {
  1157. return APCData.Pressure1Feedback.ToString("F3");
  1158. }
  1159. return APCData.Pressure2Feedback.ToString("F1");
  1160. }
  1161. }
  1162. public Visibility APCPressureView
  1163. {
  1164. get
  1165. {
  1166. if (ValveAV75 != null && ValveAV75.Feedback)
  1167. {
  1168. return Visibility.Visible;
  1169. }
  1170. return Visibility.Collapsed;
  1171. }
  1172. }
  1173. public string WaferRobotAxleStatusPath
  1174. {
  1175. get
  1176. {
  1177. switch (WaferRobotStatus)
  1178. {
  1179. case "Homing":
  1180. case "Init":
  1181. return "/FurnaceUI;component/Resources/Images/Controls3/hg2y.png";
  1182. case "Idle":
  1183. case "InTransfer":
  1184. case "Loading":
  1185. case "Unloading":
  1186. case "Picking":
  1187. case "Placing":
  1188. return "/FurnaceUI;component/Resources/Images/Controls3/hg2g.png";
  1189. case "Error":
  1190. return "/FurnaceUI;component/Resources/Images/Controls3/hg2r.png";
  1191. default:
  1192. break;
  1193. }
  1194. return "/FurnaceUI;component/Resources/Images/Controls3/hg2g.png";
  1195. }
  1196. }
  1197. public string CassetteRobotAxleStatusPath
  1198. {
  1199. get
  1200. {
  1201. switch (CassetteRobotStatus)
  1202. {
  1203. case "Homing":
  1204. case "Init":
  1205. return "/FurnaceUI;component/Resources/Images/Controls3/hg1y.png";
  1206. case "Idle":
  1207. case "InTransfer":
  1208. case "Picking":
  1209. case "Placing":
  1210. return "/FurnaceUI;component/Resources/Images/Controls3/hg1g.png";
  1211. case "Error":
  1212. return "/FurnaceUI;component/Resources/Images/Controls3/hg1r.png";
  1213. default:
  1214. break;
  1215. }
  1216. return "/FurnaceUI;component/Resources/Images/Controls3/hg1g.png";
  1217. }
  1218. }
  1219. public StatusViewModel()
  1220. {
  1221. this.DisplayName = "MainStatusViewModel";
  1222. //ActiveUpdateData = true;
  1223. _stokcers = new List<ModuleName>()
  1224. {
  1225. ModuleName.Stocker1,
  1226. ModuleName.Stocker2,
  1227. ModuleName.Stocker3,
  1228. ModuleName.Stocker4,
  1229. ModuleName.Stocker5,
  1230. ModuleName.Stocker6,
  1231. ModuleName.Stocker7,
  1232. ModuleName.Stocker8,
  1233. ModuleName.Stocker9,
  1234. ModuleName.Stocker10,
  1235. ModuleName.Stocker11,
  1236. ModuleName.Stocker12,
  1237. ModuleName.Stocker13,
  1238. ModuleName.Stocker14,
  1239. ModuleName.Stocker15,
  1240. ModuleName.Stocker16,
  1241. ModuleName.Stocker17,
  1242. ModuleName.Stocker18,
  1243. };
  1244. StockerSlots = new ObservableCollection<string>()
  1245. {
  1246. "",
  1247. "",
  1248. "",
  1249. "",
  1250. "",
  1251. "",
  1252. "",
  1253. "",
  1254. "",
  1255. "",
  1256. "",
  1257. "",
  1258. "",
  1259. "",
  1260. "",
  1261. "",
  1262. "",
  1263. "",
  1264. "",
  1265. "",
  1266. "",
  1267. };
  1268. _stokcerWaferType = Enumerable.Repeat("", 21).ToList();
  1269. _eDUseWarningLimit = (int)QueryDataClient.Instance.Service.GetConfig("PM1.WaferCycleTime.EDCountWarning");
  1270. _eDUseAlarmLimit = (int)QueryDataClient.Instance.Service.GetConfig("PM1.WaferCycleTime.EDCountAlarm");
  1271. _stockerBackground = new List<SolidColorBrush>();
  1272. for (int i = 0; i < 21; i++)
  1273. {
  1274. _stockerBackground.Add(_WhiteFill);
  1275. }
  1276. }
  1277. protected override void OnInitialize()
  1278. {
  1279. base.OnInitialize();
  1280. base.InitFOUP();
  1281. base.InitLL();
  1282. base.InitTM();
  1283. base.InitEFEM();
  1284. base.InitPM();
  1285. base.InitBuffer();
  1286. }
  1287. protected override void OnActivate()
  1288. {
  1289. base.OnActivate();
  1290. DefaultUnit = (string)QueryDataClient.Instance.Service.GetConfig($"PM1.APC.PressureUnit");
  1291. _isCycleMode = (bool)QueryDataClient.Instance.Service.GetConfig("System.IsCycleMode");
  1292. _cassetteSlot = (int)QueryDataClient.Instance.Service.GetConfig("System.CassetteSlotCount");
  1293. for (int i = 0; i < _stokcers.Count; i++)
  1294. {
  1295. _stokcerWaferType[i] = (string)QueryDataClient.Instance.Service.GetConfig($"System.Stocker.{_stokcers[i]}WaferType");
  1296. }
  1297. IsStocker1Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker1Installed") ? Visibility.Visible : Visibility.Collapsed;
  1298. IsStocker2Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker2Installed") ? Visibility.Visible : Visibility.Collapsed;
  1299. IsStocker3Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker3Installed") ? Visibility.Visible : Visibility.Collapsed;
  1300. IsStocker4Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker4Installed") ? Visibility.Visible : Visibility.Collapsed;
  1301. IsStocker5Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker5Installed") ? Visibility.Visible : Visibility.Collapsed;
  1302. IsStocker6Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker6Installed") ? Visibility.Visible : Visibility.Collapsed;
  1303. IsStocker7Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker7Installed") ? Visibility.Visible : Visibility.Collapsed;
  1304. IsStocker8Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker8Installed") ? Visibility.Visible : Visibility.Collapsed;
  1305. IsStocker9Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker9Installed") ? Visibility.Visible : Visibility.Collapsed;
  1306. IsStocker10Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker10Installed") ? Visibility.Visible : Visibility.Collapsed;
  1307. IsStocker11Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker11Installed") ? Visibility.Visible : Visibility.Collapsed;
  1308. IsStocker12Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker12Installed") ? Visibility.Visible : Visibility.Collapsed;
  1309. IsStocker13Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker13Installed") ? Visibility.Visible : Visibility.Collapsed;
  1310. IsStocker14Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker14Installed") ? Visibility.Visible : Visibility.Collapsed;
  1311. IsStocker15Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker15Installed") ? Visibility.Visible : Visibility.Collapsed;
  1312. IsStocker16Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker16Installed") ? Visibility.Visible : Visibility.Collapsed;
  1313. IsStocker17Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker17Installed") ? Visibility.Visible : Visibility.Collapsed;
  1314. IsStocker18Visibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker18Installed") ? Visibility.Visible : Visibility.Collapsed;
  1315. }
  1316. protected override void OnViewLoaded(object view)
  1317. {
  1318. base.OnViewLoaded(view);
  1319. }
  1320. public List<AITMfcData> GasDataList
  1321. {
  1322. get
  1323. {
  1324. var _gasDataList = new List<AITMfcData>();
  1325. if (MFCList != null)
  1326. {
  1327. foreach (var item in MFCList)
  1328. {
  1329. if (item == null)
  1330. {
  1331. continue;
  1332. }
  1333. if (_isShowMFCBySetPoint)
  1334. {
  1335. if (item.SetPoint > 0)
  1336. {
  1337. _gasDataList.Add(item);
  1338. }
  1339. }
  1340. else
  1341. {
  1342. _gasDataList.Add(item);
  1343. }
  1344. }
  1345. }
  1346. return _gasDataList;
  1347. }
  1348. }
  1349. public void Start()
  1350. {
  1351. InvokeClient.Instance.Service.DoOperation("System.StartAutoRun");
  1352. }
  1353. public void Stop()
  1354. {
  1355. //InvokeClient.Instance.Service.DoOperation("System.StartAutoRun");
  1356. }
  1357. public void SwitchPage(string page)
  1358. {
  1359. var wm = IoC.Get<IWindowManager>();
  1360. switch (page)
  1361. {
  1362. case "Stocker":
  1363. ClientApp.Instance.SwitchPage("status", "stocker", null);
  1364. break;
  1365. case "TransferMain":
  1366. ClientApp.Instance.SwitchPage("status", "TransferMain", null);
  1367. break;
  1368. case "N2Purge":
  1369. ClientApp.Instance.SwitchPage("status", "N2PurgeStatus", null);
  1370. break;
  1371. case "Gas":
  1372. {
  1373. ClientApp.Instance.SwitchPage("status", "Gas", null);
  1374. //CGlobal.BoatWaferEditViewEnable = false;
  1375. ////var wm = IoC.Get<IWindowManager>();
  1376. //GasDetailViewModel gasDetailViewModel = new GasDetailViewModel();
  1377. //(wm as WindowManager)?.ShowDialogWithTitle(gasDetailViewModel, null, "Gas Detail");
  1378. }
  1379. break;
  1380. case "Temp":
  1381. ClientApp.Instance.SwitchPage("status", "temp", null);
  1382. break;
  1383. case "Pressure":
  1384. {
  1385. ClientApp.Instance.SwitchPage("status", "Pressure", null);
  1386. // var wm = IoC.Get<IWindowManager>();
  1387. //var viewPressureDetail = new PressureDetailViewModel();
  1388. //(wm as WindowManager)?.ShowDialogWithTitle(viewPressureDetail, null, "Pressure Detail");
  1389. }
  1390. break;
  1391. case "MainRecipe":
  1392. if (!string.IsNullOrEmpty(PM1MainRecipeName))
  1393. {
  1394. CGlobal.RecipeProcessEditViewEnable = false;
  1395. MECF.Framework.UI.Client.CenterViews.Editors.Recipe.CGlobal.RecipeProcessEditViewEnable = false;
  1396. // var wm = IoC.Get<IWindowManager>();
  1397. var viewProcessRecipeRecipeType = "Process";
  1398. var recipeName = PM1MainRecipeName;
  1399. if (PM1ExecRecipeType.Equals("Sub"))
  1400. {
  1401. recipeName = ProcessSubRecipe;
  1402. }
  1403. else
  1404. {
  1405. recipeName = PM1MainRecipeName;
  1406. }
  1407. if (PM1ExecRecipeType.Equals("Process") || PM1ExecRecipeType.Equals("Abort"))
  1408. {
  1409. viewProcessRecipeRecipeType = PM1ExecRecipeType;
  1410. }
  1411. else
  1412. {
  1413. viewProcessRecipeRecipeType = PM1ExecRecipeType.ToLower();
  1414. }
  1415. int tableIndex = 1;
  1416. var table = PM1SubTable.Split(':');
  1417. if (table.Length < 0 || !int.TryParse(table[0], out tableIndex))
  1418. {
  1419. tableIndex = 1;
  1420. }
  1421. var viewProcessRecipe = new RecipeProcessEditViewModel($"Furnace\\{viewProcessRecipeRecipeType}", recipeName, tableIndex: tableIndex);
  1422. viewProcessRecipe.RecipeType = viewProcessRecipeRecipeType;
  1423. viewProcessRecipe.IndexNoDefault = PM1RecipeStepNumber;
  1424. viewProcessRecipe.SelectedStepName = PM1RecipeStepName;
  1425. (wm as WindowManager)?.ShowDialogWithTitle(viewProcessRecipe, null, $"View {viewProcessRecipeRecipeType} Recpie");
  1426. }
  1427. break;
  1428. case "PMCommand":
  1429. //if (!string.IsNullOrEmpty(PM1MainRecipeName))
  1430. //{
  1431. // var wm = IoC.Get<IWindowManager>();
  1432. var viewPMCommand = new PMCommandViewModel();
  1433. (wm as WindowManager)?.ShowDialogWithTitle(viewPMCommand, this, null, "PM Command");
  1434. //}
  1435. break;
  1436. case "LayoutRecipe":
  1437. {
  1438. CGlobal.BoatWaferEditViewEnable = false;
  1439. // var wm = IoC.Get<IWindowManager>();
  1440. var viewLayoutRecipe = new BoatWaferNoActionViewModel();
  1441. (wm as WindowManager)?.ShowDialogWithTitle(viewLayoutRecipe, null, "View Boat Wafer");
  1442. }
  1443. break;
  1444. case "Boat Elevator":
  1445. {
  1446. BoatElevatorParametersViewModel boatElevatorParametersViewModel = new BoatElevatorParametersViewModel();
  1447. (wm as WindowManager)?.ShowDialogWithTitle(boatElevatorParametersViewModel, null, "Boat Elevator Parameter Settings");
  1448. }
  1449. break;
  1450. case "CJStatus":
  1451. {
  1452. ClientApp.Instance.SwitchPage("status", "job", null);
  1453. //ControlJobStatusViewModel controlJobStatusViewModel = new ControlJobStatusViewModel();
  1454. //(wm as WindowManager)?.ShowDialogWithTitle(controlJobStatusViewModel, null, "CJ Status");
  1455. }
  1456. break;
  1457. case "PJStatus":
  1458. {
  1459. ProcessJobWithDrawingViewModel processJobWithDrawingViewModel = new ProcessJobWithDrawingViewModel();
  1460. (wm as WindowManager)?.ShowDialogWithTitle(processJobWithDrawingViewModel, null, "PJ Status");
  1461. }
  1462. break;
  1463. case "LoadPortState":
  1464. {
  1465. LoadPortStateViewModel loadPortStateViewModel = new LoadPortStateViewModel();
  1466. (wm as WindowManager)?.ShowDialogWithTitle(loadPortStateViewModel, null, "Load Port State");
  1467. }
  1468. break;
  1469. case "CarrierState":
  1470. {
  1471. CarrierStateViewModel carrierStateViewModel = new CarrierStateViewModel();
  1472. (wm as WindowManager)?.ShowDialogWithTitle(carrierStateViewModel, null, "Carrier State");
  1473. }
  1474. break;
  1475. case "Equipment Status":
  1476. {
  1477. EquipmentStatusViewModel equipmentStatusViewModel = new EquipmentStatusViewModel();
  1478. (wm as WindowManager)?.ShowDialogWithTitle(equipmentStatusViewModel, null, "Equipment Operation State");
  1479. }
  1480. break;
  1481. case "Load Unload State":
  1482. {
  1483. LoadUnloadStateViewModel loadUnloadStateViewModel = new LoadUnloadStateViewModel();
  1484. (wm as WindowManager)?.ShowDialogWithTitle(loadUnloadStateViewModel, null, "Load Unload State");
  1485. }
  1486. break;
  1487. case "Boat Detail":
  1488. {
  1489. BoatWaferViewModel boatWaferViewModel = new BoatWaferViewModel();
  1490. (wm as WindowManager)?.ShowDialogWithTitle(boatWaferViewModel, null, "Boat Detail");
  1491. }
  1492. break;
  1493. }
  1494. }
  1495. string[] moduleNames = new string[] { "Stocker1", "Stocker2", "Stocker3", "Stocker4", "Stocker5", "Stocker6", "Stocker7", "Stocker8", "Stocker9",
  1496. "Stocker10","Stocker11","Stocker12","Stocker13","Stocker14","Stocker15","Stocker16","Stocker17","Stocker18",
  1497. "FIMS1","FIMS2","CarrierRobot","WaferRobot","PM1"};
  1498. //string[] moduleNames = new string[] { "Stocker1", "Stocker2", "Stocker3", "Stocker4", "Stocker5", "Stocker6", "Stocker7", "Stocker8", "Stocker9",
  1499. // "Stocker10","Stocker11","Stocker12","Stocker13","Stocker14","Stocker15","Stocker16","Stocker17","Stocker18"};
  1500. protected override void InvokeBeforeUpdateProperty(Dictionary<string, object> data)
  1501. {
  1502. base.InvokeBeforeUpdateProperty(data);
  1503. _isShowMFCBySetPoint = (bool)QueryDataClient.Instance.Service.GetConfig($"System.ShowMFCBySetPoint");
  1504. }
  1505. protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
  1506. {
  1507. UpdateStockerSlots();
  1508. UpdateRecipeProgress();
  1509. var isLoadPortPosition = (string)QueryDataClient.Instance.Service.GetConfig("LoadPort.LoadPortPosition");
  1510. if (isLoadPortPosition == "Upper")
  1511. {
  1512. IsStockerVisibility = Visibility.Hidden;
  1513. IsLPVisibility = Visibility.Visible;
  1514. }
  1515. else
  1516. {
  1517. IsStockerVisibility = Visibility.Visible;
  1518. IsLPVisibility = Visibility.Hidden;
  1519. }
  1520. foreach (var item in moduleNames)
  1521. {
  1522. if (ModuleManager.ModuleInfos.ContainsKey(item))
  1523. {
  1524. this.GetType().GetProperty($"{item}WaferCount").SetValue(this, ModuleManager.ModuleInfos[item].WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count());
  1525. }
  1526. }
  1527. NotifyOfPropertyChange("IsStocker1Visibility");
  1528. }
  1529. private void UpdateStockerSlots()
  1530. {
  1531. for (int i = 0; i < _stokcers.Count; i++)
  1532. {
  1533. bool bHaveAbort = false;
  1534. var wafers = ModuleManager.ModuleInfos[_stokcers[i].ToString()].WaferManager.Wafers;
  1535. int waferNumber = 0;
  1536. string waferType = "";
  1537. SolidColorBrush _tempFill = _SD_ED_M_Fill;
  1538. if (wafers != null)
  1539. {
  1540. foreach (var wafer in wafers)
  1541. {
  1542. if (wafer.WaferStatus != 0)
  1543. {
  1544. waferNumber++;
  1545. waferType = wafer.WaferType.ToString();
  1546. if (wafer.WaferStatus == 5) // EnumWaferProcessStatus.Failed
  1547. bHaveAbort = true;
  1548. if (wafer.UseCount >= _eDUseWarningLimit)
  1549. {
  1550. _tempFill = _waringFill;
  1551. }
  1552. if (wafer.UseCount >= _eDUseAlarmLimit)
  1553. {
  1554. _tempFill = _alarmFill;
  1555. }
  1556. }
  1557. }
  1558. }
  1559. StockerSlots[i] = $"{_stokcerWaferType[i]}-{waferNumber}/{_cassetteSlot}";
  1560. if (_stokcerWaferType[i].Contains("P"))
  1561. {
  1562. if (waferNumber > 0)
  1563. {
  1564. if (bHaveAbort)
  1565. StockerBackground[i] = _redBk;
  1566. else
  1567. StockerBackground[i] = _productionFill;
  1568. }
  1569. else
  1570. {
  1571. StockerBackground[i] = _WhiteFill;
  1572. }
  1573. }
  1574. else
  1575. {
  1576. if (waferNumber > 0)
  1577. {
  1578. if (bHaveAbort)
  1579. StockerBackground[i] = _redBk;
  1580. else
  1581. {
  1582. StockerBackground[i] = _tempFill;
  1583. }
  1584. }
  1585. else
  1586. {
  1587. StockerBackground[i] = _WhiteFill;
  1588. }
  1589. }
  1590. }
  1591. }
  1592. private void UpdateRecipeProgress()
  1593. {
  1594. if (!IsPM1Process && !IsPM1PostProcess)
  1595. {
  1596. RecipeProgress = "";
  1597. RecipeProgressValue = 0;
  1598. return;
  1599. }
  1600. if (PM1RecipeTotalTime == 0)
  1601. {
  1602. RecipeProgress = "";
  1603. RecipeProgressValue = 0;
  1604. }
  1605. else
  1606. {
  1607. double totalTime = PM1RecipeTotalTime;
  1608. double elapseTime = PM1RecipeTotalElapseTime;
  1609. float percentage = (float)(elapseTime / totalTime * 100);
  1610. percentage = percentage > 100 ? 100 : percentage;
  1611. RecipeProgress = $"{percentage.ToString("f1")}%";
  1612. RecipeProgressValue = (int)(elapseTime / totalTime * 100);
  1613. }
  1614. }
  1615. public void CanvasMouseLeftButtonDown(object sender)
  1616. {
  1617. }
  1618. public Dictionary<string, StationPosition> StationPosition
  1619. {
  1620. get
  1621. {
  1622. return new Dictionary<string, StationPosition>()
  1623. {
  1624. { "ArmA.System", new StationPosition() {
  1625. StartPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }
  1626. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}}
  1627. ,{ "Robot", new StationPosition() {
  1628. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 180, Hand = 180 }
  1629. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}}
  1630. ,{"ArmA.Stocker1", new StationPosition() {
  1631. StartPosition = new RobotPosition() { X=-150, Root = 0, Arm = 180, Hand = 180 }
  1632. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  1633. ,{ "ArmA.Stocker2", new StationPosition() {
  1634. StartPosition = new RobotPosition() { X=-150, Root = 0, Arm = 180, Hand = 180 }
  1635. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1636. ,{ "ArmA.Stocker3", new StationPosition() {
  1637. StartPosition = new RobotPosition() { X=-150, Root = 0, Arm = 180, Hand = 180 }
  1638. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1639. ,{ "ArmA.Stocker4", new StationPosition() {
  1640. StartPosition = new RobotPosition() { X=-150, Root = 0, Arm = 180, Hand = 180 }
  1641. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1642. ,{"ArmA.Stocker5", new StationPosition(){
  1643. StartPosition = new RobotPosition() { X=-240, Root = 0, Arm = 180, Hand = 180 }
  1644. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  1645. ,{"ArmA.Stocker6", new StationPosition(){
  1646. StartPosition = new RobotPosition() { X=-240, Root = 0, Arm = 180, Hand = 180 }
  1647. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1648. ,{"ArmA.Stocker7", new StationPosition(){
  1649. StartPosition = new RobotPosition() { X=-240, Root = 0, Arm = 180, Hand = 180 }
  1650. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1651. ,{"ArmA.Stocker8", new StationPosition(){
  1652. StartPosition = new RobotPosition() { X=-240, Root = 0, Arm = 180, Hand = 180 }
  1653. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1654. ,{ "ArmA.Stocker9", new StationPosition() {
  1655. StartPosition = new RobotPosition() { X=-325, Root = 0, Arm = 180, Hand = 180 }
  1656. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  1657. ,{ "ArmA.Stocker10", new StationPosition() {
  1658. StartPosition = new RobotPosition() { X=-325, Root = 0, Arm = 180, Hand = 180 }
  1659. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1660. ,{ "ArmA.Stocker11", new StationPosition() {
  1661. StartPosition = new RobotPosition() { X=-325, Root = 0, Arm = 180, Hand = 180 }
  1662. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }} }
  1663. ,{"ArmA.Stocker12", new StationPosition(){
  1664. StartPosition = new RobotPosition() { X =-325, Root = 0, Arm = 180, Hand = 180 }
  1665. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1666. ,{ "ArmA.Stocker13", new StationPosition() {
  1667. StartPosition = new RobotPosition() { X=-415, Root = 0, Arm = 180, Hand = 180 }
  1668. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}}
  1669. ,{ "ArmA.Stocker14", new StationPosition() {
  1670. StartPosition = new RobotPosition() { X=-415, Root = 0, Arm = 180, Hand = 180 }
  1671. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1672. ,{ "ArmA.Stocker15", new StationPosition() {
  1673. StartPosition = new RobotPosition() { X=-415, Root = 0, Arm = 180, Hand = 180 }
  1674. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1675. ,{ "ArmA.Stocker16", new StationPosition() {
  1676. StartPosition = new RobotPosition() { X=-415, Root = 0, Arm = 180, Hand = 180 }
  1677. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1678. ,{"ArmA.Stocker17", new StationPosition(){
  1679. StartPosition = new RobotPosition() { X = -250, Root = 180, Arm = 180, Hand = 180 }
  1680. ,EndPosition = new RobotPosition() { Root = 180, Arm = -20, Hand = 0 }}}
  1681. ,{"ArmA.Stocker18", new StationPosition(){
  1682. StartPosition = new RobotPosition() { X = -250, Root = 180, Arm = 180, Hand = 180 }
  1683. ,EndPosition = new RobotPosition() { Root = 180, Arm = 23, Hand = 0 }}}
  1684. ,{"ArmA.FIMS1", new StationPosition(){
  1685. StartPosition = new RobotPosition() { X = 35, Root = 0, Arm = 180, Hand = 180 }
  1686. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1687. ,{"ArmA.FIMS2", new StationPosition(){
  1688. StartPosition = new RobotPosition() { X = -95, Root = 0, Arm = 180, Hand = 180 }
  1689. ,EndPosition = new RobotPosition() { Root = 0, Arm = -20, Hand = 0 }}}
  1690. ,{"ArmA.LP1", new StationPosition(){
  1691. StartPosition = new RobotPosition() { X = -90, Root = 180, Arm = 180, Hand = 180 }
  1692. ,EndPosition = new RobotPosition() { Root = 180, Arm = -20, Hand = 0 }}}
  1693. ,{"ArmA.LP2", new StationPosition(){
  1694. StartPosition = new RobotPosition() { X = -90, Root = 180, Arm = 180, Hand = 180 }
  1695. ,EndPosition = new RobotPosition() { Root = 180, Arm = 23, Hand = 0 }}}
  1696. ,{"ArmA.LP3", new StationPosition(){
  1697. StartPosition = new RobotPosition() { X = -365, Root = 180, Arm = 180, Hand = 180 }
  1698. ,EndPosition = new RobotPosition() { Root = 180, Arm = -20, Hand = 0 }}}
  1699. ,{"ArmA.LP4", new StationPosition(){
  1700. StartPosition = new RobotPosition() { X = -365, Root = 180, Arm = 180, Hand = 180 }
  1701. ,EndPosition = new RobotPosition() { Root = 180, Arm = 23, Hand = 0 }}}
  1702. };
  1703. }
  1704. }
  1705. public Dictionary<string, StationPosition> StationPosition2
  1706. {
  1707. get
  1708. {
  1709. return new Dictionary<string, StationPosition>()
  1710. {
  1711. { "ArmA.System", new StationPosition() {
  1712. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 180, Hand = 180 }
  1713. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}
  1714. }
  1715. ,{ "Robot", new StationPosition() {
  1716. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 180, Hand = 180 }
  1717. ,EndPosition = new RobotPosition() { Root = 0, Arm = 180, Hand = 180 }}
  1718. }
  1719. ,{ "ArmA.FIMS1", new StationPosition() {
  1720. StartPosition = new RobotPosition() { X=-20, Root = 180, Arm = 180, Hand = 180 }
  1721. ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }}
  1722. }
  1723. ,{ "ArmA.FIMS2", new StationPosition() {
  1724. StartPosition = new RobotPosition() { X=-168, Root = 180, Arm = 180, Hand = 180 }
  1725. ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }}
  1726. }
  1727. ,{ "ArmA.PM1", new StationPosition() {
  1728. StartPosition = new RobotPosition() { X=-50, Root = 0, Arm = 180, Hand = 180 }
  1729. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  1730. }
  1731. };
  1732. }
  1733. }
  1734. public Dictionary<string, StationPosition> StationPosition3
  1735. {
  1736. get
  1737. {
  1738. return new Dictionary<string, StationPosition>()
  1739. {
  1740. { "HomePosition", new StationPosition() {
  1741. StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 0, Hand = 0 }
  1742. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  1743. },
  1744. { "Position1", new StationPosition() {
  1745. StartPosition = new RobotPosition() { X=-50, Root = 0, Arm = 0, Hand = 0 }
  1746. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  1747. },
  1748. { "Position2", new StationPosition() {
  1749. StartPosition = new RobotPosition() { X=-100, Root = 0, Arm = 0, Hand = 0 }
  1750. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  1751. },
  1752. { "ProcessPosition", new StationPosition() {
  1753. StartPosition = new RobotPosition() { X=-280, Root = 0, Arm = 0, Hand = 0 }
  1754. ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }}
  1755. }
  1756. };
  1757. }
  1758. }
  1759. public void PopupPage(string page)
  1760. {
  1761. //var windowManager = IoC.Get<IWindowManager>();
  1762. var windowManager = new WindowManager();
  1763. switch (page)
  1764. {
  1765. case "PortStatus":
  1766. //LoadIOPortViewModel portStatusViewModel = new LoadIOPortViewModel();
  1767. //(windowManager as WindowManager)?.ShowDialogWithTitle(portStatusViewModel, null, "Port Status");
  1768. break;
  1769. case "JobStatus":
  1770. JOBStatusViewModel vm = new JOBStatusViewModel();
  1771. //bool? ret = windowManager.ShowDialog(vm);
  1772. (windowManager as WindowManager)?.ShowDialogWithTitle(vm, null, "Job Status View");
  1773. break;
  1774. default:
  1775. break;
  1776. }
  1777. }
  1778. public void StandbyFactor()
  1779. {
  1780. //if (!string.IsNullOrEmpty(PM1MainRecipeName))
  1781. {
  1782. var windowManager = IoC.Get<IWindowManager>();
  1783. StandbyFactorViewModel standbyFactorViewModel = new StandbyFactorViewModel();
  1784. standbyFactorViewModel.MainRecipeName = PM1MainRecipeName;
  1785. (windowManager as WindowManager)?.ShowDialogWithTitle(standbyFactorViewModel, null, "Standby Factor View");
  1786. }
  1787. }
  1788. public void Skip()
  1789. {
  1790. if (!DialogBox.Confirm("Ara you sure to skip current step?"))
  1791. return;
  1792. InvokeClient.Instance.Service.DoOperation($"PM1.RecipeSkipStep", "");
  1793. }
  1794. public void Jump()
  1795. {
  1796. //if (!DialogBox.Confirm("Ara you sure to jump current step?"))
  1797. // return;
  1798. //var recipes = new RecipeDataBase();
  1799. //recipes.PrefixPath = "Furnace\\Process";
  1800. //recipes.Name = PM1MainRecipeName;
  1801. //RecipeProvider _recipeProvider = new RecipeProvider();
  1802. //recipes.Clear();
  1803. //var recipeContent = _recipeProvider.LoadRecipe(recipes.PrefixPath, recipes.Name);
  1804. //if (string.IsNullOrEmpty(recipeContent))
  1805. //{
  1806. // MessageBox.Show($"{recipes.PrefixPath}\\{recipes.Name} is empty, please confirm the file is valid.");
  1807. // return;
  1808. //}
  1809. //recipes.RecipeChamberType = "OriginChamber";
  1810. //recipes.InitData(recipes.PrefixPath, recipes.Name, recipeContent, "PM1");
  1811. //var windowManager = IoC.Get<IWindowManager>();
  1812. //RecipeLoopSetViewModel recipeLoopSetViewModel = new RecipeLoopSetViewModel();
  1813. //recipeLoopSetViewModel.StepNames = new ObservableCollection<string>(recipes.Steps.OrderBy(x => x.StepNo).Where(x => x.StepNo != PM1RecipeStepNumber).Select(x => x.Name).ToList());
  1814. //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeLoopSetViewModel, null, "Jump"))
  1815. //{
  1816. // InvokeClient.Instance.Service.DoOperation($"PM1.RecipeJumpStep", recipeLoopSetViewModel.SelectedIndex);
  1817. //}
  1818. }
  1819. public void Hold()
  1820. {
  1821. if (HoldName == "Hold")
  1822. {
  1823. if (!DialogBox.Confirm("Ara you sure to hold current recipe?"))
  1824. return;
  1825. InvokeClient.Instance.Service.DoOperation($"PM1.RecipePause", "");
  1826. }
  1827. else
  1828. {
  1829. InvokeClient.Instance.Service.DoOperation($"PM1.RecipeContinue", "");
  1830. }
  1831. }
  1832. public void EmergencyAbort()
  1833. {
  1834. if (!DialogBox.Confirm("Ara you sure to execute EmergencyAbort?"))
  1835. return;
  1836. InvokeClient.Instance.Service.DoOperation("PM1.Abort");
  1837. }
  1838. private string CalEndTime(DateTime beginTime, double totalTime, double totalElapseTime)
  1839. {
  1840. TimeSpan secondSpan = DateTime.Now - beginTime;
  1841. return beginTime.AddSeconds(secondSpan.TotalSeconds + totalTime - totalElapseTime).ToString("yyyy-MM-dd HH:mm:ss");
  1842. }
  1843. }
  1844. }