PmOverviewViewModel.cs 75 KB

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