ManualSetViewModel.cs 114 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585
  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. foreach (var item in MFCDataList)
  1675. {
  1676. setChangedMFC.Add(item.Name, item.Value);
  1677. }
  1678. InvokeClient.Instance.Service.DoOperation($"PM1.SetAllMfcValue", setChangedMFC);
  1679. MFCDataList.ToList().ForEach(x =>
  1680. {
  1681. if (!x.IsSetChanged)
  1682. {
  1683. // InvokeClient.Instance.Service.DoOperation($"PM1.{x.DisplayName}.SetMfcValue", $"{x.Value};{x.Rampng};{x.AlarmValue}");
  1684. InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"PM1.MFC.{x.DisplayName}.SetLastPoint", x.Value);
  1685. x.IsSetChanged = true;
  1686. }
  1687. if (!x.IsRampngChanged)
  1688. {
  1689. InvokeClient.Instance.Service.DoOperation($"PM1.{x.DisplayName}.SetMfcValue", $"{x.Value};{x.Rampng};{x.AlarmValue}");
  1690. InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"PM1.MFC.{x.DisplayName}.SetLastRamping", x.Rampng);
  1691. x.IsRampngChanged = true;
  1692. }
  1693. });
  1694. }
  1695. var pressStr = GetPressString();
  1696. if (oldPressStr != pressStr || (DictValve != null && DictValve.ContainsKey("ValveAV71")))
  1697. {
  1698. if ((CheckIsChanged(pressStr) && pressStr != ";;;") || (DictValve != null && DictValve.ContainsKey("ValveAV71")))
  1699. {
  1700. if (DictValve != null && DictValve.ContainsKey("ValveAV71"))
  1701. InvokeClient.Instance.Service.DoOperation($"PM1.APC.SetManualParameters", $"{pressStr};{DictValve["ValveAV71"]}");
  1702. else
  1703. InvokeClient.Instance.Service.DoOperation($"PM1.APC.SetManualParameters", $"{pressStr}");
  1704. }
  1705. }
  1706. OldPressCommand = PressCommand;
  1707. oldPressStr = pressStr;
  1708. if (HeaterUData.CorrectTable != TemperatureCorrect || HeaterUData.PIDTable != TemperaturePID || HeaterUData.ControlModeSetpoint != TemperatureControlMode)
  1709. {
  1710. string[] tempPra = new string[] { TemperatureControlMode, TemperatureCorrect, TemperaturePID };
  1711. InvokeClient.Instance.Service.DoOperation("PM1.Heater.SetParameters", string.Join(";", tempPra));
  1712. }
  1713. if (TempList != null && TempList.Count() > 0)
  1714. {
  1715. TempList.ToList().ForEach(x =>
  1716. {
  1717. if (!x.IsRampngChanged || !x.IsSetChanged)
  1718. {
  1719. InvokeClient.Instance.Service.DoOperation($"System.{x.Name}.SetManualParameters", $"{x.Value};{x.Rampng}");
  1720. if (!x.IsSetChanged)
  1721. {
  1722. InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"PM1.Heater.{x.Name}.SetLastPoint", x.Value);
  1723. }
  1724. if (!x.IsRampngChanged)
  1725. {
  1726. InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"PM1.Heater.{x.Name}.SetLastRamping", x.Rampng);
  1727. }
  1728. x.IsSetChanged = true;
  1729. x.IsRampngChanged = true;
  1730. }
  1731. });
  1732. }
  1733. if (!string.IsNullOrEmpty(LoaderCommand))
  1734. {
  1735. if (OldLoaderCommand != LoaderCommand)
  1736. {
  1737. InvokeClient.Instance.Service.DoOperation("PM1.SetBoatManualMotion", GetSaveLoaderValue(LoaderCommand));
  1738. }
  1739. OldLoaderCommand = LoaderCommand;
  1740. }
  1741. if (PumpSetValues.Count > 0)
  1742. {
  1743. PumpSetValues.ToList().ForEach(x => InvokeClient.Instance.Service.DoOperation($"{x.Key}.{AITValveOperation.GVTurnValve}", x.Value));
  1744. }
  1745. if (F2HFClnOrHFCl2Values.Count > 0)
  1746. {
  1747. F2HFClnOrHFCl2Values.ToList().ForEach(x => InvokeClient.Instance.Service.DoOperation(x.Key, x.Value));
  1748. }
  1749. }
  1750. private bool CheckIsChanged(string value)
  1751. {
  1752. string[] strList = value.Split(';');
  1753. if (APCData.CommandSetPoint != strList[0])
  1754. {
  1755. return true;
  1756. }
  1757. if (APCData.PIDTable != strList[1])
  1758. {
  1759. return true;
  1760. }
  1761. float.TryParse(strList[2], out float set);
  1762. if (APCData.SetPoint != set)
  1763. {
  1764. return true;
  1765. }
  1766. if (APCData.LowPressWaitSetPoint != strList[3])
  1767. {
  1768. return true;
  1769. }
  1770. return false;
  1771. }
  1772. public List<ConfigNode> GetMfcItem()
  1773. {
  1774. this.SystemName = "System";
  1775. ConfigNodes = SystemConfigProvider.Instance.GetConfigTree(SystemName).SubNodes;
  1776. var MfcItems = ConfigNodes.Where(x => x.Display == "Parameter").FirstOrDefault().SubNodes.Where(y => y.Name == "MFC").FirstOrDefault().SubNodes;
  1777. return MfcItems;
  1778. }
  1779. public void RecipeCancel()
  1780. {
  1781. if (DialogBox.ShowDialog(DialogButton.Yes | DialogButton.No, DialogType.CONFIRM, " You confirm that you want to unsave the recipe and exit the interface?") == DialogButton.No)
  1782. {
  1783. return;
  1784. }
  1785. else
  1786. {
  1787. UpdateGASSetting(true);
  1788. UpdateHeaterSetting();
  1789. ClearSetValue();
  1790. }
  1791. // ((Window)GetView()).Close();
  1792. }
  1793. public void PressPIDChick()
  1794. {
  1795. var windowManager = IoC.Get<IWindowManager>();
  1796. var defaultAPCPID = SystemConfigProvider.Instance.GetValueByName("PM1.APCPID");
  1797. if (string.IsNullOrEmpty(defaultAPCPID))
  1798. {
  1799. DialogBox.ShowDialog(DialogButton.Cancel, DialogType.INFO, "Please set the default file first");
  1800. return;
  1801. }
  1802. int last = defaultAPCPID.LastIndexOf('\\');
  1803. var pix = defaultAPCPID.Substring(0, last);
  1804. var file = defaultAPCPID.Substring(last + 1, defaultAPCPID.Length - last - 1);
  1805. APCPIDEditViewModel aPCPIDEditViewModel = new APCPIDEditViewModel(pix, file);
  1806. aPCPIDEditViewModel.IsEditEnabled = false;
  1807. var rtn = (windowManager as WindowManager)?.ShowDialogWithTitle(aPCPIDEditViewModel, null, "APC PID Table");
  1808. if ((bool)rtn)
  1809. {
  1810. PressPID = aPCPIDEditViewModel.RetrunString;
  1811. }
  1812. }
  1813. private bool firstUpdate = true;
  1814. private void ClearSetValue()
  1815. {
  1816. TemperatureControlMode = "";
  1817. TemperatureCorrect = "";
  1818. TemperaturePID = "";
  1819. ClearLoaderSetValue();
  1820. LoaderCommand = "";
  1821. SetShowLoaderValuePanel("None");
  1822. PressCommand = "";
  1823. SetShowPressPanel("None");
  1824. }
  1825. protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
  1826. {
  1827. base.InvokeAfterUpdateProperty(data);
  1828. if (firstUpdate)
  1829. {
  1830. UpdateGASSetting(false);
  1831. UpdateHeaterSetting();
  1832. firstUpdate = false;
  1833. }
  1834. }
  1835. private void UpdateGASSetting(bool upDataMfcSetPoint)
  1836. {
  1837. List<AITMfcData> allmfcDatas = new List<AITMfcData>()
  1838. {
  1839. MFC1Data,
  1840. MFC2Data,
  1841. MFC3Data,
  1842. MFC4Data,
  1843. MFC5Data,
  1844. MFC6Data,
  1845. MFC7Data,
  1846. MFC8Data,
  1847. MFC9Data,
  1848. MFC10Data,
  1849. MFC11Data,
  1850. MFC12Data,
  1851. MFC13Data,
  1852. MFC14Data,
  1853. MFC15Data,
  1854. MFC16Data,
  1855. MFC17Data,
  1856. MFC31Data,
  1857. MFC32Data,
  1858. MFC51Data,
  1859. };
  1860. List<AITMfcData> mfcDatas = new List<AITMfcData>()
  1861. {
  1862. };
  1863. foreach (var item in allmfcDatas)
  1864. {
  1865. if (item != null)
  1866. {
  1867. mfcDatas.Add(item);
  1868. }
  1869. }
  1870. if (MFCDataList.Count == 0)
  1871. {
  1872. for (int i = 0; i < mfcDatas.Count; i++)
  1873. {
  1874. if (mfcDatas[i] == null)
  1875. continue;
  1876. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{mfcDatas[i].DeviceName}.SetLastPoint");
  1877. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{mfcDatas[i].DeviceName}.SetLastRamping");
  1878. //MFCDataList.Add(new MFCGasData()
  1879. //{
  1880. // Name = mfcDatas[i].DeviceName,
  1881. // DisplayName = mfcDatas[i].DisplayName,
  1882. // ActualValue = mfcDatas[i].FeedBack,
  1883. // Value = mfcDatas[i].SetPoint,
  1884. // ActualRampng = mfcDatas[i].Ramping,
  1885. // Rampng = mfcDatas[i].VirtualRamping,
  1886. // Unit = mfcDatas[i].Unit,
  1887. // AlarmValue = mfcDatas[i].AlarmWatchTable
  1888. //});
  1889. MFCDataList.Add(new MFCGasData()
  1890. {
  1891. Name = mfcDatas[i].DeviceName,
  1892. DisplayName = mfcDatas[i].DisplayName,
  1893. //ActualValue = mfcDatas[i].FeedBack,
  1894. Value = setLastPoint.ToString("f3"),
  1895. //ActualRampng = mfcDatas[i].Ramping,
  1896. Rampng = setLastRamping.ToString("f3"),
  1897. IsSetChanged = true,
  1898. Unit = mfcDatas[i].Unit,
  1899. AlarmValue = mfcDatas[i].AlarmWatchTable
  1900. });
  1901. }
  1902. }
  1903. else
  1904. {
  1905. for (int i = 0; i < MFCDataList.Count; i++)
  1906. {
  1907. var findMFC = mfcDatas.FirstOrDefault(x => x.DeviceName == MFCDataList[i].Name);
  1908. if (findMFC != null)
  1909. {
  1910. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{findMFC.DeviceName}.SetLastPoint");
  1911. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{findMFC.DeviceName}.SetLastRamping");
  1912. MFCDataList[i].Value = setLastPoint.ToString("f3");
  1913. MFCDataList[i].IsSetChanged = true;
  1914. MFCDataList[i].Rampng = setLastRamping.ToString("f3");
  1915. }
  1916. };
  1917. }
  1918. if (MFCDataList != null && MFCDataList.Count > 0)
  1919. {
  1920. if (upDataMfcSetPoint)
  1921. {
  1922. Dictionary<string, string> setChangedMFC = new Dictionary<string, string>();
  1923. foreach (var item in MFCDataList)
  1924. {
  1925. setChangedMFC.Add(item.Name, item.Value);
  1926. }
  1927. InvokeClient.Instance.Service.DoOperation($"PM1.SetAllMfcSetPoint", setChangedMFC);
  1928. }
  1929. }
  1930. }
  1931. private void UpdateHeaterSetting()
  1932. {
  1933. if ((HeaterUData != null && HeaterCUData != null && HeaterCData != null && HeaterCLData != null && HeaterLData != null))
  1934. {
  1935. List<AITHeaterData> heaterDatas = new List<AITHeaterData>()
  1936. {
  1937. HeaterUData,
  1938. HeaterCUData,
  1939. HeaterCData,
  1940. HeaterCLData,
  1941. HeaterLData,
  1942. };
  1943. if (TempList.Count == 0)
  1944. {
  1945. string[] strList = new string[5] { "BottomHeaterData", "CenterBottomHeaterData", "CenterHeaterData", "TopCenterHeaterData", "HeaterUData" };
  1946. for (int i = 0; i < heaterDatas.Count; i++)
  1947. {
  1948. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.Heater.{heaterDatas[i].DeviceName}.SetLastPoint");
  1949. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.Heater.{heaterDatas[i].DeviceName}.SetLastRamping");
  1950. //TempList.Add(new TempManualSetData()
  1951. //{
  1952. // DisplayName = heaterDatas[i].DisplayName,
  1953. // Name = heaterDatas[i].DeviceName,
  1954. // ControlName = strList[i],
  1955. // ActualValue = heaterDatas[i].FeedBack,
  1956. // Value = heaterDatas[i].SetPoint,
  1957. // ActualRampng = heaterDatas[i].Ramping,
  1958. // Rampng = heaterDatas[i].UpRateSetPoint,
  1959. // Unit = heaterDatas[i].Unit,
  1960. //});
  1961. TempList.Add(new TempManualSetData()
  1962. {
  1963. DisplayName = heaterDatas[i].DisplayName,
  1964. Name = heaterDatas[i].DeviceName,
  1965. ControlName = strList[i],
  1966. Value = setLastPoint.ToString("f1"),
  1967. Rampng = setLastRamping.ToString("f1"),
  1968. Unit = heaterDatas[i].Unit,
  1969. });
  1970. }
  1971. }
  1972. else
  1973. {
  1974. for (int i = 0; i < TempList.Count; i++)
  1975. {
  1976. var findHeater = heaterDatas.FirstOrDefault(x => x.DeviceName == TempList[i].Name);
  1977. double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.Heater.{findHeater.DeviceName}.SetLastPoint");
  1978. double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.Heater.{findHeater.DeviceName}.SetLastRamping");
  1979. if (findHeater != null)
  1980. {
  1981. TempList[i].Value = setLastPoint.ToString("f1");
  1982. TempList[i].Rampng = setLastRamping.ToString("f1");
  1983. TempList[i].IsSetChanged = true;
  1984. TempList[i].IsRampngChanged = true;
  1985. }
  1986. };
  1987. }
  1988. }
  1989. }
  1990. public void SetValue(object sender, string isFullKeyboard = "")
  1991. {
  1992. string value = ((TextBox)sender).Text;
  1993. if (!string.IsNullOrEmpty(isFullKeyboard))
  1994. {
  1995. FullKeyboard fullKeyboard1 = new FullKeyboard("", value);
  1996. if ((bool)fullKeyboard1.ShowDialog())
  1997. {
  1998. ((TextBox)sender).Text = fullKeyboard1.ValueString;
  1999. }
  2000. }
  2001. else
  2002. {
  2003. NumberKeyboard fullKeyboard = new NumberKeyboard("", value);
  2004. if ((bool)fullKeyboard.ShowDialog())
  2005. {
  2006. ((TextBox)sender).Text = fullKeyboard.ValueString;
  2007. }
  2008. }
  2009. }
  2010. private string GetPressString()
  2011. {
  2012. string[] pressStringList = new string[4] { "", "", "", "" };
  2013. pressStringList[0] = PressCommand;
  2014. if (!string.IsNullOrEmpty(PressCommand))
  2015. {
  2016. switch (PressCommand)
  2017. {
  2018. case "Press":
  2019. case "Press2":
  2020. PressVisibility = Visibility.Visible;
  2021. pressStringList[1] = PressPID;
  2022. pressStringList[2] = PressSet.ToString();
  2023. break;
  2024. case "Slow Vac":
  2025. var defaultAPCPID = SystemConfigProvider.Instance.GetValueByName("PM1.APCPID");
  2026. pressStringList[1] = defaultAPCPID;
  2027. pressStringList[2] = PressSlowVacSet.ToString();
  2028. break;
  2029. case "Valve Angle":
  2030. pressStringList[2] = PressValveAngleSet.ToString();
  2031. pressStringList[3] = LowPressWait;
  2032. break;
  2033. case "Full Open":
  2034. case "Full Close":
  2035. case "Hold":
  2036. case "Zero Set":
  2037. case "Cancel Zero":
  2038. pressStringList[1] = "";
  2039. pressStringList[2] = "";
  2040. pressStringList[3] = "";
  2041. break;
  2042. case "WaitPressUp1":
  2043. case "WaitPressDown1":
  2044. case "WaitPressUp2":
  2045. case "WaitPressDown2":
  2046. pressStringList[2] = PressWait.ToString();
  2047. break;
  2048. default:
  2049. break;
  2050. }
  2051. }
  2052. return string.Join(";", pressStringList);
  2053. }
  2054. }
  2055. public class MFCGasData : PropertyChangedBase
  2056. {
  2057. private int _no;
  2058. public int No
  2059. {
  2060. get => _no;
  2061. set
  2062. {
  2063. _no = value;
  2064. NotifyOfPropertyChange(nameof(No));
  2065. }
  2066. }
  2067. private string _name;
  2068. public string Name
  2069. {
  2070. get => _name;
  2071. set
  2072. {
  2073. _name = value;
  2074. NotifyOfPropertyChange(nameof(Name));
  2075. }
  2076. }
  2077. public string _unit;
  2078. public string Unit
  2079. {
  2080. get => _unit;
  2081. set
  2082. {
  2083. _unit = value;
  2084. NotifyOfPropertyChange(nameof(Unit));
  2085. }
  2086. }
  2087. private string _displayName;
  2088. public string DisplayName
  2089. {
  2090. get => _displayName;
  2091. set
  2092. {
  2093. _displayName = value;
  2094. NotifyOfPropertyChange(nameof(DisplayName));
  2095. }
  2096. }
  2097. private string _controlName;
  2098. public string ControlName
  2099. {
  2100. get => _controlName;
  2101. set
  2102. {
  2103. _controlName = value;
  2104. NotifyOfPropertyChange(nameof(ControlName));
  2105. }
  2106. }
  2107. private double _actualValue;
  2108. public double ActualValue
  2109. {
  2110. get => _actualValue;
  2111. set
  2112. {
  2113. _actualValue = value;
  2114. NotifyOfPropertyChange(nameof(ActualValue));
  2115. }
  2116. }
  2117. private string _value;
  2118. public string Value
  2119. {
  2120. get => _value;
  2121. set
  2122. {
  2123. _value = value;
  2124. NotifyOfPropertyChange(nameof(Value));
  2125. }
  2126. }
  2127. private double _actualRampng;
  2128. public double ActualRampng
  2129. {
  2130. get => _actualRampng; set
  2131. {
  2132. _actualRampng = value;
  2133. NotifyOfPropertyChange(nameof(ActualRampng));
  2134. }
  2135. }
  2136. private string _rampng;
  2137. public string Rampng
  2138. {
  2139. get => _rampng; set
  2140. {
  2141. _rampng = value;
  2142. NotifyOfPropertyChange(nameof(Rampng));
  2143. }
  2144. }
  2145. private string _maxValue;
  2146. public string MaxValue
  2147. {
  2148. get => _maxValue; set
  2149. {
  2150. _maxValue = value;
  2151. NotifyOfPropertyChange(nameof(MaxValue));
  2152. }
  2153. }
  2154. private string _minValue;
  2155. public string MinValue
  2156. {
  2157. get => _minValue; set
  2158. {
  2159. _minValue = value;
  2160. NotifyOfPropertyChange(nameof(MinValue));
  2161. }
  2162. }
  2163. private bool _isSetChanged = true;
  2164. public bool IsSetChanged
  2165. {
  2166. get => _isSetChanged;
  2167. set
  2168. {
  2169. _isSetChanged = value;
  2170. NotifyOfPropertyChange(nameof(IsSetChanged));
  2171. }
  2172. }
  2173. private bool _isRampngChanged = true;
  2174. public bool IsRampngChanged
  2175. {
  2176. get => _isRampngChanged;
  2177. set
  2178. {
  2179. _isRampngChanged = value;
  2180. NotifyOfPropertyChange(nameof(IsRampngChanged));
  2181. }
  2182. }
  2183. private string _alarmValue;
  2184. public string AlarmValue
  2185. {
  2186. get => _alarmValue;
  2187. set
  2188. {
  2189. _alarmValue = value;
  2190. NotifyOfPropertyChange(nameof(AlarmValue));
  2191. }
  2192. }
  2193. }
  2194. public class TempManualSetData : PropertyChangedBase
  2195. {
  2196. private int _no;
  2197. public int No
  2198. {
  2199. get => _no;
  2200. set
  2201. {
  2202. _no = value;
  2203. NotifyOfPropertyChange("No");
  2204. }
  2205. }
  2206. private string _name;
  2207. public string Name
  2208. {
  2209. get => _name;
  2210. set
  2211. {
  2212. _name = value;
  2213. NotifyOfPropertyChange("Name");
  2214. }
  2215. }
  2216. private string _displayName;
  2217. public string DisplayName
  2218. {
  2219. get => _displayName;
  2220. set
  2221. {
  2222. _displayName = value;
  2223. NotifyOfPropertyChange(nameof(DisplayName));
  2224. }
  2225. }
  2226. private string _controlName;
  2227. public string ControlName
  2228. {
  2229. get => _controlName;
  2230. set
  2231. {
  2232. _controlName = value;
  2233. NotifyOfPropertyChange(nameof(ControlName));
  2234. }
  2235. }
  2236. private double _actualValue;
  2237. public double ActualValue
  2238. {
  2239. get => _actualValue;
  2240. set
  2241. {
  2242. _actualValue = value;
  2243. NotifyOfPropertyChange(nameof(ActualValue));
  2244. }
  2245. }
  2246. private string _value;
  2247. public string Value
  2248. {
  2249. get => _value;
  2250. set
  2251. {
  2252. _value = value;
  2253. NotifyOfPropertyChange(nameof(Value));
  2254. }
  2255. }
  2256. private string _actualRampng;
  2257. public string ActualRampng
  2258. {
  2259. get => _actualRampng;
  2260. set
  2261. {
  2262. _actualRampng = value;
  2263. NotifyOfPropertyChange(nameof(ActualRampng));
  2264. }
  2265. }
  2266. private string _rampng;
  2267. public string Rampng
  2268. {
  2269. get => _rampng; set
  2270. {
  2271. _rampng = value;
  2272. NotifyOfPropertyChange(nameof(Rampng));
  2273. }
  2274. }
  2275. private string _maxValue;
  2276. public string MaxValue
  2277. {
  2278. get => _maxValue; set
  2279. {
  2280. _maxValue = value;
  2281. NotifyOfPropertyChange(nameof(MaxValue));
  2282. }
  2283. }
  2284. private string _minValue;
  2285. public string MinValue
  2286. {
  2287. get => _minValue; set
  2288. {
  2289. _minValue = value;
  2290. NotifyOfPropertyChange(nameof(MinValue));
  2291. }
  2292. }
  2293. private bool _isChanged = true;
  2294. public bool IsChanged
  2295. {
  2296. get => _isChanged;
  2297. set
  2298. {
  2299. _isChanged = value;
  2300. NotifyOfPropertyChange(nameof(IsChanged));
  2301. }
  2302. }
  2303. private string _unit;
  2304. public string Unit
  2305. {
  2306. get => _unit;
  2307. set
  2308. {
  2309. _unit = value;
  2310. NotifyOfPropertyChange("Unit");
  2311. }
  2312. }
  2313. private bool _isSetChanged = true;
  2314. public bool IsSetChanged
  2315. {
  2316. get => _isSetChanged;
  2317. set
  2318. {
  2319. _isSetChanged = value;
  2320. NotifyOfPropertyChange(nameof(IsSetChanged));
  2321. }
  2322. }
  2323. private bool _isRampngChanged = true;
  2324. public bool IsRampngChanged
  2325. {
  2326. get => _isRampngChanged;
  2327. set
  2328. {
  2329. _isRampngChanged = value;
  2330. NotifyOfPropertyChange(nameof(IsRampngChanged));
  2331. }
  2332. }
  2333. private string _alarmValue;
  2334. public string AlarmValue
  2335. {
  2336. get => _alarmValue;
  2337. set
  2338. {
  2339. _alarmValue = value;
  2340. NotifyOfPropertyChange(nameof(AlarmValue));
  2341. }
  2342. }
  2343. }
  2344. }