StatusViewModel.cs 92 KB

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