ManualSetViewModel.cs 114 KB

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