PmOverviewViewModel.cs 93 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108
  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. if(paraName.Contains("MfcGas"))
  2228. {
  2229. pmParameter.Feedback = $"{data[paraName]:N1}";
  2230. }
  2231. else
  2232. {
  2233. pmParameter.Feedback = $"{data[paraName]:N0}";
  2234. }
  2235. if (paraName == $"{SystemName}.BiasMatch.MatchProcessMode")
  2236. {
  2237. pmParameter.Feedback = (int)data[paraName] == 1 ? "Preset" : "Hold";
  2238. }
  2239. if (paraName == $"{SystemName}.BiasMatch.C1")
  2240. {
  2241. pmParameter.Feedback = $"{data[paraName]:N1}";
  2242. }
  2243. if (paraName == $"{SystemName}.BiasMatch.C2")
  2244. {
  2245. pmParameter.Feedback = $"{data[paraName]:N1}";
  2246. }
  2247. if (paraName == $"{SystemName}.ProcessGauge.Value")
  2248. {
  2249. pmParameter.Feedback = $"{data[paraName]:N1}";
  2250. }
  2251. if (paraName == $"{SystemName}.IoThrottleValve.ThrottleValve.TVMode")
  2252. {
  2253. pmParameter.Feedback = pmParameter.Setpoint;
  2254. }
  2255. if (paraName == $"{SystemName}.IoThrottleValve.ThrottleValve.TVPressure")
  2256. {
  2257. if (Convert.ToDouble(data[paraName]) <= 0.0)
  2258. {
  2259. pmParameter.Feedback = "0.0";
  2260. }
  2261. else
  2262. {
  2263. pmParameter.Feedback = $"{(Convert.ToDouble(data[paraName]) + ProcessPressureOffset):N1}";
  2264. }
  2265. }
  2266. if (paraName == $"{SystemName}.Rf.PowerOnTime")
  2267. {
  2268. pmParameter.Feedback = $"{data[$"{SystemName}.Rf.PowerOnTime"]}";
  2269. }
  2270. if (paraName == $"{SystemName}.Match.TunePosition1"|| paraName == $"{SystemName}.Match.TunePosition2")
  2271. {
  2272. pmParameter.Feedback = $"{data[paraName]:N2}";
  2273. }
  2274. if (paraName == $"{SystemName}.StepTime")
  2275. {
  2276. pmParameter.Feedback = $"{data[$"{SystemName}.RecipeStepTimeElapsed"]:N0}";
  2277. pmParameter.Setpoint = $"{data[$"{SystemName}.RecipeStepTimeSetPoint"]:N0}";
  2278. }
  2279. if (paraName == $"{SystemName}.StepNo")
  2280. {
  2281. pmParameter.Setpoint = $"{data[$"{SystemName}.RecipeSteps"]:N0}";
  2282. }
  2283. if (paraName == $"{SystemName}.RecipeStepTimeElapsed")
  2284. {
  2285. pmParameter.Setpoint = $"{data[$"{SystemName}.RecipeStepTimeSetPoint"]:N0}";
  2286. }
  2287. if (paraName == ($"{SystemName}.IoTemperatureCtrl.TemperatureControl.SubstrateTemperature"))
  2288. {
  2289. if(IsAutoMode)
  2290. {
  2291. pmParameter.Setpoint = string.Format("{0:N1}", ((AITHeaterData)data[$"{SystemName}.HeaterChamber.DeviceData"]).SetPoint);
  2292. }
  2293. pmParameter.Feedback = string.Format("{0:N1}", ((AITHeaterData)data[$"{SystemName}.HeaterChamber.DeviceData"]).FeedBack);
  2294. }
  2295. }
  2296. foreach (var gasLine in Gaslines)
  2297. {
  2298. if (data.ContainsKey(gasLine.ValveName))
  2299. {
  2300. gasLine.ValveData = (AITValveData)data[gasLine.ValveName];
  2301. gasLine.NotifyOfPropertyChange("ValveData");
  2302. }
  2303. if (data.ContainsKey(gasLine.MfcName))
  2304. {
  2305. gasLine.MfcData = (AITMfcData)data[gasLine.MfcName];
  2306. gasLine.Display = gasLine.MfcData.DeviceName + " " + gasLine.MfcData.DisplayName + " " + gasLine.MfcData.Scale + " " + gasLine.MfcData.Unit;
  2307. PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas{gasLine.Index}.FeedBack").Display = gasLine.Display;
  2308. PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas{gasLine.Index}.FeedBack").NotifyOfPropertyChange("Display");
  2309. gasLine.NotifyOfPropertyChange("MfcData");
  2310. }
  2311. }
  2312. //if (PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.MatchProcessMode").Setpoint == "Hold")
  2313. //{
  2314. // PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.C1").Setpoint = "";
  2315. // PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.C2").Setpoint = "";
  2316. //}
  2317. }
  2318. public void DoStartPump()
  2319. {
  2320. if (MenuPermission != 3) return;
  2321. if (IsStartPumping)
  2322. {
  2323. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.Abort}");
  2324. return;
  2325. }
  2326. InvokeClient.Instance.Service.DoOperation($"{SystemName}.StartPump");
  2327. }
  2328. // Pumpdown
  2329. public void DoPump()
  2330. {
  2331. if (MenuPermission != 3) return;
  2332. if (IsPumping)
  2333. {
  2334. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.Abort}");
  2335. return;
  2336. }
  2337. if (IsPumpingOkForProcess)
  2338. {
  2339. InvokeClient.Instance.Service.DoOperation($"{SystemName}.StopPump");
  2340. return;
  2341. }
  2342. // 设置底压
  2343. double basePressure = string.IsNullOrEmpty(BasePressureSetPoint) ? 0 : Convert.ToDouble(BasePressureSetPoint);
  2344. if (basePressure <= 0.01 || basePressure >= 1000)
  2345. {
  2346. MessageBox.Show($"Basic pressure setpoint {basePressure} invalid,between 0 end 1000(mtorr)");
  2347. return;
  2348. }
  2349. double pumpLimit = string.IsNullOrEmpty(PumpLimitSetPoint) ? 0 : Convert.ToDouble(PumpLimitSetPoint);
  2350. if (pumpLimit <= 0.01 || pumpLimit >= 1200)
  2351. {
  2352. MessageBox.Show($"Pump limit between 0 end 1200,current value {pumpLimit}");
  2353. return;
  2354. }
  2355. InvokeClient.Instance.Service.DoOperation("System.SetConfig", $"{SystemName}.Pump.PumpBasePressure", basePressure.ToString());
  2356. InvokeClient.Instance.Service.DoOperation("System.SetConfig", $"{SystemName}.Pump.PumpTimeLimit", pumpLimit.ToString());
  2357. InvokeClient.Instance.Service.DoOperation($"{SystemName}.Pump");
  2358. // pump down 过程中tv 全开
  2359. var tvMode = PMParameters.Find(x => x.Name == $"{SystemName}.IoThrottleValve.ThrottleValve.TVMode");
  2360. tvMode.Feedback = "Position";
  2361. PumpLimitSetPointSaved = true;
  2362. BasePressureSetPointSaved = true;
  2363. NotifyOfPropertyChange(nameof(PumpLimitSetPointSaved));
  2364. NotifyOfPropertyChange(nameof(BasePressureSetPointSaved));
  2365. }
  2366. private void MoveGuidePin(MovementPosition pos)
  2367. {
  2368. switch (pos)
  2369. {
  2370. case MovementPosition.Down:
  2371. BottomPinStatus = 1;
  2372. TopPinStatus = 0;
  2373. MidPinStatus = 0;
  2374. break;
  2375. case MovementPosition.Up:
  2376. BottomPinStatus = 0;
  2377. TopPinStatus = 1;
  2378. MidPinStatus = 0;
  2379. break;
  2380. case MovementPosition.Middle:
  2381. BottomPinStatus = 0;
  2382. TopPinStatus = 0;
  2383. MidPinStatus = 1;
  2384. break;
  2385. default:
  2386. break;
  2387. }
  2388. }
  2389. public void Purge()
  2390. {
  2391. if (MenuPermission != 3) return;
  2392. if (IsCyclePurging)
  2393. {
  2394. InvokeClient.Instance.Service.DoOperation($"{SystemName}.StopPurge");
  2395. }
  2396. else
  2397. {
  2398. InvokeClient.Instance.Service.DoOperation($"{SystemName}.Purge");
  2399. }
  2400. }
  2401. public void LeakCheck()
  2402. {
  2403. if (!IsLeakCheck)
  2404. {
  2405. InvokeClient.Instance.Service.DoOperation($"{SystemName}.LeakCheck");
  2406. }
  2407. }
  2408. public void Vent()
  2409. {
  2410. if (MenuPermission != 3) return;
  2411. //OverviewPMProvider.Instance.Vent("PM1");
  2412. if (!IsVenting)
  2413. {
  2414. InvokeClient.Instance.Service.DoOperation($"{SystemName}.Vent");
  2415. return;
  2416. }
  2417. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.Abort}");
  2418. }
  2419. /// <summary>
  2420. /// 流气
  2421. /// </summary>
  2422. public void Gas()
  2423. {
  2424. if (MenuPermission != 3) return;
  2425. if (!this.HandleThrottleValve())
  2426. return;
  2427. //GasLine 跳号Enable
  2428. object[] mfc = new object[5];
  2429. string[] mfcSetPoint = new string[5];
  2430. for (int i = 0; i < 5; i++)
  2431. {
  2432. if ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.MfcGas{i + 1}.Enable"))
  2433. {
  2434. mfcSetPoint[i] = PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas{i + 1}.FeedBack").Setpoint;
  2435. if (string.IsNullOrWhiteSpace(mfcSetPoint[i]))
  2436. {
  2437. DialogBox.ShowError("Please input gas flow value");
  2438. return;
  2439. }
  2440. }
  2441. mfc[i] = Convert.ToDouble(string.IsNullOrEmpty(mfcSetPoint[i]) ? "0.0" : mfcSetPoint[i]);
  2442. }
  2443. //object[] mfc = new object[Gaslines.Count];
  2444. //string[] mfcSetPoint = new string[Gaslines.Count];
  2445. //for (int index = 0; index < Gaslines.Count; index++)
  2446. //{
  2447. // mfcSetPoint[index] = PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas{index + 1}.FeedBack").Setpoint;
  2448. // if (string.IsNullOrWhiteSpace(mfcSetPoint[index]))
  2449. // {
  2450. // DialogBox.ShowError("请输入气体流量值");
  2451. // return;
  2452. // }
  2453. // mfc[index] = Convert.ToDouble(string.IsNullOrEmpty(mfcSetPoint[index]) ? "0.0" : mfcSetPoint[index]);
  2454. //}
  2455. if ((IsGasFlowing
  2456. && (Math.Abs((double)mfc[0] - (double)_oldmfc[0]) < 0.01)
  2457. && (Math.Abs((double)mfc[1] - (double)_oldmfc[1]) < 0.01)
  2458. && (Math.Abs((double)mfc[2] - (double)_oldmfc[2])) < 0.01)
  2459. || (IsGasFlowing && (Math.Abs((double)mfc[0]) <= 0.01 && Math.Abs((double)mfc[1]) <= 0.01 && Math.Abs((double)mfc[2]) <= 0.01)))
  2460. {
  2461. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.Abort}");
  2462. return;
  2463. }
  2464. _oldmfc = mfc;
  2465. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.GasFlow}", mfc);
  2466. }
  2467. /// <summary>
  2468. /// 处理蝶阀
  2469. /// </summary>
  2470. /// <returns></returns>
  2471. private bool HandleThrottleValve()
  2472. {
  2473. var tvMode = PMParameters.Find(x => x.Name == $"{SystemName}.IoThrottleValve.ThrottleValve.TVMode");
  2474. string tvModeSp = "TV" + tvMode.Setpoint + "Ctrl";
  2475. if (!Enum.TryParse(tvModeSp, out PressureCtrlMode ctrlMode))
  2476. {
  2477. MessageBox.Show("Select the mode of Throttle valve");
  2478. return false;
  2479. }
  2480. switch (ctrlMode)
  2481. {
  2482. case PressureCtrlMode.TVPressureCtrl:
  2483. string tvPressureSP = PMParameters.Find(x => x.Name == $"{SystemName}.IoThrottleValve.ThrottleValve.TVPressure").Setpoint;
  2484. if (string.IsNullOrWhiteSpace(tvPressureSP))
  2485. {
  2486. DialogBox.ShowError("Please input TV pressure value");
  2487. return false;
  2488. }
  2489. double pressure = Convert.ToDouble(tvPressureSP);
  2490. if (pressure < 0 || pressure > 756000)
  2491. {
  2492. DialogBox.ShowError($"TV pressure {pressure} invalid,between 0 end 756000");
  2493. return false;
  2494. }
  2495. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{VirgoDevice.ThrottleValve}.{AITThrottleValveOperation.SetPressure}", pressure);
  2496. break;
  2497. case PressureCtrlMode.TVPositionCtrl:
  2498. string tvPositionSP = PMParameters.Find(x => x.Name == $"{SystemName}.IoThrottleValve.ThrottleValve.TVPosition").Setpoint;
  2499. if (string.IsNullOrWhiteSpace(tvPositionSP))
  2500. {
  2501. DialogBox.ShowError("Please input TV Position value");
  2502. return false;
  2503. }
  2504. double position = Convert.ToDouble(tvPositionSP);
  2505. if (position < 0 || position > 100)
  2506. {
  2507. DialogBox.ShowError($"TV Position {position} invalid,between 0 end 100");
  2508. return false;
  2509. }
  2510. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{VirgoDevice.ThrottleValve}.{AITThrottleValveOperation.SetPosition}", position);
  2511. break;
  2512. default:
  2513. break;
  2514. }
  2515. tvMode.Feedback = tvMode.Setpoint;
  2516. return true;
  2517. }
  2518. public void Heat()
  2519. {
  2520. var para_temp = PMParameters.Find(x => x.Name == $"{SystemName}.IoTemperatureCtrl.TemperatureControl.SubstrateTemperature");
  2521. var temp = para_temp.Setpoint;
  2522. if (double.TryParse(temp, out double dt))
  2523. {
  2524. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.Heat}", dt);
  2525. }
  2526. else
  2527. {
  2528. DialogBox.ShowError("Set TEMP invalid");
  2529. }
  2530. }
  2531. // RF Power
  2532. public void RF()
  2533. {
  2534. if (MenuPermission != 3) return;
  2535. double rf_sp = 0;
  2536. double rf_sp_bias = 0;
  2537. double match1_sp = 0.0f;
  2538. double match2_sp = 0.0f;
  2539. double rf_time = 0;
  2540. string rfPowerSetPointBias = "";
  2541. BiasRfMatchMode matchMode = BiasRfMatchMode.Preset;
  2542. if (IsRfPowering)
  2543. {
  2544. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.Abort}");
  2545. return;
  2546. }
  2547. // 源射频功率
  2548. string rfPowerSetPoint = PMParameters.Find(x => x.Name == $"{SystemName}.Rf.ForwardPower").Setpoint;
  2549. if (string.IsNullOrWhiteSpace(rfPowerSetPoint))
  2550. {
  2551. DialogBox.ShowWarning("Input RF power set value first");
  2552. return;
  2553. }
  2554. // 源射频时间
  2555. string sRFTime = PMParameters.Find(x => x.Name == $"{SystemName}.Rf.PowerOnTime").Setpoint;
  2556. if (string.IsNullOrWhiteSpace(sRFTime))
  2557. {
  2558. DialogBox.ShowError("Input RF power time");
  2559. return;
  2560. }
  2561. // 偏压射频功率
  2562. if ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.BiasRf.EnableBiasRF"))
  2563. {
  2564. rfPowerSetPointBias = PMParameters.Find(x => x.Name == $"{SystemName}.BiasRf.ForwardPower").Setpoint;
  2565. if (string.IsNullOrWhiteSpace(rfPowerSetPointBias))
  2566. {
  2567. DialogBox.ShowWarning("Input Bias RF power set value first");
  2568. return;
  2569. }
  2570. rf_sp_bias = Convert.ToDouble(rfPowerSetPointBias);
  2571. if ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.BiasMatch.EnableBiasMatch"))
  2572. {
  2573. var MatchMode = PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.MatchProcessMode");
  2574. if (!Enum.TryParse(MatchMode.Setpoint, out matchMode))
  2575. {
  2576. MessageBox.Show("Select the mode of Throttle valve");
  2577. return;
  2578. }
  2579. if (matchMode == BiasRfMatchMode.Preset)
  2580. {
  2581. PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.MatchProcessMode").Feedback = "Preset";
  2582. // Match C1
  2583. string rfMatchC1SetPoint = PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.C1").Setpoint;
  2584. if (string.IsNullOrWhiteSpace(rfMatchC1SetPoint))
  2585. {
  2586. DialogBox.ShowWarning("Input Match C1 set value first");
  2587. return;
  2588. }
  2589. // Match C2
  2590. string rfMatchC2SetPoint = PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.C2").Setpoint;
  2591. if (string.IsNullOrWhiteSpace(rfMatchC2SetPoint))
  2592. {
  2593. DialogBox.ShowWarning("Input Match C2 set value first");
  2594. return;
  2595. }
  2596. match1_sp = Convert.ToDouble(rfMatchC1SetPoint);
  2597. match2_sp = Convert.ToDouble(rfMatchC2SetPoint);
  2598. }
  2599. else if (matchMode == BiasRfMatchMode.Hold)
  2600. {
  2601. //PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.MatchProcessMode").Feedback = "Hold";
  2602. }
  2603. }
  2604. }
  2605. rf_sp = Convert.ToDouble(rfPowerSetPoint);
  2606. rf_time = Convert.ToDouble(sRFTime);
  2607. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.RfPower}", rf_sp, rf_sp_bias, rf_time, (int)matchMode, match1_sp, match2_sp);
  2608. }
  2609. // Lift pin method
  2610. public void MoveLiftPinSetState(string name)
  2611. {
  2612. if (MenuPermission != 3) return;
  2613. if (!IsCDAOK)
  2614. {
  2615. DialogBox.ShowWarning("CDA Pressure Error");
  2616. return;
  2617. }
  2618. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{_servoLiftPinName}.SetState",name);
  2619. }
  2620. public void MoveLiftPinHome(string name)
  2621. {
  2622. if (MenuPermission != 3) return;
  2623. if (!IsCDAOK)
  2624. {
  2625. DialogBox.ShowWarning("CDA Pressure Error");
  2626. return;
  2627. }
  2628. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{_servoLiftPinName}.Home",name);
  2629. }
  2630. public void MoveLiftPinDown()
  2631. {
  2632. if (MenuPermission != 3) return;
  2633. if (!IsCDAOK)
  2634. {
  2635. DialogBox.ShowWarning("CDA Pressure Error");
  2636. return;
  2637. }
  2638. InvokeClient.Instance.Service.DoOperation($"{SystemName}.LiftPin.Close");
  2639. }
  2640. // Guide pin method
  2641. public void MovePin3Up()
  2642. {
  2643. if (MenuPermission != 3) return;
  2644. if (!IsCDAOK)
  2645. {
  2646. DialogBox.ShowWarning("CDA Pressure Error");
  2647. return;
  2648. }
  2649. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.MoveGuidePin}", WaferSize.WS3, 2);
  2650. }
  2651. public void MovePin3Down()
  2652. {
  2653. if (MenuPermission != 3) return;
  2654. if (!IsCDAOK)
  2655. {
  2656. DialogBox.ShowWarning("CDA Pressure Error");
  2657. return;
  2658. }
  2659. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.MoveGuidePin}", WaferSize.WS3, 1);
  2660. }
  2661. public void MovePin4Up()
  2662. {
  2663. if (MenuPermission != 3) return;
  2664. if (!IsCDAOK)
  2665. {
  2666. DialogBox.ShowWarning("CDA Pressure Error");
  2667. return;
  2668. }
  2669. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.MoveGuidePin}", WaferSize.WS4, 2);
  2670. }
  2671. public void MovePin4Down()
  2672. {
  2673. if (MenuPermission != 3) return;
  2674. if (!IsCDAOK)
  2675. {
  2676. DialogBox.ShowWarning("CDA Pressure Error");
  2677. return;
  2678. }
  2679. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.MoveGuidePin}", WaferSize.WS4, 1);
  2680. }
  2681. }
  2682. }