PmOverviewViewModel.cs 93 KB

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