N2PurgeEditViewModel.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. using Aitex.Core.Common.DeviceData;
  2. using Aitex.Core.RT.Log;
  3. using Aitex.Core.RT.SCCore;
  4. using Aitex.Core.Util;
  5. using Caliburn.Micro;
  6. using DocumentFormat.OpenXml.Drawing;
  7. using FurnaceUI.Client.Dialog;
  8. using FurnaceUI.Views.Recipes;
  9. using MECF.Framework.Common.DataCenter;
  10. using MECF.Framework.Common.OperationCenter;
  11. using MECF.Framework.UI.Client.CenterViews.Configs.SystemConfig;
  12. using MECF.Framework.UI.Client.CenterViews.Dialogs;
  13. using MECF.Framework.UI.Client.CenterViews.Editors.Recipe;
  14. using MECF.Framework.UI.Client.ClientBase;
  15. using OpenSEMI.ClientBase;
  16. using OxyPlot;
  17. using OxyPlot.Axes;
  18. using OxyPlot.Series;
  19. using System;
  20. using System.Collections.Generic;
  21. using System.Collections.ObjectModel;
  22. using System.Globalization;
  23. using System.Linq;
  24. using System.Reflection;
  25. using System.Text;
  26. using System.Threading;
  27. using System.Threading.Tasks;
  28. using System.Windows;
  29. using System.Windows.Controls;
  30. using System.Windows.Data;
  31. namespace FurnaceUI.Views.Parameter
  32. {
  33. public class N2PurgeEditViewModel : ModuleUiViewModelBase
  34. {
  35. public bool IsPermission { get => this.Permission == 3; }
  36. public string TransferRoomVisibleBackGround { get; set; } = "#FF7DABD4";
  37. public string FOUPOpenVisibleBackGround { get; set; } = "#FF7DABD4";
  38. public string O2DetectorVisibleBackGround { get; set; } = "#FF7DABD4";
  39. public string ClampOFFVisibleBackGround { get; set; } = "#FF7DABD4";
  40. public string FurnaceOpenVisibleBackGround { get; set; } = "#FF7DABD4";
  41. public string OperationCheckVisibleBackGround { get; set; } = "#FF7DABD4";
  42. public string O2DensityQuickDownVisibleBackGround { get; set; } = "#FF7DABD4";
  43. public string FoupEnterVisibleBackGround { get; set; } = "#FF7DABD4";
  44. public string WaferChargeVisibleBackGround { get; set; } = "#FF7DABD4";
  45. public string BoatLoadVisibleBackGround { get; set; } = "#FF7DABD4";
  46. public string FoupInhibitAfterVisibleBackGround { get; set; } = "#FF7DABD4";
  47. public string BoatUnloadVisibleBackGround { get; set; } = "#FF7DABD4";
  48. public string BoatUnloadPreVisibleBackGround { get; set; } = "#FF7DABD4";
  49. public string WaferCoolingVisibleBackGround { get; set; } = "#FF7DABD4";
  50. public string WaferDishargeVisibleBackGround { get; set; } = "#FF7DABD4";
  51. public List<ParamBase> ParameterTree { get; set; } = new List<ParamBase>();
  52. public RecipeDataBase CurrentRecipe { get; set; } = new RecipeDataBase();
  53. public ObservableCollection<TempSetData> HeadLst { get; set; } = new ObservableCollection<TempSetData>();
  54. public ObservableCollection<TempSetData> PIDHeadLst { get; set; } = new ObservableCollection<TempSetData>();
  55. private ConfigNode levelOneNode;
  56. public ConfigNode LevelOneNode
  57. {
  58. get { return levelOneNode; }
  59. set { levelOneNode = value; this.NotifyOfPropertyChange(nameof(LevelOneNode)); }
  60. }
  61. private ConfigNode levelTwoNode;
  62. public ConfigNode LevelTwoNode
  63. {
  64. get { return levelTwoNode; }
  65. set { levelTwoNode = value; this.NotifyOfPropertyChange(nameof(LevelTwoNode)); }
  66. }
  67. private List<ConfigItem> currenItems;
  68. public List<ConfigItem> CurrenItems
  69. {
  70. get { return currenItems; }
  71. set { currenItems = value; this.NotifyOfPropertyChange(nameof(CurrenItems)); }
  72. }
  73. private List<ConfigNode> _ConfigNodes = new List<ConfigNode>();
  74. public List<ConfigNode> ConfigNodes
  75. {
  76. get { return _ConfigNodes; }
  77. set { _ConfigNodes = value; NotifyOfPropertyChange("ConfigNodes"); }
  78. }
  79. private string _defaultUnit = "Pa";
  80. public string DefaultUnit
  81. {
  82. get
  83. {
  84. return _defaultUnit;
  85. }
  86. set
  87. {
  88. _defaultUnit = value;
  89. NotifyOfPropertyChange("DefaultUnit");
  90. }
  91. }
  92. private ConfigNode _rootNode;
  93. private string _CurrentNodeName = string.Empty;
  94. private string path;
  95. private string currentValue;
  96. private ObservableCollection<PageValue> valueList { get; set; } = new ObservableCollection<PageValue>();
  97. private PlotModel o2Model;
  98. public PlotModel O2Model
  99. {
  100. get { return o2Model; }
  101. set { o2Model = value; NotifyOfPropertyChange("O2Model"); }
  102. }
  103. private PlotModel n2Model;
  104. public PlotModel N2Model
  105. {
  106. get { return n2Model; }
  107. set { n2Model = value; NotifyOfPropertyChange("N2Model"); }
  108. }
  109. [Subscription("PM1.ConcentrationO2.Value")]
  110. public double ConcentrationO2Value { get; set; }
  111. [Subscription("PM1.MFC51.Feedback")]
  112. public double MFC51Feedback { get; set; }
  113. [Subscription("PM1.MFM57.Feedback")]
  114. public double MFM57Feedback { get; set; }
  115. #region WaferCharge
  116. private double _n2PurgeFOUPO2CheckSV = 0;
  117. public double N2PurgeFOUPO2CheckSV
  118. {
  119. get
  120. {
  121. return _n2PurgeFOUPO2CheckSV;
  122. }
  123. set
  124. {
  125. _n2PurgeFOUPO2CheckSV = value;
  126. NotifyOfPropertyChange("N2PurgeFOUPO2CheckSV");
  127. }
  128. }
  129. private double _n2PurgeLAO2CheckSV = 0;
  130. public double N2PurgeLAO2CheckSV
  131. {
  132. get
  133. {
  134. return _n2PurgeLAO2CheckSV;
  135. }
  136. set
  137. {
  138. _n2PurgeLAO2CheckSV = value;
  139. NotifyOfPropertyChange("N2PurgeLAO2CheckSV");
  140. }
  141. }
  142. #endregion
  143. protected override void OnInitialize()
  144. {
  145. base.OnInitialize();
  146. this.SystemName = "System";
  147. ConfigNodes = SystemConfigProvider.Instance.GetConfigTree(SystemName).SubNodes;
  148. InitTree();
  149. _rootNode = SystemConfigProvider.Instance.GetConfig(true);
  150. }
  151. protected override void OnActivate()
  152. {
  153. base.OnActivate();
  154. DefaultUnit = (string)QueryDataClient.Instance.Service.GetConfig($"PM1.APC.PressureUnit");
  155. N2PurgeFOUPO2CheckSV = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.N2Purge.N2PurgeFOUPO2CheckSV");
  156. N2PurgeLAO2CheckSV = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.N2Purge.N2PurgeLAO2CheckSV");
  157. //GetO2ModelSpline();
  158. //GetN2ModelSpline();
  159. }
  160. public void GetO2ModelSpline()
  161. {
  162. var tmp = new PlotModel { };
  163. tmp.Axes.Add(new DateTimeAxis()
  164. {
  165. StringFormat = "HH:mm:ss",
  166. IsZoomEnabled = false,
  167. IsPanEnabled = false,
  168. IntervalType = DateTimeIntervalType.Seconds
  169. });
  170. tmp.Series.Add(new LineSeries
  171. {
  172. Color = OxyColors.Blue,
  173. MarkerType = MarkerType.Circle,
  174. });
  175. this.O2Model = tmp;
  176. Task.Run(() =>
  177. {
  178. while (true)
  179. {
  180. var date = DateTime.Now;
  181. tmp.Axes[0].Maximum = DateTimeAxis.ToDouble(date.AddSeconds(1));
  182. var lineSer = this.O2Model.Series[0] as LineSeries;
  183. lineSer.Points.Add(new OxyPlot.DataPoint(DateTimeAxis.ToDouble(date), ConcentrationO2Value));
  184. if (lineSer.Points.Count > 30)
  185. {
  186. lineSer.Points.RemoveAt(0);
  187. }
  188. tmp.InvalidatePlot(true);
  189. Thread.Sleep(1000);
  190. }
  191. });
  192. }
  193. public void GetN2ModelSpline()
  194. {
  195. var tmp = new PlotModel { };
  196. tmp.Axes.Add(new DateTimeAxis()
  197. {
  198. StringFormat = "HH:mm:ss",
  199. IsZoomEnabled = false,
  200. IsPanEnabled = false,
  201. IntervalType = DateTimeIntervalType.Seconds
  202. });
  203. tmp.Series.Add(new LineSeries
  204. {
  205. Color = OxyColors.Blue,
  206. MarkerType = MarkerType.Circle,
  207. });
  208. this.N2Model = tmp;
  209. Task.Run(() =>
  210. {
  211. while (true)
  212. {
  213. var date = DateTime.Now;
  214. tmp.Axes[0].Maximum = DateTimeAxis.ToDouble(date.AddSeconds(1));
  215. var lineSer = this.N2Model.Series[0] as LineSeries;
  216. var pointValue = MFC51Feedback + MFM57Feedback;
  217. lineSer.Points.Add(new OxyPlot.DataPoint(DateTimeAxis.ToDouble(date), pointValue));
  218. if (lineSer.Points.Count > 30)
  219. {
  220. lineSer.Points.RemoveAt(0);
  221. }
  222. tmp.InvalidatePlot(true);
  223. Thread.Sleep(1000);
  224. }
  225. });
  226. }
  227. private void InitTree()
  228. {
  229. var node = SystemConfigProvider.Instance.GetConfigTree(SystemName).SubNodes;
  230. ParameterTree.Add(new ParamBase() { ID = 1, ParentID = 0, Name = "StepTime", ConfigName = "StepTime" });
  231. ParameterTree.Add(new ParamBase() { ID = 2, ParentID = 0, Name = "Temperature" });
  232. {
  233. ParameterTree.Add(new ParamBase() { ID = 21, ParentID = 2, Name = "TempOffset", ConfigName = "TempOffsetTable" });
  234. ParameterTree.Add(new ParamBase() { ID = 22, ParentID = 2, Name = "TempProfile", ConfigName = "TempProfileTable" });
  235. ParameterTree.Add(new ParamBase() { ID = 23, ParentID = 2, Name = "TempStabilize", ConfigName = "TempStabilizeTable" });
  236. ParameterTree.Add(new ParamBase() { ID = 24, ParentID = 2, Name = "TempSetting", ConfigName = "TempSetting" });
  237. ParameterTree.Add(new ParamBase() { ID = 25, ParentID = 2, Name = "TempPIDTable", ConfigName = "TempPIDTable" });
  238. }
  239. //ParameterTree.Add(new ParamBase() { ID = 3, ParentID = 0, Name = "TempSetting", ConfigName = "TempSetting" });
  240. ParameterTree.Add(new ParamBase() { ID = 4, ParentID = 0, Name = "PressureStabilize", ConfigName = "PressureStabilizeTable" });
  241. ParameterTree.Add(new ParamBase() { ID = 5, ParentID = 0, Name = "AlarmWatchTable" });
  242. {
  243. ParameterTree.Add(new ParamBase() { ID = 51, ParentID = 5, Name = "TempAlarm", ConfigName = "AlarmWatchTable.TempAlarmWatch" });
  244. ParameterTree.Add(new ParamBase() { ID = 52, ParentID = 5, Name = "FlowAlarm", ConfigName = "AlarmWatchTable.FlowAlarmWatch" });
  245. ParameterTree.Add(new ParamBase() { ID = 53, ParentID = 5, Name = "PressureAlarm", ConfigName = "AlarmWatchTable.PressureAlarmWatch" });
  246. }
  247. ParameterTree.Add(new ParamBase() { ID = 6, ParentID = 0, Name = "FlowSetting", ConfigName = "FlowSetting" });
  248. {
  249. var MfcItems = ConfigNodes.Where(x => x.Display == "Parameter").FirstOrDefault().SubNodes.Where(y => y.Name == "MFC").FirstOrDefault().SubNodes;
  250. foreach (var item in MfcItems)
  251. {
  252. var isInstalled = QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{item.Name}.IsMFCInstalled");
  253. if (!(bool)isInstalled) continue;
  254. ParameterTree.Add(new ParamBase()
  255. {
  256. ID = 61,
  257. ParentID = 6,
  258. Name = SystemConfigProvider.Instance.GetValueByName($"PM1.MFC.{item.Name}.GasName"),
  259. ConfigName = $"FlowSetting.{item.Name}"
  260. });
  261. }
  262. }
  263. ParameterTree.Add(new ParamBase() { ID = 7, ParentID = 0, Name = "APCSetting" });
  264. {
  265. ParameterTree.Add(new ParamBase() { ID = 71, ParentID = 7, Name = "Pressure", ConfigName = "APCSetting.Pressure" });
  266. ParameterTree.Add(new ParamBase() { ID = 72, ParentID = 7, Name = "Position", ConfigName = "APCSetting.Position" });
  267. }
  268. ParameterTree.Add(new ParamBase() { ID = 8, ParentID = 0, Name = "LayoutPitch", ConfigName = "LayoutPitch" });
  269. ParameterTree.Add(new ParamBase() { ID = 9, ParentID = 0, Name = "CoolingTime", ConfigName = "CoolTime" });
  270. ParameterTree = this.LoadTreeView(0);
  271. }
  272. private List<ParamBase> LoadTreeView(int id)
  273. {
  274. List<ParamBase> node = ParameterTree.FindAll(s => s.ParentID.Equals(id));
  275. foreach (var item in node)
  276. {
  277. item.Children = LoadTreeView(item.ID);
  278. }
  279. return node;
  280. }
  281. public void HideAllCanvas()
  282. {
  283. }
  284. public void TreeViewSelectedItemChanged(object obj)
  285. {
  286. valueList.Clear();
  287. LevelOneNode = LevelTwoNode = new ConfigNode();
  288. HideAllCanvas();
  289. var view = GetView() as N2PurgeEditView;
  290. ParamBase para = obj as ParamBase;
  291. string strHeader = "PM1.RecipeEditParameter";
  292. Canvas canvas = null;
  293. LevelOneNode = FindNodeByName(_rootNode, $"{strHeader}.{para.ConfigName}");
  294. LevelTwoNode = LevelOneNode.SubNodes.FirstOrDefault();
  295. if (canvas == null) return;
  296. canvas.Visibility = Visibility.Visible;
  297. this.GetHeaderConfig();
  298. this.GetPIDHeaderConfig();
  299. if (LevelTwoNode == null)
  300. {
  301. InitItemsCurrentValue(LevelOneNode, false);
  302. }
  303. else
  304. {
  305. InitItemsCurrentValue(LevelTwoNode, true);
  306. ConfigNode subNode = LevelTwoNode.SubNodes.FirstOrDefault();
  307. if (subNode != null) InitItemsCurrentValue(subNode, true);
  308. }
  309. }
  310. private void InitItemsCurrentValue(ConfigNode node, bool initSubItems = true)
  311. {
  312. if (node == null) return;
  313. CurrenItems = node.Items;
  314. _CurrentNodeName = string.IsNullOrEmpty(node.Path) ? node.Name : $"{node.Path}.{node.Name}";
  315. if (CurrenItems == null || CurrenItems.Count <= 0)
  316. {
  317. if (!initSubItems) return;
  318. foreach (var item in node.SubNodes)
  319. {
  320. InitItemsCurrentValue(item);
  321. }
  322. }
  323. else
  324. {
  325. GetDataOfConfigItems();
  326. }
  327. }
  328. private void GetDataOfConfigItems()
  329. {
  330. if (CurrenItems == null)
  331. return;
  332. for (int i = 0; i < CurrenItems.Count; i++)
  333. {
  334. var isInstalled = QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{CurrenItems[i].Name}.IsMFCInstalled");
  335. if (isInstalled != null && !(bool)isInstalled)
  336. CurrenItems[i].Visible = false;
  337. else
  338. CurrenItems[i].Visible = true;
  339. string key = String.Format("{0}{1}{2}", _CurrentNodeName, ".", CurrenItems[i].Name);
  340. CurrenItems[i].CurrentValue = SystemConfigProvider.Instance.GetValueByName(key);
  341. CurrenItems[i].Path = key;
  342. if (CurrenItems[i].Type == DataType.Bool)
  343. {
  344. bool value;
  345. if (bool.TryParse(CurrenItems[i].CurrentValue, out value))
  346. {
  347. CurrenItems[i].BoolValue = value;
  348. CurrenItems[i].CurrentValue = value ? "Yes" : "No";
  349. }
  350. }
  351. else
  352. CurrenItems[i].StringValue = CurrenItems[i].CurrentValue;
  353. }
  354. }
  355. public void MenuCommand(object obj, object menuLevel)
  356. {
  357. RadioButton radioButton = obj as RadioButton;
  358. ConfigNode currentNode = null;
  359. switch (menuLevel.ToString())
  360. {
  361. case "LevelOne":
  362. currentNode = LevelTwoNode = LevelOneNode.SubNodes.Find((x) => x.Name == radioButton.ToolTip.ToString());
  363. break;
  364. case "LevelTwo":
  365. currentNode = LevelTwoNode.SubNodes.Find((x) => x.Name == radioButton.ToolTip.ToString());
  366. break;
  367. }
  368. InitItemsCurrentValue(currentNode);
  369. }
  370. public void SetValue(object obj)
  371. {
  372. var CurrentRecipes = CurrentRecipe;
  373. if (CurrenItems == null || currenItems.Count == 0) return;
  374. ConfigItem item = null;
  375. if (obj is Control)
  376. item = CurrenItems.Find((x) => x.Name == (obj as Control).ToolTip.ToString());
  377. else
  378. item = obj as ConfigItem;
  379. InputDialogViewModel dialog = new InputDialogViewModel();
  380. dialog.Item = item;
  381. dialog.DisplayName = "Set Value";
  382. WindowManager wm = new WindowManager();
  383. bool? bret = wm.ShowDialog(dialog);
  384. if ((bool)bret)
  385. {
  386. item.StringValue = dialog.DialogResult;
  387. //key :System.IsSimulatorMode
  388. //value: true or false 都是字符串
  389. //input check
  390. string value;
  391. if (item.Type == DataType.Bool)
  392. {
  393. if (item.StringValue.Equals("Yes", StringComparison.CurrentCultureIgnoreCase))
  394. item.BoolValue = true;
  395. else if (item.StringValue.Equals("No", StringComparison.CurrentCultureIgnoreCase))
  396. item.BoolValue = false;
  397. else
  398. {
  399. DialogBox.ShowWarning("The Value Should be Yes Or No.");
  400. return;
  401. }
  402. value = item.BoolValue.ToString().ToLower();
  403. }
  404. else
  405. {
  406. if (item.Type == DataType.Int)
  407. {
  408. int iValue;
  409. if (int.TryParse(item.StringValue, out iValue))
  410. {
  411. if (!double.IsNaN(item.Max) && !double.IsNaN(item.Min))
  412. {
  413. if (iValue > item.Max || iValue < item.Min)
  414. {
  415. DialogBox.ShowWarning(string.Format("The value should be between {0} and {1}.", ((int)item.Min).ToString(), ((int)item.Max).ToString()));
  416. return;
  417. }
  418. }
  419. }
  420. else
  421. {
  422. DialogBox.ShowWarning("Please input valid data.");
  423. return;
  424. }
  425. value = item.StringValue;
  426. }
  427. else if (item.Type == DataType.Double)
  428. {
  429. double fValue;
  430. if (double.TryParse(item.StringValue, out fValue))
  431. {
  432. if (!double.IsNaN(item.Max) && !double.IsNaN(item.Min))
  433. {
  434. if (fValue > item.Max || fValue < item.Min)
  435. {
  436. DialogBox.ShowWarning(string.Format("The value should be between {0} and {1}.", item.Min.ToString(), item.Max.ToString()));
  437. return;
  438. }
  439. string[] box = fValue.ToString().Split('.');
  440. if (box.Length > 1 && box[1].Length > 3)
  441. {
  442. DialogBox.ShowWarning(string.Format("The value should be more than three decimal places"));
  443. return;
  444. }
  445. }
  446. }
  447. else
  448. {
  449. DialogBox.ShowWarning("Please input valid data.");
  450. return;
  451. }
  452. value = item.StringValue;
  453. }
  454. else
  455. value = item.StringValue;
  456. }
  457. string key = String.Format("{0}{1}{2}", _CurrentNodeName, ".", item.Name);
  458. if (item.Path.Split('.')[2] == "LayoutPitch")
  459. {
  460. if (item.Path.Split('.')[3] == "StandardPitch")
  461. {
  462. foreach (var current in currenItems.Where(x => x.Description != "StandardPitch"))
  463. {
  464. current.CurrentValue = "No";
  465. InvokeClient.Instance.Service.DoOperation($"{SystemName}.SetConfig", current.Path, "false");
  466. }
  467. }
  468. else if (item.Path.Split('.')[3] == "DoublePitch")
  469. {
  470. foreach (var current in currenItems.Where(x => x.Description != "DoublePitch"))
  471. {
  472. current.CurrentValue = "No";
  473. InvokeClient.Instance.Service.DoOperation($"{SystemName}.SetConfig", current.Path, "false");
  474. }
  475. }
  476. else
  477. {
  478. foreach (var current in currenItems.Where(x => x.Description != "TriplePitch"))
  479. {
  480. current.CurrentValue = "No";
  481. InvokeClient.Instance.Service.DoOperation($"{SystemName}.SetConfig", current.Path, "false");
  482. }
  483. }
  484. }
  485. path = item.Path;
  486. currentValue = value;
  487. valueList.Add(new PageValue() { Path = path, CurrentValue = currentValue });
  488. }
  489. }
  490. public void SaveParameter()
  491. {
  492. foreach (var item in valueList)
  493. {
  494. InvokeClient.Instance.Service.DoOperation($"{SystemName}.SetConfig", item.Path, item.CurrentValue);
  495. }
  496. }
  497. public void GetHeaderConfig()
  498. {
  499. HeadLst.Clear();
  500. for (int i = 0; i < 10; i++)
  501. {
  502. if (i % 2 != 0)
  503. {
  504. var configHeater = (string)QueryDataClient.Instance.Service.GetConfig($"PM1.Heater.Heater{i}.DisplayName");
  505. TempSetData item = new TempSetData(configHeater);
  506. item.SetValue.Value = configHeater;
  507. HeadLst.Add(item);
  508. }
  509. }
  510. }
  511. public void GetPIDHeaderConfig()
  512. {
  513. PIDHeadLst.Clear();
  514. for (int i = 0; i < 10; i++)
  515. {
  516. if (i % 2 != 0)
  517. {
  518. var configHeater = (string)QueryDataClient.Instance.Service.GetConfig($"PM1.Heater.Heater{i}.DisplayName");
  519. TempSetData item1 = new TempSetData(configHeater);
  520. TempSetData item2 = new TempSetData(configHeater);
  521. TempSetData item3 = new TempSetData(configHeater);
  522. item1.SetValue.Value = $"{configHeater} P";
  523. PIDHeadLst.Add(item1);
  524. item2.SetValue.Value = $"{configHeater} I";
  525. PIDHeadLst.Add(item2);
  526. item3.SetValue.Value = $"{configHeater} D";
  527. PIDHeadLst.Add(item3);
  528. }
  529. }
  530. }
  531. private ConfigNode FindNodeByName(ConfigNode parentNode, string strName)
  532. {
  533. string strCates = strName.Split('.')[0];
  534. ConfigNode node = parentNode.SubNodes.Find((x) => x.Name == strCates);
  535. if (node == null)
  536. return parentNode;
  537. else
  538. return FindNodeByName(node, strName.Replace(strCates + ".", ""));
  539. }
  540. public void SetConfigTextChanged(string configName, object sender, object item)
  541. {
  542. try
  543. {
  544. if (!string.IsNullOrEmpty(configName) &&item != null && sender != null)
  545. {
  546. string value = ((TextBox)sender).Text;
  547. double setValue = 0;
  548. double.TryParse(value, out setValue);
  549. InvokeClient.Instance.Service.DoOperation("System.SetConfig", $"{configName}", setValue);
  550. }
  551. }
  552. catch (Exception ex)
  553. {
  554. LOG.Info($"N2PurgeFOUPO2CheckSVTextChanged:{ex.Message}");
  555. }
  556. }
  557. public void N2PurgeParaSelect(string ButtonPara)
  558. {
  559. this.GetType().GetProperty($"{ButtonPara}BackGround").SetValue(this, "#FF7DD486");
  560. UpdataProperty();
  561. N2PurgeSelectDialogViewModel dialog = new N2PurgeSelectDialogViewModel(ButtonPara);
  562. WindowManager wm = new WindowManager();
  563. bool? bret = wm.ShowDialog(dialog);
  564. this.GetType().GetProperty($"{ButtonPara}BackGround").SetValue(this, "#FF7DABD4");
  565. UpdataProperty();
  566. if (!(bool)bret)
  567. return;
  568. }
  569. public void UpdataProperty()
  570. {
  571. NotifyOfPropertyChange("TransferRoomVisibleBackGround");
  572. NotifyOfPropertyChange("FOUPOpenVisibleBackGround");
  573. NotifyOfPropertyChange("O2DetectorVisibleBackGround");
  574. NotifyOfPropertyChange("ClampOFFVisibleBackGround");
  575. NotifyOfPropertyChange("OperationCheckVisibleBackGround");
  576. NotifyOfPropertyChange("O2DensityQuickDownVisibleBackGround");
  577. NotifyOfPropertyChange("FoupEnterVisibleBackGround");
  578. NotifyOfPropertyChange("WaferChargeVisibleBackGround");
  579. NotifyOfPropertyChange("BoatLoadVisibleBackGround");
  580. NotifyOfPropertyChange("FoupInhibitAfterVisibleBackGround");
  581. NotifyOfPropertyChange("BoatUnloadVisibleBackGround");
  582. NotifyOfPropertyChange("BoatUnloadPreVisibleBackGround");
  583. NotifyOfPropertyChange("WaferCoolingVisibleBackGround");
  584. NotifyOfPropertyChange("WaferDishargeVisibleBackGround");
  585. }
  586. protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
  587. {
  588. base.InvokeAfterUpdateProperty(data);
  589. NotifyOfPropertyChange("TransferRoomVisibleBackGround");
  590. }
  591. }
  592. }