ManualSetViewModel.cs 113 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562
  1. using Aitex.Core.Common.DeviceData;
  2. using Aitex.Core.RT.IOCore;
  3. using Aitex.Core.RT.Log;
  4. using Aitex.Core.Util;
  5. using Caliburn.Micro;
  6. using Caliburn.Micro.Core;
  7. using FurnaceUI.Client;
  8. using FurnaceUI.Common;
  9. using FurnaceUI.Models;
  10. using FurnaceUI.Views.Editors;
  11. using FurnaceUI.Views.Operations;
  12. using FurnaceUI.Views.Parameter;
  13. using FurnaceUI.Views.Status;
  14. using MECF.Framework.Common.DataCenter;
  15. using MECF.Framework.Common.OperationCenter;
  16. using MECF.Framework.Common.RecipeCenter;
  17. using MECF.Framework.UI.Client.CenterViews.Configs.SystemConfig;
  18. using MECF.Framework.UI.Client.CenterViews.Dialogs;
  19. using MECF.Framework.UI.Client.CenterViews.Editors.Recipe;
  20. using MECF.Framework.UI.Client.ClientBase;
  21. using OpenSEMI.ClientBase;
  22. using OpenSEMI.Ctrlib.Controls;
  23. using RecipeEditorLib.RecipeModel.Params;
  24. using System;
  25. using System.Collections.Generic;
  26. using System.Collections.ObjectModel;
  27. using System.Linq;
  28. using System.Reflection;
  29. using System.Windows;
  30. using System.Windows.Controls;
  31. using System.Windows.Media;
  32. namespace FurnaceUI.Views.Recipes
  33. {
  34. public class ManualSetViewModel : FurnaceUIViewModelBase
  35. {
  36. [Subscription("PM1.CurrentAuxData")]
  37. public List<AITAuxData> AUXDetailDatas { get; set; }
  38. public string DefaultUnit { get; set; }
  39. #region MFCs
  40. [Subscription("PM1.MFC1.DeviceData")]
  41. public AITMfcData MFC1Data { get; set; }
  42. [Subscription("PM1.MFC2.DeviceData")]
  43. public AITMfcData MFC2Data { get; set; }
  44. [Subscription("PM1.MFC3.DeviceData")]
  45. public AITMfcData MFC3Data { get; set; }
  46. [Subscription("PM1.MFC4.DeviceData")]
  47. public AITMfcData MFC4Data { get; set; }
  48. [Subscription("PM1.MFC5.DeviceData")]
  49. public AITMfcData MFC5Data { get; set; }
  50. [Subscription("PM1.MFC6.DeviceData")]
  51. public AITMfcData MFC6Data { get; set; }
  52. [Subscription("PM1.MFC7.DeviceData")]
  53. public AITMfcData MFC7Data { get; set; }
  54. [Subscription("PM1.MFC8.DeviceData")]
  55. public AITMfcData MFC8Data { get; set; }
  56. [Subscription("PM1.MFC9.DeviceData")]
  57. public AITMfcData MFC9Data { get; set; }
  58. [Subscription("PM1.MFC10.DeviceData")]
  59. public AITMfcData MFC10Data { get; set; }
  60. [Subscription("PM1.MFC11.DeviceData")]
  61. public AITMfcData MFC11Data { get; set; }
  62. [Subscription("PM1.MFC12.DeviceData")]
  63. public AITMfcData MFC12Data { get; set; }
  64. [Subscription("PM1.MFC13.DeviceData")]
  65. public AITMfcData MFC13Data { get; set; }
  66. [Subscription("PM1.MFC14.DeviceData")]
  67. public AITMfcData MFC14Data { get; set; }
  68. [Subscription("PM1.MFC15.DeviceData")]
  69. public AITMfcData MFC15Data { get; set; }
  70. [Subscription("PM1.MFC16.DeviceData")]
  71. public AITMfcData MFC16Data { get; set; }
  72. [Subscription("PM1.MFC17.DeviceData")]
  73. public AITMfcData MFC17Data { get; set; }
  74. [Subscription("PM1.MFC31.DeviceData")]
  75. public AITMfcData MFC31Data { get; set; }
  76. [Subscription("PM1.MFC32.DeviceData")]
  77. public AITMfcData MFC32Data { get; set; }
  78. [Subscription("PM1.MFC51.DeviceData")]
  79. public AITMfcData MFC51Data { get; set; }
  80. #endregion
  81. [Subscription("PM1.EditRecipeStepNo")]
  82. public int EditRecipeStepNo { get; set; }
  83. [Subscription("PM1.EditRecipeName")]
  84. public string EditRecipeName { get; set; }
  85. [Subscription("PM1.EditRecipeStepName")]
  86. public string EditRecipeStepName { get; set; }
  87. private int ControlMode = 1;
  88. private UIElement _parent;
  89. [Subscription("System.HeaterU.DeviceData")]
  90. public AITHeaterData HeaterUData { get; set; }
  91. [Subscription("System.HeaterCU.DeviceData")]
  92. public AITHeaterData HeaterCUData { get; set; }
  93. [Subscription("System.HeaterC.DeviceData")]
  94. public AITHeaterData HeaterCData { get; set; }
  95. [Subscription("System.HeaterCL.DeviceData")]
  96. public AITHeaterData HeaterCLData { get; set; }
  97. [Subscription("System.HeaterL.DeviceData")]
  98. public AITHeaterData HeaterLData { get; set; }
  99. public AITHeaterData BottomHeaterData => HeaterLData;
  100. public AITHeaterData CenterBottomHeaterData => HeaterCLData;
  101. public AITHeaterData CenterHeaterData => HeaterCData;
  102. public AITHeaterData TopCenterHeaterData => HeaterCUData;
  103. public AITHeaterData TopHeaterData => HeaterUData;
  104. [Subscription("PM1.APC.DeviceData")]
  105. public AITAPCData APCData { get; set; }
  106. IWindowManager wm = IoC.Get<IWindowManager>();
  107. public bool IsPermission { get => this.Permission == 3; }
  108. private string _selectBtnName;
  109. public string SelectBtnName
  110. {
  111. get { return _selectBtnName; }
  112. set { _selectBtnName = value; this.NotifyOfPropertyChange(nameof(SelectBtnName)); }
  113. }
  114. private string _temperatureControlMode;
  115. public string TemperatureControlMode
  116. {
  117. get => _temperatureControlMode;
  118. set
  119. {
  120. _temperatureControlMode = value;
  121. NotifyOfPropertyChange(nameof(TemperatureControlMode));
  122. }
  123. }
  124. private string _temperatureCorrect;
  125. public string TemperatureCorrect
  126. {
  127. get => _temperatureCorrect;
  128. set
  129. {
  130. _temperatureCorrect = value;
  131. NotifyOfPropertyChange(nameof(TemperatureCorrect));
  132. }
  133. }
  134. private string _temperaturePID;
  135. public string TemperaturePID
  136. {
  137. get => _temperaturePID;
  138. set
  139. {
  140. _temperaturePID = value;
  141. NotifyOfPropertyChange(nameof(TemperaturePID));
  142. }
  143. }
  144. private string _loaderCommand = "";
  145. public string LoaderCommand
  146. {
  147. get => _loaderCommand;
  148. set
  149. {
  150. _loaderCommand = value;
  151. NotifyOfPropertyChange(nameof(LoaderCommand));
  152. NotifyOfPropertyChange(nameof(LoaderCommandIsSaved));
  153. }
  154. }
  155. public string OldLoaderCommand { get; set; } = "";
  156. public void SetParent(UIElement parent)
  157. {
  158. _parent = parent;
  159. }
  160. public bool LoaderCommandIsSaved
  161. {
  162. get => LoaderCommand == OldLoaderCommand;
  163. }
  164. #region"Loader Set Value"
  165. private Visibility _loaderSet3SpeedVisibility = Visibility.Hidden;
  166. public Visibility LoaderSet3SpeedVisibility
  167. {
  168. get => _loaderSet3SpeedVisibility;
  169. set
  170. {
  171. _loaderSet3SpeedVisibility = value;
  172. NotifyOfPropertyChange(nameof(LoaderSet3SpeedVisibility));
  173. }
  174. }
  175. private Visibility _loaderSetSpeedVisibility = Visibility.Hidden;
  176. public Visibility LoaderSetSpeedVisibility
  177. {
  178. get => _loaderSetSpeedVisibility;
  179. set
  180. {
  181. _loaderSetSpeedVisibility = value;
  182. NotifyOfPropertyChange(nameof(LoaderSetSpeedVisibility));
  183. }
  184. }
  185. private Visibility _loaderSetSpeedFloatVisibility = Visibility.Hidden;
  186. public Visibility LoaderSetSpeedFloatVisibility
  187. {
  188. get => _loaderSetSpeedFloatVisibility;
  189. set
  190. {
  191. _loaderSetSpeedFloatVisibility = value;
  192. NotifyOfPropertyChange(nameof(LoaderSetSpeedFloatVisibility));
  193. }
  194. }
  195. private string _pressCommand = "";
  196. public string PressCommand
  197. {
  198. get => _pressCommand;
  199. set
  200. {
  201. _pressCommand = value;
  202. NotifyOfPropertyChange(nameof(PressCommand));
  203. NotifyOfPropertyChange(nameof(PressCommandIsSaved));
  204. }
  205. }
  206. public string OldPressCommand { get; set; } = "";
  207. public bool PressCommandIsSaved
  208. {
  209. get => _pressCommand == OldPressCommand;
  210. }
  211. public void SetShowLoaderValuePanel(string selectedCmd)
  212. {
  213. switch (selectedCmd)
  214. {
  215. case "Boat Load":
  216. case "Boat Unload":
  217. LoaderSet3SpeedVisibility = Visibility.Visible;
  218. LoaderSetSpeedVisibility = Visibility.Hidden;
  219. LoaderSetSpeedFloatVisibility = Visibility.Hidden;
  220. break;
  221. case "Boat Rotate":
  222. LoaderSet3SpeedVisibility = Visibility.Hidden;
  223. LoaderSetSpeedVisibility = Visibility.Hidden;
  224. LoaderSetSpeedFloatVisibility = Visibility.Visible;
  225. break;
  226. case "Boat CAP2":
  227. LoaderSet3SpeedVisibility = Visibility.Hidden;
  228. LoaderSetSpeedVisibility = Visibility.Visible;
  229. LoaderSetSpeedFloatVisibility = Visibility.Hidden;
  230. break;
  231. case "Stop(Include R-axis)":
  232. case "Boat Rotate Stop":
  233. case "Boat Loader Home":
  234. case "None":
  235. case "NONE":
  236. LoaderSet3SpeedVisibility = Visibility.Hidden;
  237. LoaderSetSpeedVisibility = Visibility.Hidden;
  238. LoaderSetSpeedFloatVisibility = Visibility.Hidden;
  239. break;
  240. default:
  241. break;
  242. }
  243. }
  244. public void SetLoaderValue(string selectedCmd, string Values)
  245. {
  246. switch (selectedCmd)
  247. {
  248. case "Boat Load":
  249. case "Boat Unload":
  250. if (string.IsNullOrEmpty(Values)) return;
  251. string[] list = Values.Split(';');
  252. if (list.Length < 3) return;
  253. Loader3Speed1 = int.Parse(list[0]);
  254. Loader3Speed2 = int.Parse(list[1]);
  255. Loader3Speed3 = int.Parse(list[2]);
  256. break;
  257. case "Boat Rotate":
  258. if (string.IsNullOrEmpty(Values)) return;
  259. LoaderRPM = double.Parse(Values);
  260. break;
  261. case "Boat CAP2":
  262. if (string.IsNullOrEmpty(Values)) return;
  263. LoaderSpeed = int.Parse(Values);
  264. break;
  265. case "Stop(Include R-axis)":
  266. case "Boat Rotate Stop":
  267. case "Boat Loader Home":
  268. case "None":
  269. break;
  270. default:
  271. break;
  272. }
  273. }
  274. public string GetSaveLoaderValue(string selectedCmd)
  275. {
  276. switch (selectedCmd)
  277. {
  278. case "Boat Load":
  279. case "Boat Unload":
  280. return $"{selectedCmd};{Loader3Speed1};{Loader3Speed2};{Loader3Speed3}";
  281. case "Boat Rotate":
  282. return $"{selectedCmd};{LoaderRPM.ToString()}";
  283. case "Boat CAP2":
  284. return $"{selectedCmd};{LoaderSpeed.ToString()}";
  285. case "Stop(Include R-axis)":
  286. case "Boat Rotate Stop":
  287. case "Boat Loader Home":
  288. case "None":
  289. return $"{selectedCmd};";
  290. default:
  291. return "";
  292. }
  293. }
  294. private int loader3Speed1 = 5;
  295. public int Loader3Speed1
  296. {
  297. get => loader3Speed1;
  298. set
  299. {
  300. loader3Speed1 = value;
  301. NotifyOfPropertyChange(nameof(Loader3Speed1));
  302. }
  303. }
  304. private int loader3Speed2 = 0;
  305. public int Loader3Speed2
  306. {
  307. get => loader3Speed2;
  308. set
  309. {
  310. loader3Speed2 = value;
  311. NotifyOfPropertyChange(nameof(Loader3Speed2));
  312. }
  313. }
  314. private int loader3Speed3 = 0;
  315. public int Loader3Speed3
  316. {
  317. get => loader3Speed3;
  318. set
  319. {
  320. loader3Speed3 = value;
  321. NotifyOfPropertyChange(nameof(Loader3Speed3));
  322. }
  323. }
  324. private double _loaderRPM = 0;
  325. public double LoaderRPM
  326. {
  327. get => _loaderRPM;
  328. set
  329. {
  330. _loaderRPM = value;
  331. NotifyOfPropertyChange(nameof(LoaderRPM));
  332. }
  333. }
  334. private int loaderSpeed = 0;
  335. public int LoaderSpeed
  336. {
  337. get => loaderSpeed;
  338. set
  339. {
  340. loaderSpeed = value;
  341. NotifyOfPropertyChange(nameof(LoaderSpeed));
  342. }
  343. }
  344. private void ClearLoaderSetValue()
  345. {
  346. Loader3Speed1 = 0;
  347. Loader3Speed2 = 0;
  348. Loader3Speed3 = 0;
  349. LoaderRPM = 0;
  350. LoaderSpeed = 0;
  351. }
  352. #endregion
  353. #region"PressVisibility"
  354. private Visibility _pressVisibility = Visibility.Hidden;
  355. public Visibility PressVisibility
  356. {
  357. get => _pressVisibility;
  358. set
  359. {
  360. _pressVisibility = value;
  361. NotifyOfPropertyChange(nameof(PressVisibility));
  362. }
  363. }
  364. private Visibility _pressSlowVacVisibility = Visibility.Hidden;
  365. public Visibility PressSlowVacVisibility
  366. {
  367. get => _pressSlowVacVisibility;
  368. set
  369. {
  370. _pressSlowVacVisibility = value;
  371. NotifyOfPropertyChange(nameof(PressSlowVacVisibility));
  372. }
  373. }
  374. private Visibility _pressValveAngleVisibility = Visibility.Hidden;
  375. public Visibility PressValveAngleVisibility
  376. {
  377. get => _pressValveAngleVisibility;
  378. set
  379. {
  380. _pressValveAngleVisibility = value;
  381. NotifyOfPropertyChange(nameof(PressValveAngleVisibility));
  382. }
  383. }
  384. private Visibility _pressWaitVisibility = Visibility.Hidden;
  385. public Visibility PressWaitVisibility
  386. {
  387. get => _pressWaitVisibility;
  388. set
  389. {
  390. _pressWaitVisibility = value;
  391. NotifyOfPropertyChange(nameof(PressWaitVisibility));
  392. }
  393. }
  394. private string _pressureCommand;
  395. public string PressureCommand
  396. {
  397. get => _pressureCommand;
  398. set
  399. {
  400. _pressureCommand = value;
  401. }
  402. }
  403. public void SetShowPressPanel(string selectedCmd)
  404. {
  405. switch (selectedCmd)
  406. {
  407. case "Press":
  408. case "Press2":
  409. PressVisibility = Visibility.Visible;
  410. PressSlowVacVisibility = Visibility.Hidden;
  411. PressValveAngleVisibility = Visibility.Hidden;
  412. PressWaitVisibility = Visibility.Hidden;
  413. break;
  414. case "Slow Vac":
  415. PressVisibility = Visibility.Hidden;
  416. PressSlowVacVisibility = Visibility.Visible;
  417. PressValveAngleVisibility = Visibility.Hidden;
  418. PressWaitVisibility = Visibility.Hidden;
  419. break;
  420. case "Valve Angle":
  421. PressVisibility = Visibility.Hidden;
  422. PressSlowVacVisibility = Visibility.Hidden;
  423. PressValveAngleVisibility = Visibility.Visible;
  424. PressWaitVisibility = Visibility.Hidden;
  425. break;
  426. case "Full Open":
  427. case "Full Close":
  428. case "Hold":
  429. case "Zero Set":
  430. case "Cancel Zero":
  431. case "Home":
  432. case "None":
  433. PressVisibility = Visibility.Hidden;
  434. PressSlowVacVisibility = Visibility.Hidden;
  435. PressValveAngleVisibility = Visibility.Hidden;
  436. PressWaitVisibility = Visibility.Hidden;
  437. break;
  438. case "WaitPressUp1":
  439. case "WaitPressDown1":
  440. case "WaitPressUp2":
  441. case "WaitPressDown2":
  442. PressVisibility = Visibility.Hidden;
  443. PressSlowVacVisibility = Visibility.Hidden;
  444. PressValveAngleVisibility = Visibility.Hidden;
  445. PressWaitVisibility = Visibility.Visible;
  446. break;
  447. default:
  448. break;
  449. }
  450. }
  451. public void SetPressValue(string selectedCmd, string Values)
  452. {
  453. switch (selectedCmd)
  454. {
  455. case "Press":
  456. case "Press2":
  457. if (string.IsNullOrEmpty(Values)) return;
  458. string[] list = Values.Split(';');
  459. if (list.Length < 2) return;
  460. PressPID = list[0];
  461. PressSet = double.Parse(list[1]);
  462. break;
  463. case "Slow Vac":
  464. if (string.IsNullOrEmpty(Values)) return;
  465. PressSlowVacSet = double.Parse(Values);
  466. break;
  467. case "Valve Angle":
  468. if (string.IsNullOrEmpty(Values)) return;
  469. PressValveAngleSet = double.Parse(Values);
  470. break;
  471. case "Full Open":
  472. case "Full Close":
  473. case "Hold":
  474. case "Zero Set":
  475. case "Cancel Zero":
  476. break;
  477. case "WaitPressUp1":
  478. case "WaitPressDown1":
  479. case "WaitPressUp2":
  480. case "WaitPressDown2":
  481. if (string.IsNullOrEmpty(Values)) return;
  482. PressWait = double.Parse(Values);
  483. break;
  484. default:
  485. break;
  486. }
  487. }
  488. public string GetSavePressValue(string selectedCmd)
  489. {
  490. switch (selectedCmd)
  491. {
  492. case "Press":
  493. case "Press2":
  494. return $"{PressPID};{PressSet}";
  495. case "Slow Vac":
  496. return PressSlowVacSet.ToString();
  497. case "Valve Angle":
  498. return PressValveAngleSet.ToString();
  499. case "Full Open":
  500. case "Full Close":
  501. case "Hold":
  502. case "Zero Set":
  503. case "Cancel Zero":
  504. return "";
  505. case "WaitPressUp1":
  506. case "WaitPressDown1":
  507. case "WaitPressUp2":
  508. case "WaitPressDown2":
  509. return PressWait.ToString();
  510. default:
  511. return "";
  512. }
  513. }
  514. private string _pressPID;
  515. public string PressPID
  516. {
  517. get => _pressPID;
  518. set
  519. {
  520. _pressPID = value;
  521. NotifyOfPropertyChange(nameof(PressPID));
  522. }
  523. }
  524. private double _pressSet;
  525. public double PressSet
  526. {
  527. get => _pressSet;
  528. set
  529. {
  530. _pressSet = value;
  531. NotifyOfPropertyChange(nameof(PressSet));
  532. }
  533. }
  534. private double _pressSlowVacSet;
  535. public double PressSlowVacSet
  536. {
  537. get => _pressSlowVacSet;
  538. set
  539. {
  540. _pressSlowVacSet = value;
  541. NotifyOfPropertyChange(nameof(PressSlowVacSet));
  542. }
  543. }
  544. private double _pressValveAngleSet;
  545. public double PressValveAngleSet
  546. {
  547. get => _pressValveAngleSet;
  548. set
  549. {
  550. _pressValveAngleSet = value;
  551. NotifyOfPropertyChange(nameof(PressValveAngleSet));
  552. }
  553. }
  554. private string _lowPressWait = "None";
  555. public string LowPressWait
  556. {
  557. get => _lowPressWait;
  558. set
  559. {
  560. _lowPressWait = value;
  561. NotifyOfPropertyChange(nameof(LowPressWait));
  562. }
  563. }
  564. private double _pressWait;
  565. public double PressWait
  566. {
  567. get => _pressWait;
  568. set
  569. {
  570. _pressWait = value;
  571. NotifyOfPropertyChange(nameof(PressWait));
  572. }
  573. }
  574. private void ClearPressSetValue()
  575. {
  576. PressPID = "None";
  577. PressSet = 0;
  578. PressSlowVacSet = 0;
  579. PressValveAngleSet = 0;
  580. LowPressWait = "None";
  581. PressWait = 0;
  582. }
  583. #endregion
  584. #region AlarmRecipe Visibility
  585. public bool IsAlarmReicpe => RecipeType.ToLower() == "alarm";
  586. public bool IsAbortReicpe => RecipeType.ToLower() == "abort";
  587. public bool IsSubReicpe => RecipeType.ToLower() == "sub";
  588. public bool IsTableVisibility => IsAlarmReicpe || IsAbortReicpe || IsSubReicpe;
  589. public bool IsRecipeHeaderVisibility => !IsTableVisibility;
  590. public bool IsVPDataListVisibility => !IsTableVisibility;
  591. public bool IsCombinationVisibility => !IsTableVisibility;
  592. #endregion
  593. private bool _noStandbyIsEnabled = false;
  594. public bool NoStandbyIsEnabled
  595. {
  596. get => _noStandbyIsEnabled;
  597. set
  598. {
  599. _noStandbyIsEnabled = value;
  600. NotifyOfPropertyChange(nameof(NoStandbyIsEnabled));
  601. }
  602. }
  603. private Visibility _standbyIsVisibility = Visibility.Visible;
  604. public Visibility StandbyIsVisibility
  605. {
  606. get => _standbyIsVisibility;
  607. set
  608. {
  609. _standbyIsVisibility = value;
  610. NotifyOfPropertyChange(nameof(StandbyIsVisibility));
  611. }
  612. }
  613. private string _selectedGasSetting2;
  614. public string SelectedGasSetting2
  615. {
  616. get
  617. {
  618. return _selectedGasSetting2;
  619. }
  620. set
  621. {
  622. _selectedGasSetting2 = value;
  623. NotifyOfPropertyChange(nameof(SelectedGasSetting2));
  624. }
  625. }
  626. private string _selectedGasSetting3;
  627. public string SelectedGasSetting3
  628. {
  629. get
  630. {
  631. return _selectedGasSetting3;
  632. }
  633. set
  634. {
  635. _selectedGasSetting3 = value;
  636. NotifyOfPropertyChange(nameof(SelectedGasSetting3));
  637. }
  638. }
  639. private string _selectedGasSetting4;
  640. public string SelectedGasSetting4
  641. {
  642. get
  643. {
  644. return _selectedGasSetting4;
  645. }
  646. set
  647. {
  648. _selectedGasSetting4 = value;
  649. NotifyOfPropertyChange(nameof(SelectedGasSetting4));
  650. }
  651. }
  652. private string _selectedGasSetting5;
  653. public string SelectedGasSetting5
  654. {
  655. get
  656. {
  657. return _selectedGasSetting5;
  658. }
  659. set
  660. {
  661. _selectedGasSetting5 = value;
  662. NotifyOfPropertyChange(nameof(SelectedGasSetting5));
  663. }
  664. }
  665. private string _selectedGasSetting6;
  666. public string SelectedGasSetting6
  667. {
  668. get
  669. {
  670. return _selectedGasSetting6;
  671. }
  672. set
  673. {
  674. _selectedGasSetting6 = value;
  675. NotifyOfPropertyChange(nameof(SelectedGasSetting6));
  676. }
  677. }
  678. private List<ConfigNode> _ConfigNodes = new List<ConfigNode>();
  679. public List<ConfigNode> ConfigNodes
  680. {
  681. get { return _ConfigNodes; }
  682. set
  683. {
  684. _ConfigNodes = value;
  685. NotifyOfPropertyChange(nameof(ConfigNodes));
  686. }
  687. }
  688. public ObservableCollection<TempManualSetData> TempList { get; set; } = new ObservableCollection<TempManualSetData>();
  689. private ObservableCollection<MFCGasData> _mFCDatas = new ObservableCollection<MFCGasData>();
  690. public ObservableCollection<MFCGasData> MFCDataList
  691. {
  692. get => _mFCDatas;
  693. set
  694. {
  695. _mFCDatas = value;
  696. NotifyOfPropertyChange(nameof(MFCDataList));
  697. }
  698. }
  699. private string _pressureUnit;
  700. public string PressureUnit
  701. {
  702. get => _pressureUnit;
  703. set
  704. {
  705. _pressureUnit = value;
  706. NotifyOfPropertyChange(nameof(PressureUnit));
  707. }
  708. }
  709. public string RecipeType { get; set; }
  710. public ManualSetViewModel()
  711. {
  712. }
  713. protected override void OnViewLoaded(object view)
  714. {
  715. base.OnViewLoaded(view);
  716. }
  717. protected override void OnActivate()
  718. {
  719. base.OnActivate();
  720. //InvokeClient.Instance.Service.DoOperation($"PM1.SetSensorRecipeOK", "");
  721. LoadData();
  722. }
  723. protected override void OnDeactivate(bool close)
  724. {
  725. base.OnDeactivate(close);
  726. //InvokeClient.Instance.Service.DoOperation($"PM1.SetSensorPROCManualOK", "");
  727. }
  728. protected override void OnInitialize()
  729. {
  730. base.OnInitialize();
  731. // GetHeaderConfig();
  732. }
  733. private void LoadData()
  734. {
  735. firstUpdate = true;
  736. }
  737. //撤销修改
  738. public void RecipeIsChangeClick(object cmdName, object value)
  739. {
  740. var windowManager = IoC.Get<IWindowManager>();
  741. switch ((string)cmdName)
  742. {
  743. case "Alarm":
  744. break;
  745. case "MFC":
  746. break;
  747. case "Gas":
  748. break;
  749. case "AUX":
  750. break;
  751. case "Press":
  752. break;
  753. case "Temp":
  754. break;
  755. default:
  756. break;
  757. }
  758. }
  759. public void TempSetClick(object sender)
  760. {
  761. string stSetValue = ShowNumberKeyboard(sender as Button, "", 1);
  762. foreach (var item in TempList)
  763. {
  764. item.Value = stSetValue;
  765. item.IsSetChanged = false;
  766. }
  767. }
  768. public Dictionary<string, bool> DictValve { get; set; } = new Dictionary<string, bool>();
  769. public Dictionary<string, string> DictMFC { get; set; } = new Dictionary<string, string>();
  770. public Dictionary<string, string> DictMFCRamp { get; set; } = new Dictionary<string, string>();
  771. public Dictionary<string, bool> PumpSetValues { get; set; } = new Dictionary<string, bool>();
  772. public Dictionary<string, bool> F2HFClnOrHFCl2Values { get; set; } = new Dictionary<string, bool>();
  773. private Dictionary<string, string> ChangedDictMFC(Dictionary<string, double> oldDict)
  774. {
  775. Dictionary<string, string> rtnKeyValue = new Dictionary<string, string>();
  776. foreach (var item in oldDict.Keys)
  777. {
  778. rtnKeyValue.Add(item, oldDict[item].ToString());
  779. }
  780. return rtnKeyValue;
  781. }
  782. public void PatternCmd()
  783. {
  784. string toolType = (string)QueryDataClient.Instance.Service.GetConfig("System.SetUp.ToolType");
  785. if (!string.IsNullOrEmpty(toolType) && toolType.Equals(ConstantsCommon.ELK))
  786. {
  787. FurnaceUI.Views.Maintenances.Maintenances.ELK.GasPanelViewModel gasPanelTwoView = new Maintenances.Maintenances.ELK.GasPanelViewModel();
  788. gasPanelTwoView.MFCDataList = MFCDataList;
  789. var rtn = (wm as WindowManager)?.ShowDialogWithTitle(gasPanelTwoView, null, "Manual Gas View");
  790. if ((bool)rtn)
  791. {
  792. DictValve = gasPanelTwoView.DictChangedValve;
  793. DictMFC = ChangedDictMFC(gasPanelTwoView.DictChangedMFC);
  794. DictMFCRamp = ChangedDictMFC(gasPanelTwoView.DictChangedMFCRamp);
  795. foreach (var item in DictMFC)
  796. {
  797. var tempMFC = MFCDataList.FirstOrDefault(x => x.Name == item.Key);
  798. if (tempMFC != null)
  799. {
  800. tempMFC.IsSetChanged = false;
  801. tempMFC.Value = item.Value;
  802. }
  803. }
  804. foreach (var item in DictMFCRamp)
  805. {
  806. var tempMFC = MFCDataList.FirstOrDefault(x => x.Name == item.Key);
  807. if (tempMFC != null)
  808. {
  809. tempMFC.IsRampngChanged = false;
  810. tempMFC.Rampng = item.Value;
  811. }
  812. }
  813. if (DictMFC.Count == 0 && DictMFCRamp.Count == 0)
  814. {
  815. for (int i = 0; i < MFCDataList.Count; i++)
  816. {
  817. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastPoint");
  818. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastRamping");
  819. MFCDataList[i].Value = setLastPoint.ToString("f3");
  820. MFCDataList[i].Rampng = setLastRamping.ToString("f3");
  821. MFCDataList[i].IsSetChanged = true;
  822. MFCDataList[i].IsRampngChanged = true;
  823. };
  824. }
  825. if (gasPanelTwoView.DictChangedPumpValve.Count > 0)
  826. {
  827. PumpSetValues.Clear();
  828. if (gasPanelTwoView.AGVPumpData != null && gasPanelTwoView.AGVPumpData.DefaultValue != gasPanelTwoView.AGVPumpData.Feedback)
  829. {
  830. PumpSetValues.Add(gasPanelTwoView.AGVPumpData.UniqueName, gasPanelTwoView.AGVPumpData.Feedback);
  831. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AGVPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AGVPumpData.Feedback);
  832. }
  833. if (gasPanelTwoView.AGV2PumpData != null && gasPanelTwoView.AGV2PumpData.DefaultValue != gasPanelTwoView.AGV2PumpData.Feedback)
  834. {
  835. PumpSetValues.Add(gasPanelTwoView.AGV2PumpData.UniqueName, gasPanelTwoView.AGV2PumpData.Feedback);
  836. }
  837. if (gasPanelTwoView.AUCPumpData != null && gasPanelTwoView.AUCPumpData.DefaultValue != gasPanelTwoView.AUCPumpData.Feedback)
  838. {
  839. PumpSetValues.Add(gasPanelTwoView.AUCPumpData.UniqueName, gasPanelTwoView.AUCPumpData.Feedback);
  840. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AUCPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AUCPumpData.Feedback);
  841. }
  842. if (gasPanelTwoView.BothPump1Data != null && gasPanelTwoView.BothPump1Data.DefaultValue != gasPanelTwoView.BothPump1Data.Feedback)
  843. {
  844. PumpSetValues.Add(gasPanelTwoView.BothPump1Data.UniqueName, gasPanelTwoView.BothPump1Data.Feedback);
  845. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.BothPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.BothPumpData.Feedback);
  846. }
  847. if (gasPanelTwoView.BothPump2Data != null && gasPanelTwoView.BothPump2Data.DefaultValue != gasPanelTwoView.BothPump2Data.Feedback)
  848. {
  849. PumpSetValues.Add(gasPanelTwoView.BothPump2Data.UniqueName, gasPanelTwoView.BothPump2Data.Feedback);
  850. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.BothPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.BothPumpData.Feedback);
  851. }
  852. if (gasPanelTwoView.ValveBWRData != null && gasPanelTwoView.ValveBWRData.DefaultValue != gasPanelTwoView.ValveBWRData.Feedback)
  853. {
  854. PumpSetValues.Add(gasPanelTwoView.ValveBWRData.UniqueName, gasPanelTwoView.ValveBWRData.Feedback);
  855. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveBWRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveBWRData.Feedback);
  856. }
  857. if (gasPanelTwoView.ValveDPRData != null && gasPanelTwoView.ValveDPRData.DefaultValue != gasPanelTwoView.ValveDPRData.Feedback)
  858. {
  859. PumpSetValues.Add(gasPanelTwoView.ValveDPRData.UniqueName, gasPanelTwoView.ValveDPRData.Feedback);
  860. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveDPRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveDPRData.Feedback);
  861. }
  862. if (gasPanelTwoView.HREFData != null && gasPanelTwoView.HREFData.DefaultValue != gasPanelTwoView.HREFData.Feedback)
  863. {
  864. PumpSetValues.Add(gasPanelTwoView.HREFData.UniqueName, gasPanelTwoView.HREFData.Feedback);
  865. }
  866. if (gasPanelTwoView.CREF2Data != null && gasPanelTwoView.CREF2Data.DefaultValue != gasPanelTwoView.CREF2Data.Feedback)
  867. {
  868. PumpSetValues.Add(gasPanelTwoView.CREF2Data.UniqueName, gasPanelTwoView.CREF2Data.Feedback);
  869. }
  870. if (gasPanelTwoView.HZEROData != null && gasPanelTwoView.HZEROData.DefaultValue != gasPanelTwoView.HZEROData.Feedback)
  871. {
  872. PumpSetValues.Add(gasPanelTwoView.HZEROData.UniqueName, gasPanelTwoView.HZEROData.Feedback);
  873. }
  874. if (gasPanelTwoView.HMNTData != null && gasPanelTwoView.HMNTData.DefaultValue != gasPanelTwoView.HMNTData.Feedback)
  875. {
  876. PumpSetValues.Add(gasPanelTwoView.HMNTData.UniqueName, gasPanelTwoView.HMNTData.Feedback);
  877. }
  878. if (gasPanelTwoView.CMNTData != null && gasPanelTwoView.CMNTData.DefaultValue != gasPanelTwoView.CMNTData.Feedback)
  879. {
  880. PumpSetValues.Add(gasPanelTwoView.CMNTData.UniqueName, gasPanelTwoView.CMNTData.Feedback);
  881. }
  882. if (gasPanelTwoView.CZEROData != null && gasPanelTwoView.CZEROData.DefaultValue != gasPanelTwoView.CZEROData.Feedback)
  883. {
  884. PumpSetValues.Add(gasPanelTwoView.CZEROData.UniqueName, gasPanelTwoView.CZEROData.Feedback);
  885. }
  886. F2HFClnOrHFCl2Values.Clear();
  887. if (gasPanelTwoView.IsDEPOOn != gasPanelTwoView.IsOldDEPOOn)
  888. {
  889. F2HFClnOrHFCl2Values.Add("PM1.SetDEPOEnable", gasPanelTwoView.IsDEPOOn);
  890. // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  891. }
  892. if (gasPanelTwoView.IsF2ClnOn != gasPanelTwoView.IsOldF2ClnOn)
  893. {
  894. F2HFClnOrHFCl2Values.Add("PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  895. // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  896. }
  897. if (gasPanelTwoView.IsHFClnOn != gasPanelTwoView.IsOldHFClnOn)
  898. {
  899. F2HFClnOrHFCl2Values.Add("PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
  900. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
  901. }
  902. if (gasPanelTwoView.IsHTR1Enable != gasPanelTwoView.IsOldHTR1Enable)
  903. {
  904. F2HFClnOrHFCl2Values.Add("PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
  905. // InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
  906. }
  907. if (gasPanelTwoView.IsHTR2Enable != gasPanelTwoView.IsOldHTR2Enable)
  908. {
  909. F2HFClnOrHFCl2Values.Add("PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  910. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  911. }
  912. if (gasPanelTwoView.IsHTR3Enable != gasPanelTwoView.IsOldHTR3Enable)
  913. {
  914. F2HFClnOrHFCl2Values.Add("PM1.SetHTR3Enable", gasPanelTwoView.IsHTR3Enable);
  915. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  916. }
  917. if (gasPanelTwoView.IsCEXHOn != gasPanelTwoView.IsOldCEXHOn)
  918. {
  919. F2HFClnOrHFCl2Values.Add("PM1.SetCEXHEnable", gasPanelTwoView.IsCEXHOn);
  920. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  921. }
  922. if (gasPanelTwoView.IsCREFOn != gasPanelTwoView.IsOldCREFOn)
  923. {
  924. F2HFClnOrHFCl2Values.Add("PM1.SetCREFEnable", gasPanelTwoView.IsCREFOn);
  925. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  926. }
  927. if (gasPanelTwoView.IsSIREFOn != gasPanelTwoView.IsOldSIREFOn)
  928. {
  929. F2HFClnOrHFCl2Values.Add("PM1.SetSIREFEnable", gasPanelTwoView.IsSIREFOn);
  930. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  931. }
  932. }
  933. }
  934. }
  935. else if (!string.IsNullOrEmpty(toolType) && toolType.Equals(ConstantsCommon.SIBCN))
  936. {
  937. FurnaceUI.Views.Maintenances.Maintenances.SiBCN.GasPanelViewModel gasPanelTwoView = new Maintenances.Maintenances.SiBCN.GasPanelViewModel();
  938. gasPanelTwoView.MFCDataList = MFCDataList;
  939. var rtn = (wm as WindowManager)?.ShowDialogWithTitle(gasPanelTwoView, null, " Gas Panel");
  940. if ((bool)rtn)
  941. {
  942. DictValve = gasPanelTwoView.DictChangedValve;
  943. DictMFC = ChangedDictMFC(gasPanelTwoView.DictChangedMFC);
  944. foreach (var item in DictMFC)
  945. {
  946. var tempMFC = MFCDataList.FirstOrDefault(x => x.Name == item.Key);
  947. if (tempMFC != null)
  948. {
  949. tempMFC.IsSetChanged = false;
  950. tempMFC.Value = item.Value;
  951. }
  952. }
  953. if (DictMFC.Count == 0)
  954. {
  955. for (int i = 0; i < MFCDataList.Count; i++)
  956. {
  957. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastPoint");
  958. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastRamping");
  959. MFCDataList[i].Value = setLastPoint.ToString("f3");
  960. MFCDataList[i].Rampng = setLastRamping.ToString("f3");
  961. MFCDataList[i].IsSetChanged = true;
  962. };
  963. }
  964. if (gasPanelTwoView.DictChangedPumpValve.Count > 0)
  965. {
  966. PumpSetValues.Clear();
  967. if (gasPanelTwoView.AGVPumpData != null && gasPanelTwoView.AGVPumpData.DefaultValue != gasPanelTwoView.AGVPumpData.Feedback)
  968. {
  969. PumpSetValues.Add(gasPanelTwoView.AGVPumpData.UniqueName, gasPanelTwoView.AGVPumpData.Feedback);
  970. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AGVPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AGVPumpData.Feedback);
  971. }
  972. if (gasPanelTwoView.AUCPumpData != null && gasPanelTwoView.AUCPumpData.DefaultValue != gasPanelTwoView.AUCPumpData.Feedback)
  973. {
  974. PumpSetValues.Add(gasPanelTwoView.AUCPumpData.UniqueName, gasPanelTwoView.AUCPumpData.Feedback);
  975. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AUCPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AUCPumpData.Feedback);
  976. }
  977. if (gasPanelTwoView.BothPumpData != null && gasPanelTwoView.BothPumpData.DefaultValue != gasPanelTwoView.BothPumpData.Feedback)
  978. {
  979. PumpSetValues.Add(gasPanelTwoView.BothPumpData.UniqueName, gasPanelTwoView.BothPumpData.Feedback);
  980. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.BothPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.BothPumpData.Feedback);
  981. }
  982. if (gasPanelTwoView.ValveBWRData != null && gasPanelTwoView.ValveBWRData.DefaultValue != gasPanelTwoView.ValveBWRData.Feedback)
  983. {
  984. PumpSetValues.Add(gasPanelTwoView.ValveBWRData.UniqueName, gasPanelTwoView.ValveBWRData.Feedback);
  985. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveBWRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveBWRData.Feedback);
  986. }
  987. if (gasPanelTwoView.ValveDPRData != null && gasPanelTwoView.ValveDPRData.DefaultValue != gasPanelTwoView.ValveDPRData.Feedback)
  988. {
  989. PumpSetValues.Add(gasPanelTwoView.ValveDPRData.UniqueName, gasPanelTwoView.ValveDPRData.Feedback);
  990. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveDPRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveDPRData.Feedback);
  991. }
  992. F2HFClnOrHFCl2Values.Clear();
  993. if (gasPanelTwoView.IsDEPOOn != gasPanelTwoView.IsOldDEPOOn)
  994. {
  995. F2HFClnOrHFCl2Values.Add("PM1.SetDEPOEnable", gasPanelTwoView.IsDEPOOn);
  996. // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  997. }
  998. if (gasPanelTwoView.IsF2ClnOn != gasPanelTwoView.IsOldF2ClnOn)
  999. {
  1000. F2HFClnOrHFCl2Values.Add("PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  1001. // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  1002. }
  1003. if (gasPanelTwoView.IsHFClnOn != gasPanelTwoView.IsOldHFClnOn)
  1004. {
  1005. F2HFClnOrHFCl2Values.Add("PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
  1006. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
  1007. }
  1008. if (gasPanelTwoView.IsHTR1Enable != gasPanelTwoView.IsOldHTR1Enable)
  1009. {
  1010. F2HFClnOrHFCl2Values.Add("PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
  1011. // InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
  1012. }
  1013. if (gasPanelTwoView.IsHTR2Enable != gasPanelTwoView.IsOldHTR2Enable)
  1014. {
  1015. F2HFClnOrHFCl2Values.Add("PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1016. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1017. }
  1018. if (gasPanelTwoView.IsHTR3Enable != gasPanelTwoView.IsOldHTR3Enable)
  1019. {
  1020. F2HFClnOrHFCl2Values.Add("PM1.SetHTR3Enable", gasPanelTwoView.IsHTR3Enable);
  1021. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1022. }
  1023. if (gasPanelTwoView.IsCEXHOn != gasPanelTwoView.IsOldCEXHOn)
  1024. {
  1025. F2HFClnOrHFCl2Values.Add("PM1.SetCEXHEnable", gasPanelTwoView.IsCEXHOn);
  1026. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1027. }
  1028. }
  1029. }
  1030. }
  1031. else if (!string.IsNullOrEmpty(toolType) && toolType.Equals(ConstantsCommon.TiN))
  1032. {
  1033. FurnaceUI.Views.Maintenances.Maintenances.TiN.GasPanelViewModel gasPanelTwoView = new Maintenances.Maintenances.TiN.GasPanelViewModel();
  1034. gasPanelTwoView.MFCDataList = MFCDataList;
  1035. var rtn = (wm as WindowManager)?.ShowDialogWithTitle(gasPanelTwoView, null, " Gas Panel");
  1036. if ((bool)rtn)
  1037. {
  1038. DictValve = gasPanelTwoView.DictChangedValve;
  1039. DictMFC = ChangedDictMFC(gasPanelTwoView.DictChangedMFC);
  1040. foreach (var item in DictMFC)
  1041. {
  1042. var tempMFC = MFCDataList.FirstOrDefault(x => x.Name == item.Key);
  1043. if (tempMFC != null)
  1044. {
  1045. tempMFC.IsSetChanged = false;
  1046. tempMFC.Value = item.Value;
  1047. }
  1048. }
  1049. if (DictMFC.Count == 0)
  1050. {
  1051. for (int i = 0; i < MFCDataList.Count; i++)
  1052. {
  1053. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastPoint");
  1054. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastRamping");
  1055. MFCDataList[i].Value = setLastPoint.ToString("f3");
  1056. MFCDataList[i].Rampng = setLastRamping.ToString("f3");
  1057. MFCDataList[i].IsSetChanged = true;
  1058. };
  1059. }
  1060. if (gasPanelTwoView.DictChangedPumpValve.Count > 0)
  1061. {
  1062. PumpSetValues.Clear();
  1063. if (gasPanelTwoView.AGVPumpData != null && gasPanelTwoView.AGVPumpData.DefaultValue != gasPanelTwoView.AGVPumpData.Feedback)
  1064. {
  1065. PumpSetValues.Add(gasPanelTwoView.AGVPumpData.UniqueName, gasPanelTwoView.AGVPumpData.Feedback);
  1066. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AGVPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AGVPumpData.Feedback);
  1067. }
  1068. if (gasPanelTwoView.AUCPumpData != null && gasPanelTwoView.AUCPumpData.DefaultValue != gasPanelTwoView.AUCPumpData.Feedback)
  1069. {
  1070. PumpSetValues.Add(gasPanelTwoView.AUCPumpData.UniqueName, gasPanelTwoView.AUCPumpData.Feedback);
  1071. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AUCPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AUCPumpData.Feedback);
  1072. }
  1073. if (gasPanelTwoView.BothPumpData != null && gasPanelTwoView.BothPumpData.DefaultValue != gasPanelTwoView.BothPumpData.Feedback)
  1074. {
  1075. PumpSetValues.Add(gasPanelTwoView.BothPumpData.UniqueName, gasPanelTwoView.BothPumpData.Feedback);
  1076. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.BothPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.BothPumpData.Feedback);
  1077. }
  1078. if (gasPanelTwoView.ValveBWRData != null && gasPanelTwoView.ValveBWRData.DefaultValue != gasPanelTwoView.ValveBWRData.Feedback)
  1079. {
  1080. PumpSetValues.Add(gasPanelTwoView.ValveBWRData.UniqueName, gasPanelTwoView.ValveBWRData.Feedback);
  1081. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveBWRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveBWRData.Feedback);
  1082. }
  1083. if (gasPanelTwoView.ValveDPRData != null && gasPanelTwoView.ValveDPRData.DefaultValue != gasPanelTwoView.ValveDPRData.Feedback)
  1084. {
  1085. PumpSetValues.Add(gasPanelTwoView.ValveDPRData.UniqueName, gasPanelTwoView.ValveDPRData.Feedback);
  1086. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveDPRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveDPRData.Feedback);
  1087. }
  1088. F2HFClnOrHFCl2Values.Clear();
  1089. if (gasPanelTwoView.IsDEPOOn != gasPanelTwoView.IsOldDEPOOn)
  1090. {
  1091. F2HFClnOrHFCl2Values.Add("PM1.SetDEPOEnable", gasPanelTwoView.IsDEPOOn);
  1092. // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  1093. }
  1094. if (gasPanelTwoView.IsF2ClnOn != gasPanelTwoView.IsOldF2ClnOn)
  1095. {
  1096. F2HFClnOrHFCl2Values.Add("PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  1097. // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  1098. }
  1099. if (gasPanelTwoView.IsHFClnOn != gasPanelTwoView.IsOldHFClnOn)
  1100. {
  1101. F2HFClnOrHFCl2Values.Add("PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
  1102. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
  1103. }
  1104. if (gasPanelTwoView.IsHTR1Enable != gasPanelTwoView.IsOldHTR1Enable)
  1105. {
  1106. F2HFClnOrHFCl2Values.Add("PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
  1107. // InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
  1108. }
  1109. if (gasPanelTwoView.IsHTR2Enable != gasPanelTwoView.IsOldHTR2Enable)
  1110. {
  1111. F2HFClnOrHFCl2Values.Add("PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1112. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1113. }
  1114. if (gasPanelTwoView.IsHTR3Enable != gasPanelTwoView.IsOldHTR3Enable)
  1115. {
  1116. F2HFClnOrHFCl2Values.Add("PM1.SetHTR3Enable", gasPanelTwoView.IsHTR3Enable);
  1117. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1118. }
  1119. if (gasPanelTwoView.IsCEXHOn != gasPanelTwoView.IsOldCEXHOn)
  1120. {
  1121. F2HFClnOrHFCl2Values.Add("PM1.SetCEXHEnable", gasPanelTwoView.IsCEXHOn);
  1122. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1123. }
  1124. }
  1125. }
  1126. }
  1127. else
  1128. {
  1129. FurnaceUI.Views.Maintenances.GasPanelTwoViewModel gasPanelTwoView = new FurnaceUI.Views.Maintenances.GasPanelTwoViewModel();
  1130. gasPanelTwoView.MFCDataList = MFCDataList;
  1131. var rtn = (wm as WindowManager)?.ShowDialogWithTitle(gasPanelTwoView, null, " Gas Panel");
  1132. if ((bool)rtn)
  1133. {
  1134. DictValve = gasPanelTwoView.DictChangedValve;
  1135. DictMFC = ChangedDictMFC(gasPanelTwoView.DictChangedMFC);
  1136. foreach (var item in DictMFC)
  1137. {
  1138. var tempMFC = MFCDataList.FirstOrDefault(x => x.Name == item.Key);
  1139. if (tempMFC != null)
  1140. {
  1141. tempMFC.IsSetChanged = false;
  1142. tempMFC.Value = item.Value;
  1143. }
  1144. }
  1145. if (DictMFC.Count == 0)
  1146. {
  1147. for (int i = 0; i < MFCDataList.Count; i++)
  1148. {
  1149. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastPoint");
  1150. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastRamping");
  1151. MFCDataList[i].Value = setLastPoint.ToString("f3");
  1152. MFCDataList[i].Rampng = setLastRamping.ToString("f3");
  1153. MFCDataList[i].IsSetChanged = true;
  1154. };
  1155. }
  1156. if (gasPanelTwoView.DictChangedPumpValve.Count > 0)
  1157. {
  1158. PumpSetValues.Clear();
  1159. if (gasPanelTwoView.AGVPumpData != null && gasPanelTwoView.AGVPumpData.DefaultValue != gasPanelTwoView.AGVPumpData.Feedback)
  1160. {
  1161. PumpSetValues.Add(gasPanelTwoView.AGVPumpData.UniqueName, gasPanelTwoView.AGVPumpData.Feedback);
  1162. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AGVPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AGVPumpData.Feedback);
  1163. }
  1164. if (gasPanelTwoView.AUCPumpData != null && gasPanelTwoView.AUCPumpData.DefaultValue != gasPanelTwoView.AUCPumpData.Feedback)
  1165. {
  1166. PumpSetValues.Add(gasPanelTwoView.AUCPumpData.UniqueName, gasPanelTwoView.AUCPumpData.Feedback);
  1167. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AUCPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AUCPumpData.Feedback);
  1168. }
  1169. if (gasPanelTwoView.BothPumpData != null && gasPanelTwoView.BothPumpData.DefaultValue != gasPanelTwoView.BothPumpData.Feedback)
  1170. {
  1171. PumpSetValues.Add(gasPanelTwoView.BothPumpData.UniqueName, gasPanelTwoView.BothPumpData.Feedback);
  1172. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.BothPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.BothPumpData.Feedback);
  1173. }
  1174. if (gasPanelTwoView.ValveBWRData != null && gasPanelTwoView.ValveBWRData.DefaultValue != gasPanelTwoView.ValveBWRData.Feedback)
  1175. {
  1176. PumpSetValues.Add(gasPanelTwoView.ValveBWRData.UniqueName, gasPanelTwoView.ValveBWRData.Feedback);
  1177. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveBWRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveBWRData.Feedback);
  1178. }
  1179. if (gasPanelTwoView.ValveDPRData != null && gasPanelTwoView.ValveDPRData.DefaultValue != gasPanelTwoView.ValveDPRData.Feedback)
  1180. {
  1181. PumpSetValues.Add(gasPanelTwoView.ValveDPRData.UniqueName, gasPanelTwoView.ValveDPRData.Feedback);
  1182. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveDPRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveDPRData.Feedback);
  1183. }
  1184. F2HFClnOrHFCl2Values.Clear();
  1185. if (gasPanelTwoView.IsF2ClnOn != gasPanelTwoView.IsOldF2ClnOn)
  1186. {
  1187. F2HFClnOrHFCl2Values.Add("PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  1188. // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  1189. }
  1190. if (gasPanelTwoView.IsHFClnOn != gasPanelTwoView.IsOldHFClnOn)
  1191. {
  1192. F2HFClnOrHFCl2Values.Add("PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
  1193. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
  1194. }
  1195. if (gasPanelTwoView.IsHTR1Enable != gasPanelTwoView.IsOldHTR1Enable)
  1196. {
  1197. F2HFClnOrHFCl2Values.Add("PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
  1198. // InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
  1199. }
  1200. if (gasPanelTwoView.IsHTR2Enable != gasPanelTwoView.IsOldHTR2Enable)
  1201. {
  1202. F2HFClnOrHFCl2Values.Add("PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1203. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1204. }
  1205. }
  1206. }
  1207. }
  1208. }
  1209. public void SwitchPage(string page)
  1210. {
  1211. switch (page)
  1212. {
  1213. case "Pressure":
  1214. {
  1215. ClientApp.Instance.SwitchPage("maintenance", "GasPanel", null);
  1216. }
  1217. break;
  1218. }
  1219. }
  1220. public void RampSetClick(object sender)
  1221. {
  1222. string strSetRamp = ShowNumberKeyboard(sender as Button, "", 1);
  1223. foreach (var item in TempList)
  1224. {
  1225. item.Rampng = strSetRamp;
  1226. item.IsRampngChanged = false;
  1227. }
  1228. }
  1229. private string ShowNumberKeyboard(Control control, string defaultValue, int keepDecimals = -1)
  1230. {
  1231. NumberKeyboard numberKeyboard = new NumberKeyboard("", defaultValue);
  1232. numberKeyboard.KeepDecimals = keepDecimals;
  1233. var point = control.PointFromScreen(new Point(0, 0));
  1234. double wx = SystemParameters.WorkArea.Width;
  1235. double hy = SystemParameters.WorkArea.Height;
  1236. if (-point.Y + control.ActualHeight + 5 + numberKeyboard.Height < hy)
  1237. {
  1238. numberKeyboard.Top = -point.Y + control.ActualHeight + 5;
  1239. }
  1240. else
  1241. {
  1242. numberKeyboard.Top = -point.Y - numberKeyboard.Height - 5;
  1243. }
  1244. if (-point.X + numberKeyboard.Width < wx)
  1245. {
  1246. numberKeyboard.Left = -point.X;
  1247. }
  1248. else
  1249. {
  1250. numberKeyboard.Left = -point.X - (numberKeyboard.Width - control.ActualWidth);
  1251. }
  1252. if ((bool)numberKeyboard.ShowDialog())
  1253. return numberKeyboard.ValueString;
  1254. else
  1255. return "Cancel";
  1256. }
  1257. private string SplitTemperatureControlMode(string str)
  1258. {
  1259. if (string.IsNullOrEmpty(str))
  1260. {
  1261. return str;
  1262. }
  1263. if (str.Contains("Profile("))
  1264. {
  1265. return str.Replace("Profile(", "").Replace(")", "").Replace(",", ":");
  1266. }
  1267. return str;
  1268. }
  1269. public void TempTextClick(string type, object sender)
  1270. {
  1271. switch (type)
  1272. {
  1273. case "Mode":
  1274. RecipeTempModeViewModel recipeTempModeViewModel = new RecipeTempModeViewModel();
  1275. recipeTempModeViewModel.SelectBtnName = SelectBtnName;
  1276. recipeTempModeViewModel.IsManualSet = true;
  1277. recipeTempModeViewModel.SelectProfileTable = SplitTemperatureControlMode(TemperatureControlMode);
  1278. var rtn = (wm as WindowManager)?.ShowDialogWithTitle(recipeTempModeViewModel, null, "Temp Mode");
  1279. if ((bool)rtn)
  1280. {
  1281. SelectBtnName = recipeTempModeViewModel.SelectBtnName;
  1282. if (null != recipeTempModeViewModel && !string.IsNullOrEmpty(recipeTempModeViewModel.ResultString) && recipeTempModeViewModel.ResultString.Contains("Profile"))
  1283. {
  1284. SelectBtnName = "Profile";
  1285. }
  1286. if (!string.IsNullOrEmpty(recipeTempModeViewModel.ResultString) && recipeTempModeViewModel.ResultString.Contains("Profile(,"))
  1287. {
  1288. recipeTempModeViewModel.ResultString = recipeTempModeViewModel.ResultString.Replace("Profile(,", "Profile(");
  1289. }
  1290. TemperatureControlMode = recipeTempModeViewModel.ResultString;
  1291. }
  1292. break;
  1293. case "Correct":
  1294. TempCorrectionEditViewModel tempCorrectionEditViewModel = new TempCorrectionEditViewModel();
  1295. tempCorrectionEditViewModel.ResultString = TemperatureCorrect;
  1296. tempCorrectionEditViewModel.IsManualSet = true;
  1297. //tempCorrectionEditViewModel.SelectedRecipeStep = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
  1298. tempCorrectionEditViewModel.IsEnabledControl = false;
  1299. tempCorrectionEditViewModel.AutoSelectVisibility = Visibility.Visible;
  1300. // tempOffsetTableViewModel.SelectedRecipeStep = SelectedRecipeStep;
  1301. rtn = (wm as WindowManager)?.ShowDialogWithTitle(tempCorrectionEditViewModel, null, "Temp Correct Table");
  1302. if ((bool)rtn)
  1303. {
  1304. TemperatureCorrect = tempCorrectionEditViewModel.ResultString;
  1305. }
  1306. break;
  1307. case "PID":
  1308. TempOffsetTableViewModel tempOffsetTableViewModel1 = new TempOffsetTableViewModel();
  1309. tempOffsetTableViewModel1.CboAutoSelectChecked = false;
  1310. tempOffsetTableViewModel1.IsEnabledControl = false;
  1311. tempOffsetTableViewModel1.IsManualSet = true;
  1312. tempOffsetTableViewModel1.TempOffsetTableSelected = TemperaturePID;
  1313. rtn = (wm as WindowManager)?.ShowDialogWithTitle(tempOffsetTableViewModel1, null, "Temp PID Table");
  1314. if ((bool)rtn)
  1315. {
  1316. TemperaturePID = tempOffsetTableViewModel1.TempOffsetTableSelected;
  1317. }
  1318. break;
  1319. default:
  1320. break;
  1321. }
  1322. }
  1323. private ObservableCollection<AUXData> _aUXDatas;
  1324. public void StepEdit(object cmdName, object value)
  1325. {
  1326. switch ((string)cmdName)
  1327. {
  1328. case "GASSetting":
  1329. RecipeMFCSettingViewModel recipeMFCSettingViewModel = new RecipeMFCSettingViewModel();
  1330. //InvokeClient.Instance.Service.DoOperation($"PM1.SetSensorRecipeOK", "");
  1331. //var tempMFCSets = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().MFCSets;
  1332. //if (tempMFCSets != null && tempMFCSets.Count > 0)
  1333. //{
  1334. // foreach (var item in tempMFCSets.Keys)
  1335. // {
  1336. // if (recipeMFCSettingViewModel.MFCSets.ContainsKey(item))
  1337. // {
  1338. // recipeMFCSettingViewModel.MFCSets[item] = tempMFCSets[item];
  1339. // }
  1340. // else
  1341. // {
  1342. // //recipeGASSettingViewModel.MFCSets.Add(item, tempMFCSets[item]);
  1343. // recipeMFCSettingViewModel.MFCSets.Add(item, new MFCValue() { AlarmValue = tempMFCSets[item].MinValue, IsNotifying = tempMFCSets[item].IsNotifying, MaxValue = tempMFCSets[item].MaxValue, MinValue = tempMFCSets[item].MinValue, IsCheck = tempMFCSets[item].IsCheck, Name = tempMFCSets[item].Name, Rampng = tempMFCSets[item].Rampng, Value = tempMFCSets[item].Value });
  1344. // }
  1345. // }
  1346. //}
  1347. ////recipeGASSettingViewModel.MFMSets = new MFMValue() { AlarmValue = tempMFMSets.AlarmValue, IsNotifying = tempMFMSets.IsNotifying, Name = tempMFMSets.Name, Value = tempMFMSets.Value };
  1348. //recipeMFCSettingViewModel.RecipeType = RecipeType;
  1349. //recipeMFCSettingViewModel.RecipeTemplate = RecipeTemplate;
  1350. //if (!(bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeMFCSettingViewModel, null, "MFC Detail"))
  1351. //{
  1352. // //InvokeClient.Instance.Service.DoOperation($"PM1.SetSensorPROCManualOK", "");
  1353. // return;
  1354. //}
  1355. ////InvokeClient.Instance.Service.DoOperation($"PM1.SetSensorPROCManualOK", "");
  1356. //if (CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().MFCSets != null)
  1357. //{
  1358. // if (recipeMFCSettingViewModel.MFCSets != null && recipeMFCSettingViewModel.MFCSets.Count > 0)
  1359. // {
  1360. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().MFCSets = recipeMFCSettingViewModel.MFCSets;
  1361. // }
  1362. //}
  1363. break;
  1364. case "PressureSetting":
  1365. RecipePressureSettingViewModel recipePressureSettingViewModel = new RecipePressureSettingViewModel();
  1366. //var tempStep = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
  1367. //recipePressureSettingViewModel.PressureSonsorValue = tempStep.PressureSonserValue;
  1368. //recipePressureSettingViewModel.PressureValveAngleValue = tempStep.PressureValveAngle;
  1369. //recipePressureSettingViewModel.PressureSettingVG = tempStep.PressureSettingVG;
  1370. //if (!string.IsNullOrEmpty(tempStep.PressureAlarmTableNo))
  1371. //{
  1372. // if (tempStep.PressureAlarmTableNo.ToLower() == "none")
  1373. // recipePressureSettingViewModel.PressureAlarmWatchTable = "None";
  1374. // else
  1375. // recipePressureSettingViewModel.PressureAlarmWatchTable = tempStep.PressureAlarmTableNo;
  1376. //}
  1377. //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipePressureSettingViewModel, null, "Recipe Pressure Setting"))
  1378. //{
  1379. // if (CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault() != null)
  1380. // {
  1381. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PressureSonserValue = recipePressureSettingViewModel.PressureSonsorValue;
  1382. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PressureValveAngle = recipePressureSettingViewModel.PressureValveAngleValue;
  1383. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PressureAlarmTableNo = recipePressureSettingViewModel.PressureAlarmWatchTable;
  1384. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PressureSettingVG = recipePressureSettingViewModel.PressureSettingVG;
  1385. // SelectedRecipeStep.PressureSonserValue = $"{recipePressureSettingViewModel.PressureSonsorValue}";
  1386. // }
  1387. //}
  1388. break;
  1389. case "RFSetting":
  1390. //RecipeRFPressureSettingViewModel recipeRFPressureSettingViewModel = new RecipeRFPressureSettingViewModel();
  1391. //var tempRecipeStep = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
  1392. //recipeRFPressureSettingViewModel.RFSwitch = tempRecipeStep.RFSwitch;
  1393. //recipeRFPressureSettingViewModel.RFSetPointValue = tempRecipeStep.RFSetpoint;
  1394. //recipeRFPressureSettingViewModel.C1SetPointValue = tempRecipeStep.C1Setpoint;
  1395. //recipeRFPressureSettingViewModel.C2SetPointValue = tempRecipeStep.C2Setpoint;
  1396. //recipeRFPressureSettingViewModel.ForwardPowerAlarmWatchSetPointValue = tempRecipeStep.ForwardPowerAlarmWatchTable;
  1397. //recipeRFPressureSettingViewModel.PrAlarmWatchSetPointValue = tempRecipeStep.PrAlarmWatchTable;
  1398. //recipeRFPressureSettingViewModel.PIAlarmWatchSetPointValue = tempRecipeStep.PIAlarmWatchTable;
  1399. //recipeRFPressureSettingViewModel.C1AlarmWatchSetPointValue = tempRecipeStep.C1AlarmWatchTable;
  1400. //recipeRFPressureSettingViewModel.C2AlarmWatchSetPointValue = tempRecipeStep.C2AlarmWatchTable;
  1401. //recipeRFPressureSettingViewModel.VppAlarmWatchSetPointValue = tempRecipeStep.VppAlarmWatchTable;
  1402. //recipeRFPressureSettingViewModel.VdcAlarmWatchSetPointValue = tempRecipeStep.VdcAlarmWatchTable;
  1403. //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeRFPressureSettingViewModel, null, "Recipe RF Setting"))
  1404. //{
  1405. // if (CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault() != null)
  1406. // {
  1407. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().RFSwitch = recipeRFPressureSettingViewModel.RFSwitch;
  1408. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().RFSetpoint = recipeRFPressureSettingViewModel.RFSetPointValue;
  1409. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().C1Setpoint = recipeRFPressureSettingViewModel.C1SetPointValue;
  1410. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().C2Setpoint = recipeRFPressureSettingViewModel.C2SetPointValue;
  1411. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ForwardPowerAlarmWatchTable = recipeRFPressureSettingViewModel.ForwardPowerAlarmWatchSetPointValue;
  1412. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PrAlarmWatchTable = recipeRFPressureSettingViewModel.PrAlarmWatchSetPointValue;
  1413. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PIAlarmWatchTable = recipeRFPressureSettingViewModel.PIAlarmWatchSetPointValue;
  1414. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().C1AlarmWatchTable = recipeRFPressureSettingViewModel.C1AlarmWatchSetPointValue;
  1415. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().C2AlarmWatchTable = recipeRFPressureSettingViewModel.C2AlarmWatchSetPointValue;
  1416. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().VppAlarmWatchTable = recipeRFPressureSettingViewModel.VppAlarmWatchSetPointValue;
  1417. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().VdcAlarmWatchTable = recipeRFPressureSettingViewModel.VdcAlarmWatchSetPointValue;
  1418. // // SelectedRecipeStep.RFSetting = $"{recipeRFPressureSettingViewModel.RFSetPointValue}";
  1419. // }
  1420. //}
  1421. break;
  1422. case "Loader":
  1423. RecipeLoaderCommandViewModel recipeLoaderCommandViewModel = new RecipeLoaderCommandViewModel();
  1424. recipeLoaderCommandViewModel.SetRecipeProcessEditViewEnable = false;
  1425. if ((bool)(wm as WindowManager)?.ShowDialogWithTitle(recipeLoaderCommandViewModel, null, "Loader Command"))
  1426. {
  1427. ClearLoaderSetValue();
  1428. LoaderCommand = recipeLoaderCommandViewModel.ReturnString;
  1429. SetShowLoaderValuePanel(recipeLoaderCommandViewModel.ReturnString);
  1430. }
  1431. break;
  1432. case "Pressure":
  1433. ManualPressCommandViewModel recipePressCommandViewModel = new ManualPressCommandViewModel();
  1434. recipePressCommandViewModel.SetRecipeProcessEditViewEnable = false;
  1435. recipePressCommandViewModel.SelectedCmd = PressCommand;
  1436. if ((bool)(wm as WindowManager)?.ShowDialogWithTitle(recipePressCommandViewModel, null, "Press Command"))
  1437. {
  1438. DefaultUnit = recipePressCommandViewModel.DefaultUnit;
  1439. string returnString = recipePressCommandViewModel.ReturnString;
  1440. PressCommand = returnString;
  1441. SetShowPressPanel(returnString);
  1442. }
  1443. break;
  1444. case "Pattern":
  1445. RecipeGasPanelSettingViewModel recipeGasPanelSettingViewModel = new RecipeGasPanelSettingViewModel();
  1446. //recipeGasPanelSettingViewModel.CurrentRecipe = CurrentRecipe;
  1447. //recipeGasPanelSettingViewModel.SelectedStepName = $"{SelectedRecipeStep.StepNo}:{SelectedRecipeStep.Name}";
  1448. //recipeGasPanelSettingViewModel.ChangedStepEvent += RecipeGasPanelSettingViewModel_ChangedStepEvent;
  1449. //recipeGasPanelSettingViewModel.SelectedStep = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
  1450. if ((bool)(wm as WindowManager)?.ShowDialogWithTitle(recipeGasPanelSettingViewModel, null, "Valve"))
  1451. {
  1452. }
  1453. break;
  1454. case "BoatElevatorSetting":
  1455. BoatElevatorSettingViewModel boatElevatorSettingViewModel = new BoatElevatorSettingViewModel();
  1456. //boatElevatorSettingViewModel.SelectedRecipeStep = SelectedRecipeStep;
  1457. //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(boatElevatorSettingViewModel, null, "BoatElevator Setting"))
  1458. //{
  1459. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ZAxisPosition = boatElevatorSettingViewModel.SelectedRecipeStep.ZAxisPosition;
  1460. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ZAxisSpeed = boatElevatorSettingViewModel.SelectedRecipeStep.ZAxisSpeed;
  1461. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().RotatePosition = boatElevatorSettingViewModel.SelectedRecipeStep.RotatePosition;
  1462. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().RotateSpeed = boatElevatorSettingViewModel.SelectedRecipeStep.RotateSpeed;
  1463. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().RotateInterval = boatElevatorSettingViewModel.SelectedRecipeStep.RotateInterval;
  1464. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().RotateDirection = boatElevatorSettingViewModel.SelectedRecipeStep.RotateDirection;
  1465. //}
  1466. break;
  1467. case "AUX":
  1468. RecipeAUXSetViewModel recipeAUXSetViewModel = new RecipeAUXSetViewModel();
  1469. if (_aUXDatas != null && _aUXDatas.Count > 0)
  1470. {
  1471. recipeAUXSetViewModel.AUXDataList.Clear();
  1472. _aUXDatas.ToList().ForEach(x => recipeAUXSetViewModel.AUXDataList.Add(x));
  1473. }
  1474. else
  1475. {
  1476. int i = 1;
  1477. recipeAUXSetViewModel.AUXDataList.Clear();
  1478. foreach (var item in AUXDetailDatas)
  1479. {
  1480. var tempAux = new AUXData();
  1481. tempAux.No = i;
  1482. tempAux.ControlName = i.ToString();
  1483. tempAux.DisplayName = item.DisplayName;
  1484. tempAux.SetValue = new DoubleParam() { Name = "SetValue", Value = item.SetPoint.ToString() };
  1485. tempAux.IsCheck = new BoolParam() { Name = "IsCheck", Value = false };
  1486. tempAux.MaxValue = new DoubleParam() { Name = "MaxValue", Value = item.WarningHighLimit.ToString() };
  1487. tempAux.MinValue = new DoubleParam() { Name = "MinValue", Value = item.WarningLowLimit.ToString() };
  1488. tempAux.SetUnit = new StringParam() { Name = "SetUnit", Value = item.Unit };
  1489. recipeAUXSetViewModel.AUXDataList.Add(tempAux);
  1490. i++;
  1491. }
  1492. }
  1493. if ((bool)(wm as WindowManager)?.ShowDialogWithTitle(recipeAUXSetViewModel, null, "AUX Set"))
  1494. {
  1495. _aUXDatas = recipeAUXSetViewModel.AUXDataList;
  1496. }
  1497. break;
  1498. case "RecipeHeader":
  1499. RecipeHeaderViewModel recipeHeaderViewModel = new RecipeHeaderViewModel();
  1500. if ((bool)(wm as WindowManager)?.ShowDialogWithTitle(recipeHeaderViewModel, null, "Recipe Header"))
  1501. {
  1502. }
  1503. break;
  1504. case "Combination":
  1505. //StringParam strCombination = CurrentRecipe.ConfigItems.FirstOrDefault(x => x.Name == "Combination") as StringParam;
  1506. //RecipeCombinationViewModel recipeCombinationViewModel = new RecipeCombinationViewModel();
  1507. //recipeCombinationViewModel.CombinationStr = strCombination.Value;
  1508. //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeCombinationViewModel, null, "Combination"))
  1509. //{
  1510. // strCombination.Value = recipeCombinationViewModel.Combination.ToString();
  1511. //}
  1512. break;
  1513. case "VPDataList":
  1514. RecipeVPItemSelectViewModel recipeVPItemSelectViewModel = new RecipeVPItemSelectViewModel();
  1515. if ((bool)(wm as WindowManager)?.ShowDialogWithTitle(recipeVPItemSelectViewModel, null, "VP Item Select"))
  1516. {
  1517. }
  1518. break;
  1519. case "SkipOrWait":
  1520. RecipeSkipWaitCommandViewModel recipeSkipWaitCommandViewModel = new RecipeSkipWaitCommandViewModel();
  1521. //recipeSkipWaitCommandViewModel.SkipWait = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().SkipWait;
  1522. //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeSkipWaitCommandViewModel, null, "Skip or wait command"))
  1523. //{
  1524. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().SkipWait = recipeSkipWaitCommandViewModel.RtnString;
  1525. // SelectedRecipeStep.SkipWait = recipeSkipWaitCommandViewModel.RtnString;
  1526. //}
  1527. break;
  1528. default:
  1529. break;
  1530. }
  1531. }
  1532. public void MFCTextChanged(string type, object sender, object item)
  1533. {
  1534. BrushConverter brushConverter = new BrushConverter();
  1535. try
  1536. {
  1537. if (!string.IsNullOrEmpty(type) && item != null && sender != null)
  1538. {
  1539. MFCGasData mFCData = (MFCGasData)item;
  1540. string value = ((TextBox)sender).Text;
  1541. string proStr = $"{mFCData.Name}Data";
  1542. Type type1 = typeof(ManualSetViewModel);
  1543. PropertyInfo property = type1.GetProperty(proStr);
  1544. if (property == null) return;
  1545. AITMfcData aITMfcData = (AITMfcData)property.GetValue(this);
  1546. double setValue = 0;
  1547. double.TryParse(value, out setValue);
  1548. var maxData = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{mFCData.Name}.N2Scale");
  1549. if (setValue > maxData && type == "Value")
  1550. {
  1551. DialogBox.ShowWarning($"{mFCData.Name} Out of the setting range {0}~{maxData}!");
  1552. ((TextBoxEx)sender).ChangedColor = ((TextBoxEx)sender).NormalColor;
  1553. ((TextBoxEx)sender).Text = $"0";
  1554. return;
  1555. }
  1556. switch (type)
  1557. {
  1558. case "Value":
  1559. mFCData.Value = value;
  1560. if (setValue != aITMfcData.SetPoint)
  1561. {
  1562. ((TextBoxEx)sender).ChangedColor = (Brush)brushConverter.ConvertFromString("Yellow");
  1563. mFCData.IsSetChanged = false;
  1564. }
  1565. else
  1566. {
  1567. // mFCData.IsSetChanged = true;
  1568. }
  1569. break;
  1570. case "Rampng":
  1571. mFCData.Rampng = value;
  1572. if (setValue != aITMfcData.Ramping)
  1573. {
  1574. mFCData.IsRampngChanged = false;
  1575. }
  1576. else
  1577. {
  1578. // mFCData.IsRampngChanged = true;
  1579. }
  1580. break;
  1581. default:
  1582. break;
  1583. }
  1584. }
  1585. }
  1586. catch (Exception ex)
  1587. {
  1588. LOG.Write(ex);
  1589. }
  1590. }
  1591. public void TempTextChanged(string type, object sender, object item)
  1592. {
  1593. try
  1594. {
  1595. if (!string.IsNullOrEmpty(type) && item != null && sender != null)
  1596. {
  1597. TempManualSetData tempData = (TempManualSetData)item;
  1598. string value = ((TextBox)sender).Text;
  1599. string proStr = tempData.ControlName;
  1600. Type type1 = typeof(ManualSetViewModel);
  1601. PropertyInfo property = type1.GetProperty(proStr);
  1602. if (property == null) return;
  1603. AITHeaterData aITHeaterData = (AITHeaterData)property.GetValue(this);
  1604. double setValue = 0;
  1605. double.TryParse(value, out setValue);
  1606. switch (type)
  1607. {
  1608. case "Value":
  1609. tempData.Value = value;
  1610. if (setValue != aITHeaterData.SetPoint)
  1611. {
  1612. tempData.IsSetChanged = false;
  1613. }
  1614. else
  1615. {
  1616. // tempData.IsSetChanged = false;
  1617. }
  1618. break;
  1619. case "Ramp":
  1620. tempData.Rampng = value;
  1621. if (setValue != aITHeaterData.RampSetPoint)
  1622. {
  1623. tempData.IsRampngChanged = false;
  1624. }
  1625. else
  1626. {
  1627. // tempData.IsRampngChanged = false;
  1628. }
  1629. break;
  1630. default:
  1631. break;
  1632. }
  1633. }
  1634. }
  1635. catch (Exception ex)
  1636. {
  1637. LOG.Write(ex);
  1638. }
  1639. }
  1640. private string oldPressStr = "";
  1641. public void Exec()
  1642. {
  1643. if (!DialogBox.Confirm("Are you sure to execute?"))
  1644. return;
  1645. if (DictValve != null && DictValve.Count > 0)
  1646. {
  1647. InvokeClient.Instance.Service.DoOperation($"PM1.SetAll{AITValveOperation.GVTurnValve}", DictValve);
  1648. }
  1649. if (MFCDataList != null && MFCDataList.Count() > 0)
  1650. {
  1651. Dictionary<string, string> setChangedMFC = new Dictionary<string, string>();
  1652. var changedList = MFCDataList.ToList().Where(x => !x.IsSetChanged);
  1653. foreach (var item in changedList)
  1654. {
  1655. setChangedMFC.Add(item.Name, item.Value);
  1656. }
  1657. InvokeClient.Instance.Service.DoOperation($"PM1.SetAllMfcValue", setChangedMFC);
  1658. MFCDataList.ToList().ForEach(x =>
  1659. {
  1660. if (!x.IsSetChanged)
  1661. {
  1662. // InvokeClient.Instance.Service.DoOperation($"PM1.{x.DisplayName}.SetMfcValue", $"{x.Value};{x.Rampng};{x.AlarmValue}");
  1663. InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"PM1.MFC.{x.DisplayName}.SetLastPoint", x.Value);
  1664. x.IsSetChanged = true;
  1665. }
  1666. if (!x.IsRampngChanged)
  1667. {
  1668. InvokeClient.Instance.Service.DoOperation($"PM1.{x.DisplayName}.SetMfcValue", $"{x.Value};{x.Rampng};{x.AlarmValue}");
  1669. InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"PM1.MFC.{x.DisplayName}.SetLastRamping", x.Rampng);
  1670. x.IsRampngChanged = true;
  1671. }
  1672. });
  1673. }
  1674. var pressStr = GetPressString();
  1675. if (oldPressStr != pressStr || (DictValve != null && DictValve.ContainsKey("ValveAV71")))
  1676. {
  1677. if ((CheckIsChanged(pressStr) && pressStr != ";;;") || (DictValve != null && DictValve.ContainsKey("ValveAV71")))
  1678. {
  1679. if (DictValve != null && DictValve.ContainsKey("ValveAV71"))
  1680. InvokeClient.Instance.Service.DoOperation($"PM1.APC.SetManualParameters", $"{pressStr};{DictValve["ValveAV71"]}");
  1681. else
  1682. InvokeClient.Instance.Service.DoOperation($"PM1.APC.SetManualParameters", $"{pressStr}");
  1683. }
  1684. }
  1685. OldPressCommand = PressCommand;
  1686. oldPressStr = pressStr;
  1687. if (HeaterUData.CorrectTable != TemperatureCorrect || HeaterUData.PIDTable != TemperaturePID || HeaterUData.ControlModeSetpoint != TemperatureControlMode)
  1688. {
  1689. string[] tempPra = new string[] { TemperatureControlMode, TemperatureCorrect, TemperaturePID };
  1690. InvokeClient.Instance.Service.DoOperation("PM1.Heater.SetParameters", string.Join(";", tempPra));
  1691. }
  1692. if (TempList != null && TempList.Count() > 0)
  1693. {
  1694. TempList.ToList().ForEach(x =>
  1695. {
  1696. if (!x.IsRampngChanged || !x.IsSetChanged)
  1697. {
  1698. InvokeClient.Instance.Service.DoOperation($"System.{x.Name}.SetManualParameters", $"{x.Value};{x.Rampng}");
  1699. if (!x.IsSetChanged)
  1700. {
  1701. InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"PM1.Heater.{x.Name}.SetLastPoint", x.Value);
  1702. }
  1703. if (!x.IsRampngChanged)
  1704. {
  1705. InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"PM1.Heater.{x.Name}.SetLastRamping", x.Rampng);
  1706. }
  1707. x.IsSetChanged = true;
  1708. x.IsRampngChanged = true;
  1709. }
  1710. });
  1711. }
  1712. if (!string.IsNullOrEmpty(LoaderCommand))
  1713. {
  1714. if (OldLoaderCommand != LoaderCommand)
  1715. {
  1716. InvokeClient.Instance.Service.DoOperation("PM1.SetBoatManualMotion", GetSaveLoaderValue(LoaderCommand));
  1717. }
  1718. OldLoaderCommand = LoaderCommand;
  1719. }
  1720. if (PumpSetValues.Count > 0)
  1721. {
  1722. PumpSetValues.ToList().ForEach(x => InvokeClient.Instance.Service.DoOperation($"{x.Key}.{AITValveOperation.GVTurnValve}", x.Value));
  1723. }
  1724. if (F2HFClnOrHFCl2Values.Count > 0)
  1725. {
  1726. F2HFClnOrHFCl2Values.ToList().ForEach(x => InvokeClient.Instance.Service.DoOperation(x.Key, x.Value));
  1727. }
  1728. }
  1729. private bool CheckIsChanged(string value)
  1730. {
  1731. string[] strList = value.Split(';');
  1732. if (APCData.CommandSetPoint != strList[0])
  1733. {
  1734. return true;
  1735. }
  1736. if (APCData.PIDTable != strList[1])
  1737. {
  1738. return true;
  1739. }
  1740. float.TryParse(strList[2], out float set);
  1741. if (APCData.SetPoint != set)
  1742. {
  1743. return true;
  1744. }
  1745. if (APCData.LowPressWaitSetPoint != strList[3])
  1746. {
  1747. return true;
  1748. }
  1749. return false;
  1750. }
  1751. public List<ConfigNode> GetMfcItem()
  1752. {
  1753. this.SystemName = "System";
  1754. ConfigNodes = SystemConfigProvider.Instance.GetConfigTree(SystemName).SubNodes;
  1755. var MfcItems = ConfigNodes.Where(x => x.Display == "Parameter").FirstOrDefault().SubNodes.Where(y => y.Name == "MFC").FirstOrDefault().SubNodes;
  1756. return MfcItems;
  1757. }
  1758. public void RecipeCancel()
  1759. {
  1760. if (DialogBox.ShowDialog(DialogButton.Yes | DialogButton.No, DialogType.CONFIRM, " You confirm that you want to unsave the recipe and exit the interface?") == DialogButton.No)
  1761. {
  1762. return;
  1763. }
  1764. else
  1765. {
  1766. UpdateGASSetting(true);
  1767. UpdateHeaterSetting();
  1768. ClearSetValue();
  1769. }
  1770. // ((Window)GetView()).Close();
  1771. }
  1772. public void PressPIDChick()
  1773. {
  1774. var windowManager = IoC.Get<IWindowManager>();
  1775. var defaultAPCPID = SystemConfigProvider.Instance.GetValueByName("PM1.APCPID");
  1776. if (string.IsNullOrEmpty(defaultAPCPID))
  1777. {
  1778. DialogBox.ShowDialog(DialogButton.Cancel, DialogType.INFO, "Please set the default file first");
  1779. return;
  1780. }
  1781. int last = defaultAPCPID.LastIndexOf('\\');
  1782. var pix = defaultAPCPID.Substring(0, last);
  1783. var file = defaultAPCPID.Substring(last + 1, defaultAPCPID.Length - last - 1);
  1784. APCPIDEditViewModel aPCPIDEditViewModel = new APCPIDEditViewModel(pix, file);
  1785. aPCPIDEditViewModel.IsEditEnabled = false;
  1786. var rtn = (windowManager as WindowManager)?.ShowDialogWithTitle(aPCPIDEditViewModel, null, "APC PID Table");
  1787. if ((bool)rtn)
  1788. {
  1789. PressPID = aPCPIDEditViewModel.RetrunString;
  1790. }
  1791. }
  1792. private bool firstUpdate = true;
  1793. private void ClearSetValue()
  1794. {
  1795. TemperatureControlMode = "";
  1796. TemperatureCorrect = "";
  1797. TemperaturePID = "";
  1798. ClearLoaderSetValue();
  1799. LoaderCommand = "";
  1800. SetShowLoaderValuePanel("None");
  1801. PressCommand = "";
  1802. SetShowPressPanel("None");
  1803. }
  1804. protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
  1805. {
  1806. base.InvokeAfterUpdateProperty(data);
  1807. if (firstUpdate)
  1808. {
  1809. UpdateGASSetting(false);
  1810. UpdateHeaterSetting();
  1811. firstUpdate = false;
  1812. }
  1813. }
  1814. private void UpdateGASSetting(bool upDataMfcSetPoint)
  1815. {
  1816. List<AITMfcData> allmfcDatas = new List<AITMfcData>()
  1817. {
  1818. MFC1Data,
  1819. MFC2Data,
  1820. MFC3Data,
  1821. MFC4Data,
  1822. MFC5Data,
  1823. MFC6Data,
  1824. MFC7Data,
  1825. MFC8Data,
  1826. MFC9Data,
  1827. MFC10Data,
  1828. MFC11Data,
  1829. MFC12Data,
  1830. MFC13Data,
  1831. MFC14Data,
  1832. MFC15Data,
  1833. MFC16Data,
  1834. MFC17Data,
  1835. MFC31Data,
  1836. MFC32Data,
  1837. MFC51Data,
  1838. };
  1839. List<AITMfcData> mfcDatas = new List<AITMfcData>()
  1840. {
  1841. };
  1842. foreach (var item in allmfcDatas)
  1843. {
  1844. if (item != null)
  1845. {
  1846. mfcDatas.Add(item);
  1847. }
  1848. }
  1849. if (MFCDataList.Count == 0)
  1850. {
  1851. for (int i = 0; i < mfcDatas.Count; i++)
  1852. {
  1853. if (mfcDatas[i] == null)
  1854. continue;
  1855. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{mfcDatas[i].DeviceName}.SetLastPoint");
  1856. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{mfcDatas[i].DeviceName}.SetLastRamping");
  1857. //MFCDataList.Add(new MFCGasData()
  1858. //{
  1859. // Name = mfcDatas[i].DeviceName,
  1860. // DisplayName = mfcDatas[i].DisplayName,
  1861. // ActualValue = mfcDatas[i].FeedBack,
  1862. // Value = mfcDatas[i].SetPoint,
  1863. // ActualRampng = mfcDatas[i].Ramping,
  1864. // Rampng = mfcDatas[i].VirtualRamping,
  1865. // Unit = mfcDatas[i].Unit,
  1866. // AlarmValue = mfcDatas[i].AlarmWatchTable
  1867. //});
  1868. MFCDataList.Add(new MFCGasData()
  1869. {
  1870. Name = mfcDatas[i].DeviceName,
  1871. DisplayName = mfcDatas[i].DisplayName,
  1872. //ActualValue = mfcDatas[i].FeedBack,
  1873. Value = setLastPoint.ToString("f3"),
  1874. //ActualRampng = mfcDatas[i].Ramping,
  1875. Rampng = setLastRamping.ToString("f3"),
  1876. IsSetChanged = true,
  1877. Unit = mfcDatas[i].Unit,
  1878. AlarmValue = mfcDatas[i].AlarmWatchTable
  1879. });
  1880. }
  1881. }
  1882. else
  1883. {
  1884. for (int i = 0; i < MFCDataList.Count; i++)
  1885. {
  1886. var findMFC = mfcDatas.FirstOrDefault(x => x.DeviceName == MFCDataList[i].Name);
  1887. if (findMFC != null)
  1888. {
  1889. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{findMFC.DeviceName}.SetLastPoint");
  1890. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{findMFC.DeviceName}.SetLastRamping");
  1891. MFCDataList[i].Value = setLastPoint.ToString("f3");
  1892. MFCDataList[i].IsSetChanged = true;
  1893. MFCDataList[i].Rampng = setLastRamping.ToString("f3");
  1894. }
  1895. };
  1896. }
  1897. if (MFCDataList != null && MFCDataList.Count > 0)
  1898. {
  1899. if (upDataMfcSetPoint)
  1900. {
  1901. Dictionary<string, string> setChangedMFC = new Dictionary<string, string>();
  1902. foreach (var item in MFCDataList)
  1903. {
  1904. setChangedMFC.Add(item.Name, item.Value);
  1905. }
  1906. InvokeClient.Instance.Service.DoOperation($"PM1.SetAllMfcSetPoint", setChangedMFC);
  1907. }
  1908. }
  1909. }
  1910. private void UpdateHeaterSetting()
  1911. {
  1912. if ((HeaterUData != null && HeaterCUData != null && HeaterCData != null && HeaterCLData != null && HeaterLData != null))
  1913. {
  1914. List<AITHeaterData> heaterDatas = new List<AITHeaterData>()
  1915. {
  1916. HeaterUData,
  1917. HeaterCUData,
  1918. HeaterCData,
  1919. HeaterCLData,
  1920. HeaterLData,
  1921. };
  1922. if (TempList.Count == 0)
  1923. {
  1924. string[] strList = new string[5] { "BottomHeaterData", "CenterBottomHeaterData", "CenterHeaterData", "TopCenterHeaterData", "HeaterUData" };
  1925. for (int i = 0; i < heaterDatas.Count; i++)
  1926. {
  1927. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.Heater.{heaterDatas[i].DeviceName}.SetLastPoint");
  1928. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.Heater.{heaterDatas[i].DeviceName}.SetLastRamping");
  1929. //TempList.Add(new TempManualSetData()
  1930. //{
  1931. // DisplayName = heaterDatas[i].DisplayName,
  1932. // Name = heaterDatas[i].DeviceName,
  1933. // ControlName = strList[i],
  1934. // ActualValue = heaterDatas[i].FeedBack,
  1935. // Value = heaterDatas[i].SetPoint,
  1936. // ActualRampng = heaterDatas[i].Ramping,
  1937. // Rampng = heaterDatas[i].UpRateSetPoint,
  1938. // Unit = heaterDatas[i].Unit,
  1939. //});
  1940. TempList.Add(new TempManualSetData()
  1941. {
  1942. DisplayName = heaterDatas[i].DisplayName,
  1943. Name = heaterDatas[i].DeviceName,
  1944. ControlName = strList[i],
  1945. Value = setLastPoint.ToString("f1"),
  1946. Rampng = setLastRamping.ToString("f1"),
  1947. Unit = heaterDatas[i].Unit,
  1948. });
  1949. }
  1950. }
  1951. else
  1952. {
  1953. for (int i = 0; i < TempList.Count; i++)
  1954. {
  1955. var findHeater = heaterDatas.FirstOrDefault(x => x.DeviceName == TempList[i].Name);
  1956. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.Heater.{findHeater.DeviceName}.SetLastPoint");
  1957. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.Heater.{findHeater.DeviceName}.SetLastRamping");
  1958. if (findHeater != null)
  1959. {
  1960. TempList[i].Value = setLastPoint.ToString("f1");
  1961. TempList[i].Rampng = setLastRamping.ToString("f1");
  1962. TempList[i].IsSetChanged = true;
  1963. TempList[i].IsRampngChanged = true;
  1964. }
  1965. };
  1966. }
  1967. }
  1968. }
  1969. public void SetValue(object sender, string isFullKeyboard = "")
  1970. {
  1971. string value = ((TextBox)sender).Text;
  1972. if (!string.IsNullOrEmpty(isFullKeyboard))
  1973. {
  1974. FullKeyboard fullKeyboard1 = new FullKeyboard("", value);
  1975. if ((bool)fullKeyboard1.ShowDialog())
  1976. {
  1977. ((TextBox)sender).Text = fullKeyboard1.ValueString;
  1978. }
  1979. }
  1980. else
  1981. {
  1982. NumberKeyboard fullKeyboard = new NumberKeyboard("", value);
  1983. if ((bool)fullKeyboard.ShowDialog())
  1984. {
  1985. ((TextBox)sender).Text = fullKeyboard.ValueString;
  1986. }
  1987. }
  1988. }
  1989. private string GetPressString()
  1990. {
  1991. string[] pressStringList = new string[4] { "", "", "", "" };
  1992. pressStringList[0] = PressCommand;
  1993. if (!string.IsNullOrEmpty(PressCommand))
  1994. {
  1995. switch (PressCommand)
  1996. {
  1997. case "Press":
  1998. case "Press2":
  1999. PressVisibility = Visibility.Visible;
  2000. pressStringList[1] = PressPID;
  2001. pressStringList[2] = PressSet.ToString();
  2002. break;
  2003. case "Slow Vac":
  2004. var defaultAPCPID = SystemConfigProvider.Instance.GetValueByName("PM1.APCPID");
  2005. pressStringList[1] = defaultAPCPID;
  2006. pressStringList[2] = PressSlowVacSet.ToString();
  2007. break;
  2008. case "Valve Angle":
  2009. pressStringList[2] = PressValveAngleSet.ToString();
  2010. pressStringList[3] = LowPressWait;
  2011. break;
  2012. case "Full Open":
  2013. case "Full Close":
  2014. case "Hold":
  2015. case "Zero Set":
  2016. case "Cancel Zero":
  2017. pressStringList[1] = "";
  2018. pressStringList[2] = "";
  2019. pressStringList[3] = "";
  2020. break;
  2021. case "WaitPressUp1":
  2022. case "WaitPressDown1":
  2023. case "WaitPressUp2":
  2024. case "WaitPressDown2":
  2025. pressStringList[2] = PressWait.ToString();
  2026. break;
  2027. default:
  2028. break;
  2029. }
  2030. }
  2031. return string.Join(";", pressStringList);
  2032. }
  2033. }
  2034. public class MFCGasData : PropertyChangedBase
  2035. {
  2036. private int _no;
  2037. public int No
  2038. {
  2039. get => _no;
  2040. set
  2041. {
  2042. _no = value;
  2043. NotifyOfPropertyChange(nameof(No));
  2044. }
  2045. }
  2046. private string _name;
  2047. public string Name
  2048. {
  2049. get => _name;
  2050. set
  2051. {
  2052. _name = value;
  2053. NotifyOfPropertyChange(nameof(Name));
  2054. }
  2055. }
  2056. public string _unit;
  2057. public string Unit
  2058. {
  2059. get => _unit;
  2060. set
  2061. {
  2062. _unit = value;
  2063. NotifyOfPropertyChange(nameof(Unit));
  2064. }
  2065. }
  2066. private string _displayName;
  2067. public string DisplayName
  2068. {
  2069. get => _displayName;
  2070. set
  2071. {
  2072. _displayName = value;
  2073. NotifyOfPropertyChange(nameof(DisplayName));
  2074. }
  2075. }
  2076. private string _controlName;
  2077. public string ControlName
  2078. {
  2079. get => _controlName;
  2080. set
  2081. {
  2082. _controlName = value;
  2083. NotifyOfPropertyChange(nameof(ControlName));
  2084. }
  2085. }
  2086. private double _actualValue;
  2087. public double ActualValue
  2088. {
  2089. get => _actualValue;
  2090. set
  2091. {
  2092. _actualValue = value;
  2093. NotifyOfPropertyChange(nameof(ActualValue));
  2094. }
  2095. }
  2096. private string _value;
  2097. public string Value
  2098. {
  2099. get => _value;
  2100. set
  2101. {
  2102. _value = value;
  2103. NotifyOfPropertyChange(nameof(Value));
  2104. }
  2105. }
  2106. private double _actualRampng;
  2107. public double ActualRampng
  2108. {
  2109. get => _actualRampng; set
  2110. {
  2111. _actualRampng = value;
  2112. NotifyOfPropertyChange(nameof(ActualRampng));
  2113. }
  2114. }
  2115. private string _rampng;
  2116. public string Rampng
  2117. {
  2118. get => _rampng; set
  2119. {
  2120. _rampng = value;
  2121. NotifyOfPropertyChange(nameof(Rampng));
  2122. }
  2123. }
  2124. private string _maxValue;
  2125. public string MaxValue
  2126. {
  2127. get => _maxValue; set
  2128. {
  2129. _maxValue = value;
  2130. NotifyOfPropertyChange(nameof(MaxValue));
  2131. }
  2132. }
  2133. private string _minValue;
  2134. public string MinValue
  2135. {
  2136. get => _minValue; set
  2137. {
  2138. _minValue = value;
  2139. NotifyOfPropertyChange(nameof(MinValue));
  2140. }
  2141. }
  2142. private bool _isSetChanged = true;
  2143. public bool IsSetChanged
  2144. {
  2145. get => _isSetChanged;
  2146. set
  2147. {
  2148. _isSetChanged = value;
  2149. NotifyOfPropertyChange(nameof(IsSetChanged));
  2150. }
  2151. }
  2152. private bool _isRampngChanged = true;
  2153. public bool IsRampngChanged
  2154. {
  2155. get => _isRampngChanged;
  2156. set
  2157. {
  2158. _isRampngChanged = value;
  2159. NotifyOfPropertyChange(nameof(IsRampngChanged));
  2160. }
  2161. }
  2162. private string _alarmValue;
  2163. public string AlarmValue
  2164. {
  2165. get => _alarmValue;
  2166. set
  2167. {
  2168. _alarmValue = value;
  2169. NotifyOfPropertyChange(nameof(AlarmValue));
  2170. }
  2171. }
  2172. }
  2173. public class TempManualSetData : PropertyChangedBase
  2174. {
  2175. private int _no;
  2176. public int No
  2177. {
  2178. get => _no;
  2179. set
  2180. {
  2181. _no = value;
  2182. NotifyOfPropertyChange("No");
  2183. }
  2184. }
  2185. private string _name;
  2186. public string Name
  2187. {
  2188. get => _name;
  2189. set
  2190. {
  2191. _name = value;
  2192. NotifyOfPropertyChange("Name");
  2193. }
  2194. }
  2195. private string _displayName;
  2196. public string DisplayName
  2197. {
  2198. get => _displayName;
  2199. set
  2200. {
  2201. _displayName = value;
  2202. NotifyOfPropertyChange(nameof(DisplayName));
  2203. }
  2204. }
  2205. private string _controlName;
  2206. public string ControlName
  2207. {
  2208. get => _controlName;
  2209. set
  2210. {
  2211. _controlName = value;
  2212. NotifyOfPropertyChange(nameof(ControlName));
  2213. }
  2214. }
  2215. private double _actualValue;
  2216. public double ActualValue
  2217. {
  2218. get => _actualValue;
  2219. set
  2220. {
  2221. _actualValue = value;
  2222. NotifyOfPropertyChange(nameof(ActualValue));
  2223. }
  2224. }
  2225. private string _value;
  2226. public string Value
  2227. {
  2228. get => _value;
  2229. set
  2230. {
  2231. _value = value;
  2232. NotifyOfPropertyChange(nameof(Value));
  2233. }
  2234. }
  2235. private string _actualRampng;
  2236. public string ActualRampng
  2237. {
  2238. get => _actualRampng;
  2239. set
  2240. {
  2241. _actualRampng = value;
  2242. NotifyOfPropertyChange(nameof(ActualRampng));
  2243. }
  2244. }
  2245. private string _rampng;
  2246. public string Rampng
  2247. {
  2248. get => _rampng; set
  2249. {
  2250. _rampng = value;
  2251. NotifyOfPropertyChange(nameof(Rampng));
  2252. }
  2253. }
  2254. private string _maxValue;
  2255. public string MaxValue
  2256. {
  2257. get => _maxValue; set
  2258. {
  2259. _maxValue = value;
  2260. NotifyOfPropertyChange(nameof(MaxValue));
  2261. }
  2262. }
  2263. private string _minValue;
  2264. public string MinValue
  2265. {
  2266. get => _minValue; set
  2267. {
  2268. _minValue = value;
  2269. NotifyOfPropertyChange(nameof(MinValue));
  2270. }
  2271. }
  2272. private bool _isChanged = true;
  2273. public bool IsChanged
  2274. {
  2275. get => _isChanged;
  2276. set
  2277. {
  2278. _isChanged = value;
  2279. NotifyOfPropertyChange(nameof(IsChanged));
  2280. }
  2281. }
  2282. private string _unit;
  2283. public string Unit
  2284. {
  2285. get => _unit;
  2286. set
  2287. {
  2288. _unit = value;
  2289. NotifyOfPropertyChange("Unit");
  2290. }
  2291. }
  2292. private bool _isSetChanged = true;
  2293. public bool IsSetChanged
  2294. {
  2295. get => _isSetChanged;
  2296. set
  2297. {
  2298. _isSetChanged = value;
  2299. NotifyOfPropertyChange(nameof(IsSetChanged));
  2300. }
  2301. }
  2302. private bool _isRampngChanged = true;
  2303. public bool IsRampngChanged
  2304. {
  2305. get => _isRampngChanged;
  2306. set
  2307. {
  2308. _isRampngChanged = value;
  2309. NotifyOfPropertyChange(nameof(IsRampngChanged));
  2310. }
  2311. }
  2312. private string _alarmValue;
  2313. public string AlarmValue
  2314. {
  2315. get => _alarmValue;
  2316. set
  2317. {
  2318. _alarmValue = value;
  2319. NotifyOfPropertyChange(nameof(AlarmValue));
  2320. }
  2321. }
  2322. }
  2323. }