PmOverviewViewModel.cs 91 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073
  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. PinPosition = _servoLiftPinMode == 1 ? TriStateLiftPinPosition : _servoLiftPinMode == 2 ? GroupTriStateLiftPinPosition: DGroupTriStateLiftPinPosition;
  1784. ManualStopState = _servoLiftPinMode == 1 ? TriStateLiftPinManualStopState : _servoLiftPinMode == 2 ? GroupTriStateLiftPinManualStopState: DGroupTriStateLiftPinManualStopState;
  1785. ManualUpState = _servoLiftPinMode == 1 ? TriStateLiftPinManualUpState : _servoLiftPinMode == 2 ? GroupTriStateLiftPinManualUpState: DGroupTriStateLiftPinManualUpState;
  1786. ManualDownState = _servoLiftPinMode == 1 ? TriStateLiftPinManualDownState : _servoLiftPinMode == 2 ? GroupTriStateLiftPinManualDownState: DGroupTriStateLiftPinManualDownState;
  1787. }
  1788. protected override void OnActivate()
  1789. {
  1790. base.OnActivate();
  1791. _servoLiftPinMode = (int)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.LiftPinMode");
  1792. _servoLiftPinName = _servoLiftPinMode == 1 ? "TriStateLiftPin" : _servoLiftPinMode == 2 ? "TriStateLiftPin2" : _servoLiftPinMode == 4 ? "TriStateLiftPin4" : "";
  1793. BasePressureSetPoint = QueryDataClient.Instance.Service.GetConfig($"{SystemName}.Pump.PumpBasePressure").ToString();
  1794. PumpLimitSetPoint = ((float)(double)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.Pump.PumpTimeLimit")).ToString();
  1795. SmallPinWaferSize = MapWaferSize((int)QueryDataClient.Instance.Service.GetConfig($"System.SmallWafer"));
  1796. MediumPinWaferSize = MapWaferSize((int)QueryDataClient.Instance.Service.GetConfig($"System.MidWafer"));
  1797. BigPinWaferSize = MapWaferSize((int)QueryDataClient.Instance.Service.GetConfig($"System.BigWafer"));
  1798. SmallPinUpText = $"{SmallPinWaferSize} Pin Up";
  1799. SmallPinDownText = $"{SmallPinWaferSize} Pin Down";
  1800. MediumPinUpText = $"{MediumPinWaferSize} Pin Up";
  1801. MediumPinDownText = $"{MediumPinWaferSize} Pin Down";
  1802. SmallPinHeight = (int)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.LiftPinMode") == 0 ? 0 : 32;
  1803. MediumPinHeight = (int)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.LiftPinMode") == 0 ? 0 : 32;
  1804. WallHeaterVisibility = ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.EnableWallHeater")) ? Visibility.Visible : Visibility.Hidden;
  1805. GridHeaterVisibility = ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.EnableGridHeater")) ? Visibility.Visible : Visibility.Hidden;
  1806. EPDVisibility = (bool) QueryDataClient.Instance.Service.GetConfig($"System.SetUp.EPDInstalled") && (bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.EPD.IsEnabled")
  1807. ? Visibility.Visible
  1808. : Visibility.Hidden;
  1809. }
  1810. private Ax.WaferSize MapWaferSize(int value)
  1811. {
  1812. switch (value)
  1813. {
  1814. case 3: return Ax.WaferSize.WS3;
  1815. case 4: return Ax.WaferSize.WS4;
  1816. case 6: return Ax.WaferSize.WS6;
  1817. case 8: return Ax.WaferSize.WS8;
  1818. }
  1819. return Ax.WaferSize.WS0;
  1820. }
  1821. protected override void OnDeactivate(bool close)
  1822. {
  1823. base.OnDeactivate(close);
  1824. }
  1825. protected override void OnInitialize()
  1826. {
  1827. base.OnInitialize();
  1828. InitGasLine();
  1829. InitParameterList(SystemName);
  1830. foreach (var pmParameter in PMParameters)
  1831. {
  1832. Subscribe(pmParameter.Name);
  1833. }
  1834. }
  1835. private void InitGasLine()
  1836. {
  1837. Gaslines = new List<GaslineItem>();
  1838. for (int i = 1; i <= 5; i++) //GasLine 跳号Enable
  1839. {
  1840. if ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.MfcGas{i}.Enable"))
  1841. {
  1842. var gasName = QueryDataClient.Instance.Service.GetConfig($"{SystemName}.MfcGas{i}.GasName");
  1843. var gasscale = QueryDataClient.Instance.Service.GetConfig($"{SystemName}.MfcGas{i}.MfcN2Scale");
  1844. Gaslines.Add(new GaslineItem
  1845. {
  1846. Index = (byte)i,
  1847. Display = $"MfcGas{i} " + gasName.ToString() + " " + gasscale.ToString() + " sccm",
  1848. ValveName = $"{SystemName}.ValveMfc{i}",
  1849. MfcName = $"{SystemName}.MfcGas{i}"
  1850. });
  1851. }
  1852. }
  1853. //int count = 0;
  1854. //for (int i = 1; i <= 5; i++)
  1855. //{
  1856. // if ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.MfcGas{i}.Enable")) count++;
  1857. //}
  1858. //for (byte index = 1; index <= count; index++)
  1859. //{
  1860. // var gasName = QueryDataClient.Instance.Service.GetConfig($"{SystemName}.MfcGas{index}.GasName");
  1861. // Gaslines.Add(new GaslineItem
  1862. // {
  1863. // Index = index,
  1864. // Display = gasName.ToString(),
  1865. // ValveName = $"{SystemName}.ValveMfc{index}",
  1866. // MfcName = $"{SystemName}.MfcGas{index}"
  1867. // });
  1868. //}
  1869. }
  1870. public List<PMParameter> InitParameterList(string pmID)
  1871. {
  1872. PMParameters = new List<PMParameter>();
  1873. // 工艺时间
  1874. PMParameters.Add(new PMParameter
  1875. {
  1876. Name = $"{pmID}.RecipeProcessTime", Display = "Process Time (s)", Type = ParameterType.Share, Feedback = "00:00:00"
  1877. });
  1878. // 工艺步数
  1879. PMParameters.Add(new PMParameter
  1880. {
  1881. Name = $"{pmID}.StepNo",
  1882. Display = "Process Step",
  1883. Type = ParameterType.Share,
  1884. Feedback = "0",
  1885. Setpoint = ""
  1886. });
  1887. // 工艺每一步运行时间
  1888. PMParameters.Add(new PMParameter
  1889. {
  1890. Name = $"{pmID}.RecipeStepTimeElapsed",
  1891. Display = "Time elapsed (s)",
  1892. Type = ParameterType.Default,
  1893. Feedback = "0",
  1894. Setpoint = "",
  1895. SetpointEnabled = false
  1896. });
  1897. // process gauge
  1898. PMParameters.Add(new PMParameter
  1899. {
  1900. Name = $"{pmID}.ProcessGauge.Value",
  1901. Display = "Process Pressure(mTorr)",
  1902. Type = ParameterType.Share,
  1903. Feedback = "0",
  1904. SetpointEnabled = false
  1905. });
  1906. // pressure gauge
  1907. //PMParameters.Add(new PMParameter
  1908. //{
  1909. // Name = $"{pmID}.PressureGauge.Value", Display = "腔体压力(mTorr)",
  1910. // Type = ParameterType.Share, Feedback = "0", SetpointEnabled = false
  1911. //});
  1912. // foreline gauge
  1913. // 蝶阀运作模式
  1914. PMParameters.Add(new PMParameter
  1915. {
  1916. Name = $"{pmID}.IoThrottleValve.ThrottleValve.TVMode",
  1917. Display = "TVMode",
  1918. Type = ParameterType.DropDownList,
  1919. SetpointEnabled = true,
  1920. Selections = new List<string> { "Position", "Pressure" },
  1921. Setpoint = "Pressure",
  1922. Feedback = "Pressure"
  1923. });
  1924. // 蝶阀位置
  1925. PMParameters.Add(new PMParameter
  1926. {
  1927. Name = $"{pmID}.IoThrottleValve.ThrottleValve.TVPosition", Display = "TVPosition (%)",
  1928. Type = ParameterType.Default, Feedback = "0", Setpoint = "", SetpointEnabled = true
  1929. });
  1930. // 蝶阀压力
  1931. PMParameters.Add(new PMParameter
  1932. {
  1933. Name = $"{pmID}.IoThrottleValve.ThrottleValve.TVPressure", Display = "TVPressure (mTorr)",
  1934. Type = ParameterType.Default, Feedback = "0", Setpoint = "", SetpointEnabled = true
  1935. });
  1936. // 底座温度
  1937. PMParameters.Add(new PMParameter
  1938. {
  1939. Name = $"{pmID}.IoTemperatureCtrl.TemperatureControl.SubstrateTemperature",
  1940. Display = HeaterButtonContent== "Substrate Heating" ? "LE TEMP (℃)": "Chiller TEMP(℃)",
  1941. Type = ParameterType.Default,
  1942. Feedback = "0",
  1943. Setpoint = "",
  1944. SetpointEnabled = true
  1945. });
  1946. // 射频时间
  1947. PMParameters.Add(new PMParameter
  1948. {
  1949. Name = $"{pmID}.Rf.PowerOnTime", Display = "RF Time (s)", Type = ParameterType.Default,
  1950. Feedback = "0", Setpoint = "", SetpointEnabled = true
  1951. });
  1952. //para = new PMParameter() { Display = "RF Mode", Type = ParameterType.DropDownList, Feedback = "Manual", SetpointEnabled = true };
  1953. //para.Selections = new List<string>() { "Manual", "Auto" };
  1954. //paras.Add(para);
  1955. // 设定功率
  1956. PMParameters.Add(new PMParameter
  1957. {
  1958. Name = $"{pmID}.Rf.ForwardPower", Display = "Source ForwardPower (w)", Type = ParameterType.Default,
  1959. Feedback = "", Setpoint = "", SetpointEnabled = true
  1960. });
  1961. // ReflectPower
  1962. PMParameters.Add(new PMParameter
  1963. {
  1964. Name = $"{pmID}.Rf.ReflectPower",
  1965. Display = "Source ReflectPower (w)",
  1966. Type = ParameterType.Share,
  1967. Setpoint = ""
  1968. });
  1969. //// Match C1
  1970. //PMParameters.Add(new PMParameter
  1971. //{
  1972. // Name =$"{pmID}.Match.TunePosition1", Display = "Match C1 (%)", Type = ParameterType.Default, Feedback = "", Setpoint = "",
  1973. // SetpointEnabled = true
  1974. //});
  1975. //// Match C2
  1976. //PMParameters.Add(new PMParameter
  1977. //{
  1978. // Name = $"{pmID}.Match.TunePosition2", Display = "Match C2 (%)", Type = ParameterType.Default, Feedback = "", Setpoint = "",
  1979. // SetpointEnabled = true
  1980. //});
  1981. // Match C1
  1982. PMParameters.Add(new PMParameter()
  1983. {
  1984. Name = $"{pmID}.Match.TunePosition1",
  1985. Display = "Source Match C1(%)",
  1986. Type = ParameterType.Share,
  1987. Setpoint = ""
  1988. });
  1989. // Match C2
  1990. PMParameters.Add(new PMParameter()
  1991. {
  1992. Name = $"{pmID}.Match.TunePosition2",
  1993. Display = "Source Match C2(%)",
  1994. Type = ParameterType.Share,
  1995. Setpoint = ""
  1996. });
  1997. // Vpp
  1998. PMParameters.Add(new PMParameter()
  1999. {
  2000. Name = $"{pmID}.Match.VPP",
  2001. Display = "Source Vpp", Type = ParameterType.Share, Setpoint = ""
  2002. });
  2003. if ((bool)QueryDataClient.Instance.Service.GetConfig($"{pmID}.BiasRf.EnableBiasRF"))
  2004. {
  2005. // 设定功率
  2006. PMParameters.Add(new PMParameter
  2007. {
  2008. Name = $"{pmID}.BiasRf.ForwardPower",
  2009. Display = "Bias ForwardPower(w)",
  2010. Type = ParameterType.Default,
  2011. Feedback = "",
  2012. Setpoint = "",
  2013. SetpointEnabled = true
  2014. });
  2015. // ReflectPower
  2016. PMParameters.Add(new PMParameter
  2017. {
  2018. Name = $"{pmID}.BiasRf.ReflectPower",
  2019. Display = "Bias ReflectPower(w)",
  2020. Type = ParameterType.Share,
  2021. Setpoint = ""
  2022. });
  2023. // Match Mode
  2024. PMParameters.Add(new PMParameter
  2025. {
  2026. Name = $"{pmID}.BiasMatch.MatchProcessMode",
  2027. Display = "Bias Match Mode",
  2028. Type = ParameterType.DropDownList,
  2029. SetpointEnabled = true,
  2030. Selections = new List<string> { "Preset", "Hold" },
  2031. Setpoint = "Preset",
  2032. Feedback = "Preset"
  2033. });
  2034. // Match C1
  2035. PMParameters.Add(new PMParameter
  2036. {
  2037. Name = $"{pmID}.BiasMatch.C1",
  2038. Display = "Bias Match C1(%)",
  2039. Type = ParameterType.Default,
  2040. Feedback = "0",
  2041. Setpoint = "",
  2042. SetpointEnabled = true
  2043. });
  2044. // Match C2
  2045. PMParameters.Add(new PMParameter
  2046. {
  2047. Name = $"{pmID}.BiasMatch.C2",
  2048. Display = "Bias Match C2(%)",
  2049. Type = ParameterType.Default,
  2050. Feedback = "0",
  2051. Setpoint = "",
  2052. SetpointEnabled = true
  2053. });
  2054. // Vpp
  2055. PMParameters.Add(new PMParameter()
  2056. {
  2057. Name = $"{pmID}.BiasMatch.VPP",
  2058. Display = "Bias Vpp",
  2059. Type = ParameterType.Share,
  2060. Setpoint = ""
  2061. });
  2062. }
  2063. // 气体
  2064. foreach (var gas in Gaslines)
  2065. {
  2066. PMParameters.Add(new PMParameter
  2067. {
  2068. Name = $"{pmID}.IoMfc.MfcGas{gas.Index}.FeedBack",
  2069. Display = $"{gas.Display} (sccm)",
  2070. Type = ParameterType.Default,
  2071. Feedback = "0",
  2072. Setpoint = "0",
  2073. SetpointEnabled = true
  2074. });
  2075. }
  2076. return PMParameters;
  2077. }
  2078. public void SelectRecipe()
  2079. {
  2080. if (MenuPermission != 3) return;
  2081. if (!Enum.TryParse(SystemName, out ModuleName mod))
  2082. return;
  2083. RecipeSequenceSelectDialogViewModel dialog = new RecipeSequenceSelectDialogViewModel();
  2084. dialog.DisplayName = "Select Recipe";
  2085. dialog.Files = new ObservableCollection<FileNode>(RecipeSequenceTreeBuilder.GetFiles(RecipeClient.Instance.Service.GetRecipes(mod, false).ToList()));
  2086. WindowManager wm = new WindowManager();
  2087. bool? bret = wm.ShowDialog(dialog);
  2088. if ((bool)bret)
  2089. {
  2090. SelectedRecipeName = dialog.DialogResult;
  2091. }
  2092. }
  2093. public void UnLoad()
  2094. {
  2095. }
  2096. public void Start()
  2097. {
  2098. if (MenuPermission != 3) return;
  2099. if (string.IsNullOrWhiteSpace(this.SelectedRecipeName))
  2100. {
  2101. DialogBox.ShowError("Choose recipe");
  2102. return;
  2103. }
  2104. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.RunRecipe}", $"{SystemName}\\{this.SelectedRecipeName}");
  2105. }
  2106. public void NextStep()
  2107. {
  2108. if (MenuPermission != 3) return;
  2109. if (MessageBox.Show("Next step?", "JetPlasma", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
  2110. {
  2111. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.SkipCurrentStep}");
  2112. }
  2113. }
  2114. public void Stop()
  2115. {
  2116. if (MenuPermission != 3) return;
  2117. if (MessageBox.Show("Stop process?", "JetPlasma", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
  2118. {
  2119. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.AbortRecipe}");
  2120. }
  2121. }
  2122. public void SetManual()
  2123. {
  2124. if (MenuPermission != 3) return;
  2125. InvokeClient.Instance.Service.DoOperation($"{SystemName}.PmManual");
  2126. }
  2127. public void SetAuto()
  2128. {
  2129. if (MenuPermission != 3) return;
  2130. InvokeClient.Instance.Service.DoOperation($"{SystemName}.PmAuto");
  2131. }
  2132. public void SetOnline()
  2133. {
  2134. if (MenuPermission != 3) return;
  2135. InvokeClient.Instance.Service.DoOperation($"{SystemName}.PmOnline");
  2136. }
  2137. public void SetInit()
  2138. {
  2139. if (MenuPermission != 3) return;
  2140. InvokeClient.Instance.Service.DoOperation($"{SystemName}.Home");
  2141. }
  2142. public void AbortPM()
  2143. {
  2144. if (MenuPermission != 3) return;
  2145. InvokeClient.Instance.Service.DoOperation($"{SystemName}.Abort");
  2146. }
  2147. public void SetOffline()
  2148. {
  2149. if (MenuPermission != 3) return;
  2150. InvokeClient.Instance.Service.DoOperation($"{SystemName}.PmOffline");
  2151. }
  2152. public void UnlockLid()
  2153. {
  2154. if (MenuPermission != 3) return;
  2155. InvokeClient.Instance.Service.DoOperation($"{SystemName}.UnlockLid");
  2156. }
  2157. public void LockLid()
  2158. {
  2159. if (MenuPermission != 3) return;
  2160. InvokeClient.Instance.Service.DoOperation($"{SystemName}.LockLid");
  2161. }
  2162. public void OpenSlitValve()
  2163. {
  2164. if (MenuPermission != 3) return;
  2165. if (!IsCDAOK)
  2166. {
  2167. DialogBox.ShowWarning("CDA Pressure Error");
  2168. return;
  2169. }
  2170. if (!IsArmNotExtend)
  2171. {
  2172. DialogBox.ShowWarning("Arm Is Not Extend Error");
  2173. return;
  2174. }
  2175. InvokeClient.Instance.Service.DoOperation($"{SystemName}.SlitDoor.Open");
  2176. }
  2177. public void CloseSlitValve()
  2178. {
  2179. if (MenuPermission != 3) return;
  2180. if (!IsCDAOK)
  2181. {
  2182. DialogBox.ShowWarning("CDA Pressure Error");
  2183. return;
  2184. }
  2185. if (!IsArmNotExtend)
  2186. {
  2187. DialogBox.ShowWarning("Arm Is Not Extend Error");
  2188. return;
  2189. }
  2190. InvokeClient.Instance.Service.DoOperation($"{SystemName}.SlitDoor.Close");
  2191. }
  2192. protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
  2193. {
  2194. MenuPermission = ClientApp.Instance.GetPermission($"Overview{SystemName}");
  2195. foreach (var pmParameter in PMParameters)
  2196. {
  2197. string paraName = pmParameter.Name;
  2198. if (!data.ContainsKey(paraName))
  2199. continue;
  2200. pmParameter.Feedback = $"{data[paraName]:N0}";
  2201. if (paraName == $"{SystemName}.BiasMatch.MatchProcessMode")
  2202. {
  2203. pmParameter.Feedback = (int)data[paraName] == 1 ? "Preset" : "Hold";
  2204. }
  2205. if (paraName == $"{SystemName}.BiasMatch.C1")
  2206. {
  2207. pmParameter.Feedback = $"{data[paraName]:N1}";
  2208. }
  2209. if (paraName == $"{SystemName}.BiasMatch.C2")
  2210. {
  2211. pmParameter.Feedback = $"{data[paraName]:N1}";
  2212. }
  2213. if (paraName == $"{SystemName}.ProcessGauge.Value")
  2214. {
  2215. pmParameter.Feedback = $"{data[paraName]:N1}";
  2216. }
  2217. if (paraName == $"{SystemName}.IoThrottleValve.ThrottleValve.TVMode")
  2218. {
  2219. pmParameter.Feedback = pmParameter.Setpoint;
  2220. }
  2221. if (paraName == $"{SystemName}.IoThrottleValve.ThrottleValve.TVPressure")
  2222. {
  2223. if (Convert.ToDouble(data[paraName]) <= 0.0)
  2224. {
  2225. pmParameter.Feedback = "0.0";
  2226. }
  2227. else
  2228. {
  2229. pmParameter.Feedback = $"{(Convert.ToDouble(data[paraName]) + ProcessPressureOffset):N1}";
  2230. }
  2231. }
  2232. if (paraName == $"{SystemName}.Rf.PowerOnTime")
  2233. {
  2234. pmParameter.Feedback = $"{data[$"{SystemName}.Rf.PowerOnTime"]}";
  2235. }
  2236. if (paraName == $"{SystemName}.Match.TunePosition1"|| paraName == $"{SystemName}.Match.TunePosition2")
  2237. {
  2238. pmParameter.Feedback = $"{data[paraName]:N2}";
  2239. }
  2240. if (paraName == $"{SystemName}.StepTime")
  2241. {
  2242. pmParameter.Feedback = $"{data[$"{SystemName}.RecipeStepTimeElapsed"]:N0}";
  2243. pmParameter.Setpoint = $"{data[$"{SystemName}.RecipeStepTimeSetPoint"]:N0}";
  2244. }
  2245. if (paraName == $"{SystemName}.StepNo")
  2246. {
  2247. pmParameter.Setpoint = $"{data[$"{SystemName}.RecipeSteps"]:N0}";
  2248. }
  2249. if (paraName == $"{SystemName}.RecipeStepTimeElapsed")
  2250. {
  2251. pmParameter.Setpoint = $"{data[$"{SystemName}.RecipeStepTimeSetPoint"]:N0}";
  2252. }
  2253. if (paraName == ($"{SystemName}.IoTemperatureCtrl.TemperatureControl.SubstrateTemperature"))
  2254. {
  2255. if(IsAutoMode)
  2256. {
  2257. pmParameter.Setpoint = string.Format("{0:N1}", ((AITHeaterData)data[$"{SystemName}.HeaterChamber.DeviceData"]).SetPoint);
  2258. }
  2259. pmParameter.Feedback = string.Format("{0:N1}", ((AITHeaterData)data[$"{SystemName}.HeaterChamber.DeviceData"]).FeedBack);
  2260. }
  2261. }
  2262. foreach (var gasLine in Gaslines)
  2263. {
  2264. if (data.ContainsKey(gasLine.ValveName))
  2265. {
  2266. gasLine.ValveData = (AITValveData)data[gasLine.ValveName];
  2267. gasLine.NotifyOfPropertyChange("ValveData");
  2268. }
  2269. if (data.ContainsKey(gasLine.MfcName))
  2270. {
  2271. gasLine.MfcData = (AITMfcData)data[gasLine.MfcName];
  2272. gasLine.Display = gasLine.MfcData.DeviceName + " " + gasLine.MfcData.DisplayName + " " + gasLine.MfcData.Scale + " " + gasLine.MfcData.Unit;
  2273. PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas{gasLine.Index}.FeedBack").Display = gasLine.Display;
  2274. PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas{gasLine.Index}.FeedBack").NotifyOfPropertyChange("Display");
  2275. gasLine.NotifyOfPropertyChange("MfcData");
  2276. }
  2277. }
  2278. //if (PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.MatchProcessMode").Setpoint == "Hold")
  2279. //{
  2280. // PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.C1").Setpoint = "";
  2281. // PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.C2").Setpoint = "";
  2282. //}
  2283. }
  2284. public void DoStartPump()
  2285. {
  2286. if (MenuPermission != 3) return;
  2287. if (IsStartPumping)
  2288. {
  2289. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.Abort}");
  2290. return;
  2291. }
  2292. InvokeClient.Instance.Service.DoOperation($"{SystemName}.StartPump");
  2293. }
  2294. // Pumpdown
  2295. public void DoPump()
  2296. {
  2297. if (MenuPermission != 3) return;
  2298. if (IsPumping)
  2299. {
  2300. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.Abort}");
  2301. return;
  2302. }
  2303. if (IsPumpingOkForProcess)
  2304. {
  2305. InvokeClient.Instance.Service.DoOperation($"{SystemName}.StopPump");
  2306. return;
  2307. }
  2308. // 设置底压
  2309. double basePressure = string.IsNullOrEmpty(BasePressureSetPoint) ? 0 : Convert.ToDouble(BasePressureSetPoint);
  2310. if (basePressure <= 0.01 || basePressure >= 1000)
  2311. {
  2312. MessageBox.Show($"Basic pressure setpoint {basePressure} invalid,between 0 end 1000(mtorr)");
  2313. return;
  2314. }
  2315. double pumpLimit = string.IsNullOrEmpty(PumpLimitSetPoint) ? 0 : Convert.ToDouble(PumpLimitSetPoint);
  2316. if (pumpLimit <= 0.01 || pumpLimit >= 1200)
  2317. {
  2318. MessageBox.Show($"Pump limit between 0 end 1200,current value {pumpLimit}");
  2319. return;
  2320. }
  2321. InvokeClient.Instance.Service.DoOperation("System.SetConfig", $"{SystemName}.Pump.PumpBasePressure", basePressure.ToString());
  2322. InvokeClient.Instance.Service.DoOperation("System.SetConfig", $"{SystemName}.Pump.PumpTimeLimit", pumpLimit.ToString());
  2323. InvokeClient.Instance.Service.DoOperation($"{SystemName}.Pump");
  2324. // pump down 过程中tv 全开
  2325. var tvMode = PMParameters.Find(x => x.Name == $"{SystemName}.IoThrottleValve.ThrottleValve.TVMode");
  2326. tvMode.Feedback = "Position";
  2327. PumpLimitSetPointSaved = true;
  2328. BasePressureSetPointSaved = true;
  2329. NotifyOfPropertyChange(nameof(PumpLimitSetPointSaved));
  2330. NotifyOfPropertyChange(nameof(BasePressureSetPointSaved));
  2331. }
  2332. private void MoveGuidePin(MovementPosition pos)
  2333. {
  2334. switch (pos)
  2335. {
  2336. case MovementPosition.Down:
  2337. BottomPinStatus = 1;
  2338. TopPinStatus = 0;
  2339. MidPinStatus = 0;
  2340. break;
  2341. case MovementPosition.Up:
  2342. BottomPinStatus = 0;
  2343. TopPinStatus = 1;
  2344. MidPinStatus = 0;
  2345. break;
  2346. case MovementPosition.Middle:
  2347. BottomPinStatus = 0;
  2348. TopPinStatus = 0;
  2349. MidPinStatus = 1;
  2350. break;
  2351. default:
  2352. break;
  2353. }
  2354. }
  2355. public void Purge()
  2356. {
  2357. if (MenuPermission != 3) return;
  2358. if (IsCyclePurging)
  2359. {
  2360. InvokeClient.Instance.Service.DoOperation($"{SystemName}.StopPurge");
  2361. }
  2362. else
  2363. {
  2364. InvokeClient.Instance.Service.DoOperation($"{SystemName}.Purge");
  2365. }
  2366. }
  2367. public void LeakCheck()
  2368. {
  2369. if (!IsLeakCheck)
  2370. {
  2371. InvokeClient.Instance.Service.DoOperation($"{SystemName}.LeakCheck");
  2372. }
  2373. }
  2374. public void Vent()
  2375. {
  2376. if (MenuPermission != 3) return;
  2377. //OverviewPMProvider.Instance.Vent("PM1");
  2378. if (!IsVenting)
  2379. {
  2380. InvokeClient.Instance.Service.DoOperation($"{SystemName}.Vent");
  2381. return;
  2382. }
  2383. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.Abort}");
  2384. }
  2385. /// <summary>
  2386. /// 流气
  2387. /// </summary>
  2388. public void Gas()
  2389. {
  2390. if (MenuPermission != 3) return;
  2391. if (!this.HandleThrottleValve())
  2392. return;
  2393. //GasLine 跳号Enable
  2394. object[] mfc = new object[5];
  2395. string[] mfcSetPoint = new string[5];
  2396. for (int i = 0; i < 5; i++)
  2397. {
  2398. if ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.MfcGas{i + 1}.Enable"))
  2399. {
  2400. mfcSetPoint[i] = PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas{i + 1}.FeedBack").Setpoint;
  2401. if (string.IsNullOrWhiteSpace(mfcSetPoint[i]))
  2402. {
  2403. DialogBox.ShowError("Please input gas flow value");
  2404. return;
  2405. }
  2406. }
  2407. mfc[i] = Convert.ToDouble(string.IsNullOrEmpty(mfcSetPoint[i]) ? "0.0" : mfcSetPoint[i]);
  2408. }
  2409. //object[] mfc = new object[Gaslines.Count];
  2410. //string[] mfcSetPoint = new string[Gaslines.Count];
  2411. //for (int index = 0; index < Gaslines.Count; index++)
  2412. //{
  2413. // mfcSetPoint[index] = PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas{index + 1}.FeedBack").Setpoint;
  2414. // if (string.IsNullOrWhiteSpace(mfcSetPoint[index]))
  2415. // {
  2416. // DialogBox.ShowError("请输入气体流量值");
  2417. // return;
  2418. // }
  2419. // mfc[index] = Convert.ToDouble(string.IsNullOrEmpty(mfcSetPoint[index]) ? "0.0" : mfcSetPoint[index]);
  2420. //}
  2421. if ((IsGasFlowing
  2422. && (Math.Abs((double)mfc[0] - (double)_oldmfc[0]) < 0.01)
  2423. && (Math.Abs((double)mfc[1] - (double)_oldmfc[1]) < 0.01)
  2424. && (Math.Abs((double)mfc[2] - (double)_oldmfc[2])) < 0.01)
  2425. || (IsGasFlowing && (Math.Abs((double)mfc[0]) <= 0.01 && Math.Abs((double)mfc[1]) <= 0.01 && Math.Abs((double)mfc[2]) <= 0.01)))
  2426. {
  2427. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.Abort}");
  2428. return;
  2429. }
  2430. _oldmfc = mfc;
  2431. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.GasFlow}", mfc);
  2432. }
  2433. /// <summary>
  2434. /// 处理蝶阀
  2435. /// </summary>
  2436. /// <returns></returns>
  2437. private bool HandleThrottleValve()
  2438. {
  2439. var tvMode = PMParameters.Find(x => x.Name == $"{SystemName}.IoThrottleValve.ThrottleValve.TVMode");
  2440. string tvModeSp = "TV" + tvMode.Setpoint + "Ctrl";
  2441. if (!Enum.TryParse(tvModeSp, out PressureCtrlMode ctrlMode))
  2442. {
  2443. MessageBox.Show("Select the mode of Throttle valve");
  2444. return false;
  2445. }
  2446. switch (ctrlMode)
  2447. {
  2448. case PressureCtrlMode.TVPressureCtrl:
  2449. string tvPressureSP = PMParameters.Find(x => x.Name == $"{SystemName}.IoThrottleValve.ThrottleValve.TVPressure").Setpoint;
  2450. if (string.IsNullOrWhiteSpace(tvPressureSP))
  2451. {
  2452. DialogBox.ShowError("Please input TV pressure value");
  2453. return false;
  2454. }
  2455. double pressure = Convert.ToDouble(tvPressureSP);
  2456. if (pressure < 0 || pressure > 756000)
  2457. {
  2458. DialogBox.ShowError($"TV pressure {pressure} invalid,between 0 end 756000");
  2459. return false;
  2460. }
  2461. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{VirgoDevice.ThrottleValve}.{AITThrottleValveOperation.SetPressure}", pressure);
  2462. break;
  2463. case PressureCtrlMode.TVPositionCtrl:
  2464. string tvPositionSP = PMParameters.Find(x => x.Name == $"{SystemName}.IoThrottleValve.ThrottleValve.TVPosition").Setpoint;
  2465. if (string.IsNullOrWhiteSpace(tvPositionSP))
  2466. {
  2467. DialogBox.ShowError("Please input TV Position value");
  2468. return false;
  2469. }
  2470. double position = Convert.ToDouble(tvPositionSP);
  2471. if (position < 0 || position > 100)
  2472. {
  2473. DialogBox.ShowError($"TV Position {position} invalid,between 0 end 100");
  2474. return false;
  2475. }
  2476. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{VirgoDevice.ThrottleValve}.{AITThrottleValveOperation.SetPosition}", position);
  2477. break;
  2478. default:
  2479. break;
  2480. }
  2481. tvMode.Feedback = tvMode.Setpoint;
  2482. return true;
  2483. }
  2484. public void Heat()
  2485. {
  2486. var para_temp = PMParameters.Find(x => x.Name == $"{SystemName}.IoTemperatureCtrl.TemperatureControl.SubstrateTemperature");
  2487. var temp = para_temp.Setpoint;
  2488. if (double.TryParse(temp, out double dt))
  2489. {
  2490. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.Heat}", dt);
  2491. }
  2492. else
  2493. {
  2494. DialogBox.ShowError("Set TEMP invalid");
  2495. }
  2496. }
  2497. // RF Power
  2498. public void RF()
  2499. {
  2500. if (MenuPermission != 3) return;
  2501. double rf_sp = 0;
  2502. double rf_sp_bias = 0;
  2503. double match1_sp = 0.0f;
  2504. double match2_sp = 0.0f;
  2505. double rf_time = 0;
  2506. string rfPowerSetPointBias = "";
  2507. BiasRfMatchMode matchMode = BiasRfMatchMode.Preset;
  2508. if (IsRfPowering)
  2509. {
  2510. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.Abort}");
  2511. return;
  2512. }
  2513. // 源射频功率
  2514. string rfPowerSetPoint = PMParameters.Find(x => x.Name == $"{SystemName}.Rf.ForwardPower").Setpoint;
  2515. if (string.IsNullOrWhiteSpace(rfPowerSetPoint))
  2516. {
  2517. DialogBox.ShowWarning("Input RF power set value first");
  2518. return;
  2519. }
  2520. // 源射频时间
  2521. string sRFTime = PMParameters.Find(x => x.Name == $"{SystemName}.Rf.PowerOnTime").Setpoint;
  2522. if (string.IsNullOrWhiteSpace(sRFTime))
  2523. {
  2524. DialogBox.ShowError("Input RF power time");
  2525. return;
  2526. }
  2527. // 偏压射频功率
  2528. if ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.BiasRf.EnableBiasRF"))
  2529. {
  2530. rfPowerSetPointBias = PMParameters.Find(x => x.Name == $"{SystemName}.BiasRf.ForwardPower").Setpoint;
  2531. if (string.IsNullOrWhiteSpace(rfPowerSetPointBias))
  2532. {
  2533. DialogBox.ShowWarning("Input Bias RF power set value first");
  2534. return;
  2535. }
  2536. rf_sp_bias = Convert.ToDouble(rfPowerSetPointBias);
  2537. if ((bool)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.BiasMatch.EnableBiasMatch"))
  2538. {
  2539. var MatchMode = PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.MatchProcessMode");
  2540. if (!Enum.TryParse(MatchMode.Setpoint, out matchMode))
  2541. {
  2542. MessageBox.Show("Select the mode of Throttle valve");
  2543. return;
  2544. }
  2545. if (matchMode == BiasRfMatchMode.Preset)
  2546. {
  2547. PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.MatchProcessMode").Feedback = "Preset";
  2548. // Match C1
  2549. string rfMatchC1SetPoint = PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.C1").Setpoint;
  2550. if (string.IsNullOrWhiteSpace(rfMatchC1SetPoint))
  2551. {
  2552. DialogBox.ShowWarning("Input Match C1 set value first");
  2553. return;
  2554. }
  2555. // Match C2
  2556. string rfMatchC2SetPoint = PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.C2").Setpoint;
  2557. if (string.IsNullOrWhiteSpace(rfMatchC2SetPoint))
  2558. {
  2559. DialogBox.ShowWarning("Input Match C2 set value first");
  2560. return;
  2561. }
  2562. match1_sp = Convert.ToDouble(rfMatchC1SetPoint);
  2563. match2_sp = Convert.ToDouble(rfMatchC2SetPoint);
  2564. }
  2565. else if (matchMode == BiasRfMatchMode.Hold)
  2566. {
  2567. //PMParameters.Find(x => x.Name == $"{SystemName}.BiasMatch.MatchProcessMode").Feedback = "Hold";
  2568. }
  2569. }
  2570. }
  2571. rf_sp = Convert.ToDouble(rfPowerSetPoint);
  2572. rf_time = Convert.ToDouble(sRFTime);
  2573. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.RfPower}", rf_sp, rf_sp_bias, rf_time, (int)matchMode, match1_sp, match2_sp);
  2574. }
  2575. // Lift pin method
  2576. public void MoveLiftPinSetState(string name)
  2577. {
  2578. if (MenuPermission != 3) return;
  2579. if (!IsCDAOK)
  2580. {
  2581. DialogBox.ShowWarning("CDA Pressure Error");
  2582. return;
  2583. }
  2584. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{_servoLiftPinName}.SetState",name);
  2585. }
  2586. public void MoveLiftPinHome(string name)
  2587. {
  2588. if (MenuPermission != 3) return;
  2589. if (!IsCDAOK)
  2590. {
  2591. DialogBox.ShowWarning("CDA Pressure Error");
  2592. return;
  2593. }
  2594. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{_servoLiftPinName}.Home",name);
  2595. }
  2596. public void MoveLiftPinDown()
  2597. {
  2598. if (MenuPermission != 3) return;
  2599. if (!IsCDAOK)
  2600. {
  2601. DialogBox.ShowWarning("CDA Pressure Error");
  2602. return;
  2603. }
  2604. InvokeClient.Instance.Service.DoOperation($"{SystemName}.LiftPin.Close");
  2605. }
  2606. // Guide pin method
  2607. public void MovePin3Up()
  2608. {
  2609. if (MenuPermission != 3) return;
  2610. if (!IsCDAOK)
  2611. {
  2612. DialogBox.ShowWarning("CDA Pressure Error");
  2613. return;
  2614. }
  2615. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.MoveGuidePin}", WaferSize.WS3, 2);
  2616. }
  2617. public void MovePin3Down()
  2618. {
  2619. if (MenuPermission != 3) return;
  2620. if (!IsCDAOK)
  2621. {
  2622. DialogBox.ShowWarning("CDA Pressure Error");
  2623. return;
  2624. }
  2625. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.MoveGuidePin}", WaferSize.WS3, 1);
  2626. }
  2627. public void MovePin4Up()
  2628. {
  2629. if (MenuPermission != 3) return;
  2630. if (!IsCDAOK)
  2631. {
  2632. DialogBox.ShowWarning("CDA Pressure Error");
  2633. return;
  2634. }
  2635. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.MoveGuidePin}", WaferSize.WS4, 2);
  2636. }
  2637. public void MovePin4Down()
  2638. {
  2639. if (MenuPermission != 3) return;
  2640. if (!IsCDAOK)
  2641. {
  2642. DialogBox.ShowWarning("CDA Pressure Error");
  2643. return;
  2644. }
  2645. InvokeClient.Instance.Service.DoOperation($"{SystemName}.{RtOperation.MoveGuidePin}", WaferSize.WS4, 1);
  2646. }
  2647. }
  2648. }