ManualSetViewModel.cs 114 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586
  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 double _boatZAxisLimitSpeed;
  594. public double BoatZAxisLimitSpeed
  595. {
  596. get => _boatZAxisLimitSpeed;
  597. set
  598. {
  599. _boatZAxisLimitSpeed = value;
  600. NotifyOfPropertyChange(nameof(BoatZAxisLimitSpeed));
  601. }
  602. }
  603. private double _boatRAxisLimitSpeed;
  604. public double BoatRAxisLimitSpeed
  605. {
  606. get => _boatRAxisLimitSpeed;
  607. set
  608. {
  609. _boatRAxisLimitSpeed = value;
  610. NotifyOfPropertyChange(nameof(BoatRAxisLimitSpeed));
  611. }
  612. }
  613. private bool _noStandbyIsEnabled = false;
  614. public bool NoStandbyIsEnabled
  615. {
  616. get => _noStandbyIsEnabled;
  617. set
  618. {
  619. _noStandbyIsEnabled = value;
  620. NotifyOfPropertyChange(nameof(NoStandbyIsEnabled));
  621. }
  622. }
  623. private Visibility _standbyIsVisibility = Visibility.Visible;
  624. public Visibility StandbyIsVisibility
  625. {
  626. get => _standbyIsVisibility;
  627. set
  628. {
  629. _standbyIsVisibility = value;
  630. NotifyOfPropertyChange(nameof(StandbyIsVisibility));
  631. }
  632. }
  633. private string _selectedGasSetting2;
  634. public string SelectedGasSetting2
  635. {
  636. get
  637. {
  638. return _selectedGasSetting2;
  639. }
  640. set
  641. {
  642. _selectedGasSetting2 = value;
  643. NotifyOfPropertyChange(nameof(SelectedGasSetting2));
  644. }
  645. }
  646. private string _selectedGasSetting3;
  647. public string SelectedGasSetting3
  648. {
  649. get
  650. {
  651. return _selectedGasSetting3;
  652. }
  653. set
  654. {
  655. _selectedGasSetting3 = value;
  656. NotifyOfPropertyChange(nameof(SelectedGasSetting3));
  657. }
  658. }
  659. private string _selectedGasSetting4;
  660. public string SelectedGasSetting4
  661. {
  662. get
  663. {
  664. return _selectedGasSetting4;
  665. }
  666. set
  667. {
  668. _selectedGasSetting4 = value;
  669. NotifyOfPropertyChange(nameof(SelectedGasSetting4));
  670. }
  671. }
  672. private string _selectedGasSetting5;
  673. public string SelectedGasSetting5
  674. {
  675. get
  676. {
  677. return _selectedGasSetting5;
  678. }
  679. set
  680. {
  681. _selectedGasSetting5 = value;
  682. NotifyOfPropertyChange(nameof(SelectedGasSetting5));
  683. }
  684. }
  685. private string _selectedGasSetting6;
  686. public string SelectedGasSetting6
  687. {
  688. get
  689. {
  690. return _selectedGasSetting6;
  691. }
  692. set
  693. {
  694. _selectedGasSetting6 = value;
  695. NotifyOfPropertyChange(nameof(SelectedGasSetting6));
  696. }
  697. }
  698. private List<ConfigNode> _ConfigNodes = new List<ConfigNode>();
  699. public List<ConfigNode> ConfigNodes
  700. {
  701. get { return _ConfigNodes; }
  702. set
  703. {
  704. _ConfigNodes = value;
  705. NotifyOfPropertyChange(nameof(ConfigNodes));
  706. }
  707. }
  708. public ObservableCollection<TempManualSetData> TempList { get; set; } = new ObservableCollection<TempManualSetData>();
  709. private ObservableCollection<MFCGasData> _mFCDatas = new ObservableCollection<MFCGasData>();
  710. public ObservableCollection<MFCGasData> MFCDataList
  711. {
  712. get => _mFCDatas;
  713. set
  714. {
  715. _mFCDatas = value;
  716. NotifyOfPropertyChange(nameof(MFCDataList));
  717. }
  718. }
  719. private string _pressureUnit;
  720. public string PressureUnit
  721. {
  722. get => _pressureUnit;
  723. set
  724. {
  725. _pressureUnit = value;
  726. NotifyOfPropertyChange(nameof(PressureUnit));
  727. }
  728. }
  729. public string RecipeType { get; set; }
  730. public ManualSetViewModel()
  731. {
  732. }
  733. protected override void OnViewLoaded(object view)
  734. {
  735. base.OnViewLoaded(view);
  736. }
  737. protected override void OnActivate()
  738. {
  739. base.OnActivate();
  740. //InvokeClient.Instance.Service.DoOperation($"PM1.SetSensorRecipeOK", "");
  741. LoadData();
  742. BoatZAxisLimitSpeed = (double)QueryDataClient.Instance.Service.GetConfig($"Boat.BoatElevatorServo.BoatZAxisLimitSpeed");
  743. BoatRAxisLimitSpeed = (double)QueryDataClient.Instance.Service.GetConfig($"Boat.BoatRotationServo.BoatRAxisLimitSpeed");
  744. }
  745. protected override void OnDeactivate(bool close)
  746. {
  747. base.OnDeactivate(close);
  748. //InvokeClient.Instance.Service.DoOperation($"PM1.SetSensorPROCManualOK", "");
  749. }
  750. protected override void OnInitialize()
  751. {
  752. base.OnInitialize();
  753. // GetHeaderConfig();
  754. }
  755. private void LoadData()
  756. {
  757. firstUpdate = true;
  758. }
  759. //撤销修改
  760. public void RecipeIsChangeClick(object cmdName, object value)
  761. {
  762. var windowManager = IoC.Get<IWindowManager>();
  763. switch ((string)cmdName)
  764. {
  765. case "Alarm":
  766. break;
  767. case "MFC":
  768. break;
  769. case "Gas":
  770. break;
  771. case "AUX":
  772. break;
  773. case "Press":
  774. break;
  775. case "Temp":
  776. break;
  777. default:
  778. break;
  779. }
  780. }
  781. public void TempSetClick(object sender)
  782. {
  783. string stSetValue = ShowNumberKeyboard(sender as Button, "", 1);
  784. foreach (var item in TempList)
  785. {
  786. item.Value = stSetValue;
  787. item.IsSetChanged = false;
  788. }
  789. }
  790. public Dictionary<string, bool> DictValve { get; set; } = new Dictionary<string, bool>();
  791. public Dictionary<string, string> DictMFC { get; set; } = new Dictionary<string, string>();
  792. public Dictionary<string, string> DictMFCRamp { get; set; } = new Dictionary<string, string>();
  793. public Dictionary<string, bool> PumpSetValues { get; set; } = new Dictionary<string, bool>();
  794. public Dictionary<string, bool> F2HFClnOrHFCl2Values { get; set; } = new Dictionary<string, bool>();
  795. private Dictionary<string, string> ChangedDictMFC(Dictionary<string, double> oldDict)
  796. {
  797. Dictionary<string, string> rtnKeyValue = new Dictionary<string, string>();
  798. foreach (var item in oldDict.Keys)
  799. {
  800. rtnKeyValue.Add(item, oldDict[item].ToString());
  801. }
  802. return rtnKeyValue;
  803. }
  804. public void PatternCmd()
  805. {
  806. string toolType = (string)QueryDataClient.Instance.Service.GetConfig("System.SetUp.ToolType");
  807. if (!string.IsNullOrEmpty(toolType) && toolType.Equals(ConstantsCommon.ELK))
  808. {
  809. FurnaceUI.Views.Maintenances.Maintenances.ELK.GasPanelViewModel gasPanelTwoView = new Maintenances.Maintenances.ELK.GasPanelViewModel();
  810. gasPanelTwoView.MFCDataList = MFCDataList;
  811. var rtn = (wm as WindowManager)?.ShowDialogWithTitle(gasPanelTwoView, null, "Manual Gas View");
  812. if ((bool)rtn)
  813. {
  814. DictValve = gasPanelTwoView.DictChangedValve;
  815. DictMFC = ChangedDictMFC(gasPanelTwoView.DictChangedMFC);
  816. DictMFCRamp = ChangedDictMFC(gasPanelTwoView.DictChangedMFCRamp);
  817. foreach (var item in DictMFC)
  818. {
  819. var tempMFC = MFCDataList.FirstOrDefault(x => x.Name == item.Key);
  820. if (tempMFC != null)
  821. {
  822. tempMFC.IsSetChanged = false;
  823. tempMFC.Value = item.Value;
  824. }
  825. }
  826. foreach (var item in DictMFCRamp)
  827. {
  828. var tempMFC = MFCDataList.FirstOrDefault(x => x.Name == item.Key);
  829. if (tempMFC != null)
  830. {
  831. tempMFC.IsRampngChanged = false;
  832. tempMFC.Rampng = item.Value;
  833. }
  834. }
  835. if (DictMFC.Count == 0 && DictMFCRamp.Count == 0)
  836. {
  837. for (int i = 0; i < MFCDataList.Count; i++)
  838. {
  839. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastPoint");
  840. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastRamping");
  841. MFCDataList[i].Value = setLastPoint.ToString("f3");
  842. MFCDataList[i].Rampng = setLastRamping.ToString("f3");
  843. MFCDataList[i].IsSetChanged = true;
  844. MFCDataList[i].IsRampngChanged = true;
  845. };
  846. }
  847. if (gasPanelTwoView.DictChangedPumpValve.Count > 0)
  848. {
  849. PumpSetValues.Clear();
  850. if (gasPanelTwoView.AGVPumpData != null && gasPanelTwoView.AGVPumpData.DefaultValue != gasPanelTwoView.AGVPumpData.Feedback)
  851. {
  852. PumpSetValues.Add(gasPanelTwoView.AGVPumpData.UniqueName, gasPanelTwoView.AGVPumpData.Feedback);
  853. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AGVPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AGVPumpData.Feedback);
  854. }
  855. if (gasPanelTwoView.AGV2PumpData != null && gasPanelTwoView.AGV2PumpData.DefaultValue != gasPanelTwoView.AGV2PumpData.Feedback)
  856. {
  857. PumpSetValues.Add(gasPanelTwoView.AGV2PumpData.UniqueName, gasPanelTwoView.AGV2PumpData.Feedback);
  858. }
  859. if (gasPanelTwoView.AUCPumpData != null && gasPanelTwoView.AUCPumpData.DefaultValue != gasPanelTwoView.AUCPumpData.Feedback)
  860. {
  861. PumpSetValues.Add(gasPanelTwoView.AUCPumpData.UniqueName, gasPanelTwoView.AUCPumpData.Feedback);
  862. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AUCPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AUCPumpData.Feedback);
  863. }
  864. if (gasPanelTwoView.BothPump1Data != null && gasPanelTwoView.BothPump1Data.DefaultValue != gasPanelTwoView.BothPump1Data.Feedback)
  865. {
  866. PumpSetValues.Add(gasPanelTwoView.BothPump1Data.UniqueName, gasPanelTwoView.BothPump1Data.Feedback);
  867. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.BothPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.BothPumpData.Feedback);
  868. }
  869. if (gasPanelTwoView.BothPump2Data != null && gasPanelTwoView.BothPump2Data.DefaultValue != gasPanelTwoView.BothPump2Data.Feedback)
  870. {
  871. PumpSetValues.Add(gasPanelTwoView.BothPump2Data.UniqueName, gasPanelTwoView.BothPump2Data.Feedback);
  872. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.BothPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.BothPumpData.Feedback);
  873. }
  874. if (gasPanelTwoView.ValveBWRData != null && gasPanelTwoView.ValveBWRData.DefaultValue != gasPanelTwoView.ValveBWRData.Feedback)
  875. {
  876. PumpSetValues.Add(gasPanelTwoView.ValveBWRData.UniqueName, gasPanelTwoView.ValveBWRData.Feedback);
  877. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveBWRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveBWRData.Feedback);
  878. }
  879. if (gasPanelTwoView.ValveDPRData != null && gasPanelTwoView.ValveDPRData.DefaultValue != gasPanelTwoView.ValveDPRData.Feedback)
  880. {
  881. PumpSetValues.Add(gasPanelTwoView.ValveDPRData.UniqueName, gasPanelTwoView.ValveDPRData.Feedback);
  882. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveDPRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveDPRData.Feedback);
  883. }
  884. if (gasPanelTwoView.HREFData != null && gasPanelTwoView.HREFData.DefaultValue != gasPanelTwoView.HREFData.Feedback)
  885. {
  886. PumpSetValues.Add(gasPanelTwoView.HREFData.UniqueName, gasPanelTwoView.HREFData.Feedback);
  887. }
  888. if (gasPanelTwoView.CREF2Data != null && gasPanelTwoView.CREF2Data.DefaultValue != gasPanelTwoView.CREF2Data.Feedback)
  889. {
  890. PumpSetValues.Add(gasPanelTwoView.CREF2Data.UniqueName, gasPanelTwoView.CREF2Data.Feedback);
  891. }
  892. if (gasPanelTwoView.HZEROData != null && gasPanelTwoView.HZEROData.DefaultValue != gasPanelTwoView.HZEROData.Feedback)
  893. {
  894. PumpSetValues.Add(gasPanelTwoView.HZEROData.UniqueName, gasPanelTwoView.HZEROData.Feedback);
  895. }
  896. if (gasPanelTwoView.HMNTData != null && gasPanelTwoView.HMNTData.DefaultValue != gasPanelTwoView.HMNTData.Feedback)
  897. {
  898. PumpSetValues.Add(gasPanelTwoView.HMNTData.UniqueName, gasPanelTwoView.HMNTData.Feedback);
  899. }
  900. if (gasPanelTwoView.CMNTData != null && gasPanelTwoView.CMNTData.DefaultValue != gasPanelTwoView.CMNTData.Feedback)
  901. {
  902. PumpSetValues.Add(gasPanelTwoView.CMNTData.UniqueName, gasPanelTwoView.CMNTData.Feedback);
  903. }
  904. if (gasPanelTwoView.CZEROData != null && gasPanelTwoView.CZEROData.DefaultValue != gasPanelTwoView.CZEROData.Feedback)
  905. {
  906. PumpSetValues.Add(gasPanelTwoView.CZEROData.UniqueName, gasPanelTwoView.CZEROData.Feedback);
  907. }
  908. F2HFClnOrHFCl2Values.Clear();
  909. if (gasPanelTwoView.IsDEPOOn != gasPanelTwoView.IsOldDEPOOn)
  910. {
  911. F2HFClnOrHFCl2Values.Add("PM1.SetDEPOEnable", gasPanelTwoView.IsDEPOOn);
  912. // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  913. }
  914. if (gasPanelTwoView.IsF2ClnOn != gasPanelTwoView.IsOldF2ClnOn)
  915. {
  916. F2HFClnOrHFCl2Values.Add("PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  917. // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  918. }
  919. if (gasPanelTwoView.IsHFClnOn != gasPanelTwoView.IsOldHFClnOn)
  920. {
  921. F2HFClnOrHFCl2Values.Add("PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
  922. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
  923. }
  924. if (gasPanelTwoView.IsHTR1Enable != gasPanelTwoView.IsOldHTR1Enable)
  925. {
  926. F2HFClnOrHFCl2Values.Add("PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
  927. // InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
  928. }
  929. if (gasPanelTwoView.IsHTR2Enable != gasPanelTwoView.IsOldHTR2Enable)
  930. {
  931. F2HFClnOrHFCl2Values.Add("PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  932. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  933. }
  934. if (gasPanelTwoView.IsHTR3Enable != gasPanelTwoView.IsOldHTR3Enable)
  935. {
  936. F2HFClnOrHFCl2Values.Add("PM1.SetHTR3Enable", gasPanelTwoView.IsHTR3Enable);
  937. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  938. }
  939. if (gasPanelTwoView.IsCEXHOn != gasPanelTwoView.IsOldCEXHOn)
  940. {
  941. F2HFClnOrHFCl2Values.Add("PM1.SetCEXHEnable", gasPanelTwoView.IsCEXHOn);
  942. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  943. }
  944. if (gasPanelTwoView.IsCREFOn != gasPanelTwoView.IsOldCREFOn)
  945. {
  946. F2HFClnOrHFCl2Values.Add("PM1.SetCREFEnable", gasPanelTwoView.IsCREFOn);
  947. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  948. }
  949. if (gasPanelTwoView.IsSIREFOn != gasPanelTwoView.IsOldSIREFOn)
  950. {
  951. F2HFClnOrHFCl2Values.Add("PM1.SetSIREFEnable", gasPanelTwoView.IsSIREFOn);
  952. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  953. }
  954. }
  955. }
  956. }
  957. else if (!string.IsNullOrEmpty(toolType) && toolType.Equals(ConstantsCommon.SIBCN))
  958. {
  959. FurnaceUI.Views.Maintenances.Maintenances.SiBCN.GasPanelViewModel gasPanelTwoView = new Maintenances.Maintenances.SiBCN.GasPanelViewModel();
  960. gasPanelTwoView.MFCDataList = MFCDataList;
  961. var rtn = (wm as WindowManager)?.ShowDialogWithTitle(gasPanelTwoView, null, " Gas Panel");
  962. if ((bool)rtn)
  963. {
  964. DictValve = gasPanelTwoView.DictChangedValve;
  965. DictMFC = ChangedDictMFC(gasPanelTwoView.DictChangedMFC);
  966. foreach (var item in DictMFC)
  967. {
  968. var tempMFC = MFCDataList.FirstOrDefault(x => x.Name == item.Key);
  969. if (tempMFC != null)
  970. {
  971. tempMFC.IsSetChanged = false;
  972. tempMFC.Value = item.Value;
  973. }
  974. }
  975. if (DictMFC.Count == 0)
  976. {
  977. for (int i = 0; i < MFCDataList.Count; i++)
  978. {
  979. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastPoint");
  980. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastRamping");
  981. MFCDataList[i].Value = setLastPoint.ToString("f3");
  982. MFCDataList[i].Rampng = setLastRamping.ToString("f3");
  983. MFCDataList[i].IsSetChanged = true;
  984. };
  985. }
  986. if (gasPanelTwoView.DictChangedPumpValve.Count > 0)
  987. {
  988. PumpSetValues.Clear();
  989. if (gasPanelTwoView.AGVPumpData != null && gasPanelTwoView.AGVPumpData.DefaultValue != gasPanelTwoView.AGVPumpData.Feedback)
  990. {
  991. PumpSetValues.Add(gasPanelTwoView.AGVPumpData.UniqueName, gasPanelTwoView.AGVPumpData.Feedback);
  992. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AGVPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AGVPumpData.Feedback);
  993. }
  994. if (gasPanelTwoView.AUCPumpData != null && gasPanelTwoView.AUCPumpData.DefaultValue != gasPanelTwoView.AUCPumpData.Feedback)
  995. {
  996. PumpSetValues.Add(gasPanelTwoView.AUCPumpData.UniqueName, gasPanelTwoView.AUCPumpData.Feedback);
  997. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AUCPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AUCPumpData.Feedback);
  998. }
  999. if (gasPanelTwoView.BothPumpData != null && gasPanelTwoView.BothPumpData.DefaultValue != gasPanelTwoView.BothPumpData.Feedback)
  1000. {
  1001. PumpSetValues.Add(gasPanelTwoView.BothPumpData.UniqueName, gasPanelTwoView.BothPumpData.Feedback);
  1002. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.BothPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.BothPumpData.Feedback);
  1003. }
  1004. if (gasPanelTwoView.ValveBWRData != null && gasPanelTwoView.ValveBWRData.DefaultValue != gasPanelTwoView.ValveBWRData.Feedback)
  1005. {
  1006. PumpSetValues.Add(gasPanelTwoView.ValveBWRData.UniqueName, gasPanelTwoView.ValveBWRData.Feedback);
  1007. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveBWRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveBWRData.Feedback);
  1008. }
  1009. if (gasPanelTwoView.ValveDPRData != null && gasPanelTwoView.ValveDPRData.DefaultValue != gasPanelTwoView.ValveDPRData.Feedback)
  1010. {
  1011. PumpSetValues.Add(gasPanelTwoView.ValveDPRData.UniqueName, gasPanelTwoView.ValveDPRData.Feedback);
  1012. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveDPRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveDPRData.Feedback);
  1013. }
  1014. F2HFClnOrHFCl2Values.Clear();
  1015. if (gasPanelTwoView.IsDEPOOn != gasPanelTwoView.IsOldDEPOOn)
  1016. {
  1017. F2HFClnOrHFCl2Values.Add("PM1.SetDEPOEnable", gasPanelTwoView.IsDEPOOn);
  1018. // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  1019. }
  1020. if (gasPanelTwoView.IsF2ClnOn != gasPanelTwoView.IsOldF2ClnOn)
  1021. {
  1022. F2HFClnOrHFCl2Values.Add("PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  1023. // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  1024. }
  1025. if (gasPanelTwoView.IsHFClnOn != gasPanelTwoView.IsOldHFClnOn)
  1026. {
  1027. F2HFClnOrHFCl2Values.Add("PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
  1028. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
  1029. }
  1030. if (gasPanelTwoView.IsHTR1Enable != gasPanelTwoView.IsOldHTR1Enable)
  1031. {
  1032. F2HFClnOrHFCl2Values.Add("PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
  1033. // InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
  1034. }
  1035. if (gasPanelTwoView.IsHTR2Enable != gasPanelTwoView.IsOldHTR2Enable)
  1036. {
  1037. F2HFClnOrHFCl2Values.Add("PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1038. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1039. }
  1040. if (gasPanelTwoView.IsHTR3Enable != gasPanelTwoView.IsOldHTR3Enable)
  1041. {
  1042. F2HFClnOrHFCl2Values.Add("PM1.SetHTR3Enable", gasPanelTwoView.IsHTR3Enable);
  1043. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1044. }
  1045. if (gasPanelTwoView.IsCEXHOn != gasPanelTwoView.IsOldCEXHOn)
  1046. {
  1047. F2HFClnOrHFCl2Values.Add("PM1.SetCEXHEnable", gasPanelTwoView.IsCEXHOn);
  1048. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1049. }
  1050. }
  1051. }
  1052. }
  1053. else if (!string.IsNullOrEmpty(toolType) && toolType.Equals(ConstantsCommon.TiN))
  1054. {
  1055. FurnaceUI.Views.Maintenances.Maintenances.TiN.GasPanelViewModel gasPanelTwoView = new Maintenances.Maintenances.TiN.GasPanelViewModel();
  1056. gasPanelTwoView.MFCDataList = MFCDataList;
  1057. var rtn = (wm as WindowManager)?.ShowDialogWithTitle(gasPanelTwoView, null, " Gas Panel");
  1058. if ((bool)rtn)
  1059. {
  1060. DictValve = gasPanelTwoView.DictChangedValve;
  1061. DictMFC = ChangedDictMFC(gasPanelTwoView.DictChangedMFC);
  1062. foreach (var item in DictMFC)
  1063. {
  1064. var tempMFC = MFCDataList.FirstOrDefault(x => x.Name == item.Key);
  1065. if (tempMFC != null)
  1066. {
  1067. tempMFC.IsSetChanged = false;
  1068. tempMFC.Value = item.Value;
  1069. }
  1070. }
  1071. if (DictMFC.Count == 0)
  1072. {
  1073. for (int i = 0; i < MFCDataList.Count; i++)
  1074. {
  1075. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastPoint");
  1076. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastRamping");
  1077. MFCDataList[i].Value = setLastPoint.ToString("f3");
  1078. MFCDataList[i].Rampng = setLastRamping.ToString("f3");
  1079. MFCDataList[i].IsSetChanged = true;
  1080. };
  1081. }
  1082. if (gasPanelTwoView.DictChangedPumpValve.Count > 0)
  1083. {
  1084. PumpSetValues.Clear();
  1085. if (gasPanelTwoView.AGVPumpData != null && gasPanelTwoView.AGVPumpData.DefaultValue != gasPanelTwoView.AGVPumpData.Feedback)
  1086. {
  1087. PumpSetValues.Add(gasPanelTwoView.AGVPumpData.UniqueName, gasPanelTwoView.AGVPumpData.Feedback);
  1088. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AGVPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AGVPumpData.Feedback);
  1089. }
  1090. if (gasPanelTwoView.AUCPumpData != null && gasPanelTwoView.AUCPumpData.DefaultValue != gasPanelTwoView.AUCPumpData.Feedback)
  1091. {
  1092. PumpSetValues.Add(gasPanelTwoView.AUCPumpData.UniqueName, gasPanelTwoView.AUCPumpData.Feedback);
  1093. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AUCPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AUCPumpData.Feedback);
  1094. }
  1095. if (gasPanelTwoView.BothPumpData != null && gasPanelTwoView.BothPumpData.DefaultValue != gasPanelTwoView.BothPumpData.Feedback)
  1096. {
  1097. PumpSetValues.Add(gasPanelTwoView.BothPumpData.UniqueName, gasPanelTwoView.BothPumpData.Feedback);
  1098. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.BothPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.BothPumpData.Feedback);
  1099. }
  1100. if (gasPanelTwoView.ValveBWRData != null && gasPanelTwoView.ValveBWRData.DefaultValue != gasPanelTwoView.ValveBWRData.Feedback)
  1101. {
  1102. PumpSetValues.Add(gasPanelTwoView.ValveBWRData.UniqueName, gasPanelTwoView.ValveBWRData.Feedback);
  1103. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveBWRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveBWRData.Feedback);
  1104. }
  1105. if (gasPanelTwoView.ValveDPRData != null && gasPanelTwoView.ValveDPRData.DefaultValue != gasPanelTwoView.ValveDPRData.Feedback)
  1106. {
  1107. PumpSetValues.Add(gasPanelTwoView.ValveDPRData.UniqueName, gasPanelTwoView.ValveDPRData.Feedback);
  1108. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveDPRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveDPRData.Feedback);
  1109. }
  1110. F2HFClnOrHFCl2Values.Clear();
  1111. if (gasPanelTwoView.IsDEPOOn != gasPanelTwoView.IsOldDEPOOn)
  1112. {
  1113. F2HFClnOrHFCl2Values.Add("PM1.SetDEPOEnable", gasPanelTwoView.IsDEPOOn);
  1114. // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  1115. }
  1116. if (gasPanelTwoView.IsF2ClnOn != gasPanelTwoView.IsOldF2ClnOn)
  1117. {
  1118. F2HFClnOrHFCl2Values.Add("PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  1119. // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  1120. }
  1121. if (gasPanelTwoView.IsHFClnOn != gasPanelTwoView.IsOldHFClnOn)
  1122. {
  1123. F2HFClnOrHFCl2Values.Add("PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
  1124. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
  1125. }
  1126. if (gasPanelTwoView.IsHTR1Enable != gasPanelTwoView.IsOldHTR1Enable)
  1127. {
  1128. F2HFClnOrHFCl2Values.Add("PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
  1129. // InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
  1130. }
  1131. if (gasPanelTwoView.IsHTR2Enable != gasPanelTwoView.IsOldHTR2Enable)
  1132. {
  1133. F2HFClnOrHFCl2Values.Add("PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1134. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1135. }
  1136. if (gasPanelTwoView.IsHTR3Enable != gasPanelTwoView.IsOldHTR3Enable)
  1137. {
  1138. F2HFClnOrHFCl2Values.Add("PM1.SetHTR3Enable", gasPanelTwoView.IsHTR3Enable);
  1139. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1140. }
  1141. if (gasPanelTwoView.IsCEXHOn != gasPanelTwoView.IsOldCEXHOn)
  1142. {
  1143. F2HFClnOrHFCl2Values.Add("PM1.SetCEXHEnable", gasPanelTwoView.IsCEXHOn);
  1144. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1145. }
  1146. }
  1147. }
  1148. }
  1149. else
  1150. {
  1151. FurnaceUI.Views.Maintenances.GasPanelTwoViewModel gasPanelTwoView = new FurnaceUI.Views.Maintenances.GasPanelTwoViewModel();
  1152. gasPanelTwoView.MFCDataList = MFCDataList;
  1153. var rtn = (wm as WindowManager)?.ShowDialogWithTitle(gasPanelTwoView, null, " Gas Panel");
  1154. if ((bool)rtn)
  1155. {
  1156. DictValve = gasPanelTwoView.DictChangedValve;
  1157. DictMFC = ChangedDictMFC(gasPanelTwoView.DictChangedMFC);
  1158. foreach (var item in DictMFC)
  1159. {
  1160. var tempMFC = MFCDataList.FirstOrDefault(x => x.Name == item.Key);
  1161. if (tempMFC != null)
  1162. {
  1163. tempMFC.IsSetChanged = false;
  1164. tempMFC.Value = item.Value;
  1165. }
  1166. }
  1167. if (DictMFC.Count == 0)
  1168. {
  1169. for (int i = 0; i < MFCDataList.Count; i++)
  1170. {
  1171. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastPoint");
  1172. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastRamping");
  1173. MFCDataList[i].Value = setLastPoint.ToString("f3");
  1174. MFCDataList[i].Rampng = setLastRamping.ToString("f3");
  1175. MFCDataList[i].IsSetChanged = true;
  1176. };
  1177. }
  1178. if (gasPanelTwoView.DictChangedPumpValve.Count > 0)
  1179. {
  1180. PumpSetValues.Clear();
  1181. if (gasPanelTwoView.AGVPumpData != null && gasPanelTwoView.AGVPumpData.DefaultValue != gasPanelTwoView.AGVPumpData.Feedback)
  1182. {
  1183. PumpSetValues.Add(gasPanelTwoView.AGVPumpData.UniqueName, gasPanelTwoView.AGVPumpData.Feedback);
  1184. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AGVPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AGVPumpData.Feedback);
  1185. }
  1186. if (gasPanelTwoView.AUCPumpData != null && gasPanelTwoView.AUCPumpData.DefaultValue != gasPanelTwoView.AUCPumpData.Feedback)
  1187. {
  1188. PumpSetValues.Add(gasPanelTwoView.AUCPumpData.UniqueName, gasPanelTwoView.AUCPumpData.Feedback);
  1189. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AUCPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AUCPumpData.Feedback);
  1190. }
  1191. if (gasPanelTwoView.BothPumpData != null && gasPanelTwoView.BothPumpData.DefaultValue != gasPanelTwoView.BothPumpData.Feedback)
  1192. {
  1193. PumpSetValues.Add(gasPanelTwoView.BothPumpData.UniqueName, gasPanelTwoView.BothPumpData.Feedback);
  1194. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.BothPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.BothPumpData.Feedback);
  1195. }
  1196. if (gasPanelTwoView.ValveBWRData != null && gasPanelTwoView.ValveBWRData.DefaultValue != gasPanelTwoView.ValveBWRData.Feedback)
  1197. {
  1198. PumpSetValues.Add(gasPanelTwoView.ValveBWRData.UniqueName, gasPanelTwoView.ValveBWRData.Feedback);
  1199. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveBWRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveBWRData.Feedback);
  1200. }
  1201. if (gasPanelTwoView.ValveDPRData != null && gasPanelTwoView.ValveDPRData.DefaultValue != gasPanelTwoView.ValveDPRData.Feedback)
  1202. {
  1203. PumpSetValues.Add(gasPanelTwoView.ValveDPRData.UniqueName, gasPanelTwoView.ValveDPRData.Feedback);
  1204. // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveDPRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveDPRData.Feedback);
  1205. }
  1206. F2HFClnOrHFCl2Values.Clear();
  1207. if (gasPanelTwoView.IsF2ClnOn != gasPanelTwoView.IsOldF2ClnOn)
  1208. {
  1209. F2HFClnOrHFCl2Values.Add("PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  1210. // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
  1211. }
  1212. if (gasPanelTwoView.IsHFClnOn != gasPanelTwoView.IsOldHFClnOn)
  1213. {
  1214. F2HFClnOrHFCl2Values.Add("PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
  1215. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
  1216. }
  1217. if (gasPanelTwoView.IsHTR1Enable != gasPanelTwoView.IsOldHTR1Enable)
  1218. {
  1219. F2HFClnOrHFCl2Values.Add("PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
  1220. // InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
  1221. }
  1222. if (gasPanelTwoView.IsHTR2Enable != gasPanelTwoView.IsOldHTR2Enable)
  1223. {
  1224. F2HFClnOrHFCl2Values.Add("PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1225. //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
  1226. }
  1227. }
  1228. }
  1229. }
  1230. }
  1231. public void SwitchPage(string page)
  1232. {
  1233. switch (page)
  1234. {
  1235. case "Pressure":
  1236. {
  1237. ClientApp.Instance.SwitchPage("maintenance", "GasPanel", null);
  1238. }
  1239. break;
  1240. }
  1241. }
  1242. public void RampSetClick(object sender)
  1243. {
  1244. string strSetRamp = ShowNumberKeyboard(sender as Button, "", 1);
  1245. foreach (var item in TempList)
  1246. {
  1247. item.Rampng = strSetRamp;
  1248. item.IsRampngChanged = false;
  1249. }
  1250. }
  1251. private string ShowNumberKeyboard(Control control, string defaultValue, int keepDecimals = -1)
  1252. {
  1253. NumberKeyboard numberKeyboard = new NumberKeyboard("", defaultValue);
  1254. numberKeyboard.KeepDecimals = keepDecimals;
  1255. var point = control.PointFromScreen(new Point(0, 0));
  1256. double wx = SystemParameters.WorkArea.Width;
  1257. double hy = SystemParameters.WorkArea.Height;
  1258. if (-point.Y + control.ActualHeight + 5 + numberKeyboard.Height < hy)
  1259. {
  1260. numberKeyboard.Top = -point.Y + control.ActualHeight + 5;
  1261. }
  1262. else
  1263. {
  1264. numberKeyboard.Top = -point.Y - numberKeyboard.Height - 5;
  1265. }
  1266. if (-point.X + numberKeyboard.Width < wx)
  1267. {
  1268. numberKeyboard.Left = -point.X;
  1269. }
  1270. else
  1271. {
  1272. numberKeyboard.Left = -point.X - (numberKeyboard.Width - control.ActualWidth);
  1273. }
  1274. if ((bool)numberKeyboard.ShowDialog())
  1275. return numberKeyboard.ValueString;
  1276. else
  1277. return "Cancel";
  1278. }
  1279. private string SplitTemperatureControlMode(string str)
  1280. {
  1281. if (string.IsNullOrEmpty(str))
  1282. {
  1283. return str;
  1284. }
  1285. if (str.Contains("Profile("))
  1286. {
  1287. return str.Replace("Profile(", "").Replace(")", "").Replace(",", ":");
  1288. }
  1289. return str;
  1290. }
  1291. public void TempTextClick(string type, object sender)
  1292. {
  1293. switch (type)
  1294. {
  1295. case "Mode":
  1296. RecipeTempModeViewModel recipeTempModeViewModel = new RecipeTempModeViewModel();
  1297. recipeTempModeViewModel.SelectBtnName = SelectBtnName;
  1298. recipeTempModeViewModel.IsManualSet = true;
  1299. recipeTempModeViewModel.SelectProfileTable = SplitTemperatureControlMode(TemperatureControlMode);
  1300. var rtn = (wm as WindowManager)?.ShowDialogWithTitle(recipeTempModeViewModel, null, "Temp Mode");
  1301. if ((bool)rtn)
  1302. {
  1303. SelectBtnName = recipeTempModeViewModel.SelectBtnName;
  1304. if (null != recipeTempModeViewModel && !string.IsNullOrEmpty(recipeTempModeViewModel.ResultString) && recipeTempModeViewModel.ResultString.Contains("Profile"))
  1305. {
  1306. SelectBtnName = "Profile";
  1307. }
  1308. if (!string.IsNullOrEmpty(recipeTempModeViewModel.ResultString) && recipeTempModeViewModel.ResultString.Contains("Profile(,"))
  1309. {
  1310. recipeTempModeViewModel.ResultString = recipeTempModeViewModel.ResultString.Replace("Profile(,", "Profile(");
  1311. }
  1312. TemperatureControlMode = recipeTempModeViewModel.ResultString;
  1313. }
  1314. break;
  1315. case "Correct":
  1316. TempCorrectionEditViewModel tempCorrectionEditViewModel = new TempCorrectionEditViewModel();
  1317. tempCorrectionEditViewModel.ResultString = TemperatureCorrect;
  1318. tempCorrectionEditViewModel.IsManualSet = true;
  1319. //tempCorrectionEditViewModel.SelectedRecipeStep = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
  1320. tempCorrectionEditViewModel.IsEnabledControl = false;
  1321. tempCorrectionEditViewModel.AutoSelectVisibility = Visibility.Visible;
  1322. // tempOffsetTableViewModel.SelectedRecipeStep = SelectedRecipeStep;
  1323. rtn = (wm as WindowManager)?.ShowDialogWithTitle(tempCorrectionEditViewModel, null, "Temp Correct Table");
  1324. if ((bool)rtn)
  1325. {
  1326. TemperatureCorrect = tempCorrectionEditViewModel.ResultString;
  1327. }
  1328. break;
  1329. case "PID":
  1330. TempOffsetTableViewModel tempOffsetTableViewModel1 = new TempOffsetTableViewModel();
  1331. tempOffsetTableViewModel1.CboAutoSelectChecked = false;
  1332. tempOffsetTableViewModel1.IsEnabledControl = false;
  1333. tempOffsetTableViewModel1.IsManualSet = true;
  1334. tempOffsetTableViewModel1.TempOffsetTableSelected = TemperaturePID;
  1335. rtn = (wm as WindowManager)?.ShowDialogWithTitle(tempOffsetTableViewModel1, null, "Temp PID Table");
  1336. if ((bool)rtn)
  1337. {
  1338. TemperaturePID = tempOffsetTableViewModel1.TempOffsetTableSelected;
  1339. }
  1340. break;
  1341. default:
  1342. break;
  1343. }
  1344. }
  1345. private ObservableCollection<AUXData> _aUXDatas;
  1346. public void StepEdit(object cmdName, object value)
  1347. {
  1348. switch ((string)cmdName)
  1349. {
  1350. case "GASSetting":
  1351. RecipeMFCSettingViewModel recipeMFCSettingViewModel = new RecipeMFCSettingViewModel();
  1352. //InvokeClient.Instance.Service.DoOperation($"PM1.SetSensorRecipeOK", "");
  1353. //var tempMFCSets = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().MFCSets;
  1354. //if (tempMFCSets != null && tempMFCSets.Count > 0)
  1355. //{
  1356. // foreach (var item in tempMFCSets.Keys)
  1357. // {
  1358. // if (recipeMFCSettingViewModel.MFCSets.ContainsKey(item))
  1359. // {
  1360. // recipeMFCSettingViewModel.MFCSets[item] = tempMFCSets[item];
  1361. // }
  1362. // else
  1363. // {
  1364. // //recipeGASSettingViewModel.MFCSets.Add(item, tempMFCSets[item]);
  1365. // 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 });
  1366. // }
  1367. // }
  1368. //}
  1369. ////recipeGASSettingViewModel.MFMSets = new MFMValue() { AlarmValue = tempMFMSets.AlarmValue, IsNotifying = tempMFMSets.IsNotifying, Name = tempMFMSets.Name, Value = tempMFMSets.Value };
  1370. //recipeMFCSettingViewModel.RecipeType = RecipeType;
  1371. //recipeMFCSettingViewModel.RecipeTemplate = RecipeTemplate;
  1372. //if (!(bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeMFCSettingViewModel, null, "MFC Detail"))
  1373. //{
  1374. // //InvokeClient.Instance.Service.DoOperation($"PM1.SetSensorPROCManualOK", "");
  1375. // return;
  1376. //}
  1377. ////InvokeClient.Instance.Service.DoOperation($"PM1.SetSensorPROCManualOK", "");
  1378. //if (CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().MFCSets != null)
  1379. //{
  1380. // if (recipeMFCSettingViewModel.MFCSets != null && recipeMFCSettingViewModel.MFCSets.Count > 0)
  1381. // {
  1382. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().MFCSets = recipeMFCSettingViewModel.MFCSets;
  1383. // }
  1384. //}
  1385. break;
  1386. case "PressureSetting":
  1387. RecipePressureSettingViewModel recipePressureSettingViewModel = new RecipePressureSettingViewModel();
  1388. //var tempStep = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
  1389. //recipePressureSettingViewModel.PressureSonsorValue = tempStep.PressureSonserValue;
  1390. //recipePressureSettingViewModel.PressureValveAngleValue = tempStep.PressureValveAngle;
  1391. //recipePressureSettingViewModel.PressureSettingVG = tempStep.PressureSettingVG;
  1392. //if (!string.IsNullOrEmpty(tempStep.PressureAlarmTableNo))
  1393. //{
  1394. // if (tempStep.PressureAlarmTableNo.ToLower() == "none")
  1395. // recipePressureSettingViewModel.PressureAlarmWatchTable = "None";
  1396. // else
  1397. // recipePressureSettingViewModel.PressureAlarmWatchTable = tempStep.PressureAlarmTableNo;
  1398. //}
  1399. //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipePressureSettingViewModel, null, "Recipe Pressure Setting"))
  1400. //{
  1401. // if (CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault() != null)
  1402. // {
  1403. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PressureSonserValue = recipePressureSettingViewModel.PressureSonsorValue;
  1404. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PressureValveAngle = recipePressureSettingViewModel.PressureValveAngleValue;
  1405. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PressureAlarmTableNo = recipePressureSettingViewModel.PressureAlarmWatchTable;
  1406. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PressureSettingVG = recipePressureSettingViewModel.PressureSettingVG;
  1407. // SelectedRecipeStep.PressureSonserValue = $"{recipePressureSettingViewModel.PressureSonsorValue}";
  1408. // }
  1409. //}
  1410. break;
  1411. case "RFSetting":
  1412. //RecipeRFPressureSettingViewModel recipeRFPressureSettingViewModel = new RecipeRFPressureSettingViewModel();
  1413. //var tempRecipeStep = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
  1414. //recipeRFPressureSettingViewModel.RFSwitch = tempRecipeStep.RFSwitch;
  1415. //recipeRFPressureSettingViewModel.RFSetPointValue = tempRecipeStep.RFSetpoint;
  1416. //recipeRFPressureSettingViewModel.C1SetPointValue = tempRecipeStep.C1Setpoint;
  1417. //recipeRFPressureSettingViewModel.C2SetPointValue = tempRecipeStep.C2Setpoint;
  1418. //recipeRFPressureSettingViewModel.ForwardPowerAlarmWatchSetPointValue = tempRecipeStep.ForwardPowerAlarmWatchTable;
  1419. //recipeRFPressureSettingViewModel.PrAlarmWatchSetPointValue = tempRecipeStep.PrAlarmWatchTable;
  1420. //recipeRFPressureSettingViewModel.PIAlarmWatchSetPointValue = tempRecipeStep.PIAlarmWatchTable;
  1421. //recipeRFPressureSettingViewModel.C1AlarmWatchSetPointValue = tempRecipeStep.C1AlarmWatchTable;
  1422. //recipeRFPressureSettingViewModel.C2AlarmWatchSetPointValue = tempRecipeStep.C2AlarmWatchTable;
  1423. //recipeRFPressureSettingViewModel.VppAlarmWatchSetPointValue = tempRecipeStep.VppAlarmWatchTable;
  1424. //recipeRFPressureSettingViewModel.VdcAlarmWatchSetPointValue = tempRecipeStep.VdcAlarmWatchTable;
  1425. //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeRFPressureSettingViewModel, null, "Recipe RF Setting"))
  1426. //{
  1427. // if (CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault() != null)
  1428. // {
  1429. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().RFSwitch = recipeRFPressureSettingViewModel.RFSwitch;
  1430. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().RFSetpoint = recipeRFPressureSettingViewModel.RFSetPointValue;
  1431. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().C1Setpoint = recipeRFPressureSettingViewModel.C1SetPointValue;
  1432. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().C2Setpoint = recipeRFPressureSettingViewModel.C2SetPointValue;
  1433. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ForwardPowerAlarmWatchTable = recipeRFPressureSettingViewModel.ForwardPowerAlarmWatchSetPointValue;
  1434. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PrAlarmWatchTable = recipeRFPressureSettingViewModel.PrAlarmWatchSetPointValue;
  1435. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PIAlarmWatchTable = recipeRFPressureSettingViewModel.PIAlarmWatchSetPointValue;
  1436. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().C1AlarmWatchTable = recipeRFPressureSettingViewModel.C1AlarmWatchSetPointValue;
  1437. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().C2AlarmWatchTable = recipeRFPressureSettingViewModel.C2AlarmWatchSetPointValue;
  1438. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().VppAlarmWatchTable = recipeRFPressureSettingViewModel.VppAlarmWatchSetPointValue;
  1439. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().VdcAlarmWatchTable = recipeRFPressureSettingViewModel.VdcAlarmWatchSetPointValue;
  1440. // // SelectedRecipeStep.RFSetting = $"{recipeRFPressureSettingViewModel.RFSetPointValue}";
  1441. // }
  1442. //}
  1443. break;
  1444. case "Loader":
  1445. RecipeLoaderCommandViewModel recipeLoaderCommandViewModel = new RecipeLoaderCommandViewModel();
  1446. recipeLoaderCommandViewModel.SetRecipeProcessEditViewEnable = false;
  1447. if ((bool)(wm as WindowManager)?.ShowDialogWithTitle(recipeLoaderCommandViewModel, null, "Loader Command"))
  1448. {
  1449. ClearLoaderSetValue();
  1450. LoaderCommand = recipeLoaderCommandViewModel.ReturnString;
  1451. SetShowLoaderValuePanel(recipeLoaderCommandViewModel.ReturnString);
  1452. }
  1453. break;
  1454. case "Pressure":
  1455. ManualPressCommandViewModel recipePressCommandViewModel = new ManualPressCommandViewModel();
  1456. recipePressCommandViewModel.SetRecipeProcessEditViewEnable = false;
  1457. recipePressCommandViewModel.SelectedCmd = PressCommand;
  1458. if ((bool)(wm as WindowManager)?.ShowDialogWithTitle(recipePressCommandViewModel, null, "Press Command"))
  1459. {
  1460. DefaultUnit = recipePressCommandViewModel.DefaultUnit;
  1461. string returnString = recipePressCommandViewModel.ReturnString;
  1462. PressCommand = returnString;
  1463. SetShowPressPanel(returnString);
  1464. }
  1465. break;
  1466. case "Pattern":
  1467. RecipeGasPanelSettingViewModel recipeGasPanelSettingViewModel = new RecipeGasPanelSettingViewModel();
  1468. //recipeGasPanelSettingViewModel.CurrentRecipe = CurrentRecipe;
  1469. //recipeGasPanelSettingViewModel.SelectedStepName = $"{SelectedRecipeStep.StepNo}:{SelectedRecipeStep.Name}";
  1470. //recipeGasPanelSettingViewModel.ChangedStepEvent += RecipeGasPanelSettingViewModel_ChangedStepEvent;
  1471. //recipeGasPanelSettingViewModel.SelectedStep = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
  1472. if ((bool)(wm as WindowManager)?.ShowDialogWithTitle(recipeGasPanelSettingViewModel, null, "Valve"))
  1473. {
  1474. }
  1475. break;
  1476. case "BoatElevatorSetting":
  1477. BoatElevatorSettingViewModel boatElevatorSettingViewModel = new BoatElevatorSettingViewModel();
  1478. //boatElevatorSettingViewModel.SelectedRecipeStep = SelectedRecipeStep;
  1479. //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(boatElevatorSettingViewModel, null, "BoatElevator Setting"))
  1480. //{
  1481. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ZAxisPosition = boatElevatorSettingViewModel.SelectedRecipeStep.ZAxisPosition;
  1482. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ZAxisSpeed = boatElevatorSettingViewModel.SelectedRecipeStep.ZAxisSpeed;
  1483. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().RotatePosition = boatElevatorSettingViewModel.SelectedRecipeStep.RotatePosition;
  1484. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().RotateSpeed = boatElevatorSettingViewModel.SelectedRecipeStep.RotateSpeed;
  1485. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().RotateInterval = boatElevatorSettingViewModel.SelectedRecipeStep.RotateInterval;
  1486. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().RotateDirection = boatElevatorSettingViewModel.SelectedRecipeStep.RotateDirection;
  1487. //}
  1488. break;
  1489. case "AUX":
  1490. RecipeAUXSetViewModel recipeAUXSetViewModel = new RecipeAUXSetViewModel();
  1491. if (_aUXDatas != null && _aUXDatas.Count > 0)
  1492. {
  1493. recipeAUXSetViewModel.AUXDataList.Clear();
  1494. _aUXDatas.ToList().ForEach(x => recipeAUXSetViewModel.AUXDataList.Add(x));
  1495. }
  1496. else
  1497. {
  1498. int i = 1;
  1499. recipeAUXSetViewModel.AUXDataList.Clear();
  1500. foreach (var item in AUXDetailDatas)
  1501. {
  1502. var tempAux = new AUXData();
  1503. tempAux.No = i;
  1504. tempAux.ControlName = i.ToString();
  1505. tempAux.DisplayName = item.DisplayName;
  1506. tempAux.SetValue = new DoubleParam() { Name = "SetValue", Value = item.SetPoint.ToString() };
  1507. tempAux.IsCheck = new BoolParam() { Name = "IsCheck", Value = false };
  1508. tempAux.MaxValue = new DoubleParam() { Name = "MaxValue", Value = item.WarningHighLimit.ToString() };
  1509. tempAux.MinValue = new DoubleParam() { Name = "MinValue", Value = item.WarningLowLimit.ToString() };
  1510. tempAux.SetUnit = new StringParam() { Name = "SetUnit", Value = item.Unit };
  1511. recipeAUXSetViewModel.AUXDataList.Add(tempAux);
  1512. i++;
  1513. }
  1514. }
  1515. if ((bool)(wm as WindowManager)?.ShowDialogWithTitle(recipeAUXSetViewModel, null, "AUX Set"))
  1516. {
  1517. _aUXDatas = recipeAUXSetViewModel.AUXDataList;
  1518. }
  1519. break;
  1520. case "RecipeHeader":
  1521. RecipeHeaderViewModel recipeHeaderViewModel = new RecipeHeaderViewModel();
  1522. if ((bool)(wm as WindowManager)?.ShowDialogWithTitle(recipeHeaderViewModel, null, "Recipe Header"))
  1523. {
  1524. }
  1525. break;
  1526. case "Combination":
  1527. //StringParam strCombination = CurrentRecipe.ConfigItems.FirstOrDefault(x => x.Name == "Combination") as StringParam;
  1528. //RecipeCombinationViewModel recipeCombinationViewModel = new RecipeCombinationViewModel();
  1529. //recipeCombinationViewModel.CombinationStr = strCombination.Value;
  1530. //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeCombinationViewModel, null, "Combination"))
  1531. //{
  1532. // strCombination.Value = recipeCombinationViewModel.Combination.ToString();
  1533. //}
  1534. break;
  1535. case "VPDataList":
  1536. RecipeVPItemSelectViewModel recipeVPItemSelectViewModel = new RecipeVPItemSelectViewModel();
  1537. if ((bool)(wm as WindowManager)?.ShowDialogWithTitle(recipeVPItemSelectViewModel, null, "VP Item Select"))
  1538. {
  1539. }
  1540. break;
  1541. case "SkipOrWait":
  1542. RecipeSkipWaitCommandViewModel recipeSkipWaitCommandViewModel = new RecipeSkipWaitCommandViewModel();
  1543. //recipeSkipWaitCommandViewModel.SkipWait = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().SkipWait;
  1544. //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeSkipWaitCommandViewModel, null, "Skip or wait command"))
  1545. //{
  1546. // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().SkipWait = recipeSkipWaitCommandViewModel.RtnString;
  1547. // SelectedRecipeStep.SkipWait = recipeSkipWaitCommandViewModel.RtnString;
  1548. //}
  1549. break;
  1550. default:
  1551. break;
  1552. }
  1553. }
  1554. public void MFCTextChanged(string type, object sender, object item)
  1555. {
  1556. BrushConverter brushConverter = new BrushConverter();
  1557. try
  1558. {
  1559. if (!string.IsNullOrEmpty(type) && item != null && sender != null)
  1560. {
  1561. MFCGasData mFCData = (MFCGasData)item;
  1562. string value = ((TextBox)sender).Text;
  1563. string proStr = $"{mFCData.Name}Data";
  1564. Type type1 = typeof(ManualSetViewModel);
  1565. PropertyInfo property = type1.GetProperty(proStr);
  1566. if (property == null) return;
  1567. AITMfcData aITMfcData = (AITMfcData)property.GetValue(this);
  1568. double setValue = 0;
  1569. double.TryParse(value, out setValue);
  1570. var maxData = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{mFCData.Name}.N2Scale");
  1571. if (setValue > maxData && type == "Value")
  1572. {
  1573. DialogBox.ShowWarning($"{mFCData.Name} Out of the setting range {0}~{maxData}!");
  1574. ((TextBoxEx)sender).ChangedColor = ((TextBoxEx)sender).NormalColor;
  1575. ((TextBoxEx)sender).Text = $"0";
  1576. return;
  1577. }
  1578. switch (type)
  1579. {
  1580. case "Value":
  1581. mFCData.Value = value;
  1582. if (setValue != aITMfcData.SetPoint)
  1583. {
  1584. ((TextBoxEx)sender).ChangedColor = (Brush)brushConverter.ConvertFromString("Yellow");
  1585. mFCData.IsSetChanged = false;
  1586. }
  1587. else
  1588. {
  1589. // mFCData.IsSetChanged = true;
  1590. }
  1591. break;
  1592. case "Rampng":
  1593. mFCData.Rampng = value;
  1594. if (setValue != aITMfcData.Ramping)
  1595. {
  1596. mFCData.IsRampngChanged = false;
  1597. }
  1598. else
  1599. {
  1600. // mFCData.IsRampngChanged = true;
  1601. }
  1602. break;
  1603. default:
  1604. break;
  1605. }
  1606. }
  1607. }
  1608. catch (Exception ex)
  1609. {
  1610. LOG.Write(ex);
  1611. }
  1612. }
  1613. public void TempTextChanged(string type, object sender, object item)
  1614. {
  1615. try
  1616. {
  1617. if (!string.IsNullOrEmpty(type) && item != null && sender != null)
  1618. {
  1619. TempManualSetData tempData = (TempManualSetData)item;
  1620. string value = ((TextBox)sender).Text;
  1621. string proStr = tempData.ControlName;
  1622. Type type1 = typeof(ManualSetViewModel);
  1623. PropertyInfo property = type1.GetProperty(proStr);
  1624. if (property == null) return;
  1625. AITHeaterData aITHeaterData = (AITHeaterData)property.GetValue(this);
  1626. double setValue = 0;
  1627. double.TryParse(value, out setValue);
  1628. switch (type)
  1629. {
  1630. case "Value":
  1631. tempData.Value = value;
  1632. if (setValue != aITHeaterData.SetPoint)
  1633. {
  1634. tempData.IsSetChanged = false;
  1635. }
  1636. else
  1637. {
  1638. // tempData.IsSetChanged = false;
  1639. }
  1640. break;
  1641. case "Ramp":
  1642. tempData.Rampng = value;
  1643. if (setValue != aITHeaterData.RampSetPoint)
  1644. {
  1645. tempData.IsRampngChanged = false;
  1646. }
  1647. else
  1648. {
  1649. // tempData.IsRampngChanged = false;
  1650. }
  1651. break;
  1652. default:
  1653. break;
  1654. }
  1655. }
  1656. }
  1657. catch (Exception ex)
  1658. {
  1659. LOG.Write(ex);
  1660. }
  1661. }
  1662. private string oldPressStr = "";
  1663. public void Exec()
  1664. {
  1665. if (!DialogBox.Confirm("Are you sure to execute?"))
  1666. return;
  1667. if (DictValve != null && DictValve.Count > 0)
  1668. {
  1669. InvokeClient.Instance.Service.DoOperation($"PM1.SetAll{AITValveOperation.GVTurnValve}", DictValve);
  1670. }
  1671. if (MFCDataList != null && MFCDataList.Count() > 0)
  1672. {
  1673. Dictionary<string, string> setChangedMFC = new Dictionary<string, string>();
  1674. var changedList = MFCDataList.ToList().Where(x => !x.IsSetChanged);
  1675. foreach (var item in changedList)
  1676. {
  1677. setChangedMFC.Add(item.Name, item.Value);
  1678. }
  1679. InvokeClient.Instance.Service.DoOperation($"PM1.SetAllMfcValue", setChangedMFC);
  1680. MFCDataList.ToList().ForEach(x =>
  1681. {
  1682. if (!x.IsSetChanged)
  1683. {
  1684. // InvokeClient.Instance.Service.DoOperation($"PM1.{x.DisplayName}.SetMfcValue", $"{x.Value};{x.Rampng};{x.AlarmValue}");
  1685. InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"PM1.MFC.{x.DisplayName}.SetLastPoint", x.Value);
  1686. x.IsSetChanged = true;
  1687. }
  1688. if (!x.IsRampngChanged)
  1689. {
  1690. InvokeClient.Instance.Service.DoOperation($"PM1.{x.DisplayName}.SetMfcValue", $"{x.Value};{x.Rampng};{x.AlarmValue}");
  1691. InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"PM1.MFC.{x.DisplayName}.SetLastRamping", x.Rampng);
  1692. x.IsRampngChanged = true;
  1693. }
  1694. });
  1695. }
  1696. var pressStr = GetPressString();
  1697. if (oldPressStr != pressStr || (DictValve != null && DictValve.ContainsKey("ValveAV71")))
  1698. {
  1699. if ((CheckIsChanged(pressStr) && pressStr != ";;;") || (DictValve != null && DictValve.ContainsKey("ValveAV71")))
  1700. {
  1701. if (DictValve != null && DictValve.ContainsKey("ValveAV71"))
  1702. InvokeClient.Instance.Service.DoOperation($"PM1.APC.SetManualParameters", $"{pressStr};{DictValve["ValveAV71"]}");
  1703. else
  1704. InvokeClient.Instance.Service.DoOperation($"PM1.APC.SetManualParameters", $"{pressStr}");
  1705. }
  1706. }
  1707. OldPressCommand = PressCommand;
  1708. oldPressStr = pressStr;
  1709. if (HeaterUData.CorrectTable != TemperatureCorrect || HeaterUData.PIDTable != TemperaturePID || HeaterUData.ControlModeSetpoint != TemperatureControlMode)
  1710. {
  1711. string[] tempPra = new string[] { TemperatureControlMode, TemperatureCorrect, TemperaturePID };
  1712. InvokeClient.Instance.Service.DoOperation("PM1.Heater.SetParameters", string.Join(";", tempPra));
  1713. }
  1714. if (TempList != null && TempList.Count() > 0)
  1715. {
  1716. TempList.ToList().ForEach(x =>
  1717. {
  1718. if (!x.IsRampngChanged || !x.IsSetChanged)
  1719. {
  1720. InvokeClient.Instance.Service.DoOperation($"System.{x.Name}.SetManualParameters", $"{x.Value};{x.Rampng}");
  1721. if (!x.IsSetChanged)
  1722. {
  1723. InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"PM1.Heater.{x.Name}.SetLastPoint", x.Value);
  1724. }
  1725. if (!x.IsRampngChanged)
  1726. {
  1727. InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"PM1.Heater.{x.Name}.SetLastRamping", x.Rampng);
  1728. }
  1729. x.IsSetChanged = true;
  1730. x.IsRampngChanged = true;
  1731. }
  1732. });
  1733. }
  1734. if (!string.IsNullOrEmpty(LoaderCommand))
  1735. {
  1736. if (OldLoaderCommand != LoaderCommand)
  1737. {
  1738. InvokeClient.Instance.Service.DoOperation("PM1.SetBoatManualMotion", GetSaveLoaderValue(LoaderCommand));
  1739. }
  1740. OldLoaderCommand = LoaderCommand;
  1741. }
  1742. if (PumpSetValues.Count > 0)
  1743. {
  1744. PumpSetValues.ToList().ForEach(x => InvokeClient.Instance.Service.DoOperation($"{x.Key}.{AITValveOperation.GVTurnValve}", x.Value));
  1745. }
  1746. if (F2HFClnOrHFCl2Values.Count > 0)
  1747. {
  1748. F2HFClnOrHFCl2Values.ToList().ForEach(x => InvokeClient.Instance.Service.DoOperation(x.Key, x.Value));
  1749. }
  1750. }
  1751. private bool CheckIsChanged(string value)
  1752. {
  1753. string[] strList = value.Split(';');
  1754. if (APCData.CommandSetPoint != strList[0])
  1755. {
  1756. return true;
  1757. }
  1758. if (APCData.PIDTable != strList[1])
  1759. {
  1760. return true;
  1761. }
  1762. float.TryParse(strList[2], out float set);
  1763. if (APCData.SetPoint != set)
  1764. {
  1765. return true;
  1766. }
  1767. if (APCData.LowPressWaitSetPoint != strList[3])
  1768. {
  1769. return true;
  1770. }
  1771. return false;
  1772. }
  1773. public List<ConfigNode> GetMfcItem()
  1774. {
  1775. this.SystemName = "System";
  1776. ConfigNodes = SystemConfigProvider.Instance.GetConfigTree(SystemName).SubNodes;
  1777. var MfcItems = ConfigNodes.Where(x => x.Display == "Parameter").FirstOrDefault().SubNodes.Where(y => y.Name == "MFC").FirstOrDefault().SubNodes;
  1778. return MfcItems;
  1779. }
  1780. public void RecipeCancel()
  1781. {
  1782. if (DialogBox.ShowDialog(DialogButton.Yes | DialogButton.No, DialogType.CONFIRM, " You confirm that you want to unsave the recipe and exit the interface?") == DialogButton.No)
  1783. {
  1784. return;
  1785. }
  1786. else
  1787. {
  1788. UpdateGASSetting(true);
  1789. UpdateHeaterSetting();
  1790. ClearSetValue();
  1791. }
  1792. // ((Window)GetView()).Close();
  1793. }
  1794. public void PressPIDChick()
  1795. {
  1796. var windowManager = IoC.Get<IWindowManager>();
  1797. var defaultAPCPID = SystemConfigProvider.Instance.GetValueByName("PM1.APCPID");
  1798. if (string.IsNullOrEmpty(defaultAPCPID))
  1799. {
  1800. DialogBox.ShowDialog(DialogButton.Cancel, DialogType.INFO, "Please set the default file first");
  1801. return;
  1802. }
  1803. int last = defaultAPCPID.LastIndexOf('\\');
  1804. var pix = defaultAPCPID.Substring(0, last);
  1805. var file = defaultAPCPID.Substring(last + 1, defaultAPCPID.Length - last - 1);
  1806. APCPIDEditViewModel aPCPIDEditViewModel = new APCPIDEditViewModel(pix, file);
  1807. aPCPIDEditViewModel.IsEditEnabled = false;
  1808. var rtn = (windowManager as WindowManager)?.ShowDialogWithTitle(aPCPIDEditViewModel, null, "APC PID Table");
  1809. if ((bool)rtn)
  1810. {
  1811. PressPID = aPCPIDEditViewModel.RetrunString;
  1812. }
  1813. }
  1814. private bool firstUpdate = true;
  1815. private void ClearSetValue()
  1816. {
  1817. TemperatureControlMode = "";
  1818. TemperatureCorrect = "";
  1819. TemperaturePID = "";
  1820. ClearLoaderSetValue();
  1821. LoaderCommand = "";
  1822. SetShowLoaderValuePanel("None");
  1823. PressCommand = "";
  1824. SetShowPressPanel("None");
  1825. }
  1826. protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
  1827. {
  1828. base.InvokeAfterUpdateProperty(data);
  1829. if (firstUpdate)
  1830. {
  1831. UpdateGASSetting(false);
  1832. UpdateHeaterSetting();
  1833. firstUpdate = false;
  1834. }
  1835. }
  1836. private void UpdateGASSetting(bool upDataMfcSetPoint)
  1837. {
  1838. List<AITMfcData> allmfcDatas = new List<AITMfcData>()
  1839. {
  1840. MFC1Data,
  1841. MFC2Data,
  1842. MFC3Data,
  1843. MFC4Data,
  1844. MFC5Data,
  1845. MFC6Data,
  1846. MFC7Data,
  1847. MFC8Data,
  1848. MFC9Data,
  1849. MFC10Data,
  1850. MFC11Data,
  1851. MFC12Data,
  1852. MFC13Data,
  1853. MFC14Data,
  1854. MFC15Data,
  1855. MFC16Data,
  1856. MFC17Data,
  1857. MFC31Data,
  1858. MFC32Data,
  1859. MFC51Data,
  1860. };
  1861. List<AITMfcData> mfcDatas = new List<AITMfcData>()
  1862. {
  1863. };
  1864. foreach (var item in allmfcDatas)
  1865. {
  1866. if (item != null)
  1867. {
  1868. mfcDatas.Add(item);
  1869. }
  1870. }
  1871. if (MFCDataList.Count == 0)
  1872. {
  1873. for (int i = 0; i < mfcDatas.Count; i++)
  1874. {
  1875. if (mfcDatas[i] == null)
  1876. continue;
  1877. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{mfcDatas[i].DeviceName}.SetLastPoint");
  1878. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{mfcDatas[i].DeviceName}.SetLastRamping");
  1879. //MFCDataList.Add(new MFCGasData()
  1880. //{
  1881. // Name = mfcDatas[i].DeviceName,
  1882. // DisplayName = mfcDatas[i].DisplayName,
  1883. // ActualValue = mfcDatas[i].FeedBack,
  1884. // Value = mfcDatas[i].SetPoint,
  1885. // ActualRampng = mfcDatas[i].Ramping,
  1886. // Rampng = mfcDatas[i].VirtualRamping,
  1887. // Unit = mfcDatas[i].Unit,
  1888. // AlarmValue = mfcDatas[i].AlarmWatchTable
  1889. //});
  1890. MFCDataList.Add(new MFCGasData()
  1891. {
  1892. Name = mfcDatas[i].DeviceName,
  1893. DisplayName = mfcDatas[i].DisplayName,
  1894. //ActualValue = mfcDatas[i].FeedBack,
  1895. Value = setLastPoint.ToString("f3"),
  1896. //ActualRampng = mfcDatas[i].Ramping,
  1897. Rampng = setLastRamping.ToString("f3"),
  1898. IsSetChanged = true,
  1899. Unit = mfcDatas[i].Unit,
  1900. AlarmValue = mfcDatas[i].AlarmWatchTable
  1901. });
  1902. }
  1903. }
  1904. else
  1905. {
  1906. for (int i = 0; i < MFCDataList.Count; i++)
  1907. {
  1908. var findMFC = mfcDatas.FirstOrDefault(x => x.DeviceName == MFCDataList[i].Name);
  1909. if (findMFC != null)
  1910. {
  1911. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{findMFC.DeviceName}.SetLastPoint");
  1912. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{findMFC.DeviceName}.SetLastRamping");
  1913. MFCDataList[i].Value = setLastPoint.ToString("f3");
  1914. MFCDataList[i].IsSetChanged = true;
  1915. MFCDataList[i].Rampng = setLastRamping.ToString("f3");
  1916. }
  1917. };
  1918. }
  1919. if (MFCDataList != null && MFCDataList.Count > 0)
  1920. {
  1921. if (upDataMfcSetPoint)
  1922. {
  1923. Dictionary<string, string> setChangedMFC = new Dictionary<string, string>();
  1924. foreach (var item in MFCDataList)
  1925. {
  1926. setChangedMFC.Add(item.Name, item.Value);
  1927. }
  1928. InvokeClient.Instance.Service.DoOperation($"PM1.SetAllMfcSetPoint", setChangedMFC);
  1929. }
  1930. }
  1931. }
  1932. private void UpdateHeaterSetting()
  1933. {
  1934. if ((HeaterUData != null && HeaterCUData != null && HeaterCData != null && HeaterCLData != null && HeaterLData != null))
  1935. {
  1936. List<AITHeaterData> heaterDatas = new List<AITHeaterData>()
  1937. {
  1938. HeaterUData,
  1939. HeaterCUData,
  1940. HeaterCData,
  1941. HeaterCLData,
  1942. HeaterLData,
  1943. };
  1944. if (TempList.Count == 0)
  1945. {
  1946. string[] strList = new string[5] { "BottomHeaterData", "CenterBottomHeaterData", "CenterHeaterData", "TopCenterHeaterData", "HeaterUData" };
  1947. for (int i = 0; i < heaterDatas.Count; i++)
  1948. {
  1949. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.Heater.{heaterDatas[i].DeviceName}.SetLastPoint");
  1950. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.Heater.{heaterDatas[i].DeviceName}.SetLastRamping");
  1951. //TempList.Add(new TempManualSetData()
  1952. //{
  1953. // DisplayName = heaterDatas[i].DisplayName,
  1954. // Name = heaterDatas[i].DeviceName,
  1955. // ControlName = strList[i],
  1956. // ActualValue = heaterDatas[i].FeedBack,
  1957. // Value = heaterDatas[i].SetPoint,
  1958. // ActualRampng = heaterDatas[i].Ramping,
  1959. // Rampng = heaterDatas[i].UpRateSetPoint,
  1960. // Unit = heaterDatas[i].Unit,
  1961. //});
  1962. TempList.Add(new TempManualSetData()
  1963. {
  1964. DisplayName = heaterDatas[i].DisplayName,
  1965. Name = heaterDatas[i].DeviceName,
  1966. ControlName = strList[i],
  1967. Value = setLastPoint.ToString("f1"),
  1968. Rampng = setLastRamping.ToString("f1"),
  1969. Unit = heaterDatas[i].Unit,
  1970. });
  1971. }
  1972. }
  1973. else
  1974. {
  1975. for (int i = 0; i < TempList.Count; i++)
  1976. {
  1977. var findHeater = heaterDatas.FirstOrDefault(x => x.DeviceName == TempList[i].Name);
  1978. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.Heater.{findHeater.DeviceName}.SetLastPoint");
  1979. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.Heater.{findHeater.DeviceName}.SetLastRamping");
  1980. if (findHeater != null)
  1981. {
  1982. TempList[i].Value = setLastPoint.ToString("f1");
  1983. TempList[i].Rampng = setLastRamping.ToString("f1");
  1984. TempList[i].IsSetChanged = true;
  1985. TempList[i].IsRampngChanged = true;
  1986. }
  1987. };
  1988. }
  1989. }
  1990. }
  1991. public void SetValue(object sender, string isFullKeyboard = "")
  1992. {
  1993. string value = ((TextBox)sender).Text;
  1994. if (!string.IsNullOrEmpty(isFullKeyboard))
  1995. {
  1996. FullKeyboard fullKeyboard1 = new FullKeyboard("", value);
  1997. if ((bool)fullKeyboard1.ShowDialog())
  1998. {
  1999. ((TextBox)sender).Text = fullKeyboard1.ValueString;
  2000. }
  2001. }
  2002. else
  2003. {
  2004. NumberKeyboard fullKeyboard = new NumberKeyboard("", value);
  2005. if ((bool)fullKeyboard.ShowDialog())
  2006. {
  2007. ((TextBox)sender).Text = fullKeyboard.ValueString;
  2008. }
  2009. }
  2010. }
  2011. private string GetPressString()
  2012. {
  2013. string[] pressStringList = new string[4] { "", "", "", "" };
  2014. pressStringList[0] = PressCommand;
  2015. if (!string.IsNullOrEmpty(PressCommand))
  2016. {
  2017. switch (PressCommand)
  2018. {
  2019. case "Press":
  2020. case "Press2":
  2021. PressVisibility = Visibility.Visible;
  2022. pressStringList[1] = PressPID;
  2023. pressStringList[2] = PressSet.ToString();
  2024. break;
  2025. case "Slow Vac":
  2026. var defaultAPCPID = SystemConfigProvider.Instance.GetValueByName("PM1.APCPID");
  2027. pressStringList[1] = defaultAPCPID;
  2028. pressStringList[2] = PressSlowVacSet.ToString();
  2029. break;
  2030. case "Valve Angle":
  2031. pressStringList[2] = PressValveAngleSet.ToString();
  2032. pressStringList[3] = LowPressWait;
  2033. break;
  2034. case "Full Open":
  2035. case "Full Close":
  2036. case "Hold":
  2037. case "Zero Set":
  2038. case "Cancel Zero":
  2039. pressStringList[1] = "";
  2040. pressStringList[2] = "";
  2041. pressStringList[3] = "";
  2042. break;
  2043. case "WaitPressUp1":
  2044. case "WaitPressDown1":
  2045. case "WaitPressUp2":
  2046. case "WaitPressDown2":
  2047. pressStringList[2] = PressWait.ToString();
  2048. break;
  2049. default:
  2050. break;
  2051. }
  2052. }
  2053. return string.Join(";", pressStringList);
  2054. }
  2055. }
  2056. public class MFCGasData : PropertyChangedBase
  2057. {
  2058. private int _no;
  2059. public int No
  2060. {
  2061. get => _no;
  2062. set
  2063. {
  2064. _no = value;
  2065. NotifyOfPropertyChange(nameof(No));
  2066. }
  2067. }
  2068. private string _name;
  2069. public string Name
  2070. {
  2071. get => _name;
  2072. set
  2073. {
  2074. _name = value;
  2075. NotifyOfPropertyChange(nameof(Name));
  2076. }
  2077. }
  2078. public string _unit;
  2079. public string Unit
  2080. {
  2081. get => _unit;
  2082. set
  2083. {
  2084. _unit = value;
  2085. NotifyOfPropertyChange(nameof(Unit));
  2086. }
  2087. }
  2088. private string _displayName;
  2089. public string DisplayName
  2090. {
  2091. get => _displayName;
  2092. set
  2093. {
  2094. _displayName = value;
  2095. NotifyOfPropertyChange(nameof(DisplayName));
  2096. }
  2097. }
  2098. private string _controlName;
  2099. public string ControlName
  2100. {
  2101. get => _controlName;
  2102. set
  2103. {
  2104. _controlName = value;
  2105. NotifyOfPropertyChange(nameof(ControlName));
  2106. }
  2107. }
  2108. private double _actualValue;
  2109. public double ActualValue
  2110. {
  2111. get => _actualValue;
  2112. set
  2113. {
  2114. _actualValue = value;
  2115. NotifyOfPropertyChange(nameof(ActualValue));
  2116. }
  2117. }
  2118. private string _value;
  2119. public string Value
  2120. {
  2121. get => _value;
  2122. set
  2123. {
  2124. _value = value;
  2125. NotifyOfPropertyChange(nameof(Value));
  2126. }
  2127. }
  2128. private double _actualRampng;
  2129. public double ActualRampng
  2130. {
  2131. get => _actualRampng; set
  2132. {
  2133. _actualRampng = value;
  2134. NotifyOfPropertyChange(nameof(ActualRampng));
  2135. }
  2136. }
  2137. private string _rampng;
  2138. public string Rampng
  2139. {
  2140. get => _rampng; set
  2141. {
  2142. _rampng = value;
  2143. NotifyOfPropertyChange(nameof(Rampng));
  2144. }
  2145. }
  2146. private string _maxValue;
  2147. public string MaxValue
  2148. {
  2149. get => _maxValue; set
  2150. {
  2151. _maxValue = value;
  2152. NotifyOfPropertyChange(nameof(MaxValue));
  2153. }
  2154. }
  2155. private string _minValue;
  2156. public string MinValue
  2157. {
  2158. get => _minValue; set
  2159. {
  2160. _minValue = value;
  2161. NotifyOfPropertyChange(nameof(MinValue));
  2162. }
  2163. }
  2164. private bool _isSetChanged = true;
  2165. public bool IsSetChanged
  2166. {
  2167. get => _isSetChanged;
  2168. set
  2169. {
  2170. _isSetChanged = value;
  2171. NotifyOfPropertyChange(nameof(IsSetChanged));
  2172. }
  2173. }
  2174. private bool _isRampngChanged = true;
  2175. public bool IsRampngChanged
  2176. {
  2177. get => _isRampngChanged;
  2178. set
  2179. {
  2180. _isRampngChanged = value;
  2181. NotifyOfPropertyChange(nameof(IsRampngChanged));
  2182. }
  2183. }
  2184. private string _alarmValue;
  2185. public string AlarmValue
  2186. {
  2187. get => _alarmValue;
  2188. set
  2189. {
  2190. _alarmValue = value;
  2191. NotifyOfPropertyChange(nameof(AlarmValue));
  2192. }
  2193. }
  2194. }
  2195. public class TempManualSetData : PropertyChangedBase
  2196. {
  2197. private int _no;
  2198. public int No
  2199. {
  2200. get => _no;
  2201. set
  2202. {
  2203. _no = value;
  2204. NotifyOfPropertyChange("No");
  2205. }
  2206. }
  2207. private string _name;
  2208. public string Name
  2209. {
  2210. get => _name;
  2211. set
  2212. {
  2213. _name = value;
  2214. NotifyOfPropertyChange("Name");
  2215. }
  2216. }
  2217. private string _displayName;
  2218. public string DisplayName
  2219. {
  2220. get => _displayName;
  2221. set
  2222. {
  2223. _displayName = value;
  2224. NotifyOfPropertyChange(nameof(DisplayName));
  2225. }
  2226. }
  2227. private string _controlName;
  2228. public string ControlName
  2229. {
  2230. get => _controlName;
  2231. set
  2232. {
  2233. _controlName = value;
  2234. NotifyOfPropertyChange(nameof(ControlName));
  2235. }
  2236. }
  2237. private double _actualValue;
  2238. public double ActualValue
  2239. {
  2240. get => _actualValue;
  2241. set
  2242. {
  2243. _actualValue = value;
  2244. NotifyOfPropertyChange(nameof(ActualValue));
  2245. }
  2246. }
  2247. private string _value;
  2248. public string Value
  2249. {
  2250. get => _value;
  2251. set
  2252. {
  2253. _value = value;
  2254. NotifyOfPropertyChange(nameof(Value));
  2255. }
  2256. }
  2257. private string _actualRampng;
  2258. public string ActualRampng
  2259. {
  2260. get => _actualRampng;
  2261. set
  2262. {
  2263. _actualRampng = value;
  2264. NotifyOfPropertyChange(nameof(ActualRampng));
  2265. }
  2266. }
  2267. private string _rampng;
  2268. public string Rampng
  2269. {
  2270. get => _rampng; set
  2271. {
  2272. _rampng = value;
  2273. NotifyOfPropertyChange(nameof(Rampng));
  2274. }
  2275. }
  2276. private string _maxValue;
  2277. public string MaxValue
  2278. {
  2279. get => _maxValue; set
  2280. {
  2281. _maxValue = value;
  2282. NotifyOfPropertyChange(nameof(MaxValue));
  2283. }
  2284. }
  2285. private string _minValue;
  2286. public string MinValue
  2287. {
  2288. get => _minValue; set
  2289. {
  2290. _minValue = value;
  2291. NotifyOfPropertyChange(nameof(MinValue));
  2292. }
  2293. }
  2294. private bool _isChanged = true;
  2295. public bool IsChanged
  2296. {
  2297. get => _isChanged;
  2298. set
  2299. {
  2300. _isChanged = value;
  2301. NotifyOfPropertyChange(nameof(IsChanged));
  2302. }
  2303. }
  2304. private string _unit;
  2305. public string Unit
  2306. {
  2307. get => _unit;
  2308. set
  2309. {
  2310. _unit = value;
  2311. NotifyOfPropertyChange("Unit");
  2312. }
  2313. }
  2314. private bool _isSetChanged = true;
  2315. public bool IsSetChanged
  2316. {
  2317. get => _isSetChanged;
  2318. set
  2319. {
  2320. _isSetChanged = value;
  2321. NotifyOfPropertyChange(nameof(IsSetChanged));
  2322. }
  2323. }
  2324. private bool _isRampngChanged = true;
  2325. public bool IsRampngChanged
  2326. {
  2327. get => _isRampngChanged;
  2328. set
  2329. {
  2330. _isRampngChanged = value;
  2331. NotifyOfPropertyChange(nameof(IsRampngChanged));
  2332. }
  2333. }
  2334. private string _alarmValue;
  2335. public string AlarmValue
  2336. {
  2337. get => _alarmValue;
  2338. set
  2339. {
  2340. _alarmValue = value;
  2341. NotifyOfPropertyChange(nameof(AlarmValue));
  2342. }
  2343. }
  2344. }
  2345. }