StatusViewModel.cs 92 KB

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