PmOverviewViewModel.cs 92 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.Linq;
  5. using System.Windows;
  6. using System.Windows.Media;
  7. using Aitex.Core.Common;
  8. using Aitex.Core.Common.DeviceData;
  9. using Aitex.Core.Util;
  10. using Aitex.Core.Utilities;
  11. using Caliburn.Micro;
  12. using MECF.Framework.Common.DataCenter;
  13. using MECF.Framework.Common.Equipment;
  14. using MECF.Framework.Common.OperationCenter;
  15. using MECF.Framework.Common.RecipeCenter;
  16. using OpenSEMI.ClientBase;
  17. using VirgoCommon;
  18. using VirgoUI.Client.Models.Recipe;
  19. using VirgoUI.Client.Models.Sys;
  20. using Ax = Aitex.Core.Common;
  21. namespace VirgoUI.Client.Models.PMs
  22. {
  23. public class PmOverviewViewModel : ModuleUiViewModelBase, ISupportMultipleSystem
  24. {
  25. private object[] _oldmfc = new object[5] { 0.0, 0.0, 0.0, 0.0, 0.0 };
  26. //public Ax.WaferInfo PMWafer { get; set; }
  27. //private Ax.WaferSize _PMWaferType = Ax.WaferSize.WS6;
  28. //public Ax.WaferSize PMWaferType
  29. //{
  30. // get
  31. // {
  32. // return _PMWaferType;
  33. // }
  34. // set
  35. // {
  36. // _PMWaferType = value;
  37. // NotifyOfPropertyChange("PMWaferType");
  38. // }
  39. //}
  40. private int _BottomPinStatus = 0;
  41. public int BottomPinStatus
  42. {
  43. get
  44. {
  45. return _BottomPinStatus;
  46. }
  47. set
  48. {
  49. _BottomPinStatus = value;
  50. NotifyOfPropertyChange("BottomPinStatus");
  51. }
  52. }
  53. public int WaferLength1
  54. {
  55. get
  56. {
  57. Ax.WaferInfo wafer = ChamberWafer == null ? new Ax.WaferInfo() : ChamberWafer[0];
  58. if (wafer.IsEmpty)
  59. return 0;
  60. switch (wafer.Size)
  61. {
  62. case Ax.WaferSize.WS3: return 85;
  63. case Ax.WaferSize.WS8: return 125;
  64. default: return 145;
  65. }
  66. }
  67. }
  68. private int _MidPinStatus = 0;
  69. public int MidPinStatus
  70. {
  71. get
  72. {
  73. return _MidPinStatus;
  74. }
  75. set
  76. {
  77. _MidPinStatus = value;
  78. NotifyOfPropertyChange("MidPinStatus");
  79. }
  80. }
  81. private int _TopPinStatus = 0;
  82. public int TopPinStatus
  83. {
  84. get
  85. {
  86. return _TopPinStatus;
  87. }
  88. set
  89. {
  90. _TopPinStatus = value;
  91. NotifyOfPropertyChange("TopPinStatus");
  92. }
  93. }
  94. private int _CoverStatus = 0;
  95. public int CoverStatus
  96. {
  97. get
  98. {
  99. return _CoverStatus;
  100. }
  101. set
  102. {
  103. _CoverStatus = value;
  104. NotifyOfPropertyChange("CoverStatus");
  105. }
  106. }
  107. //private int _ChamberStatus;
  108. //public int ChamberStatus
  109. //{
  110. // get { return _ChamberStatus; }
  111. // set
  112. // {
  113. // _ChamberStatus = value;
  114. // NotifyOfPropertyChange("ChamberStatus");
  115. // }
  116. //}
  117. private List<PMParameter> _PMParameters;
  118. public List<PMParameter> PMParameters
  119. {
  120. get
  121. {
  122. return _PMParameters;
  123. }
  124. set
  125. {
  126. _PMParameters = value;
  127. NotifyOfPropertyChange("PMParameters");
  128. }
  129. }
  130. private List<PMParameter> _Temperatures;
  131. public List<PMParameter> Temperatures
  132. {
  133. get
  134. {
  135. return _Temperatures;
  136. }
  137. set
  138. {
  139. _Temperatures = value;
  140. NotifyOfPropertyChange("Temperatures");
  141. }
  142. }
  143. private List<GaslineItem> _Gaslines;
  144. public List<GaslineItem> Gaslines
  145. {
  146. get
  147. {
  148. return _Gaslines;
  149. }
  150. set
  151. {
  152. _Gaslines = value;
  153. NotifyOfPropertyChange("Gaslines");
  154. }
  155. }
  156. [Subscription("EPD.IsConnected")]
  157. public bool IsEPDConnected
  158. {
  159. get;
  160. set;
  161. }
  162. [Subscription("EPD.ChannelStatus")]
  163. public string EPDStatus
  164. {
  165. get;
  166. set;
  167. }
  168. public Visibility EPDVisibility
  169. {
  170. get;
  171. set;
  172. }
  173. [Subscription("EnableBiasRF")]
  174. public bool EnableBiasRF
  175. {
  176. get;
  177. set;
  178. }
  179. [Subscription("IoThrottleValve.ThrottleValve.ProcessPressureOffset")]
  180. public double ProcessPressureOffset
  181. {
  182. get;
  183. set;
  184. }
  185. [Subscription("IoMfc.MfcGas1.IsEnable")]
  186. public bool MfcGas1Enable
  187. {
  188. get;
  189. set;
  190. }
  191. [Subscription("IoMfc.MfcGas2.IsEnable")]
  192. public bool MfcGas2Enable
  193. {
  194. get;
  195. set;
  196. }
  197. [Subscription("IoMfc.MfcGas3.IsEnable")]
  198. public bool MfcGas3Enable
  199. {
  200. get;
  201. set;
  202. }
  203. [Subscription("IoMfc.MfcGas4.IsEnable")]
  204. public bool MfcGas4Enable
  205. {
  206. get;
  207. set;
  208. }
  209. [Subscription("IoMfc.MfcGas5.IsEnable")]
  210. public bool MfcGas5Enable
  211. {
  212. get;
  213. set;
  214. }
  215. [Subscription("ModuleWaferList")]
  216. public Ax.WaferInfo[] ChamberWafer
  217. {
  218. get;
  219. set;
  220. }
  221. [Subscription("SlitDoor.DeviceData")]
  222. public AITCylinderData SlitDoorData
  223. {
  224. get;
  225. set;
  226. }
  227. [Subscription("LiftPin.DeviceData")]
  228. public AITCylinderData LiftPinData
  229. {
  230. get;
  231. set;
  232. }
  233. [Subscription("TriStateLiftPin.PinPosition")]
  234. public int TriStateLiftPinPosition { get; set; }
  235. [Subscription("TriStateLiftPin2.PinPosition")]
  236. public int GroupTriStateLiftPinPosition { get; set; }
  237. [Subscription("TriStateLiftPin4.PinPosition")]
  238. public int DGroupTriStateLiftPinPosition { get; set; }
  239. private int _PinPosition;
  240. public int PinPosition
  241. {
  242. get
  243. {
  244. return _PinPosition;
  245. }
  246. set
  247. {
  248. _PinPosition = value;
  249. NotifyOfPropertyChange("PinPosition");
  250. }
  251. }
  252. [Subscription("TriStateLiftPin.ManualStopState")]
  253. public bool TriStateLiftPinManualStopState { get; set; }
  254. [Subscription("TriStateLiftPin2.ManualStopState")]
  255. public bool GroupTriStateLiftPinManualStopState { get; set; }
  256. [Subscription("TriStateLiftPin4.ManualStopState")]
  257. public bool DGroupTriStateLiftPinManualStopState { get; set; }
  258. private bool _ManualStopState;
  259. public bool ManualStopState
  260. {
  261. get
  262. {
  263. return _ManualStopState;
  264. }
  265. set
  266. {
  267. _ManualStopState = value;
  268. NotifyOfPropertyChange("ManualStopState");
  269. }
  270. }
  271. [Subscription("TriStateLiftPin.ManualUpState")]
  272. public bool TriStateLiftPinManualUpState { get; set; }
  273. [Subscription("TriStateLiftPin2.ManualUpState")]
  274. public bool GroupTriStateLiftPinManualUpState { get; set; }
  275. [Subscription("TriStateLiftPin4.ManualUpState")]
  276. public bool DGroupTriStateLiftPinManualUpState { get; set; }
  277. public bool _ManualUpState;
  278. public bool ManualUpState
  279. {
  280. get
  281. {
  282. return _ManualUpState;
  283. }
  284. set
  285. {
  286. _ManualUpState = value;
  287. NotifyOfPropertyChange("ManualUpState");
  288. }
  289. }
  290. [Subscription("TriStateLiftPin.ManualDownState")]
  291. public bool TriStateLiftPinManualDownState { get; set; }
  292. [Subscription("TriStateLiftPin2.ManualDownState")]
  293. public bool GroupTriStateLiftPinManualDownState { get; set; }
  294. [Subscription("TriStateLiftPin4.ManualDownState")]
  295. public bool DGroupTriStateLiftPinManualDownState { get; set; }
  296. private bool _ManualDownState;
  297. public bool ManualDownState
  298. {
  299. get
  300. {
  301. return _ManualDownState;
  302. }
  303. set
  304. {
  305. _ManualDownState = value;
  306. NotifyOfPropertyChange("ManualDownState");
  307. }
  308. }
  309. [Subscription("SmallPin.DeviceData")]
  310. public AITCylinderData UpperPinData
  311. {
  312. get;
  313. set;
  314. }
  315. [Subscription("MediumPin.DeviceData")]
  316. public AITCylinderData LowerPinData
  317. {
  318. get;
  319. set;
  320. }
  321. [Subscription("Lid.DeviceData")]
  322. public AITCylinderData LidData
  323. {
  324. get;
  325. set;
  326. }
  327. [Subscription("LidLocker.DeviceData")]
  328. public AITCylinderData LidLockerData
  329. {
  330. get;
  331. set;
  332. }
  333. [Subscription("IsOnline")]
  334. public bool IsOnline { get; set; }
  335. [Subscription("LeakRate")]
  336. public double LeakRate { get; set; }
  337. [Subscription("IsCDAOK")]
  338. public bool IsCDAOK { get; set; }
  339. [Subscription("IsArmNotExtend")]
  340. public bool IsArmNotExtend { get; set; }
  341. [Subscription(VirgoDevice.ValveMfc1)]
  342. public AITValveData GP1Valve
  343. {
  344. get;
  345. set;
  346. }
  347. [Subscription(VirgoDevice.ValveMfc2)]
  348. public AITValveData GP2Valve
  349. {
  350. get;
  351. set;
  352. }
  353. [Subscription(VirgoDevice.ValveMfc3)]
  354. public AITValveData GP3Valve
  355. {
  356. get;
  357. set;
  358. }
  359. [Subscription(VirgoDevice.ValveMfc4)]
  360. public AITValveData GP4Valve
  361. {
  362. get;
  363. set;
  364. }
  365. [Subscription(VirgoDevice.ValveMfc5)]
  366. public AITValveData GP5Valve
  367. {
  368. get;
  369. set;
  370. }
  371. [Subscription(VirgoDevice.ValveChamberPurge)]
  372. public AITValveData ChamberPurgeValve
  373. {
  374. get;
  375. set;
  376. }
  377. [Subscription(VirgoDevice.ValveChamberPurge)]
  378. public AITValveData SoftVentVlv { get; set; }
  379. [Subscription(VirgoDevice.ValveFastVent)]
  380. public AITValveData FastVentVlv { get; set; }
  381. [Subscription(VirgoDevice.ValveSoftPumping)]
  382. public AITValveData SoftPumpVlv { get; set; }
  383. [Subscription(VirgoDevice.ValveFastPumping)]
  384. public AITValveData FastPumpVlv { get; set; }
  385. [Subscription(VirgoDevice.ValveN2Supply)]
  386. public AITValveData N2SupplyVlv { get; set; }
  387. [Subscription(VirgoDevice.ValveProcess)]
  388. public AITValveData ProcessVlv { get; set; }
  389. [Subscription("SensorATMSwitch")]
  390. public AITSensorData SensorATMSwitch { get; set; }
  391. [Subscription("N2PressureOk")]
  392. public AITSensorData N2PressureOk { get; set; }
  393. [Subscription("SensorVacSwitch")]
  394. public AITSensorData SensorVacSwitch { get; set; }
  395. [Subscription("SensorWaterFlowOk")]
  396. public AITSensorData SensorWaterFlowOk { get; set; }
  397. [Subscription("SensorCDAPressureOk")]
  398. public AITSensorData SensorCDAPressureOk { get; set; }
  399. //[Subscription("SensorCDAPressureOk2")]
  400. //public AITSensorData SensorCDAPressureOk2 { get; set; }
  401. [Subscription("SourceFan1")]
  402. public AITSensorData SourceFan1 { get; set; }
  403. [Subscription("SensorWaterLeakOk")]
  404. public AITSensorData SensorWaterLeakOk { get; set; }
  405. [Subscription("SensorArmNotExtend")]
  406. public AITSensorData SensorArmNotExtend { get; set; }
  407. [Subscription("TriStateLiftPin.CurrentValue")]
  408. public float TriStateLiftPinCurrentValue { get; set; }
  409. public void TriStateLiftPinStop()
  410. {
  411. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{_servoLiftPinName}.Stop");
  412. }
  413. public void TriStateLiftPinUp()
  414. {
  415. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{_servoLiftPinName}.Up");
  416. }
  417. public void TriStateLiftPinDown()
  418. {
  419. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{_servoLiftPinName}.Down");
  420. }
  421. private AITMfcData _mfc1;
  422. [Subscription(VirgoDevice.MfcGas1)]
  423. public AITMfcData GP1Mfc
  424. {
  425. get
  426. {
  427. return _mfc1;
  428. }
  429. set
  430. {
  431. _mfc1 = value;
  432. if (IsAutoMode && MfcGas1Enable)
  433. {
  434. PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas1.FeedBack").Setpoint = _mfc1.SetPoint.ToString("F1");
  435. }
  436. }
  437. }
  438. private AITMfcData _mfc2;
  439. [Subscription(VirgoDevice.MfcGas2)]
  440. public AITMfcData GP2Mfc
  441. {
  442. get
  443. {
  444. return _mfc2;
  445. }
  446. set
  447. {
  448. _mfc2 = value;
  449. if (IsAutoMode && MfcGas2Enable)
  450. {
  451. PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas2.FeedBack").Setpoint = _mfc2.SetPoint.ToString("F1");
  452. }
  453. }
  454. }
  455. private AITMfcData _mfc3;
  456. [Subscription(VirgoDevice.MfcGas3)]
  457. public AITMfcData GP3Mfc
  458. {
  459. get
  460. {
  461. return _mfc3;
  462. }
  463. set
  464. {
  465. _mfc3 = value;
  466. if (IsAutoMode && MfcGas3Enable/* && _Gaslines.Count > 2*/)
  467. {
  468. PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas3.FeedBack").Setpoint = _mfc3.SetPoint.ToString("F1");
  469. }
  470. }
  471. }
  472. private AITMfcData _mfc4;
  473. [Subscription(VirgoDevice.MfcGas4)]
  474. public AITMfcData GP4Mfc
  475. {
  476. get
  477. {
  478. return _mfc4;
  479. }
  480. set
  481. {
  482. _mfc4 = value;
  483. if (IsAutoMode && MfcGas4Enable/* && _Gaslines.Count > 3*/)
  484. {
  485. PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas4.FeedBack").Setpoint = _mfc4.SetPoint.ToString("F1");
  486. }
  487. }
  488. }
  489. private AITMfcData _mfc5;
  490. [Subscription(VirgoDevice.MfcGas5)]
  491. public AITMfcData GP5Mfc
  492. {
  493. get
  494. {
  495. return _mfc5;
  496. }
  497. set
  498. {
  499. _mfc5 = value;
  500. if (IsAutoMode && MfcGas5Enable/* && _Gaslines.Count > 4*/)
  501. {
  502. PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas5.FeedBack").Setpoint = _mfc5.SetPoint.ToString("F1");
  503. }
  504. }
  505. }
  506. [Subscription("Chiller.DeviceData")]
  507. public AITChillerData ChillerData { get; set; }
  508. [Subscription("HeaterChamber.DeviceData")]
  509. public AITHeaterData HeaterChamber { get; set; }
  510. [Subscription("ForelineHeater.DeviceData")]
  511. public AITHeaterData ForelineHeater { get; set; }
  512. [Subscription("WallHeater.DeviceData")]
  513. public AITHeaterData WallHeater { get; set; }
  514. [Subscription("GridHeater.DeviceData")]
  515. public AITHeaterData GridHeater { get; set; }
  516. [Subscription(VirgoDevice.ProcessGauge)]
  517. public AITPressureMeterData ProcessGauge { get; set; }
  518. [Subscription(VirgoDevice.PressureGauge)]
  519. public AITPressureMeterData PressureGauge { get; set; }
  520. [Subscription(VirgoDevice.ForelineGauge)]
  521. public AITPressureMeterData ForelineGauge { get; set; }
  522. private AITRfData _rf;
  523. [Subscription("Rf.DeviceData")]
  524. public AITRfData Rf
  525. {
  526. get
  527. {
  528. return _rf;
  529. }
  530. set
  531. {
  532. _rf = value;
  533. if (IsAutoMode)
  534. {
  535. PMParameters.Find(x => x.Name == $"{SystemName}.Rf.PowerOnTime").Setpoint = "";
  536. PMParameters.Find(x => x.Name == $"{SystemName}.Rf.ForwardPower").Setpoint = _rf.PowerSetPoint.ToString("F0");
  537. RfDutySetPoint = _rf.DutySetPoint.ToString("F0");
  538. NotifyOfPropertyChange("RfDutySetPoint");
  539. RfFrequencySetPoint = _rf.FrequencySetPoint.ToString("F0");
  540. NotifyOfPropertyChange("RfFrequencySetPoint");
  541. RfModeSetPoint = _rf.WorkMode == (int)RfMode.ContinuousWaveMode ? "Continuous" : "Pulsing";
  542. NotifyOfPropertyChange("RfModeSetPoint");
  543. }
  544. }
  545. }
  546. private AITRfData _rfBias;
  547. [Subscription("BiasRf.DeviceData")]
  548. public AITRfData RfBias
  549. {
  550. get
  551. {
  552. return _rfBias;
  553. }
  554. set
  555. {
  556. _rfBias = value;
  557. if (IsAutoMode)
  558. {
  559. PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.MatchProcessMode").Setpoint = _rfBias.MatchPresetMode == (int)BiasRfMatchMode.Preset ? "Preset" : "Hold";
  560. PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.C1").Setpoint = _rfBias.MatchPositionC1SetPoint.ToString("F1");
  561. PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.C2").Setpoint = _rfBias.MatchPositionC2SetPoint.ToString("F1");
  562. PMParameters.Find(x => x.Name == $"{SystemName}.BiasRf.ForwardPower").Setpoint = _rfBias.PowerSetPoint.ToString("F0");
  563. RfMatchProcessModeSetPoint = _rf.TritonMatchProcessModeDisplay;
  564. InvokePropertyChanged("RfMatchProcessModeSetPoint");
  565. }
  566. }
  567. }
  568. private AITRfMatchData _match;
  569. [Subscription("Match.DeviceData")]
  570. public AITRfMatchData Match
  571. {
  572. get
  573. {
  574. return _match;
  575. }
  576. set
  577. {
  578. _match = value;
  579. RfMatchPositionC1SetPoint = _match.TunePosition1.ToString("F0");
  580. NotifyOfPropertyChange("RfMatchPositionC1SetPoint");
  581. RfMatchPositionC2SetPoint = _match.TunePosition2.ToString("F0");
  582. NotifyOfPropertyChange("RfMatchPositionC2SetPoint");
  583. }
  584. }
  585. [Subscription("MainPump.DeviceData")]
  586. public AITPumpData MainPumpData { get; set; }
  587. private AITThrottleValveData _tv;
  588. [Subscription(VirgoDevice.ThrottleValve)]
  589. public AITThrottleValveData Tv
  590. {
  591. get
  592. {
  593. return _tv;
  594. }
  595. set
  596. {
  597. _tv = value;
  598. if (IsAutoMode)
  599. {
  600. PMParameters.Find(x => x.Name == $"{SystemName}.IoThrottleValve.ThrottleValve.TVMode").Setpoint = _tv.Mode == (int)PressureCtrlMode.TVPressureCtrl ? "Pressure"
  601. : _tv.Mode == (int)PressureCtrlMode.TVPositionCtrl ? "Position" : "Undefined";
  602. PMParameters.Find(x => x.Name == $"{SystemName}.IoThrottleValve.ThrottleValve.TVMode").Feedback = _tv.Mode == (int)PressureCtrlMode.TVPressureCtrl ? "Pressure"
  603. : _tv.Mode == (int)PressureCtrlMode.TVPositionCtrl ? "Position" : "Undefined";
  604. PMParameters.Find(x => x.Name == $"{SystemName}.IoThrottleValve.ThrottleValve.TVPosition").Setpoint = _tv.PositionSetPoint.ToString("F0");
  605. PMParameters.Find(x => x.Name == $"{SystemName}.IoThrottleValve.ThrottleValve.TVPressure").Setpoint = _tv.PressureSetPoint.ToString("F0");
  606. ThrottleValveModeSetPoint = _tv.TextMode;
  607. NotifyOfPropertyChange("ThrottleValveModeSetPoint");
  608. ThrottleValvePositionSetPoint = _tv.PositionSetPoint.ToString("F0");
  609. NotifyOfPropertyChange("ThrottleValvePositionSetPoint");
  610. ThrottleValvePressureSetPoint = _tv.PressureSetPoint.ToString("F0");
  611. NotifyOfPropertyChange("ThrottleValvePressureSetPoint");
  612. }
  613. }
  614. }
  615. public double TvHeight { get; set; }
  616. public Visibility TvVisible { get; set; }
  617. private AITSensorData _chamberDoorLid = new AITSensorData();
  618. [Subscription(VirgoDevice.ChamberLid)]
  619. public AITSensorData ChamberDoorLid
  620. {
  621. get
  622. {
  623. return _chamberDoorLid;
  624. }
  625. set
  626. {
  627. _chamberDoorLid = value;
  628. }
  629. }
  630. private bool _isAutoMode;
  631. private R_TRIG _trigChangeToAuto = new R_TRIG();
  632. [Subscription(StateData.IsAutoMode)]
  633. public bool IsAutoMode
  634. {
  635. get
  636. {
  637. return _isAutoMode;
  638. }
  639. set
  640. {
  641. _isAutoMode = value;
  642. _trigChangeToAuto.CLK = _isAutoMode;
  643. if (_trigChangeToAuto.Q)
  644. {
  645. RfTimeSetPoint = "";
  646. NotifyOfPropertyChange("RfTimeSetPoint");
  647. RfModeSetPoint = "";
  648. NotifyOfPropertyChange("RfModeSetPoint");
  649. PMParameters.Find(x => x.Name == $"{SystemName}.Rf.ForwardPower").Setpoint = "";
  650. RfFrequencySetPoint = "";
  651. NotifyOfPropertyChange("RfFrequencySetPoint");
  652. RfDutySetPoint = "";
  653. NotifyOfPropertyChange("RfDutySetPoint");
  654. RfMatchProcessModeSetPoint = "";
  655. InvokePropertyChanged("RfMatchProcessModeSetPoint");
  656. RfMatchPositionC1SetPoint = "";
  657. NotifyOfPropertyChange("RfMatchPositionC1SetPoint");
  658. RfMatchPositionC2SetPoint = "";
  659. NotifyOfPropertyChange("RfMatchPositionC2SetPoint");
  660. for (int i = 1; i <= 5; i++) //GasLine 跳号Enable
  661. {
  662. if ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.MfcGas{i}.Enable"))
  663. {
  664. PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas{i}.FeedBack").Setpoint = "";
  665. }
  666. }
  667. //PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas1.FeedBack").Setpoint = "";
  668. //PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas2.FeedBack").Setpoint = "";
  669. //PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas3.FeedBack").Setpoint = "";
  670. //if (_Gaslines.Count > 3)
  671. // PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas4.FeedBack").Setpoint = "";
  672. //if (_Gaslines.Count > 4)
  673. // PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas5.FeedBack").Setpoint = "";
  674. ElectrodeTemperatureSetPoint = "";
  675. NotifyOfPropertyChange("ElectrodeTemperatureSetPoint");
  676. StepModeSetPoint = "";
  677. NotifyOfPropertyChange("StepModeSetPoint");
  678. }
  679. }
  680. }
  681. public bool IsManualMode
  682. {
  683. get
  684. {
  685. return !IsAutoMode;
  686. }
  687. }
  688. public bool IsRFEnabled
  689. {
  690. get
  691. {
  692. return IsManualMode && IsGasFlowing || IsRfPowering;
  693. }
  694. }
  695. //public bool IsMatchPositionInputEnabled
  696. //{
  697. // get
  698. // {
  699. // if (Rf != null && Match.TuneMode1 == EnumRfMatchTuneMode.Auto)
  700. // return false;
  701. // return IsManualMode;
  702. // }
  703. //}
  704. [Subscription(StateData.RecipeStepNo)]
  705. public int RecipeStepNo
  706. {
  707. get;
  708. set;
  709. }
  710. private int _recipeStepMode;
  711. [Subscription(StateData.RecipeStepMode)]
  712. public int RecipeStepMode
  713. {
  714. get
  715. {
  716. return _recipeStepMode;
  717. }
  718. set
  719. {
  720. _recipeStepMode = value;
  721. if (IsAutoMode)
  722. {
  723. switch (_recipeStepMode)
  724. {
  725. //case (int)EndByCondition.EndByHeatUp:
  726. // StepModeSetPoint = "Heat Up";
  727. // break;
  728. //case (int)EndByCondition.EndByRfTime:
  729. // StepModeSetPoint = "RF Time";
  730. // break;
  731. default:
  732. StepModeSetPoint = "Step Time";
  733. break;
  734. }
  735. NotifyOfPropertyChange("StepModeSetPoint");
  736. }
  737. }
  738. }
  739. [Subscription(StateData.RecipeProcessTime)]
  740. public string RecipeProcessTime
  741. {
  742. get;
  743. set;
  744. }
  745. [Subscription(StateData.PumpTime)]
  746. public string PumpTime
  747. {
  748. get;
  749. set;
  750. }
  751. [Subscription(StateData.PMState)]
  752. public int PMStatus { get; set; }
  753. [Subscription(StateData.IsPumpingOkForProcess)]
  754. public bool IsPumpingOkForProcess
  755. {
  756. get;
  757. set;
  758. }
  759. [Subscription(StateData.IsCoolingOkForProcess)]
  760. public bool IsCoolingOkForProcess
  761. {
  762. get;
  763. set;
  764. }
  765. [Subscription(StateData.IsGasFlowingOkForProcess)]
  766. public bool IsGasFlowingOkForProcess
  767. {
  768. get;
  769. set;
  770. }
  771. [Subscription(StateData.DataLogName)]
  772. public string DataLogName
  773. {
  774. get;
  775. set;
  776. }
  777. [Subscription(StateData.TotalCycle)]
  778. public int TotalCycle
  779. {
  780. get;
  781. set;
  782. }
  783. [Subscription(StateData.SmallWafer)]
  784. public int SmallWafer { get; set; }
  785. [Subscription(StateData.MidWafer)]
  786. public int MidWafer { get; set; }
  787. [Subscription(StateData.BigWafer)]
  788. public int BigWafer { get; set; }
  789. public string TvText
  790. {
  791. get
  792. {
  793. //if (Tv == null || !SCLocal.PressureControlConfig.EnableThrottleValve)
  794. return "";
  795. //return string.Format("{0}%", Tv.PositionFeedback.ToString("F0"));
  796. }
  797. }
  798. public string TvTextBackground
  799. {
  800. get
  801. {
  802. if (Tv == null)
  803. return "Transparent";
  804. if (Tv.State != 1)
  805. return "Red";
  806. return "Green";
  807. }
  808. }
  809. public string PmOperationMode
  810. {
  811. get
  812. {
  813. return IsAutoMode ? "Auto" : "Manual";
  814. }
  815. }
  816. public string PmOnlineMode
  817. {
  818. get
  819. {
  820. return IsOnline ? "Online" : "Offline";
  821. }
  822. }
  823. public bool IsOnlineButtonEnabled
  824. {
  825. get { return !IsOnline; }
  826. }
  827. public bool IsOfflineButtonEnabled
  828. {
  829. get { return IsOnline; }
  830. }
  831. [IgnorePropertyChange]
  832. public bool BasePressureSetPointSaved { get; set; }
  833. [IgnorePropertyChange]
  834. public bool PumpLimitSetPointSaved { get; set; }
  835. public double ElectrodeTemperatureFeedback
  836. {
  837. get
  838. {
  839. return 0;
  840. //return SCLocal.CoolingConfig.EnableElectrodeTcLeftAsControlTc ? (ElectrodeLeftThermalCouple!= null ? ElectrodeLeftThermalCouple.FeedBack :0) :
  841. // (ElectrodeRightThermalCouple!=null ? ElectrodeRightThermalCouple.FeedBack : 0);
  842. }
  843. }
  844. public int WaferLength
  845. {
  846. get
  847. {
  848. Ax.WaferInfo wafer = ChamberWafer==null ? new Ax.WaferInfo() : ChamberWafer[0];
  849. if (wafer.IsEmpty)
  850. return 0;
  851. switch (wafer.Size)
  852. {
  853. case Ax.WaferSize.WS3: return 85;
  854. case Ax.WaferSize.WS4: return 125;
  855. default: return 145;
  856. }
  857. }
  858. }
  859. public bool IsHeaterButtonEnable
  860. {
  861. get
  862. {
  863. if (SystemName == "PMB")
  864. {
  865. if ((bool)QueryDataClient.Instance.Service.GetConfig($"PMA.Chiller.EnableChiller") && (bool)QueryDataClient.Instance.Service.GetConfig($"PMB.Chiller.ChillerSameWithPMA"))
  866. {
  867. return false;
  868. }
  869. else
  870. return IsManualMode;
  871. }
  872. else
  873. return IsManualMode;
  874. }
  875. }
  876. public string HeaterButtonContent
  877. {
  878. get
  879. {
  880. if ((bool)QueryDataClient.Instance.Service.GetConfig($"PMA.Chiller.EnableChiller"))
  881. {
  882. if (SystemName == "PMB")
  883. {
  884. if ((bool)QueryDataClient.Instance.Service.GetConfig($"PMB.Chiller.ChillerSameWithPMA"))
  885. {
  886. return "Temperature Set";
  887. }
  888. else
  889. {
  890. if ((bool)QueryDataClient.Instance.Service.GetConfig($"PMB.Chiller.EnableChiller"))
  891. {
  892. return "Temperature Set";
  893. }
  894. else
  895. {
  896. return "Substrate Heating";
  897. }
  898. }
  899. }
  900. else
  901. {
  902. return "Temperature Set";
  903. }
  904. }
  905. else
  906. return "Substrate Heating";
  907. }
  908. }
  909. //public string WaferSize
  910. //{
  911. // get
  912. // {
  913. // Ax.WaferInfo wafer = ChamberWafer == null ? new Ax.WaferInfo() : ChamberWafer[0];
  914. // if (wafer.IsEmpty)
  915. // return "";
  916. // switch (wafer.Size)
  917. // {
  918. // case Ax.WaferSize.WS3: return SmallWafer.ToString();
  919. // case Ax.WaferSize.WS4: return MidWafer.ToString();
  920. // default: return BigWafer.ToString();
  921. // }
  922. // }
  923. //}
  924. public bool IsSmallPinVisible
  925. {
  926. get { return (int)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.LiftPinMode") == 1; }
  927. }
  928. public bool IsMidPinVisible
  929. {
  930. get { return (int)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.LiftPinMode") == 1; }
  931. }
  932. public bool IsLiftPinVisible
  933. {
  934. get { return true; }
  935. }
  936. public bool IsLiftPinUp
  937. {
  938. get
  939. {
  940. return PinPosition == 3;
  941. }
  942. }
  943. public bool IsLiftPinMiddle
  944. {
  945. get
  946. {
  947. return PinPosition == 2;
  948. }
  949. }
  950. public bool IsLiftPinHome
  951. {
  952. get
  953. {
  954. return PinPosition == 0;
  955. }
  956. }
  957. public bool EnableLiftPinUp
  958. {
  959. get { return !IsAutoMode && !IsLiftPinUp; }
  960. }
  961. public bool EnableLiftPinMiddle
  962. {
  963. get { return !IsAutoMode && !IsLiftPinMiddle; }
  964. }
  965. public bool EnableLiftPinHome
  966. {
  967. get { return !IsAutoMode && !IsLiftPinHome; }
  968. }
  969. public bool EnableLock
  970. {
  971. get { return LidLockerData != null && !LidLockerData.OpenSetPoint; }
  972. }
  973. public bool IsLiftPinDown
  974. {
  975. get
  976. {
  977. return PinPosition == 1;
  978. }
  979. }
  980. public bool EnableLiftPinDown
  981. {
  982. get { return !IsAutoMode && !IsLiftPinDown; }
  983. }
  984. public bool EnableUnlock
  985. {
  986. get { return LidLockerData != null && !LidLockerData.CloseSetPoint; }
  987. }
  988. public bool IsUpperPinUp
  989. {
  990. get { return UpperPinData != null && UpperPinData.OpenFeedback; }
  991. }
  992. public bool EnableUpperPinUp
  993. {
  994. get { return !IsAutoMode && UpperPinData != null && !UpperPinData.OpenFeedback; }
  995. }
  996. public bool IsUpperPinDown
  997. {
  998. get { return UpperPinData != null && UpperPinData.CloseFeedback; }
  999. }
  1000. public bool EnableUpperPinDown
  1001. {
  1002. get { return !IsAutoMode && UpperPinData != null && !UpperPinData.CloseFeedback; }
  1003. }
  1004. public bool EnableLiftPinManualMove
  1005. {
  1006. get { return !IsAutoMode; }
  1007. }
  1008. public bool IsLowerPinUp
  1009. {
  1010. get { return LowerPinData != null && LowerPinData.OpenFeedback; }
  1011. }
  1012. public bool EnableLowerPinUp
  1013. {
  1014. get { return !IsAutoMode && LowerPinData != null && !LowerPinData.OpenFeedback; }
  1015. }
  1016. public bool IsLowerPinDown
  1017. {
  1018. get { return LowerPinData != null && LowerPinData.CloseFeedback; }
  1019. }
  1020. public bool EnableLowerPinDown
  1021. {
  1022. get { return !IsAutoMode && LowerPinData != null && !LowerPinData.CloseFeedback; }
  1023. }
  1024. public bool IsLidOpen
  1025. {
  1026. get { return LidData != null && !LidData.CloseFeedback; }
  1027. }
  1028. public bool EnableCloseLid
  1029. {
  1030. get
  1031. {
  1032. return LidData != null && !LidData.CloseFeedback;
  1033. }
  1034. }
  1035. public bool EnableOpenLid
  1036. {
  1037. get
  1038. {
  1039. return LidData != null && LidData.CloseFeedback;
  1040. }
  1041. }
  1042. public bool IsSlitValveOpen
  1043. {
  1044. get { return SlitDoorData != null && SlitDoorData.OpenFeedback; }
  1045. }
  1046. public bool IsSlitValveClose
  1047. {
  1048. get { return !IsSlitValveOpen; }
  1049. }
  1050. public bool EnableCloseSlitValve
  1051. {
  1052. get
  1053. {
  1054. return !IsAutoMode && SlitDoorData != null && !SlitDoorData.CloseFeedback;
  1055. }
  1056. }
  1057. public bool EnableOpenSlitValve
  1058. {
  1059. get
  1060. {
  1061. return !IsAutoMode && SlitDoorData != null && SlitDoorData.CloseFeedback;
  1062. }
  1063. }
  1064. public bool EnableRfTimeSetPoint
  1065. {
  1066. get
  1067. {
  1068. return IsManualMode;
  1069. }
  1070. }
  1071. //public bool IsEnableCloseLid
  1072. //{
  1073. // get
  1074. // {
  1075. // return !ChamberDoorLid.IsClose && !IsAutoMode;
  1076. // }
  1077. //}
  1078. public bool IsLeftTcAsControlTc
  1079. {
  1080. get
  1081. {
  1082. return true;//SCLocal.CoolingConfig.EnableElectrodeTcLeftAsControlTc;
  1083. }
  1084. }
  1085. public bool IsRightTcAsControlTc
  1086. {
  1087. get
  1088. {
  1089. return !IsLeftTcAsControlTc;
  1090. }
  1091. }
  1092. public bool IsEnableRecipeScan
  1093. {
  1094. get
  1095. {
  1096. return IsAutoMode && !IsProcessing;
  1097. }
  1098. }
  1099. public bool IsEnableLotScan
  1100. {
  1101. get
  1102. {
  1103. return IsAutoMode && !IsProcessing;
  1104. }
  1105. }
  1106. public bool IsEnableSelectRecipe
  1107. {
  1108. get
  1109. {
  1110. return IsAutoMode && !IsProcessing;
  1111. }
  1112. }
  1113. public bool IsEnableStartRecipe
  1114. {
  1115. get
  1116. {
  1117. return IsAutoMode && !string.IsNullOrEmpty(SelectedRecipeName) && !IsProcessing;
  1118. }
  1119. }
  1120. public bool IsEnableNextStep
  1121. {
  1122. get
  1123. {
  1124. return IsAutoMode && IsProcessing;
  1125. }
  1126. }
  1127. public bool IsEnableStopRecipe
  1128. {
  1129. get
  1130. {
  1131. return IsAutoMode && IsProcessing;
  1132. }
  1133. }
  1134. public bool IsBarcodeEnabled
  1135. {
  1136. get;
  1137. set;
  1138. }
  1139. public bool IsRfPowerOn
  1140. {
  1141. get
  1142. {
  1143. return Rf != null && Rf.IsRfOn;
  1144. }
  1145. }
  1146. public bool IsBiasRfPowerOn
  1147. {
  1148. get
  1149. {
  1150. return RfBias != null && RfBias.IsRfOn;
  1151. }
  1152. }
  1153. public bool IsBiasMatchPowerOn
  1154. {
  1155. get
  1156. {
  1157. return RfBias != null && RfBias.IsRfOn && RfBias.IsMatchOn;
  1158. }
  1159. }
  1160. public bool IsBiasRfVisible
  1161. {
  1162. get
  1163. {
  1164. return (bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.BiasRf.EnableBiasRF");
  1165. }
  1166. }
  1167. public bool IsBiasMatchVisible
  1168. {
  1169. get
  1170. {
  1171. return (bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.BiasMatch.EnableBiasMatch");
  1172. }
  1173. }
  1174. public bool IsChillerVisibility
  1175. {
  1176. get
  1177. {
  1178. return (bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.Chiller.EnableChiller");
  1179. }
  1180. }
  1181. public bool IsHeaterVisibility
  1182. {
  1183. get
  1184. {
  1185. return !IsChillerVisibility;
  1186. }
  1187. }
  1188. public bool IsMatchPositionInputEnabled
  1189. {
  1190. get
  1191. {
  1192. if (Rf != null && RfMatchProcessModeSetPoint != "Preset")
  1193. return false;
  1194. return IsManualMode;
  1195. }
  1196. }
  1197. public bool IsChillerEnable
  1198. {
  1199. get
  1200. {
  1201. if (SystemName == "PMB")
  1202. {
  1203. if ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.Chiller.ChillerSameWithPMA"))
  1204. {
  1205. return false;
  1206. }
  1207. else
  1208. {
  1209. return (bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.Chiller.EnableChiller");
  1210. }
  1211. }
  1212. else
  1213. {
  1214. return (bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.Chiller.EnableChiller");
  1215. }
  1216. }
  1217. }
  1218. public bool IsHeaterEnable
  1219. {
  1220. get
  1221. {
  1222. return IsHeaterVisibility;
  1223. }
  1224. }
  1225. public bool SensorValue
  1226. {
  1227. get
  1228. {
  1229. return false;
  1230. }
  1231. }
  1232. public bool IsManualButtonEnabled
  1233. {
  1234. get
  1235. {
  1236. return IsAutoMode;
  1237. }
  1238. }
  1239. public bool IsAutoButtonEnabled
  1240. {
  1241. get
  1242. {
  1243. return !IsAutoMode;
  1244. }
  1245. }
  1246. public bool IsPumping
  1247. {
  1248. get
  1249. {
  1250. return (PMState)PMStatus == PMState.Pumping;
  1251. }
  1252. }
  1253. public bool IsStartPumping
  1254. {
  1255. get
  1256. {
  1257. return (PMState)PMStatus == PMState.LaunchingPump;
  1258. }
  1259. }
  1260. public bool enableServiceControl
  1261. {
  1262. get
  1263. {
  1264. return Permission == 3;
  1265. }
  1266. }
  1267. public string RecipeStepNoDisplay
  1268. {
  1269. get
  1270. {
  1271. return (PMState)PMStatus == PMState.Processing ? RecipeStepNo.ToString() : "--";
  1272. }
  1273. }
  1274. public string RecipeStepModeDisplay
  1275. {
  1276. get
  1277. {
  1278. if ((PMState)PMStatus != PMState.Processing)
  1279. return "--";
  1280. switch (RecipeStepMode)
  1281. {
  1282. //case (int)EndByCondition.EndByHeatUp:
  1283. // return "Heat Up Mode";
  1284. //case (int)EndByCondition.EndByRfTime:
  1285. // return "RF Time Mode";
  1286. default:
  1287. return "Step Time Mode";
  1288. }
  1289. }
  1290. }
  1291. private string _pumpButtonBackground = "#376092";
  1292. public string PumpButtonBackground
  1293. {
  1294. get
  1295. {
  1296. if (IsPumping)
  1297. {
  1298. _pumpButtonBackground = _pumpButtonBackground == "#95B3D7" ? "Blue" : "#95B3D7";
  1299. return _pumpButtonBackground;
  1300. }
  1301. if (IsPumpingOkForProcess)
  1302. return "#00C900";
  1303. return "#376092";
  1304. }
  1305. }
  1306. public bool IsGasFlowing
  1307. {
  1308. get
  1309. {
  1310. return (PMState)PMStatus == PMState.GasFlowing;
  1311. }
  1312. }
  1313. private string _gasFlowButtonBackground = "CadetBlue";
  1314. public string GasFlowButtonBackground
  1315. {
  1316. get
  1317. {
  1318. if (IsGasFlowing)
  1319. {
  1320. _gasFlowButtonBackground = _gasFlowButtonBackground == "#95B3D7" ? "Blue" : "#95B3D7";
  1321. return _gasFlowButtonBackground;
  1322. }
  1323. if (IsGasFlowingOkForProcess)
  1324. return "#00C900";
  1325. return "CadetBlue";
  1326. }
  1327. }
  1328. public bool IsCooling
  1329. {
  1330. get
  1331. {
  1332. return true;//ElectrodeCoolingWaterValve!=null && ElectrodeCoolingWaterValve.IsOpen;
  1333. }
  1334. }
  1335. private string _coolingButtonBackground = "CadetBlue";
  1336. public string CoolingButtonBackground
  1337. {
  1338. get
  1339. {
  1340. if (IsCooling)
  1341. {
  1342. _coolingButtonBackground = _coolingButtonBackground == "#95B3D7" ? "Blue" : "#95B3D7";
  1343. return _coolingButtonBackground;
  1344. }
  1345. if (IsCoolingOkForProcess)
  1346. return "#00C900";
  1347. return "CadetBlue";
  1348. }
  1349. }
  1350. public bool IsRfPowering
  1351. {
  1352. get
  1353. {
  1354. return (PMState)PMStatus == PMState.RfPowering;
  1355. }
  1356. }
  1357. public bool IsLeakCheck
  1358. {
  1359. get
  1360. {
  1361. return (PMState)PMStatus == PMState.LeakCheck;
  1362. }
  1363. }
  1364. private string _rfPowerButtonBackground = "CadetBlue";
  1365. public string RfPowerButtonBackground
  1366. {
  1367. get
  1368. {
  1369. if (IsRfPowering)
  1370. {
  1371. _rfPowerButtonBackground = _rfPowerButtonBackground == "#95B3D7" ? "Blue" : "#95B3D7";
  1372. return _rfPowerButtonBackground;
  1373. }
  1374. return "CadetBlue";
  1375. }
  1376. }
  1377. public bool IsCyclePurging => (PMState)PMStatus == PMState.Purge;
  1378. private string _cyclePurgeButtonBackground = "CadetBlue";
  1379. public string CyclePurgeButtonBackground
  1380. {
  1381. get
  1382. {
  1383. if (IsCyclePurging)
  1384. {
  1385. _cyclePurgeButtonBackground = _cyclePurgeButtonBackground == "#95B3D7" ? "Blue" : "#95B3D7";
  1386. return _cyclePurgeButtonBackground;
  1387. }
  1388. return "CadetBlue";
  1389. }
  1390. }
  1391. public bool IsVenting
  1392. {
  1393. get
  1394. {
  1395. return (PMState)PMStatus == PMState.Venting;
  1396. }
  1397. }
  1398. private string _ventButtonBackground = "CadetBlue";
  1399. public string VentButtonBackground
  1400. {
  1401. get
  1402. {
  1403. if (IsVenting)
  1404. {
  1405. _ventButtonBackground = _ventButtonBackground == "#95B3D7" ? "Blue" : "#95B3D7";
  1406. return _ventButtonBackground;
  1407. }
  1408. return "CadetBlue";
  1409. }
  1410. }
  1411. public bool IsProcessing
  1412. {
  1413. get
  1414. {
  1415. return (PMState)PMStatus == PMState.PreProcess || (PMState)PMStatus == PMState.Processing || (PMState)PMStatus == PMState.PostProcess;
  1416. }
  1417. }
  1418. public Visibility RfPowerOnChamberVisibility
  1419. {
  1420. get
  1421. {
  1422. return IsRfPowerOn ? Visibility.Visible : Visibility.Hidden;
  1423. }
  1424. }
  1425. public Visibility BiasRfPowerOnChamberVisibility
  1426. {
  1427. get
  1428. {
  1429. if (!IsBiasRfVisible)
  1430. return RfPowerOnChamberVisibility;
  1431. return IsBiasRfPowerOn ? Visibility.Visible : Visibility.Hidden;
  1432. }
  1433. }
  1434. public Visibility BoostPumpVisibility
  1435. {
  1436. get;
  1437. set;
  1438. }
  1439. public bool IsRfPowerOnEnabled
  1440. {
  1441. get
  1442. {
  1443. return !IsRfPowerOn;
  1444. }
  1445. }
  1446. public bool IsRfPowerOffEnabled
  1447. {
  1448. get
  1449. {
  1450. return IsRfPowerOn;
  1451. }
  1452. }
  1453. public string ChamberStatus
  1454. {
  1455. get
  1456. {
  1457. return $"{(PMState)PMStatus}";
  1458. }
  1459. }
  1460. public Brush ChamberStatusBkColor
  1461. {
  1462. get
  1463. {
  1464. switch ((PMState)PMStatus)
  1465. {
  1466. case PMState.Error:
  1467. return Brushes.Red;
  1468. case PMState.Idle:
  1469. return Brushes.LightGray;
  1470. default:
  1471. return Brushes.LightGreen;
  1472. }
  1473. //return Brushes.Transparent;
  1474. }
  1475. }
  1476. public Brush ChamberStatusForeColor
  1477. {
  1478. get
  1479. {
  1480. if (true)
  1481. return Brushes.Black;
  1482. //else if (false)
  1483. // return Brushes.LightGreen;
  1484. //return Brushes.Red;
  1485. }
  1486. }
  1487. public Brush PMOnlineColor
  1488. {
  1489. get
  1490. {
  1491. if (IsOnline)
  1492. return Brushes.LimeGreen;
  1493. return Brushes.Transparent;
  1494. }
  1495. }
  1496. public double RfReflectPower
  1497. {
  1498. get;
  1499. set;
  1500. }
  1501. public double RfForwardPower
  1502. {
  1503. get;
  1504. set;
  1505. }
  1506. public object[] RfPowerOnCommandParameter
  1507. {
  1508. get
  1509. {
  1510. return new object[] { VirgoDevice.Rf.ToString(), AITRfOperation.SetPowerOnOff.ToString(), "true" };
  1511. }
  1512. }
  1513. public object[] RfPowerOffCommandParameter
  1514. {
  1515. get
  1516. {
  1517. return new object[] { VirgoDevice.Rf.ToString(), AITRfOperation.SetPowerOnOff.ToString(), "false" };
  1518. }
  1519. }
  1520. public double LotBarcodeHeight
  1521. {
  1522. get
  1523. {
  1524. return IsBarcodeEnabled ? 35 : 0;
  1525. }
  1526. }
  1527. public double DataLogHeight
  1528. {
  1529. get
  1530. {
  1531. return IsBarcodeEnabled ? 0 : 35;
  1532. }
  1533. }
  1534. public double RecipeBarcodeHeight
  1535. {
  1536. get
  1537. {
  1538. return IsBarcodeEnabled ? 35 : 0;
  1539. }
  1540. }
  1541. public string RecipeBarcodeInputText
  1542. {
  1543. get;
  1544. set;
  1545. }
  1546. public int RecipeBarcodeLength
  1547. {
  1548. get;
  1549. set;
  1550. }
  1551. public int LotBarcodeLength
  1552. {
  1553. get;
  1554. set;
  1555. }
  1556. public int LotBarcodeMaxCount
  1557. {
  1558. get;
  1559. set;
  1560. }
  1561. [IgnorePropertyChange]
  1562. public string BasePressureSetPoint
  1563. {
  1564. get;
  1565. set;
  1566. }
  1567. [IgnorePropertyChange]
  1568. public string PumpLimitSetPoint
  1569. {
  1570. get;
  1571. set;
  1572. }
  1573. [IgnorePropertyChange]
  1574. public string ManualProcessElectrodeCriticalTemperatureSetPoint
  1575. {
  1576. get;
  1577. set;
  1578. }
  1579. private string _stepModeSetPoint = "";
  1580. [IgnorePropertyChange]
  1581. public string StepModeSetPoint
  1582. {
  1583. get
  1584. {
  1585. return _stepModeSetPoint;
  1586. }
  1587. set
  1588. {
  1589. _stepModeSetPoint = value;
  1590. }
  1591. }
  1592. [IgnorePropertyChange]
  1593. public string ElectrodeTemperatureSetPoint
  1594. {
  1595. get;
  1596. set;
  1597. }
  1598. [IgnorePropertyChange]
  1599. public string ThrottleValveModeSetPoint
  1600. {
  1601. get;
  1602. set;
  1603. }
  1604. [IgnorePropertyChange]
  1605. public string ThrottleValvePositionSetPoint
  1606. {
  1607. get;
  1608. set;
  1609. }
  1610. [IgnorePropertyChange]
  1611. public string ThrottleValvePressureSetPoint
  1612. {
  1613. get;
  1614. set;
  1615. }
  1616. [IgnorePropertyChange]
  1617. public string BoostPumpPressureSetPoint
  1618. {
  1619. get;
  1620. set;
  1621. }
  1622. [IgnorePropertyChange]
  1623. public string RfTimeSetPoint
  1624. {
  1625. get;
  1626. set;
  1627. }
  1628. private string _rfModeSetPoint;
  1629. [IgnorePropertyChange]
  1630. public string RfModeSetPoint
  1631. {
  1632. get
  1633. {
  1634. return _rfModeSetPoint;
  1635. }
  1636. set
  1637. {
  1638. _rfModeSetPoint = value;
  1639. }
  1640. }
  1641. [IgnorePropertyChange]
  1642. public string RfFrequencySetPoint
  1643. {
  1644. get;
  1645. set;
  1646. }
  1647. [IgnorePropertyChange]
  1648. public string RfDutySetPoint
  1649. {
  1650. get;
  1651. set;
  1652. }
  1653. [IgnorePropertyChange]
  1654. public string RfMatchProcessModeSetPoint
  1655. {
  1656. get;
  1657. set;
  1658. }
  1659. [IgnorePropertyChange]
  1660. public string RfMatchPositionC1SetPoint
  1661. {
  1662. get;
  1663. set;
  1664. }
  1665. [IgnorePropertyChange]
  1666. public string RfMatchPositionC2SetPoint
  1667. {
  1668. get;
  1669. set;
  1670. }
  1671. private string _selectedRecipeName;
  1672. [Subscription("RecipeName")]
  1673. public string SelectedRecipeName
  1674. {
  1675. get
  1676. {
  1677. return _selectedRecipeName;
  1678. }
  1679. set
  1680. {
  1681. if (string.IsNullOrEmpty(value))
  1682. return;
  1683. _selectedRecipeName = value;
  1684. if (IsAutoMode)
  1685. {
  1686. InvokePropertyChanged("SelectedRecipeName");
  1687. }
  1688. }
  1689. }
  1690. [Subscription("ProcessStatus")]
  1691. public string ProcessStatus
  1692. {
  1693. get;
  1694. set;
  1695. }
  1696. [Subscription("RecipeStepTimeElapsed")]
  1697. public string RecipeStepTimeElapsed
  1698. {
  1699. get;
  1700. set;
  1701. }
  1702. [Subscription("RecipeStepTimeSetPoint")]
  1703. public string RecipeStepTimeSetPoint
  1704. {
  1705. get;
  1706. set;
  1707. }
  1708. [Subscription("RecipeSteps")]
  1709. public string RecipeSteps
  1710. {
  1711. get;
  1712. set;
  1713. }
  1714. private string _recipeStepRfTimeSetPoint;
  1715. [Subscription("RecipeStepRfTimeSetPoint")]
  1716. public string RecipeStepRfTimeSetPoint
  1717. {
  1718. get
  1719. {
  1720. return _recipeStepRfTimeSetPoint;
  1721. }
  1722. set
  1723. {
  1724. _recipeStepRfTimeSetPoint = value;
  1725. if (IsAutoMode)
  1726. {
  1727. RfTimeSetPoint = _recipeStepRfTimeSetPoint;
  1728. InvokePropertyChanged("RfTimeSetPoint");
  1729. }
  1730. }
  1731. }
  1732. //public string RecipeStatusBackground
  1733. //{
  1734. // get
  1735. // {
  1736. // return IsProcessing ? "Green" : "Blue";
  1737. // }
  1738. //}
  1739. public ObservableCollection<string> RFModeItems
  1740. {
  1741. get;
  1742. set;
  1743. }
  1744. public bool IsRFModeSelectable
  1745. {
  1746. get;
  1747. set;
  1748. }
  1749. public bool IsFullControlPermission
  1750. {
  1751. get;
  1752. set;
  1753. }
  1754. public bool EnableDeviceControl
  1755. {
  1756. get
  1757. {
  1758. return IsFullControlPermission;
  1759. }
  1760. }
  1761. public Visibility WallHeaterVisibility { get; set; }
  1762. public Visibility GridHeaterVisibility { get; set; }
  1763. public Ax.WaferSize SmallPinWaferSize { get; set; }
  1764. public Ax.WaferSize MediumPinWaferSize { get; set; }
  1765. public Ax.WaferSize BigPinWaferSize { get; set; }
  1766. public string SmallPinUpText { get; set; }
  1767. public string SmallPinDownText { get; set; }
  1768. public string MediumPinUpText { get; set; }
  1769. public string MediumPinDownText { get; set; }
  1770. public int SmallPinHeight { get; set; }
  1771. public int MediumPinHeight { get; set; }
  1772. private int MenuPermission;
  1773. private int _servoLiftPinMode;
  1774. private string _servoLiftPinName;
  1775. public PmOverviewViewModel()
  1776. {
  1777. BasePressureSetPointSaved = true;
  1778. PumpLimitSetPointSaved = true;
  1779. }
  1780. protected override void Poll()
  1781. {
  1782. base.Poll();
  1783. if(_view != null &&_view.Middle_LiftPin.Resources.Count == 0 && _resourceDic != null && _resourceDic.Count > 0)
  1784. {
  1785. foreach (var rsSource in _resourceDic)
  1786. {
  1787. var rs = (System.Collections.DictionaryEntry)rsSource;
  1788. Application.Current.Dispatcher.BeginInvoke(new System.Action(()=> {
  1789. if(!_view.Middle_LiftPin.Resources.Contains(rs.Key))
  1790. {
  1791. _view.Middle_LiftPin.Resources.Add(rs.Key, rs.Value);
  1792. }
  1793. }));
  1794. }
  1795. }
  1796. PinPosition = _servoLiftPinMode == 1 ? TriStateLiftPinPosition : _servoLiftPinMode == 2 ? GroupTriStateLiftPinPosition: DGroupTriStateLiftPinPosition;
  1797. ManualStopState = _servoLiftPinMode == 1 ? TriStateLiftPinManualStopState : _servoLiftPinMode == 2 ? GroupTriStateLiftPinManualStopState: DGroupTriStateLiftPinManualStopState;
  1798. ManualUpState = _servoLiftPinMode == 1 ? TriStateLiftPinManualUpState : _servoLiftPinMode == 2 ? GroupTriStateLiftPinManualUpState: DGroupTriStateLiftPinManualUpState;
  1799. ManualDownState = _servoLiftPinMode == 1 ? TriStateLiftPinManualDownState : _servoLiftPinMode == 2 ? GroupTriStateLiftPinManualDownState: DGroupTriStateLiftPinManualDownState;
  1800. }
  1801. protected override void OnActivate()
  1802. {
  1803. base.OnActivate();
  1804. _servoLiftPinMode = (int)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.LiftPinMode");
  1805. _servoLiftPinName = _servoLiftPinMode == 1 ? "TriStateLiftPin" : _servoLiftPinMode == 2 ? "TriStateLiftPin2" : _servoLiftPinMode == 4 ? "TriStateLiftPin4" : "";
  1806. BasePressureSetPoint = QueryDataClient.Instance.Service.GetConfig($"{SystemName}.Pump.PumpBasePressure").ToString();
  1807. PumpLimitSetPoint = ((float)(double)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.Pump.PumpTimeLimit")).ToString();
  1808. SmallPinWaferSize = MapWaferSize((int)QueryDataClient.Instance.Service.GetConfig($"System.SmallWafer"));
  1809. MediumPinWaferSize = MapWaferSize((int)QueryDataClient.Instance.Service.GetConfig($"System.MidWafer"));
  1810. BigPinWaferSize = MapWaferSize((int)QueryDataClient.Instance.Service.GetConfig($"System.BigWafer"));
  1811. SmallPinUpText = $"{SmallPinWaferSize} Pin Up";
  1812. SmallPinDownText = $"{SmallPinWaferSize} Pin Down";
  1813. MediumPinUpText = $"{MediumPinWaferSize} Pin Up";
  1814. MediumPinDownText = $"{MediumPinWaferSize} Pin Down";
  1815. SmallPinHeight = (int)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.LiftPinMode") == 0 ? 0 : 32;
  1816. MediumPinHeight = (int)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.LiftPinMode") == 0 ? 0 : 32;
  1817. WallHeaterVisibility = ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.EnableWallHeater")) ? Visibility.Visible : Visibility.Hidden;
  1818. GridHeaterVisibility = ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.EnableGridHeater")) ? Visibility.Visible : Visibility.Hidden;
  1819. EPDVisibility = (bool) QueryDataClient.Instance.Service.GetConfig($"System.SetUp.EPDInstalled") && (bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.EPD.IsEnabled")
  1820. ? Visibility.Visible
  1821. : Visibility.Hidden;
  1822. }
  1823. private Ax.WaferSize MapWaferSize(int value)
  1824. {
  1825. switch (value)
  1826. {
  1827. case 3: return Ax.WaferSize.WS3;
  1828. case 4: return Ax.WaferSize.WS4;
  1829. case 6: return Ax.WaferSize.WS6;
  1830. case 8: return Ax.WaferSize.WS8;
  1831. }
  1832. return Ax.WaferSize.WS0;
  1833. }
  1834. private PmOverviewView _view;
  1835. private ResourceDictionary _resourceDic = new ResourceDictionary();
  1836. protected override void OnViewLoaded(object view)
  1837. {
  1838. base.OnViewLoaded(_view);
  1839. this._view = (PmOverviewView)view;
  1840. _resourceDic.Clear();
  1841. foreach (var rsSource in _view.Middle_LiftPin.Resources)
  1842. {
  1843. var rs = (System.Collections.DictionaryEntry)rsSource;
  1844. _resourceDic.Add(rs.Key, rs.Value);
  1845. }
  1846. _view.Middle_LiftPin.Resources.Clear();
  1847. }
  1848. protected override void OnDeactivate(bool close)
  1849. {
  1850. base.OnDeactivate(close);
  1851. }
  1852. protected override void OnInitialize()
  1853. {
  1854. base.OnInitialize();
  1855. InitGasLine();
  1856. InitParameterList(SystemName);
  1857. foreach (var pmParameter in PMParameters)
  1858. {
  1859. Subscribe(pmParameter.Name);
  1860. }
  1861. }
  1862. private void InitGasLine()
  1863. {
  1864. Gaslines = new List<GaslineItem>();
  1865. for (int i = 1; i <= 5; i++) //GasLine 跳号Enable
  1866. {
  1867. if ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.MfcGas{i}.Enable"))
  1868. {
  1869. var gasName = QueryDataClient.Instance.Service.GetConfig($"{SystemName}.MfcGas{i}.GasName");
  1870. var gasscale = QueryDataClient.Instance.Service.GetConfig($"{SystemName}.MfcGas{i}.MfcN2Scale");
  1871. Gaslines.Add(new GaslineItem
  1872. {
  1873. Index = (byte)i,
  1874. Display = $"MfcGas{i} " + gasName.ToString() + " " + gasscale.ToString() + " sccm",
  1875. ValveName = $"{SystemName}.ValveMfc{i}",
  1876. MfcName = $"{SystemName}.MfcGas{i}"
  1877. });
  1878. }
  1879. }
  1880. //int count = 0;
  1881. //for (int i = 1; i <= 5; i++)
  1882. //{
  1883. // if ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.MfcGas{i}.Enable")) count++;
  1884. //}
  1885. //for (byte index = 1; index <= count; index++)
  1886. //{
  1887. // var gasName = QueryDataClient.Instance.Service.GetConfig($"{SystemName}.MfcGas{index}.GasName");
  1888. // Gaslines.Add(new GaslineItem
  1889. // {
  1890. // Index = index,
  1891. // Display = gasName.ToString(),
  1892. // ValveName = $"{SystemName}.ValveMfc{index}",
  1893. // MfcName = $"{SystemName}.MfcGas{index}"
  1894. // });
  1895. //}
  1896. }
  1897. public List<PMParameter> InitParameterList(string pmID)
  1898. {
  1899. PMParameters = new List<PMParameter>();
  1900. // 工艺时间
  1901. PMParameters.Add(new PMParameter
  1902. {
  1903. Name = $"{pmID}.RecipeProcessTime", Display = "Process Time (s)", Type = ParameterType.Share, Feedback = "00:00:00"
  1904. });
  1905. // 工艺步数
  1906. PMParameters.Add(new PMParameter
  1907. {
  1908. Name = $"{pmID}.StepNo",
  1909. Display = "Process Step",
  1910. Type = ParameterType.Share,
  1911. Feedback = "0",
  1912. Setpoint = ""
  1913. });
  1914. // 工艺每一步运行时间
  1915. PMParameters.Add(new PMParameter
  1916. {
  1917. Name = $"{pmID}.RecipeStepTimeElapsed",
  1918. Display = "Time elapsed (s)",
  1919. Type = ParameterType.Default,
  1920. Feedback = "0",
  1921. Setpoint = "",
  1922. SetpointEnabled = false
  1923. });
  1924. // process gauge
  1925. PMParameters.Add(new PMParameter
  1926. {
  1927. Name = $"{pmID}.ProcessGauge.Value",
  1928. Display = "Process Pressure(mTorr)",
  1929. Type = ParameterType.Share,
  1930. Feedback = "0",
  1931. SetpointEnabled = false
  1932. });
  1933. // pressure gauge
  1934. //PMParameters.Add(new PMParameter
  1935. //{
  1936. // Name = $"{pmID}.PressureGauge.Value", Display = "腔体压力(mTorr)",
  1937. // Type = ParameterType.Share, Feedback = "0", SetpointEnabled = false
  1938. //});
  1939. // foreline gauge
  1940. // 蝶阀运作模式
  1941. PMParameters.Add(new PMParameter
  1942. {
  1943. Name = $"{pmID}.IoThrottleValve.ThrottleValve.TVMode",
  1944. Display = "TVMode",
  1945. Type = ParameterType.DropDownList,
  1946. SetpointEnabled = true,
  1947. Selections = new List<string> { "Position", "Pressure" },
  1948. Setpoint = "Pressure",
  1949. Feedback = "Pressure"
  1950. });
  1951. // 蝶阀位置
  1952. PMParameters.Add(new PMParameter
  1953. {
  1954. Name = $"{pmID}.IoThrottleValve.ThrottleValve.TVPosition", Display = "TVPosition (%)",
  1955. Type = ParameterType.Default, Feedback = "0", Setpoint = "", SetpointEnabled = true
  1956. });
  1957. // 蝶阀压力
  1958. PMParameters.Add(new PMParameter
  1959. {
  1960. Name = $"{pmID}.IoThrottleValve.ThrottleValve.TVPressure", Display = "TVPressure (mTorr)",
  1961. Type = ParameterType.Default, Feedback = "0", Setpoint = "", SetpointEnabled = true
  1962. });
  1963. // 底座温度
  1964. PMParameters.Add(new PMParameter
  1965. {
  1966. Name = $"{pmID}.IoTemperatureCtrl.TemperatureControl.SubstrateTemperature",
  1967. Display = HeaterButtonContent== "Substrate Heating" ? "LE TEMP (℃)": "Chiller TEMP(℃)",
  1968. Type = ParameterType.Default,
  1969. Feedback = "0",
  1970. Setpoint = "",
  1971. SetpointEnabled = true
  1972. });
  1973. // 射频时间
  1974. PMParameters.Add(new PMParameter
  1975. {
  1976. Name = $"{pmID}.Rf.PowerOnTime", Display = "RF Time (s)", Type = ParameterType.Default,
  1977. Feedback = "0", Setpoint = "", SetpointEnabled = true
  1978. });
  1979. //para = new PMParameter() { Display = "RF Mode", Type = ParameterType.DropDownList, Feedback = "Manual", SetpointEnabled = true };
  1980. //para.Selections = new List<string>() { "Manual", "Auto" };
  1981. //paras.Add(para);
  1982. // 设定功率
  1983. PMParameters.Add(new PMParameter
  1984. {
  1985. Name = $"{pmID}.Rf.ForwardPower", Display = "Source ForwardPower (w)", Type = ParameterType.Default,
  1986. Feedback = "", Setpoint = "", SetpointEnabled = true
  1987. });
  1988. // ReflectPower
  1989. PMParameters.Add(new PMParameter
  1990. {
  1991. Name = $"{pmID}.Rf.ReflectPower",
  1992. Display = "Source ReflectPower (w)",
  1993. Type = ParameterType.Share,
  1994. Setpoint = ""
  1995. });
  1996. //// Match C1
  1997. //PMParameters.Add(new PMParameter
  1998. //{
  1999. // Name =$"{pmID}.Match.TunePosition1", Display = "Match C1 (%)", Type = ParameterType.Default, Feedback = "", Setpoint = "",
  2000. // SetpointEnabled = true
  2001. //});
  2002. //// Match C2
  2003. //PMParameters.Add(new PMParameter
  2004. //{
  2005. // Name = $"{pmID}.Match.TunePosition2", Display = "Match C2 (%)", Type = ParameterType.Default, Feedback = "", Setpoint = "",
  2006. // SetpointEnabled = true
  2007. //});
  2008. // Match C1
  2009. PMParameters.Add(new PMParameter()
  2010. {
  2011. Name = $"{pmID}.Match.TunePosition1",
  2012. Display = "Source Match C1(%)",
  2013. Type = ParameterType.Share,
  2014. Setpoint = ""
  2015. });
  2016. // Match C2
  2017. PMParameters.Add(new PMParameter()
  2018. {
  2019. Name = $"{pmID}.Match.TunePosition2",
  2020. Display = "Source Match C2(%)",
  2021. Type = ParameterType.Share,
  2022. Setpoint = ""
  2023. });
  2024. // Vpp
  2025. PMParameters.Add(new PMParameter()
  2026. {
  2027. Name = $"{pmID}.Match.VPP",
  2028. Display = "Source Vpp", Type = ParameterType.Share, Setpoint = ""
  2029. });
  2030. if ((bool)QueryDataClient.Instance.Service.GetConfig($"{pmID}.BiasRf.EnableBiasRF"))
  2031. {
  2032. // 设定功率
  2033. PMParameters.Add(new PMParameter
  2034. {
  2035. Name = $"{pmID}.BiasRf.ForwardPower",
  2036. Display = "Bias ForwardPower(w)",
  2037. Type = ParameterType.Default,
  2038. Feedback = "",
  2039. Setpoint = "",
  2040. SetpointEnabled = true
  2041. });
  2042. // ReflectPower
  2043. PMParameters.Add(new PMParameter
  2044. {
  2045. Name = $"{pmID}.BiasRf.ReflectPower",
  2046. Display = "Bias ReflectPower(w)",
  2047. Type = ParameterType.Share,
  2048. Setpoint = ""
  2049. });
  2050. // Match Mode
  2051. PMParameters.Add(new PMParameter
  2052. {
  2053. Name = $"{pmID}.BiasMatch.MatchProcessMode",
  2054. Display = "Bias Match Mode",
  2055. Type = ParameterType.DropDownList,
  2056. SetpointEnabled = true,
  2057. Selections = new List<string> { "Preset", "Hold" },
  2058. Setpoint = "Preset",
  2059. Feedback = "Preset"
  2060. });
  2061. // Match C1
  2062. PMParameters.Add(new PMParameter
  2063. {
  2064. Name = $"{pmID}.BiasMatch.C1",
  2065. Display = "Bias Match C1(%)",
  2066. Type = ParameterType.Default,
  2067. Feedback = "0",
  2068. Setpoint = "",
  2069. SetpointEnabled = true
  2070. });
  2071. // Match C2
  2072. PMParameters.Add(new PMParameter
  2073. {
  2074. Name = $"{pmID}.BiasMatch.C2",
  2075. Display = "Bias Match C2(%)",
  2076. Type = ParameterType.Default,
  2077. Feedback = "0",
  2078. Setpoint = "",
  2079. SetpointEnabled = true
  2080. });
  2081. // Vpp
  2082. PMParameters.Add(new PMParameter()
  2083. {
  2084. Name = $"{pmID}.BiasMatch.VPP",
  2085. Display = "Bias Vpp",
  2086. Type = ParameterType.Share,
  2087. Setpoint = ""
  2088. });
  2089. }
  2090. // 气体
  2091. foreach (var gas in Gaslines)
  2092. {
  2093. PMParameters.Add(new PMParameter
  2094. {
  2095. Name = $"{pmID}.IoMfc.MfcGas{gas.Index}.FeedBack",
  2096. Display = $"{gas.Display} (sccm)",
  2097. Type = ParameterType.Default,
  2098. Feedback = "0",
  2099. Setpoint = "0",
  2100. SetpointEnabled = true
  2101. });
  2102. }
  2103. return PMParameters;
  2104. }
  2105. public void SelectRecipe()
  2106. {
  2107. if (MenuPermission != 3) return;
  2108. if (!Enum.TryParse(SystemName, out ModuleName mod))
  2109. return;
  2110. RecipeSequenceSelectDialogViewModel dialog = new RecipeSequenceSelectDialogViewModel();
  2111. dialog.DisplayName = "Select Recipe";
  2112. dialog.Files = new ObservableCollection<FileNode>(RecipeSequenceTreeBuilder.GetFiles(RecipeClient.Instance.Service.GetRecipes(mod, false).ToList()));
  2113. WindowManager wm = new WindowManager();
  2114. bool? bret = wm.ShowDialog(dialog);
  2115. if ((bool)bret)
  2116. {
  2117. SelectedRecipeName = dialog.DialogResult;
  2118. }
  2119. }
  2120. public void UnLoad()
  2121. {
  2122. }
  2123. public void Start()
  2124. {
  2125. if (MenuPermission != 3) return;
  2126. if (string.IsNullOrWhiteSpace(this.SelectedRecipeName))
  2127. {
  2128. DialogBox.ShowError("Choose recipe");
  2129. return;
  2130. }
  2131. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.RunRecipe}", $"{SystemName}\\{this.SelectedRecipeName}");
  2132. }
  2133. public void NextStep()
  2134. {
  2135. if (MenuPermission != 3) return;
  2136. if (MessageBox.Show("Next step?", "JetPlasma", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
  2137. {
  2138. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.SkipCurrentStep}");
  2139. }
  2140. }
  2141. public void Stop()
  2142. {
  2143. if (MenuPermission != 3) return;
  2144. if (MessageBox.Show("Stop process?", "JetPlasma", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
  2145. {
  2146. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.AbortRecipe}");
  2147. }
  2148. }
  2149. public void SetManual()
  2150. {
  2151. if (MenuPermission != 3) return;
  2152. InvokeClient.Instance.Service.DoOperation($"{SystemName}.PmManual");
  2153. }
  2154. public void SetAuto()
  2155. {
  2156. if (MenuPermission != 3) return;
  2157. InvokeClient.Instance.Service.DoOperation($"{SystemName}.PmAuto");
  2158. }
  2159. public void SetOnline()
  2160. {
  2161. if (MenuPermission != 3) return;
  2162. InvokeClient.Instance.Service.DoOperation($"{SystemName}.PmOnline");
  2163. }
  2164. public void SetInit()
  2165. {
  2166. if (MenuPermission != 3) return;
  2167. InvokeClient.Instance.Service.DoOperation($"{SystemName}.Home");
  2168. }
  2169. public void AbortPM()
  2170. {
  2171. if (MenuPermission != 3) return;
  2172. InvokeClient.Instance.Service.DoOperation($"{SystemName}.Abort");
  2173. }
  2174. public void SetOffline()
  2175. {
  2176. if (MenuPermission != 3) return;
  2177. InvokeClient.Instance.Service.DoOperation($"{SystemName}.PmOffline");
  2178. }
  2179. public void UnlockLid()
  2180. {
  2181. if (MenuPermission != 3) return;
  2182. InvokeClient.Instance.Service.DoOperation($"{SystemName}.UnlockLid");
  2183. }
  2184. public void LockLid()
  2185. {
  2186. if (MenuPermission != 3) return;
  2187. InvokeClient.Instance.Service.DoOperation($"{SystemName}.LockLid");
  2188. }
  2189. public void OpenSlitValve()
  2190. {
  2191. if (MenuPermission != 3) return;
  2192. if (!IsCDAOK)
  2193. {
  2194. DialogBox.ShowWarning("CDA Pressure Error");
  2195. return;
  2196. }
  2197. if (!IsArmNotExtend)
  2198. {
  2199. DialogBox.ShowWarning("Arm Is Not Extend Error");
  2200. return;
  2201. }
  2202. InvokeClient.Instance.Service.DoOperation($"{SystemName}.SlitDoor.Open");
  2203. }
  2204. public void CloseSlitValve()
  2205. {
  2206. if (MenuPermission != 3) return;
  2207. if (!IsCDAOK)
  2208. {
  2209. DialogBox.ShowWarning("CDA Pressure Error");
  2210. return;
  2211. }
  2212. if (!IsArmNotExtend)
  2213. {
  2214. DialogBox.ShowWarning("Arm Is Not Extend Error");
  2215. return;
  2216. }
  2217. InvokeClient.Instance.Service.DoOperation($"{SystemName}.SlitDoor.Close");
  2218. }
  2219. protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
  2220. {
  2221. MenuPermission = ClientApp.Instance.GetPermission($"Overview{SystemName}");
  2222. foreach (var pmParameter in PMParameters)
  2223. {
  2224. string paraName = pmParameter.Name;
  2225. if (!data.ContainsKey(paraName))
  2226. continue;
  2227. pmParameter.Feedback = $"{data[paraName]:N0}";
  2228. if (paraName == $"{SystemName}.BiasMatch.MatchProcessMode")
  2229. {
  2230. pmParameter.Feedback = (int)data[paraName] == 1 ? "Preset" : "Hold";
  2231. }
  2232. if (paraName == $"{SystemName}.BiasMatch.C1")
  2233. {
  2234. pmParameter.Feedback = $"{data[paraName]:N1}";
  2235. }
  2236. if (paraName == $"{SystemName}.BiasMatch.C2")
  2237. {
  2238. pmParameter.Feedback = $"{data[paraName]:N1}";
  2239. }
  2240. if (paraName == $"{SystemName}.ProcessGauge.Value")
  2241. {
  2242. pmParameter.Feedback = $"{data[paraName]:N1}";
  2243. }
  2244. if (paraName == $"{SystemName}.IoThrottleValve.ThrottleValve.TVMode")
  2245. {
  2246. pmParameter.Feedback = pmParameter.Setpoint;
  2247. }
  2248. if (paraName == $"{SystemName}.IoThrottleValve.ThrottleValve.TVPressure")
  2249. {
  2250. if (Convert.ToDouble(data[paraName]) <= 0.0)
  2251. {
  2252. pmParameter.Feedback = "0.0";
  2253. }
  2254. else
  2255. {
  2256. pmParameter.Feedback = $"{(Convert.ToDouble(data[paraName]) + ProcessPressureOffset):N1}";
  2257. }
  2258. }
  2259. if (paraName == $"{SystemName}.Rf.PowerOnTime")
  2260. {
  2261. pmParameter.Feedback = $"{data[$"{SystemName}.Rf.PowerOnTime"]}";
  2262. }
  2263. if (paraName == $"{SystemName}.Match.TunePosition1"|| paraName == $"{SystemName}.Match.TunePosition2")
  2264. {
  2265. pmParameter.Feedback = $"{data[paraName]:N2}";
  2266. }
  2267. if (paraName == $"{SystemName}.StepTime")
  2268. {
  2269. pmParameter.Feedback = $"{data[$"{SystemName}.RecipeStepTimeElapsed"]:N0}";
  2270. pmParameter.Setpoint = $"{data[$"{SystemName}.RecipeStepTimeSetPoint"]:N0}";
  2271. }
  2272. if (paraName == $"{SystemName}.StepNo")
  2273. {
  2274. pmParameter.Setpoint = $"{data[$"{SystemName}.RecipeSteps"]:N0}";
  2275. }
  2276. if (paraName == $"{SystemName}.RecipeStepTimeElapsed")
  2277. {
  2278. pmParameter.Setpoint = $"{data[$"{SystemName}.RecipeStepTimeSetPoint"]:N0}";
  2279. }
  2280. if (paraName == ($"{SystemName}.IoTemperatureCtrl.TemperatureControl.SubstrateTemperature"))
  2281. {
  2282. if(IsAutoMode)
  2283. {
  2284. pmParameter.Setpoint = string.Format("{0:N1}", ((AITHeaterData)data[$"{SystemName}.HeaterChamber.DeviceData"]).SetPoint);
  2285. }
  2286. pmParameter.Feedback = string.Format("{0:N1}", ((AITHeaterData)data[$"{SystemName}.HeaterChamber.DeviceData"]).FeedBack);
  2287. }
  2288. }
  2289. foreach (var gasLine in Gaslines)
  2290. {
  2291. if (data.ContainsKey(gasLine.ValveName))
  2292. {
  2293. gasLine.ValveData = (AITValveData)data[gasLine.ValveName];
  2294. gasLine.NotifyOfPropertyChange("ValveData");
  2295. }
  2296. if (data.ContainsKey(gasLine.MfcName))
  2297. {
  2298. gasLine.MfcData = (AITMfcData)data[gasLine.MfcName];
  2299. gasLine.Display = gasLine.MfcData.DeviceName + " " + gasLine.MfcData.DisplayName + " " + gasLine.MfcData.Scale + " " + gasLine.MfcData.Unit;
  2300. PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas{gasLine.Index}.FeedBack").Display = gasLine.Display;
  2301. PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas{gasLine.Index}.FeedBack").NotifyOfPropertyChange("Display");
  2302. gasLine.NotifyOfPropertyChange("MfcData");
  2303. }
  2304. }
  2305. //if (PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.MatchProcessMode").Setpoint == "Hold")
  2306. //{
  2307. // PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.C1").Setpoint = "";
  2308. // PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.C2").Setpoint = "";
  2309. //}
  2310. }
  2311. public void DoStartPump()
  2312. {
  2313. if (MenuPermission != 3) return;
  2314. if (IsStartPumping)
  2315. {
  2316. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.Abort}");
  2317. return;
  2318. }
  2319. InvokeClient.Instance.Service.DoOperation($"{SystemName}.StartPump");
  2320. }
  2321. // Pumpdown
  2322. public void DoPump()
  2323. {
  2324. if (MenuPermission != 3) return;
  2325. if (IsPumping)
  2326. {
  2327. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.Abort}");
  2328. return;
  2329. }
  2330. if (IsPumpingOkForProcess)
  2331. {
  2332. InvokeClient.Instance.Service.DoOperation($"{SystemName}.StopPump");
  2333. return;
  2334. }
  2335. // 设置底压
  2336. double basePressure = string.IsNullOrEmpty(BasePressureSetPoint) ? 0 : Convert.ToDouble(BasePressureSetPoint);
  2337. if (basePressure <= 0.01 || basePressure >= 1000)
  2338. {
  2339. MessageBox.Show($"Basic pressure setpoint {basePressure} invalid,between 0 end 1000(mtorr)");
  2340. return;
  2341. }
  2342. double pumpLimit = string.IsNullOrEmpty(PumpLimitSetPoint) ? 0 : Convert.ToDouble(PumpLimitSetPoint);
  2343. if (pumpLimit <= 0.01 || pumpLimit >= 1200)
  2344. {
  2345. MessageBox.Show($"Pump limit between 0 end 1200,current value {pumpLimit}");
  2346. return;
  2347. }
  2348. InvokeClient.Instance.Service.DoOperation("System.SetConfig", $"{SystemName}.Pump.PumpBasePressure", basePressure.ToString());
  2349. InvokeClient.Instance.Service.DoOperation("System.SetConfig", $"{SystemName}.Pump.PumpTimeLimit", pumpLimit.ToString());
  2350. InvokeClient.Instance.Service.DoOperation($"{SystemName}.Pump");
  2351. // pump down 过程中tv 全开
  2352. var tvMode = PMParameters.Find(x => x.Name == $"{SystemName}.IoThrottleValve.ThrottleValve.TVMode");
  2353. tvMode.Feedback = "Position";
  2354. PumpLimitSetPointSaved = true;
  2355. BasePressureSetPointSaved = true;
  2356. NotifyOfPropertyChange(nameof(PumpLimitSetPointSaved));
  2357. NotifyOfPropertyChange(nameof(BasePressureSetPointSaved));
  2358. }
  2359. private void MoveGuidePin(MovementPosition pos)
  2360. {
  2361. switch (pos)
  2362. {
  2363. case MovementPosition.Down:
  2364. BottomPinStatus = 1;
  2365. TopPinStatus = 0;
  2366. MidPinStatus = 0;
  2367. break;
  2368. case MovementPosition.Up:
  2369. BottomPinStatus = 0;
  2370. TopPinStatus = 1;
  2371. MidPinStatus = 0;
  2372. break;
  2373. case MovementPosition.Middle:
  2374. BottomPinStatus = 0;
  2375. TopPinStatus = 0;
  2376. MidPinStatus = 1;
  2377. break;
  2378. default:
  2379. break;
  2380. }
  2381. }
  2382. public void Purge()
  2383. {
  2384. if (MenuPermission != 3) return;
  2385. if (IsCyclePurging)
  2386. {
  2387. InvokeClient.Instance.Service.DoOperation($"{SystemName}.StopPurge");
  2388. }
  2389. else
  2390. {
  2391. InvokeClient.Instance.Service.DoOperation($"{SystemName}.Purge");
  2392. }
  2393. }
  2394. public void LeakCheck()
  2395. {
  2396. if (!IsLeakCheck)
  2397. {
  2398. InvokeClient.Instance.Service.DoOperation($"{SystemName}.LeakCheck");
  2399. }
  2400. }
  2401. public void Vent()
  2402. {
  2403. if (MenuPermission != 3) return;
  2404. //OverviewPMProvider.Instance.Vent("PM1");
  2405. if (!IsVenting)
  2406. {
  2407. InvokeClient.Instance.Service.DoOperation($"{SystemName}.Vent");
  2408. return;
  2409. }
  2410. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.Abort}");
  2411. }
  2412. /// <summary>
  2413. /// 流气
  2414. /// </summary>
  2415. public void Gas()
  2416. {
  2417. if (MenuPermission != 3) return;
  2418. if (!this.HandleThrottleValve())
  2419. return;
  2420. //GasLine 跳号Enable
  2421. object[] mfc = new object[5];
  2422. string[] mfcSetPoint = new string[5];
  2423. for (int i = 0; i < 5; i++)
  2424. {
  2425. if ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.MfcGas{i + 1}.Enable"))
  2426. {
  2427. mfcSetPoint[i] = PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas{i + 1}.FeedBack").Setpoint;
  2428. if (string.IsNullOrWhiteSpace(mfcSetPoint[i]))
  2429. {
  2430. DialogBox.ShowError("Please input gas flow value");
  2431. return;
  2432. }
  2433. }
  2434. mfc[i] = Convert.ToDouble(string.IsNullOrEmpty(mfcSetPoint[i]) ? "0.0" : mfcSetPoint[i]);
  2435. }
  2436. //object[] mfc = new object[Gaslines.Count];
  2437. //string[] mfcSetPoint = new string[Gaslines.Count];
  2438. //for (int index = 0; index < Gaslines.Count; index++)
  2439. //{
  2440. // mfcSetPoint[index] = PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas{index + 1}.FeedBack").Setpoint;
  2441. // if (string.IsNullOrWhiteSpace(mfcSetPoint[index]))
  2442. // {
  2443. // DialogBox.ShowError("请输入气体流量值");
  2444. // return;
  2445. // }
  2446. // mfc[index] = Convert.ToDouble(string.IsNullOrEmpty(mfcSetPoint[index]) ? "0.0" : mfcSetPoint[index]);
  2447. //}
  2448. if ((IsGasFlowing
  2449. && (Math.Abs((double)mfc[0] - (double)_oldmfc[0]) < 0.01)
  2450. && (Math.Abs((double)mfc[1] - (double)_oldmfc[1]) < 0.01)
  2451. && (Math.Abs((double)mfc[2] - (double)_oldmfc[2])) < 0.01)
  2452. || (IsGasFlowing && (Math.Abs((double)mfc[0]) <= 0.01 && Math.Abs((double)mfc[1]) <= 0.01 && Math.Abs((double)mfc[2]) <= 0.01)))
  2453. {
  2454. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.Abort}");
  2455. return;
  2456. }
  2457. _oldmfc = mfc;
  2458. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.GasFlow}", mfc);
  2459. }
  2460. /// <summary>
  2461. /// 处理蝶阀
  2462. /// </summary>
  2463. /// <returns></returns>
  2464. private bool HandleThrottleValve()
  2465. {
  2466. var tvMode = PMParameters.Find(x => x.Name == $"{SystemName}.IoThrottleValve.ThrottleValve.TVMode");
  2467. string tvModeSp = "TV" + tvMode.Setpoint + "Ctrl";
  2468. if (!Enum.TryParse(tvModeSp, out PressureCtrlMode ctrlMode))
  2469. {
  2470. MessageBox.Show("Select the mode of Throttle valve");
  2471. return false;
  2472. }
  2473. switch (ctrlMode)
  2474. {
  2475. case PressureCtrlMode.TVPressureCtrl:
  2476. string tvPressureSP = PMParameters.Find(x => x.Name == $"{SystemName}.IoThrottleValve.ThrottleValve.TVPressure").Setpoint;
  2477. if (string.IsNullOrWhiteSpace(tvPressureSP))
  2478. {
  2479. DialogBox.ShowError("Please input TV pressure value");
  2480. return false;
  2481. }
  2482. double pressure = Convert.ToDouble(tvPressureSP);
  2483. if (pressure < 0 || pressure > 756000)
  2484. {
  2485. DialogBox.ShowError($"TV pressure {pressure} invalid,between 0 end 756000");
  2486. return false;
  2487. }
  2488. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{VirgoDevice.ThrottleValve}.{AITThrottleValveOperation.SetPressure}", pressure);
  2489. break;
  2490. case PressureCtrlMode.TVPositionCtrl:
  2491. string tvPositionSP = PMParameters.Find(x => x.Name == $"{SystemName}.IoThrottleValve.ThrottleValve.TVPosition").Setpoint;
  2492. if (string.IsNullOrWhiteSpace(tvPositionSP))
  2493. {
  2494. DialogBox.ShowError("Please input TV Position value");
  2495. return false;
  2496. }
  2497. double position = Convert.ToDouble(tvPositionSP);
  2498. if (position < 0 || position > 100)
  2499. {
  2500. DialogBox.ShowError($"TV Position {position} invalid,between 0 end 100");
  2501. return false;
  2502. }
  2503. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{VirgoDevice.ThrottleValve}.{AITThrottleValveOperation.SetPosition}", position);
  2504. break;
  2505. default:
  2506. break;
  2507. }
  2508. tvMode.Feedback = tvMode.Setpoint;
  2509. return true;
  2510. }
  2511. public void Heat()
  2512. {
  2513. var para_temp = PMParameters.Find(x => x.Name == $"{SystemName}.IoTemperatureCtrl.TemperatureControl.SubstrateTemperature");
  2514. var temp = para_temp.Setpoint;
  2515. if (double.TryParse(temp, out double dt))
  2516. {
  2517. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.Heat}", dt);
  2518. }
  2519. else
  2520. {
  2521. DialogBox.ShowError("Set TEMP invalid");
  2522. }
  2523. }
  2524. // RF Power
  2525. public void RF()
  2526. {
  2527. if (MenuPermission != 3) return;
  2528. double rf_sp = 0;
  2529. double rf_sp_bias = 0;
  2530. double match1_sp = 0.0f;
  2531. double match2_sp = 0.0f;
  2532. double rf_time = 0;
  2533. string rfPowerSetPointBias = "";
  2534. BiasRfMatchMode matchMode = BiasRfMatchMode.Preset;
  2535. if (IsRfPowering)
  2536. {
  2537. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.Abort}");
  2538. return;
  2539. }
  2540. // 源射频功率
  2541. string rfPowerSetPoint = PMParameters.Find(x => x.Name == $"{SystemName}.Rf.ForwardPower").Setpoint;
  2542. if (string.IsNullOrWhiteSpace(rfPowerSetPoint))
  2543. {
  2544. DialogBox.ShowWarning("Input RF power set value first");
  2545. return;
  2546. }
  2547. // 源射频时间
  2548. string sRFTime = PMParameters.Find(x => x.Name == $"{SystemName}.Rf.PowerOnTime").Setpoint;
  2549. if (string.IsNullOrWhiteSpace(sRFTime))
  2550. {
  2551. DialogBox.ShowError("Input RF power time");
  2552. return;
  2553. }
  2554. // 偏压射频功率
  2555. if ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.BiasRf.EnableBiasRF"))
  2556. {
  2557. rfPowerSetPointBias = PMParameters.Find(x => x.Name == $"{SystemName}.BiasRf.ForwardPower").Setpoint;
  2558. if (string.IsNullOrWhiteSpace(rfPowerSetPointBias))
  2559. {
  2560. DialogBox.ShowWarning("Input Bias RF power set value first");
  2561. return;
  2562. }
  2563. rf_sp_bias = Convert.ToDouble(rfPowerSetPointBias);
  2564. if ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.BiasMatch.EnableBiasMatch"))
  2565. {
  2566. var MatchMode = PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.MatchProcessMode");
  2567. if (!Enum.TryParse(MatchMode.Setpoint, out matchMode))
  2568. {
  2569. MessageBox.Show("Select the mode of Throttle valve");
  2570. return;
  2571. }
  2572. if (matchMode == BiasRfMatchMode.Preset)
  2573. {
  2574. PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.MatchProcessMode").Feedback = "Preset";
  2575. // Match C1
  2576. string rfMatchC1SetPoint = PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.C1").Setpoint;
  2577. if (string.IsNullOrWhiteSpace(rfMatchC1SetPoint))
  2578. {
  2579. DialogBox.ShowWarning("Input Match C1 set value first");
  2580. return;
  2581. }
  2582. // Match C2
  2583. string rfMatchC2SetPoint = PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.C2").Setpoint;
  2584. if (string.IsNullOrWhiteSpace(rfMatchC2SetPoint))
  2585. {
  2586. DialogBox.ShowWarning("Input Match C2 set value first");
  2587. return;
  2588. }
  2589. match1_sp = Convert.ToDouble(rfMatchC1SetPoint);
  2590. match2_sp = Convert.ToDouble(rfMatchC2SetPoint);
  2591. }
  2592. else if (matchMode == BiasRfMatchMode.Hold)
  2593. {
  2594. //PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.MatchProcessMode").Feedback = "Hold";
  2595. }
  2596. }
  2597. }
  2598. rf_sp = Convert.ToDouble(rfPowerSetPoint);
  2599. rf_time = Convert.ToDouble(sRFTime);
  2600. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.RfPower}", rf_sp, rf_sp_bias, rf_time, (int)matchMode, match1_sp, match2_sp);
  2601. }
  2602. // Lift pin method
  2603. public void MoveLiftPinSetState(string name)
  2604. {
  2605. if (MenuPermission != 3) return;
  2606. if (!IsCDAOK)
  2607. {
  2608. DialogBox.ShowWarning("CDA Pressure Error");
  2609. return;
  2610. }
  2611. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{_servoLiftPinName}.SetState",name);
  2612. }
  2613. public void MoveLiftPinHome(string name)
  2614. {
  2615. if (MenuPermission != 3) return;
  2616. if (!IsCDAOK)
  2617. {
  2618. DialogBox.ShowWarning("CDA Pressure Error");
  2619. return;
  2620. }
  2621. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{_servoLiftPinName}.Home",name);
  2622. }
  2623. public void MoveLiftPinDown()
  2624. {
  2625. if (MenuPermission != 3) return;
  2626. if (!IsCDAOK)
  2627. {
  2628. DialogBox.ShowWarning("CDA Pressure Error");
  2629. return;
  2630. }
  2631. InvokeClient.Instance.Service.DoOperation($"{SystemName}.LiftPin.Close");
  2632. }
  2633. // Guide pin method
  2634. public void MovePin3Up()
  2635. {
  2636. if (MenuPermission != 3) return;
  2637. if (!IsCDAOK)
  2638. {
  2639. DialogBox.ShowWarning("CDA Pressure Error");
  2640. return;
  2641. }
  2642. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.MoveGuidePin}", WaferSize.WS3, 2);
  2643. }
  2644. public void MovePin3Down()
  2645. {
  2646. if (MenuPermission != 3) return;
  2647. if (!IsCDAOK)
  2648. {
  2649. DialogBox.ShowWarning("CDA Pressure Error");
  2650. return;
  2651. }
  2652. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.MoveGuidePin}", WaferSize.WS3, 1);
  2653. }
  2654. public void MovePin4Up()
  2655. {
  2656. if (MenuPermission != 3) return;
  2657. if (!IsCDAOK)
  2658. {
  2659. DialogBox.ShowWarning("CDA Pressure Error");
  2660. return;
  2661. }
  2662. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.MoveGuidePin}", WaferSize.WS4, 2);
  2663. }
  2664. public void MovePin4Down()
  2665. {
  2666. if (MenuPermission != 3) return;
  2667. if (!IsCDAOK)
  2668. {
  2669. DialogBox.ShowWarning("CDA Pressure Error");
  2670. return;
  2671. }
  2672. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.MoveGuidePin}", WaferSize.WS4, 1);
  2673. }
  2674. }
  2675. }