TMOperationViewModel.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  1. using Aitex.Core.Common.DeviceData;
  2. using Aitex.Core.RT.Log;
  3. using ExcelLibrary.BinaryFileFormat;
  4. using MECF.Framework.Common.DataCenter;
  5. using MECF.Framework.Common.Equipment;
  6. using MECF.Framework.Common.OperationCenter;
  7. using Prism.Commands;
  8. using Prism.Mvvm;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.Collections.ObjectModel;
  12. using System.Linq;
  13. using System.Reflection;
  14. using System.Windows.Threading;
  15. using Venus_Core;
  16. using Venus_MainPages.Unity;
  17. using Venus_MainPages.Views;
  18. using Venus_Themes.CustomControls;
  19. namespace Venus_MainPages.ViewModels
  20. {
  21. public class TMOperationViewModel : BindableBase
  22. {
  23. #region 私有字段
  24. private TMOperationView m_TMOperationView;
  25. private bool m_IsOFFline = true;
  26. private bool m_TMIsOFFline = true;
  27. private bool m_PMAIsInstalled;
  28. private bool m_PMBIsInstalled;
  29. private bool m_PMCIsInstalled;
  30. private bool m_PMDIsInstalled;
  31. private bool m_LLAIsInstalled;
  32. private bool m_LLBIsInstalled;
  33. private Dictionary<string, object> m_RtDataValues;
  34. private string m_ModuleCheckedName = "TM";
  35. private bool m_TMValveN2IsOpen;
  36. private bool m_TMSoftPumpValveIsOpen;
  37. private bool m_TMFastPumpValveIsOpen;
  38. private bool m_TMPurgeValveIsOpen;
  39. private bool m_TMSoftVentValveIsOpen;
  40. private bool m_TMFastVentValveIsOpen;
  41. private bool m_LLASoftPumpValveIsOpen;
  42. private bool m_LLAFastPumpValveIsOpen;
  43. private bool m_LLAPurgeValveIsOpen;
  44. private bool m_LLAVentValveIsOpen;
  45. private bool m_LLBSoftPumpValveIsOpen;
  46. private bool m_LLBFastPumpValveIsOpen;
  47. private bool m_LLBPurgeValveIsOpen;
  48. private bool m_LLBVentValveIsOpen;
  49. private bool m_TMVentExhaustValveIsOpen;
  50. private bool m_LLAVentExhaustValveIsOpen;
  51. private bool m_LLBVentExhaustValveIsOpen;
  52. private List<string> m_RtDataKeys = new List<string>();
  53. private int m_TMOutChamberPressure;
  54. private int m_TMOutChamberFlow;
  55. private int m_TMChamberPressureSetPoint;
  56. private int m_TMChamberFlowSetPoint;
  57. private ObservableCollection<string> m_HomeAllSteps = new ObservableCollection<string>();
  58. private int m_StepProcess;
  59. private bool m_TMIsHoming;
  60. private PressureType m_PressureType;
  61. private TMState m_TMCurrentState;
  62. private LLState m_LLACurrentState;
  63. private LLState m_LLBCurrentState;
  64. private ObservableCollection<PMLeakCheckResult> m_LeakCheckResultList = new ObservableCollection<PMLeakCheckResult>();
  65. private bool m_firstLoad = true;
  66. DispatcherTimer timer;
  67. #endregion
  68. #region 属性
  69. public PressureType PressureType
  70. {
  71. get { return m_PressureType; }
  72. set { SetProperty(ref m_PressureType, value); }
  73. }
  74. public bool TMValveN2IsOpen
  75. {
  76. get { return m_TMValveN2IsOpen; }
  77. set { SetProperty(ref m_TMValveN2IsOpen, value); }
  78. }
  79. public bool TMSoftPumpValveIsOpen
  80. {
  81. get { return m_TMSoftPumpValveIsOpen; }
  82. set { SetProperty(ref m_TMSoftPumpValveIsOpen, value); }
  83. }
  84. public bool TMFastPumpValveIsOpen
  85. {
  86. get { return m_TMFastPumpValveIsOpen; }
  87. set { SetProperty(ref m_TMFastPumpValveIsOpen, value); }
  88. }
  89. public bool TMPurgeValveIsOpen
  90. {
  91. get { return m_TMPurgeValveIsOpen; }
  92. set { SetProperty(ref m_TMPurgeValveIsOpen, value); }
  93. }
  94. public bool TMSoftVentValveIsOpen
  95. {
  96. get { return m_TMSoftVentValveIsOpen; }
  97. set { SetProperty(ref m_TMSoftVentValveIsOpen, value); }
  98. }
  99. public bool TMFastVentValveIsOpen
  100. {
  101. get { return m_TMFastVentValveIsOpen; }
  102. set { SetProperty(ref m_TMFastVentValveIsOpen, value); }
  103. }
  104. public bool LLAFastPumpValveIsOpen
  105. {
  106. get { return m_LLAFastPumpValveIsOpen; }
  107. set { SetProperty(ref m_LLAFastPumpValveIsOpen, value); }
  108. }
  109. public bool LLASoftPumpValveIsOpen
  110. {
  111. get { return m_LLASoftPumpValveIsOpen; }
  112. set { SetProperty(ref m_LLASoftPumpValveIsOpen, value); }
  113. }
  114. public bool LLAPurgeValveIsOpen
  115. {
  116. get { return m_LLAPurgeValveIsOpen; }
  117. set { SetProperty(ref m_LLAPurgeValveIsOpen, value); }
  118. }
  119. public bool LLAVentValveIsOpen
  120. {
  121. get { return m_LLAVentValveIsOpen; }
  122. set { SetProperty(ref m_LLAVentValveIsOpen, value); }
  123. }
  124. public bool LLBSoftPumpValveIsOpen
  125. {
  126. get { return m_LLBSoftPumpValveIsOpen; }
  127. set { SetProperty(ref m_LLBSoftPumpValveIsOpen, value); }
  128. }
  129. public bool LLBFastPumpValveIsOpen
  130. {
  131. get { return m_LLBFastPumpValveIsOpen; }
  132. set { SetProperty(ref m_LLBFastPumpValveIsOpen, value); }
  133. }
  134. public bool LLBPurgeValveIsOpen
  135. {
  136. get { return m_LLBPurgeValveIsOpen; }
  137. set { SetProperty(ref m_LLBPurgeValveIsOpen, value); }
  138. }
  139. public bool LLBVentValveIsOpen
  140. {
  141. get { return m_LLBVentValveIsOpen; }
  142. set { SetProperty(ref m_LLBVentValveIsOpen, value); }
  143. }
  144. public bool TMVentExhaustValveIsOpen
  145. {
  146. get { return m_TMVentExhaustValveIsOpen; }
  147. set { SetProperty(ref m_TMVentExhaustValveIsOpen, value); }
  148. }
  149. public bool LLAVentExhaustValveIsOpen
  150. {
  151. get { return m_LLAVentExhaustValveIsOpen; }
  152. set { SetProperty(ref m_LLAVentExhaustValveIsOpen, value); }
  153. }
  154. public bool LLBVentExhaustValveIsOpen
  155. {
  156. get { return m_LLBVentExhaustValveIsOpen; }
  157. set { SetProperty(ref m_LLBVentExhaustValveIsOpen, value); }
  158. }
  159. public int TMChamberPressureSetPoint
  160. {
  161. get { return m_TMChamberPressureSetPoint; }
  162. set { SetProperty(ref m_TMChamberPressureSetPoint, value); }
  163. }
  164. public int TMChamberFlowSetPoint
  165. {
  166. get { return m_TMChamberFlowSetPoint; }
  167. set { SetProperty(ref m_TMChamberFlowSetPoint, value); }
  168. }
  169. public bool IsOFFline
  170. {
  171. get { return m_IsOFFline; }
  172. set
  173. {
  174. SetProperty(ref m_IsOFFline, value);
  175. }
  176. }
  177. public bool TMIsOFFline
  178. {
  179. get { return m_TMIsOFFline; }
  180. set
  181. {
  182. SetProperty(ref m_TMIsOFFline, value);
  183. }
  184. }
  185. public Dictionary<string, object> RtDataValues
  186. {
  187. get { return m_RtDataValues; }
  188. set { SetProperty(ref m_RtDataValues, value); }
  189. }
  190. public bool PMAIsInstalled
  191. {
  192. get { return m_PMAIsInstalled; }
  193. set { SetProperty(ref m_PMAIsInstalled, value); }
  194. }
  195. public bool PMBIsInstalled
  196. {
  197. get { return m_PMBIsInstalled; }
  198. set { SetProperty(ref m_PMBIsInstalled, value); }
  199. }
  200. public bool PMCIsInstalled
  201. {
  202. get { return m_PMCIsInstalled; }
  203. set { SetProperty(ref m_PMCIsInstalled, value); }
  204. }
  205. public bool PMDIsInstalled
  206. {
  207. get { return m_PMDIsInstalled; }
  208. set { SetProperty(ref m_PMDIsInstalled, value); }
  209. }
  210. public bool LLAIsInstalled
  211. {
  212. get { return m_LLAIsInstalled; }
  213. set { SetProperty(ref m_LLAIsInstalled, value); }
  214. }
  215. public bool LLBIsInstalled
  216. {
  217. get { return m_LLBIsInstalled; }
  218. set { SetProperty(ref m_LLBIsInstalled, value); }
  219. }
  220. public int TMOutChamberFlow
  221. {
  222. get { return m_TMOutChamberFlow; }
  223. set
  224. {
  225. if (value != m_TMOutChamberFlow)
  226. {
  227. InvokeClient.Instance.Service.DoOperation($"TM.SetChamberFlow", value);
  228. }
  229. SetProperty(ref m_TMOutChamberFlow, value);
  230. }
  231. }
  232. public int TMOutChamberPressure
  233. {
  234. get { return m_TMOutChamberPressure; }
  235. set
  236. {
  237. SetProperty(ref m_TMOutChamberPressure, value);
  238. }
  239. }
  240. public ObservableCollection<string> HomeAllSteps
  241. {
  242. get { return m_HomeAllSteps; }
  243. set { SetProperty(ref m_HomeAllSteps, value); }
  244. }
  245. public int StepProcess
  246. {
  247. get { return m_StepProcess; }
  248. set { SetProperty(ref m_StepProcess, value); }
  249. }
  250. public bool TMIsHoming
  251. {
  252. get { return m_TMIsHoming; }
  253. set { SetProperty(ref m_TMIsHoming, value); }
  254. }
  255. public TMState TMCurrentState
  256. {
  257. get { return m_TMCurrentState; }
  258. set
  259. {
  260. if ((m_TMCurrentState == TMState.Leakchecking) && value == TMState.Idle)
  261. {
  262. var AllLeakCheckDa = QueryDataClient.Instance.Service.GetPMLeakCheckResult(m_ModuleCheckedName);
  263. if (AllLeakCheckDa != null)
  264. {
  265. LeakCheckResultList = new ObservableCollection<PMLeakCheckResult>(AllLeakCheckDa);
  266. }
  267. }
  268. SetProperty(ref m_TMCurrentState, value);
  269. }
  270. }
  271. public LLState LLACurrentState
  272. {
  273. get { return m_LLACurrentState; }
  274. set
  275. {
  276. if ((m_LLACurrentState == LLState.LeakCheck) && value == LLState.Idle)
  277. {
  278. var AllLeakCheckDa = QueryDataClient.Instance.Service.GetPMLeakCheckResult(m_ModuleCheckedName);
  279. if (AllLeakCheckDa != null)
  280. {
  281. LeakCheckResultList = new ObservableCollection<PMLeakCheckResult>(AllLeakCheckDa);
  282. }
  283. }
  284. SetProperty(ref m_LLACurrentState, value);
  285. }
  286. }
  287. public LLState LLBCurrentState
  288. {
  289. get { return m_LLBCurrentState; }
  290. set
  291. {
  292. if ((m_LLBCurrentState == LLState.LeakCheck) && value == LLState.Idle)
  293. {
  294. var AllLeakCheckDa = QueryDataClient.Instance.Service.GetPMLeakCheckResult(m_ModuleCheckedName);
  295. if (AllLeakCheckDa != null)
  296. {
  297. LeakCheckResultList = new ObservableCollection<PMLeakCheckResult>(AllLeakCheckDa);
  298. }
  299. }
  300. SetProperty(ref m_LLBCurrentState, value);
  301. }
  302. }
  303. public ObservableCollection<PMLeakCheckResult> LeakCheckResultList
  304. {
  305. get { return m_LeakCheckResultList; }
  306. set { SetProperty(ref m_LeakCheckResultList, value); }
  307. }
  308. #endregion
  309. #region 命令
  310. private DelegateCommand<object> _LoadCommand;
  311. public DelegateCommand<object> LoadCommand =>
  312. _LoadCommand ?? (_LoadCommand = new DelegateCommand<object>(OnLoad));
  313. private DelegateCommand _HomeCommand;
  314. public DelegateCommand HomeCommand =>
  315. _HomeCommand ?? (_HomeCommand = new DelegateCommand(OnHome));
  316. private DelegateCommand _RobotHomeCommand;
  317. public DelegateCommand RobotHomeCommand =>
  318. _RobotHomeCommand ?? (_RobotHomeCommand = new DelegateCommand(OnHome));
  319. private DelegateCommand _VentCommand;
  320. public DelegateCommand VentCommand =>
  321. _VentCommand ?? (_VentCommand = new DelegateCommand(OnVent));
  322. private DelegateCommand _PumpCommand;
  323. public DelegateCommand PumpCommand =>
  324. _PumpCommand ?? (_PumpCommand = new DelegateCommand(OnPump));
  325. private DelegateCommand _PurgeCommand;
  326. public DelegateCommand PurgeCommand =>
  327. _PurgeCommand ?? (_PurgeCommand = new DelegateCommand(OnPurge));
  328. private DelegateCommand _LeakCheckCommand;
  329. public DelegateCommand LeakCheckCommand =>
  330. _LeakCheckCommand ?? (_LeakCheckCommand = new DelegateCommand(OnLeakCheck));
  331. private DelegateCommand _AbortCommand;
  332. public DelegateCommand AbortCommand =>
  333. _AbortCommand ?? (_AbortCommand = new DelegateCommand(OnAbort));
  334. private DelegateCommand<object> _ModuleCheckedCommand;
  335. public DelegateCommand<object> ModuleCheckedCommand =>
  336. _ModuleCheckedCommand ?? (_ModuleCheckedCommand = new DelegateCommand<object>(OnModuleChecked));
  337. private DelegateCommand<object> _ControlValveCommand;
  338. public DelegateCommand<object> ControlValveCommand =>
  339. _ControlValveCommand ?? (_ControlValveCommand = new DelegateCommand<object>(OnControlValve));
  340. //private DelegateCommand _OpenLLPumpCommand;
  341. //public DelegateCommand OpenLLPumpCommand =>
  342. // _OpenLLPumpCommand ?? (_OpenLLPumpCommand = new DelegateCommand(OnOpenLLPump));
  343. //private DelegateCommand _CloseLLPumpCommand;
  344. //public DelegateCommand CloseLLPumpCommand =>
  345. // _CloseLLPumpCommand ?? (_CloseLLPumpCommand = new DelegateCommand(OnCloseLLPump));
  346. private DelegateCommand<object> _OpenPumpCommand;
  347. public DelegateCommand<object> OpenPumpCommand =>
  348. _OpenPumpCommand ?? (_OpenPumpCommand = new DelegateCommand<object>(OnOpenPump));
  349. private DelegateCommand<object> _ClosePumpCommand;
  350. public DelegateCommand<object> ClosePumpCommand =>
  351. _ClosePumpCommand ?? (_ClosePumpCommand = new DelegateCommand<object>(OnClosePump));
  352. private DelegateCommand<object> _DoorUpDownCommand;
  353. public DelegateCommand<object> DoorUpDownCommand =>
  354. _DoorUpDownCommand ?? (_DoorUpDownCommand = new DelegateCommand<object>(OnDoorUpDown));
  355. private DelegateCommand<object> _ChamberDoorOpenCommand;
  356. public DelegateCommand<object> ChamberDoorOpenCommand =>
  357. _ChamberDoorOpenCommand ?? (_ChamberDoorOpenCommand = new DelegateCommand<object>(OnChamberDoorOpen));
  358. private DelegateCommand<object> _ChamberDoorCloseCommand;
  359. public DelegateCommand<object> ChamberDoorCloseCommand =>
  360. _ChamberDoorCloseCommand ?? (_ChamberDoorCloseCommand = new DelegateCommand<object>(OnChamberDoorClose));
  361. private DelegateCommand _SetTMChamberPressureCommand;
  362. public DelegateCommand SetTMChamberPressureCommand =>
  363. _SetTMChamberPressureCommand ?? (_SetTMChamberPressureCommand = new DelegateCommand(OnSetTMChamberPressure));
  364. private DelegateCommand _OnlineCommand;
  365. public DelegateCommand OnlineCommand =>
  366. _OnlineCommand ?? (_OnlineCommand = new DelegateCommand(OnOnline));
  367. private DelegateCommand _OfflineCommand;
  368. public DelegateCommand OfflineCommand =>
  369. _OfflineCommand ?? (_OfflineCommand = new DelegateCommand(OnOffline));
  370. #endregion
  371. #region 构造函数
  372. public TMOperationViewModel()
  373. {
  374. addDataKeys();
  375. RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
  376. string[] allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString().Split(',');
  377. PMAIsInstalled = allModules.Contains("PMA");
  378. PMBIsInstalled = allModules.Contains("PMB");
  379. PMCIsInstalled = allModules.Contains("PMC");
  380. PMDIsInstalled = allModules.Contains("PMD");
  381. LLAIsInstalled = allModules.Contains("LLA");
  382. LLBIsInstalled = allModules.Contains("LLB");
  383. timer = new DispatcherTimer();
  384. timer.Interval = TimeSpan.FromSeconds(0.5);
  385. timer.Tick += timer_Tick;
  386. //timer.Start();
  387. HomeAllSteps.Add("Lid");
  388. HomeAllSteps.Add("Robot");
  389. HomeAllSteps.Add("Slit Door");
  390. HomeAllSteps.Add("Pump ");
  391. object obj = QueryDataClient.Instance.Service.GetData("System.PressureUnitType");
  392. PressureType = (PressureType)Convert.ToInt32(obj);
  393. }
  394. #endregion
  395. #region 命令方法
  396. private void OnLoad(object tmOperationView)
  397. {
  398. if (m_firstLoad)
  399. {
  400. m_TMOperationView = (TMOperationView)tmOperationView;
  401. var AllLeakCheckDa = QueryDataClient.Instance.Service.GetPMLeakCheckResult("TM");
  402. if (AllLeakCheckDa != null)
  403. {
  404. LeakCheckResultList = new ObservableCollection<PMLeakCheckResult>(AllLeakCheckDa);
  405. }
  406. m_firstLoad=false;
  407. }
  408. }
  409. private void OnHome()
  410. {
  411. InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.Home");
  412. }
  413. //private void OnRobotHome()
  414. //{
  415. // InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.RobotHome");
  416. //}
  417. private void OnVent()
  418. {
  419. InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.{RtOperation.Vent}");
  420. }
  421. private void OnPump()
  422. {
  423. InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.{RtOperation.Pump}");
  424. }
  425. private void OnPurge()
  426. {
  427. InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.{RtOperation.Purge}");
  428. }
  429. private void OnLeakCheck()
  430. {
  431. InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.{RtOperation.LeakCheck}");
  432. }
  433. private void OnAbort()
  434. {
  435. InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.{RtOperation.Abort}");
  436. }
  437. private void OnModuleChecked(object obj)
  438. {
  439. m_ModuleCheckedName = obj.ToString();
  440. }
  441. private void OnControlValve(object obj)
  442. {
  443. CommonValveControl commonValveControl = (CommonValveControl)obj;
  444. if (commonValveControl.IsCanEdit == true)
  445. {
  446. InvokeClient.Instance.Service.DoOperation($"TM.{commonValveControl.Tag.ToString()}.{AITValveOperation.GVTurnValve}", !commonValveControl.Status);
  447. string operation = commonValveControl.Status ? "关闭" : "打开";
  448. LOG.Info($"{ModuleName.TM},{operation}{commonValveControl.Tag.ToString()}");
  449. }
  450. }
  451. private void OnOpenPump(object obj)
  452. {
  453. InvokeClient.Instance.Service.DoOperation($"{obj}.ControlPump", true);
  454. }
  455. private void OnClosePump(object obj)
  456. {
  457. InvokeClient.Instance.Service.DoOperation($"{obj}.ControlPump", false);
  458. }
  459. //private void OnOpenLLPump()
  460. //{
  461. // InvokeClient.Instance.Service.DoOperation("LL.ControlPump", true);
  462. //}
  463. //private void OnCloseLLPump()
  464. //{
  465. // InvokeClient.Instance.Service.DoOperation("LL.ControlPump", false);
  466. //}
  467. private void OnDoorUpDown(object obj)
  468. {
  469. InvokeClient.Instance.Service.DoOperation(obj.ToString());
  470. }
  471. private void OnChamberDoorOpen(object obj)
  472. {
  473. InvokeClient.Instance.Service.DoOperation($"{obj?.ToString()}.SlitDoor.Open");
  474. }
  475. private void OnChamberDoorClose(object obj)
  476. {
  477. InvokeClient.Instance.Service.DoOperation($"{obj?.ToString()}.SlitDoor.Close");
  478. }
  479. private void OnSetTMChamberPressure()
  480. {
  481. if (CommonFunction.GetValue<bool>(RtDataValues, $"{m_ModuleCheckedName}.IsEnableControlPressure"))
  482. {
  483. InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.{RtOperation.AbortControlPressure}");
  484. }
  485. else
  486. {
  487. InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.{RtOperation.ControlPressure}");
  488. }
  489. }
  490. private void OnOnline()
  491. {
  492. InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.{RtOperation.Online}");
  493. }
  494. private void OnOffline()
  495. {
  496. InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.{RtOperation.Offline}");
  497. }
  498. #endregion
  499. #region 私有方法
  500. void timer_Tick(object sender, EventArgs e)
  501. {
  502. TMOutChamberPressure = (int)QueryDataClient.Instance.Service.GetConfig("TM.ControlPressureSetPoint");
  503. RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
  504. if (RtDataValues == null)
  505. {
  506. return;
  507. }
  508. TMValveN2IsOpen = CommonFunction.GetValue<bool>(RtDataValues, "TM.TMValveN2.IsOpen");
  509. TMSoftPumpValveIsOpen = CommonFunction.GetValue<bool>(RtDataValues, "TM.TMSoftPumpValve.IsOpen"); ;
  510. TMFastPumpValveIsOpen = CommonFunction.GetValue<bool>(RtDataValues, "TM.TMFastPumpValve.IsOpen"); ;
  511. //TMPurgeValveIsOpen = CommonFunction.GetValue<bool>(RtDataValues, "TM.TMPurgeValve.IsOpen"); ;
  512. TMSoftVentValveIsOpen = CommonFunction.GetValue<bool>(RtDataValues, "TM.TMPurgeValve.IsOpen"); ;
  513. TMFastVentValveIsOpen = CommonFunction.GetValue<bool>(RtDataValues, "TM.TMVentValve.IsOpen"); ;
  514. LLASoftPumpValveIsOpen = CommonFunction.GetValue<bool>(RtDataValues, "TM.LLASoftPumpValve.IsOpen");
  515. LLAFastPumpValveIsOpen = CommonFunction.GetValue<bool>(RtDataValues, "TM.LLAFastPumpValve.IsOpen");
  516. LLAPurgeValveIsOpen = CommonFunction.GetValue<bool>(RtDataValues, "TM.LLAPurgeValve.IsOpen");
  517. LLAVentValveIsOpen = CommonFunction.GetValue<bool>(RtDataValues, "TM.LLAVentValve.IsOpen");
  518. LLBSoftPumpValveIsOpen = CommonFunction.GetValue<bool>(RtDataValues, "TM.LLBSoftPumpValve.IsOpen");
  519. LLBFastPumpValveIsOpen = CommonFunction.GetValue<bool>(RtDataValues, "TM.LLBFastPumpValve.IsOpen");
  520. LLBPurgeValveIsOpen = CommonFunction.GetValue<bool>(RtDataValues, "TM.LLBPurgeValve.IsOpen");
  521. LLBVentValveIsOpen = CommonFunction.GetValue<bool>(RtDataValues, "TM.LLBVentValve.IsOpen");
  522. LLAVentExhaustValveIsOpen= CommonFunction.GetValue<bool>(RtDataValues, "TM.LLAVentExhaustValve.IsOpen");
  523. LLBVentExhaustValveIsOpen = CommonFunction.GetValue<bool>(RtDataValues, "TM.LLBVentExhaustValve.IsOpen");
  524. TMVentExhaustValveIsOpen = CommonFunction.GetValue<bool>(RtDataValues, "TM.TMVentExhaustValve.IsOpen");
  525. IsOFFline = !CommonFunction.GetValue<bool>(RtDataValues, $"{m_ModuleCheckedName}.IsOnline");
  526. TMIsOFFline = !CommonFunction.GetValue<bool>(RtDataValues, $"TM.IsOnline");
  527. TMCurrentState = (TMState)(Enum.Parse(typeof(TMState), RtDataValues[$"TM.FsmState"].ToString()));
  528. LLACurrentState = (LLState)(Enum.Parse(typeof(LLState), RtDataValues[$"LLA.FsmState"].ToString()));
  529. LLBCurrentState = (LLState)(Enum.Parse(typeof(LLState), RtDataValues[$"LLB.FsmState"].ToString()));
  530. TMIsHoming = TMCurrentState == TMState.Initializing || (TMState)(Enum.Parse(typeof(TMState), RtDataValues[$"TM.FsmState"].ToString())) == TMState.InitializingRB;
  531. //if (m_TMOperationView != null)
  532. //{
  533. // m_TMOperationView.stepBar.Progress = CommonFunction.GetValue<int>(RtDataValues, "TM.Home.StepNo");
  534. //}
  535. }
  536. private void addDataKeys()
  537. {
  538. m_RtDataKeys.Add($"TM.TMValveN2.IsOpen");
  539. m_RtDataKeys.Add($"TM.TMSoftPumpValve.IsOpen");
  540. m_RtDataKeys.Add($"TM.TMFastPumpValve.IsOpen");
  541. m_RtDataKeys.Add($"TM.TMPurgeValve.IsOpen");
  542. //m_RtDataKeys.Add($"TM.TMSoftVentValve.IsOpen");
  543. m_RtDataKeys.Add($"TM.TMVentValve.IsOpen");
  544. m_RtDataKeys.Add($"TM.LLASoftPumpValve.IsOpen");
  545. m_RtDataKeys.Add($"TM.LLAFastPumpValve.IsOpen");
  546. m_RtDataKeys.Add($"TM.LLAPurgeValve.IsOpen");
  547. m_RtDataKeys.Add($"TM.LLBPurgeValve.IsOpen");
  548. m_RtDataKeys.Add($"TM.LLAVentValve.IsOpen");
  549. m_RtDataKeys.Add($"TM.LLBVentValve.IsOpen");
  550. m_RtDataKeys.Add($"TM.LLBSoftPumpValve.IsOpen");
  551. m_RtDataKeys.Add($"TM.LLBFastPumpValve.IsOpen");
  552. m_RtDataKeys.Add($"TM.TMVentExhaustValve.IsOpen");
  553. m_RtDataKeys.Add($"TM.LLAVentExhaustValve.IsOpen");
  554. m_RtDataKeys.Add($"TM.LLBVentExhaustValve.IsOpen");
  555. m_RtDataKeys.Add($"TM.TMVacSwitch.Value");
  556. m_RtDataKeys.Add($"TM.LLAVacSwitch.Value");
  557. m_RtDataKeys.Add($"TM.LLBVacSwitch.Value");
  558. m_RtDataKeys.Add($"TM.TMATMSwitch.Value");
  559. m_RtDataKeys.Add($"TM.LLAATMSwitch.Value");
  560. m_RtDataKeys.Add($"TM.LLBATMSwitch.Value");
  561. m_RtDataKeys.Add($"TM.TMProcessGauge.Value");
  562. m_RtDataKeys.Add($"TM.TMForelineGauge.Value");
  563. m_RtDataKeys.Add($"TM.LLAPressureGauge.Value");
  564. m_RtDataKeys.Add($"TM.LLBPressureGauge.Value");
  565. m_RtDataKeys.Add($"TM.LLAForelineGauge.Value");
  566. m_RtDataKeys.Add($"TM.LLBForelineGauge.Value");
  567. m_RtDataKeys.Add($"TM.PumpIsRunning");
  568. m_RtDataKeys.Add($"LLA.PumpIsRunning");
  569. m_RtDataKeys.Add($"LLB.PumpIsRunning");
  570. m_RtDataKeys.Add("PMA.IsSlitDoorClosed");
  571. m_RtDataKeys.Add("PMB.IsSlitDoorClosed");
  572. m_RtDataKeys.Add("PMC.IsSlitDoorClosed");
  573. m_RtDataKeys.Add("PMD.IsSlitDoorClosed");
  574. m_RtDataKeys.Add("TM.LLATSlitDoor.IsClosed");
  575. m_RtDataKeys.Add("TM.LLBTSlitDoor.IsClosed");
  576. m_RtDataKeys.Add("TM.LLAESlitDoor.IsClosed");
  577. m_RtDataKeys.Add("TM.LLBESlitDoor.IsClosed");
  578. m_RtDataKeys.Add("TM.N2PressureSwitch.Value");
  579. m_RtDataKeys.Add("TM.TMPressureCtrl.TMChamberSetPoint");
  580. m_RtDataKeys.Add("TM.TMPressureCtrl.LLAChamberSetPoint");
  581. m_RtDataKeys.Add("TM.TMPressureCtrl.LLBChamberSetPoint");
  582. m_RtDataKeys.Add("LLA.IsOnline");
  583. m_RtDataKeys.Add("LLB.IsOnline");
  584. m_RtDataKeys.Add("TM.IsOnline");
  585. m_RtDataKeys.Add("TM.FsmState");
  586. m_RtDataKeys.Add("LLA.FsmState");
  587. m_RtDataKeys.Add("LLB.FsmState");
  588. m_RtDataKeys.Add("TM.Home.StepNo");
  589. m_RtDataKeys.Add("TM.PMASlitDoor.IsClosed");
  590. m_RtDataKeys.Add("TM.PMBSlitDoor.IsClosed");
  591. m_RtDataKeys.Add("TM.PMCSlitDoor.IsClosed");
  592. m_RtDataKeys.Add("TM.PMDSlitDoor.IsClosed");
  593. m_RtDataKeys.Add("LLA.IsEnableControlPressure");
  594. m_RtDataKeys.Add("LLB.IsEnableControlPressure");
  595. }
  596. public void EnterExitView(bool isEnter)
  597. {
  598. if (isEnter)
  599. {
  600. timer_Tick(null, null);
  601. timer.Start();
  602. }
  603. else
  604. {
  605. timer.Stop();
  606. }
  607. }
  608. #endregion
  609. }
  610. }