ManualSetViewModel.cs 113 KB

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