SystemFacilitiesViewModel.cs 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. using Aitex.Core.RT.DataCenter;
  2. using Aitex.Core.RT.Log;
  3. using Aitex.Core.UI.Dialog;
  4. using Aitex.Core.UI.MVVM;
  5. using Aitex.Core.Util;
  6. using Aitex.Core.Utilities;
  7. using MECF.Framework.Common.CommonData;
  8. using MECF.Framework.Common.DataCenter;
  9. using MECF.Framework.Common.Equipment;
  10. using MECF.Framework.Common.OperationCenter;
  11. using MECF.Framework.Common.RecipeCenter;
  12. using MECF.Framework.Common.Utilities;
  13. using CyberX8_Core;
  14. using CyberX8_MainPages.PMs;
  15. using CyberX8_Themes.UserControls;
  16. using Prism.Mvvm;
  17. using System;
  18. using System.Collections.Generic;
  19. using System.Collections.ObjectModel;
  20. using System.ComponentModel;
  21. using System.Linq;
  22. using System.Reflection;
  23. using System.Text;
  24. using System.Threading.Tasks;
  25. using System.Timers;
  26. using System.Windows;
  27. using System.Windows.Input;
  28. using System.Windows.Threading;
  29. namespace CyberX8_MainPages.ViewModels
  30. {
  31. public class SystemFacilitiesViewModel : BindableBase
  32. {
  33. #region 常量
  34. private const string FACILITIES = "Facilities";
  35. private const string FACILITIES_DATA = "Facilities_Data";
  36. private const string N2_ENABLE = "N2Enable";
  37. private const string CDA_ENABLE = "CDAEnable";
  38. private const string EXTERNAL_CDA_ENABLE = "ExternalCDAEnable";
  39. private const string DI_WATER_ENABLE = "DiWaterEnable";
  40. private const string HOUSE_CHILLED_WATER_ENABLE="HouseChilledWaterEnable";
  41. private const string DI_REPLEN_ENABLE = "DiReplenEnable";
  42. private const string DI_FILL_ENABLE = "DiFillEnable";
  43. private const string LOADER_DI_ENABLE = "LoaderDiEnable";
  44. private const string FILTER_PURGE_ENABLE = "FilterPurgeEnable";
  45. private const string N2_BLANKET_PRESSURE_VALUE = "N2BlanketPressure";
  46. private const string SAMPLE_ENABLE = "SampleEnable";
  47. private const string SAMPLE_FLOW_1_ENABLE = "SampleFlow1Enable";
  48. private const string SAMPLE_FLOW_2_ENABLE = "SampleFlow2Enable";
  49. private const string SAMPLE_FLOW_3_ENABLE = "SampleFlow3Enable";
  50. private const string SAMPLE_FLOW_4_ENABLE = "SampleFlow4Enable";
  51. private const string FFU_LOADER_ERROR = "FFULoaderError";
  52. private const string FFU_PROCESS_ERROR = "FFUProcessError";
  53. private const string FFU_LOADER_PRESSURE = "FFULoaderPressure";
  54. private const string FFU_PROCESS_PRESSURE = "FFUProcessPressure";
  55. private const string ARS_FLUID_DETECT = "ArsFluidDetect";
  56. private const string PROCESS_FLUID_DETECT= "ProcessFluidDetect";
  57. private const string SAMPLE_FLUID_DETECT = "SampleFluidDetect";
  58. #endregion
  59. #region 内部变量
  60. private CommonLimitData _nitrogen1AData = new CommonLimitData();
  61. private CommonLimitData _nitrogen1BData = new CommonLimitData();
  62. private CommonLimitData _nitrogen2AData = new CommonLimitData();
  63. private CommonLimitData _nitrogen2BData = new CommonLimitData();
  64. private CommonLimitData _vacuumData = new CommonLimitData();
  65. private CommonLimitData _cda1Data = new CommonLimitData();
  66. private CommonLimitData _cda2Data = new CommonLimitData();
  67. private CommonLimitData _extendCdaData = new CommonLimitData();
  68. private CommonLimitData _exhaustData = new CommonLimitData();
  69. private CommonLimitData _diWaterPressureData = new CommonLimitData();
  70. private CommonLimitData _houseChilledWaterFlowData = new CommonLimitData();
  71. private bool _nitrogenOn;
  72. private bool _cdaOn;
  73. private bool _extendCdaOn;
  74. private bool _diWaterPressureOn;
  75. private bool _houseChilledWaterFlowOn;
  76. private bool _diFillEnable;
  77. private bool _diReplenEnable;
  78. private bool _loaderDiEnable;
  79. private bool _slipstreamEnable;
  80. private bool _filterPurgeEnable;
  81. private double _n2BlanketPressure;
  82. private int _allStatus;
  83. private bool _processFluidDetect;
  84. private bool _sampleFluidDetect;
  85. private bool _arsFluidDetect;
  86. private bool _crsWashBoxFluidDetect;
  87. private bool _processFFUError;
  88. private bool _loaderFFUError;
  89. private double _processFFUPressure;
  90. private double _loaderFFUPressure;
  91. private bool _sampleEnable;
  92. private bool _sampleFlow1Enable;
  93. private bool _sampleFlow2Enable;
  94. private bool _sampleFlow3Enable;
  95. private bool _sampleFlow4Enable;
  96. private bool _startEnable;
  97. /// <summary>
  98. /// 定时器
  99. /// </summary>
  100. DispatcherTimer _timer;
  101. /// <summary>
  102. /// 查询后台数据集合
  103. /// </summary>
  104. private List<string> _rtDataKeys = new List<string>();
  105. /// <summary>
  106. /// rt查询key数值字典
  107. /// </summary>
  108. private Dictionary<string, object> _rtDataValueDic = new Dictionary<string, object>();
  109. #region Home
  110. private bool _homeAllOn;
  111. private bool _homeLoaderTransporterOn;
  112. private bool _homeEfemOn;
  113. private bool _homeProcessTransporterOn;
  114. private bool _homeLoaderOn;
  115. private bool _homePufOn;
  116. private bool _homeSrdOn;
  117. #endregion
  118. #endregion
  119. #region 属性
  120. public CommonLimitData Nitrogen1AData{ get { return _nitrogen1AData; } set { SetProperty(ref _nitrogen1AData, value); } }
  121. public CommonLimitData Nitrogen1BData { get { return _nitrogen1BData; } set { SetProperty(ref _nitrogen1BData, value); }}
  122. public CommonLimitData Nitrogen2AData { get { return _nitrogen2AData; } set { SetProperty(ref _nitrogen2AData, value); } }
  123. public CommonLimitData Nitrogen2BData { get { return _nitrogen2BData; } set { SetProperty(ref _nitrogen2BData, value); } }
  124. public CommonLimitData VacuumData { get { return _vacuumData; } set { SetProperty(ref _vacuumData, value); } }
  125. public CommonLimitData Cda1Data { get { return _cda1Data; }set { SetProperty(ref _cda1Data, value); } }
  126. public CommonLimitData Cda2Data{ get { return _cda2Data; } set { SetProperty(ref _cda2Data, value); }}
  127. public CommonLimitData ExtendCdaData{ get { return _extendCdaData; } set { SetProperty(ref _extendCdaData, value); }}
  128. public CommonLimitData ExhaustData{ get { return _exhaustData; } set { SetProperty(ref _exhaustData, value); } }
  129. public CommonLimitData DiWaterPressureData { get { return _diWaterPressureData; } set { SetProperty(ref _diWaterPressureData, value); }}
  130. public CommonLimitData HouseChilledWaterFlowData{ get { return _houseChilledWaterFlowData; } set { SetProperty(ref _houseChilledWaterFlowData, value); }}
  131. public bool NitrogenOn { get { return _nitrogenOn; } set { SetProperty(ref _nitrogenOn, value); }}
  132. public bool CdaOn { get { return _cdaOn; } set { SetProperty(ref _cdaOn, value); } }
  133. public bool ExtendCdaOn { get { return _extendCdaOn; } set { SetProperty(ref _extendCdaOn, value); } }
  134. public bool DiWaterPressureOn{ get { return _diWaterPressureOn; } set { SetProperty(ref _diWaterPressureOn, value); } }
  135. public bool HouseChilledWaterFlowOn { get { return _houseChilledWaterFlowOn; } set { SetProperty(ref _houseChilledWaterFlowOn, value); } }
  136. public bool DiFillEnable{ get { return _diFillEnable; } set { SetProperty(ref _diFillEnable, value); }}
  137. public bool DiReplenEnable{get { return _diReplenEnable; }set { SetProperty(ref _diReplenEnable, value); } }
  138. public bool LoaderDiEnable{ get { return _loaderDiEnable; } set { SetProperty(ref _loaderDiEnable, value); }}
  139. public bool SlipstreamEnable { get { return _slipstreamEnable; } set { SetProperty(ref _slipstreamEnable, value); }}
  140. public bool FilterPurgeEnable{ get { return _filterPurgeEnable; } set { SetProperty(ref _filterPurgeEnable, value);} }
  141. public double N2BlanketPressure{ get { return _n2BlanketPressure; } set { SetProperty(ref _n2BlanketPressure, value); }}
  142. public int AllStatus { get { return _allStatus; } set { SetProperty(ref _allStatus, value); } }
  143. #region Fluid Detect
  144. public bool ProcessFluidDetect { get { return _processFluidDetect; } set { SetProperty(ref _processFluidDetect, value); }}
  145. public bool SampleFluidDetect { get { return _sampleFluidDetect; } set { SetProperty(ref _sampleFluidDetect, value); } }
  146. public bool ArsFluidDetect{ get { return _arsFluidDetect; } set { SetProperty(ref _arsFluidDetect, value); }}
  147. public bool CRSWashBoxFluidDetect { get { return _crsWashBoxFluidDetect; } set { SetProperty(ref _crsWashBoxFluidDetect, value); } }
  148. #endregion
  149. #region FFU
  150. public bool ProcessFFUError { get { return _processFFUError; } set { SetProperty(ref _processFFUError, value); } }
  151. public bool LoaderFFUError { get { return _loaderFFUError; } set { SetProperty(ref _loaderFFUError, value); } }
  152. public double ProcessFFUPressure { get { return _processFFUPressure; } set { SetProperty(ref _processFFUPressure, value); } }
  153. public double LoaderFFUPressure { get { return _loaderFFUPressure; } set { SetProperty(ref _loaderFFUPressure, value); } }
  154. #endregion
  155. #region Home
  156. public bool HomeAllOn { get { return _homeAllOn; } set { SetProperty(ref _homeAllOn, value); } }
  157. public bool HomeLoaderTransporterOn { get { return _homeLoaderTransporterOn; } set { SetProperty(ref _homeLoaderTransporterOn, value); }}
  158. public bool HomeEfemOn { get { return _homeEfemOn; } set { SetProperty(ref _homeEfemOn, value); }}
  159. public bool HomeProcessTransporterOn{ get { return _homeProcessTransporterOn; } set { SetProperty(ref _homeProcessTransporterOn, value); } }
  160. public bool HomeLoaderOn { get { return _homeLoaderOn; } set { SetProperty(ref _homeLoaderOn, value); }}
  161. public bool HomePufOn { get { return _homePufOn; } set { SetProperty(ref _homePufOn, value); }}
  162. public bool HomeSrdOn { get { return _homeSrdOn; } set { SetProperty(ref _homeSrdOn, value); } }
  163. #endregion
  164. public bool SampleEnable { get { return _sampleEnable; } set { SetProperty(ref _sampleEnable, value); } }
  165. public bool SampleFlow1Enable { get { return _sampleFlow1Enable; } set { SetProperty(ref _sampleFlow1Enable, value); } }
  166. public bool SampleFlow2Enable { get { return _sampleFlow2Enable; } set { SetProperty(ref _sampleFlow2Enable, value); } }
  167. public bool SampleFlow3Enable { get { return _sampleFlow3Enable; } set { SetProperty(ref _sampleFlow3Enable, value); } }
  168. public bool SampleFlow4Enable { get { return _sampleFlow4Enable; } set { SetProperty(ref _sampleFlow4Enable, value); } }
  169. public bool StartEnable { get { return _startEnable; } set { SetProperty(ref _startEnable, value); } }
  170. #endregion
  171. #region 指令
  172. public ICommand HomeLoaderCommand { get; private set;}
  173. public ICommand HomePufCommand { get; private set;}
  174. public ICommand HomeEfemCommand { get; private set; }
  175. public ICommand HomeLoaderTransporterCommand { get;private set; }
  176. public ICommand HomeProcessTransporterCommand{get;private set;}
  177. public ICommand HomeSRDCommand { get; private set; }
  178. public ICommand NitrogenOnCommand{get;private set;}
  179. public ICommand NitrogenOffCommand{ get;private set;}
  180. public ICommand CDAOnCommand { get; private set; }
  181. public ICommand CDAOffCommand { get; private set; }
  182. public ICommand ExternalCDAOnCommand { get;private set; }
  183. public ICommand ExternalCDAOffCommand { get;private set; }
  184. public ICommand DiWaterPressureOnCommand { get; private set; }
  185. public ICommand DiWaterPressureOffCommand { get; private set; }
  186. public ICommand HouseChilledWaferFlowOnCommand { get; private set; }
  187. public ICommand HouseChilledWaferFlowOffCommand { get; private set; }
  188. public ICommand DiFillEnableCommand { get; private set; }
  189. public ICommand DiFillDisableCommand { get; private set; }
  190. public ICommand DiReplenEnableCommand { get; private set; }
  191. public ICommand DiReplenDisableCommand { get; private set; }
  192. public ICommand LoaderDIEnableCommand { get; private set; }
  193. public ICommand LoaderDIDisableCommand { get; private set; }
  194. public ICommand FilterPurgeEnableCommand { get; private set; }
  195. public ICommand FilterPurgeDisableCommand { get; private set; }
  196. public ICommand AllOnCommand { get; private set; }
  197. public ICommand AllOffCommand { get; private set; }
  198. public ICommand SampleEnableCommand { get; private set; }
  199. public ICommand SampleDisableCommand { get; private set; }
  200. #endregion
  201. /// <summary>
  202. /// 构造函数
  203. /// </summary>
  204. public SystemFacilitiesViewModel()
  205. {
  206. HomeLoaderCommand = new DelegateCommand<object>(HomeLoaderAction);
  207. HomePufCommand=new DelegateCommand<object>(HomePufAction);
  208. HomeEfemCommand = new DelegateCommand<object>(HomeEfemAction);
  209. HomeLoaderTransporterCommand = new DelegateCommand<object>(HomeLoaderTransporterAction);
  210. HomeProcessTransporterCommand = new DelegateCommand<object>(HomeProcessTransporterAction);
  211. HomeSRDCommand = new DelegateCommand<object>(HomeSRDsAction);
  212. NitrogenOnCommand = new DelegateCommand<object>(NitrogenOnAction);
  213. NitrogenOffCommand = new DelegateCommand<object>(NitrogenOffAction);
  214. CDAOnCommand=new DelegateCommand<object>(CDAOnAction);
  215. CDAOffCommand=new DelegateCommand<object>(CDAOffAction);
  216. ExternalCDAOnCommand = new DelegateCommand<object>(ExternalCDAOnAction);
  217. ExternalCDAOffCommand = new DelegateCommand<object>(ExternalCDAOffAction);
  218. DiWaterPressureOnCommand = new DelegateCommand<object>(DiWaterOnAction);
  219. DiWaterPressureOffCommand = new DelegateCommand<object>(DiWaterOffAction);
  220. HouseChilledWaferFlowOnCommand = new DelegateCommand<object>(HouseChilledWaterOnAction);
  221. HouseChilledWaferFlowOffCommand = new DelegateCommand<object>(HouseChilledWaterOffAction);
  222. DiFillEnableCommand = new DelegateCommand<object>(DiFillEnableAction);
  223. DiFillDisableCommand=new DelegateCommand<object>(DiFillDisableAction);
  224. DiReplenEnableCommand = new DelegateCommand<object>(DiReplenEnableAction);
  225. DiReplenDisableCommand = new DelegateCommand<object>(DiReplenDisableAction);
  226. LoaderDIEnableCommand = new DelegateCommand<object>(LoaderDiEnableAction);
  227. LoaderDIDisableCommand = new DelegateCommand<object>(LoaderDiDisableAction);
  228. FilterPurgeEnableCommand = new DelegateCommand<object>(FilterPurgeEnableAction);
  229. FilterPurgeDisableCommand = new DelegateCommand<object>(FilterPurgeDisableAction);
  230. AllOnCommand=new DelegateCommand<object>(AllOnAction);
  231. AllOffCommand=new DelegateCommand<object>(AllOffAction);
  232. SampleEnableCommand = new DelegateCommand<object>(SampleEnableAction);
  233. SampleDisableCommand = new DelegateCommand<object>(SampleDisableAction);
  234. }
  235. /// <summary>
  236. /// 加载数据
  237. /// </summary>
  238. public void LoadData(string systemName)
  239. {
  240. InitialKeys();
  241. if (_timer == null)
  242. {
  243. _timer = new DispatcherTimer();
  244. _timer.Interval = TimeSpan.FromMilliseconds(200) ;
  245. _timer.Tick += Timer_Tick; ;
  246. }
  247. _timer.Start();
  248. }
  249. /// <summary>
  250. /// 定时器执行
  251. /// </summary>
  252. /// <param name="sender"></param>
  253. /// <param name="e"></param>
  254. /// <exception cref="NotImplementedException"></exception>
  255. private void Timer_Tick(object sender, EventArgs e)
  256. {
  257. if (_rtDataKeys.Count != 0)
  258. {
  259. _rtDataValueDic = QueryDataClient.Instance.Service.PollData(_rtDataKeys);
  260. if (_rtDataValueDic != null)
  261. {
  262. HomeEfemOn = CommonFunction.GetValue<bool>(_rtDataValueDic, $"{ModuleName.EFEM}.IsHomed");
  263. bool puf1 = CommonFunction.GetValue<bool>(_rtDataValueDic, $"{ModuleName.PUF1}.IsHomed");
  264. bool puf2 = CommonFunction.GetValue<bool>(_rtDataValueDic, $"{ModuleName.PUF2}.IsHomed");
  265. HomePufOn = puf1 && puf2;
  266. HomeLoaderOn = CommonFunction.GetValue<bool>(_rtDataValueDic, $"{ModuleName.Loader1}.IsHomed");
  267. List<CommonLimitData> facilitiesDatas = CommonFunction.GetValue<List<CommonLimitData>>(_rtDataValueDic, $"System.{FACILITIES}.{FACILITIES_DATA}");
  268. if (facilitiesDatas != null)
  269. {
  270. Cda1Data = facilitiesDatas[0];
  271. Cda2Data = facilitiesDatas[1];
  272. Nitrogen1AData = facilitiesDatas[2];
  273. Nitrogen1BData = facilitiesDatas[3];
  274. Nitrogen2AData = facilitiesDatas[4];
  275. Nitrogen2BData = facilitiesDatas[5];
  276. DiWaterPressureData = facilitiesDatas[6];
  277. HouseChilledWaterFlowData = facilitiesDatas[7];
  278. ExtendCdaData = facilitiesDatas[8];
  279. VacuumData = facilitiesDatas[9];
  280. ExhaustData = facilitiesDatas[10];
  281. }
  282. NitrogenOn = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{N2_ENABLE}");
  283. CdaOn = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{CDA_ENABLE}");
  284. ExtendCdaOn = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{EXTERNAL_CDA_ENABLE}");
  285. DiWaterPressureOn = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{DI_WATER_ENABLE}");
  286. HouseChilledWaterFlowOn = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{HOUSE_CHILLED_WATER_ENABLE}");
  287. DiFillEnable = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{DI_FILL_ENABLE}");
  288. DiReplenEnable = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{DI_REPLEN_ENABLE}");
  289. LoaderDiEnable = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{LOADER_DI_ENABLE}");
  290. FilterPurgeEnable = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{FILTER_PURGE_ENABLE}");
  291. N2BlanketPressure = CommonFunction.GetValue<double>(_rtDataValueDic, $"System.{FACILITIES}.{N2_BLANKET_PRESSURE_VALUE}");
  292. SampleEnable = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{SAMPLE_ENABLE}");
  293. SampleFlow1Enable = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{SAMPLE_FLOW_1_ENABLE}");
  294. SampleFlow2Enable = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{SAMPLE_FLOW_2_ENABLE}");
  295. SampleFlow3Enable = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{SAMPLE_FLOW_3_ENABLE}");
  296. SampleFlow4Enable = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{SAMPLE_FLOW_4_ENABLE}");
  297. LoaderFFUError = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{FFU_LOADER_ERROR}");
  298. ProcessFFUError = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{FFU_PROCESS_ERROR}");
  299. LoaderFFUPressure = CommonFunction.GetValue<double>(_rtDataValueDic, $"System.{FACILITIES}.{FFU_LOADER_PRESSURE}");
  300. ProcessFFUPressure = CommonFunction.GetValue<double>(_rtDataValueDic, $"System.{FACILITIES}.{FFU_PROCESS_PRESSURE}");
  301. ArsFluidDetect = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{ARS_FLUID_DETECT}");
  302. ProcessFluidDetect = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{PROCESS_FLUID_DETECT}");
  303. SampleFluidDetect = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{SAMPLE_FLUID_DETECT}");
  304. AllStatus = (NitrogenOn && CdaOn && DiWaterPressureOn && HouseChilledWaterFlowOn && DiFillEnable && DiReplenEnable && LoaderDiEnable) ? 1 :
  305. (!NitrogenOn && !CdaOn && !DiWaterPressureOn && !HouseChilledWaterFlowOn && !DiFillEnable && !DiReplenEnable && !LoaderDiEnable) ? 0 : -1;
  306. }
  307. }
  308. }
  309. /// <summary>
  310. /// 隐藏
  311. /// </summary>
  312. public void Hide()
  313. {
  314. if (_timer != null)
  315. {
  316. _timer.Stop();
  317. }
  318. }
  319. /// <summary>
  320. /// 初始化Keys
  321. /// </summary>
  322. private void InitialKeys()
  323. {
  324. _rtDataKeys.Clear();
  325. _rtDataKeys.Add($"{ModuleName.EFEM}.IsHomed");
  326. _rtDataKeys.Add($"{ModuleName.Loader1}.IsHomed");
  327. _rtDataKeys.Add($"{ModuleName.PUF1}.IsHomed");
  328. _rtDataKeys.Add($"{ModuleName.PUF2}.IsHomed");
  329. _rtDataKeys.Add($"System.{FACILITIES}.{FACILITIES_DATA}");
  330. _rtDataKeys.Add($"System.{FACILITIES}.{N2_ENABLE}");
  331. _rtDataKeys.Add($"System.{FACILITIES}.{CDA_ENABLE}");
  332. _rtDataKeys.Add($"System.{FACILITIES}.{EXTERNAL_CDA_ENABLE}");
  333. _rtDataKeys.Add($"System.{FACILITIES}.{DI_WATER_ENABLE}");
  334. _rtDataKeys.Add($"System.{FACILITIES}.{HOUSE_CHILLED_WATER_ENABLE}");
  335. _rtDataKeys.Add($"System.{FACILITIES}.{DI_FILL_ENABLE}");
  336. _rtDataKeys.Add($"System.{FACILITIES}.{DI_REPLEN_ENABLE}");
  337. _rtDataKeys.Add($"System.{FACILITIES}.{LOADER_DI_ENABLE}");
  338. _rtDataKeys.Add($"System.{FACILITIES}.{FILTER_PURGE_ENABLE}");
  339. _rtDataKeys.Add($"System.{FACILITIES}.{N2_BLANKET_PRESSURE_VALUE}");
  340. _rtDataKeys.Add($"System.{FACILITIES}.{SAMPLE_ENABLE}");
  341. _rtDataKeys.Add($"System.{FACILITIES}.{SAMPLE_FLOW_1_ENABLE}");
  342. _rtDataKeys.Add($"System.{FACILITIES}.{SAMPLE_FLOW_2_ENABLE}");
  343. _rtDataKeys.Add($"System.{FACILITIES}.{SAMPLE_FLOW_3_ENABLE}");
  344. _rtDataKeys.Add($"System.{FACILITIES}.{SAMPLE_FLOW_4_ENABLE}");
  345. _rtDataKeys.Add($"System.{FACILITIES}.{FFU_LOADER_ERROR}");
  346. _rtDataKeys.Add($"System.{FACILITIES}.{FFU_PROCESS_ERROR}");
  347. _rtDataKeys.Add($"System.{FACILITIES}.{FFU_LOADER_PRESSURE}");
  348. _rtDataKeys.Add($"System.{FACILITIES}.{FFU_PROCESS_PRESSURE}");
  349. _rtDataKeys.Add($"System.{FACILITIES}.{ARS_FLUID_DETECT}");
  350. _rtDataKeys.Add($"System.{FACILITIES}.{PROCESS_FLUID_DETECT}");
  351. _rtDataKeys.Add($"System.{FACILITIES}.{SAMPLE_FLUID_DETECT}");
  352. }
  353. #region 指令Action
  354. /// <summary>
  355. /// Loader Home
  356. /// </summary>
  357. /// <param name="param"></param>
  358. private void HomeLoaderAction(object param)
  359. {
  360. InvokeClient.Instance.Service.DoOperation($"{ModuleName.Loader1}.Common.HomeAll");
  361. }
  362. /// <summary>
  363. /// PUF Home
  364. /// </summary>
  365. /// <param name="param"></param>
  366. private void HomePufAction(object param)
  367. {
  368. InvokeClient.Instance.Service.DoOperation($"{ModuleName.PUF1}.HomeAll");
  369. InvokeClient.Instance.Service.DoOperation($"{ModuleName.PUF2}.HomeAll");
  370. }
  371. /// <summary>
  372. /// EFEM Home
  373. /// </summary>
  374. /// <param name="param"></param>
  375. private void HomeEfemAction(object param)
  376. {
  377. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EFEM}.Home");
  378. }
  379. /// <summary>
  380. /// Process Transporter Home
  381. /// </summary>
  382. /// <param name="param"></param>
  383. private void HomeProcessTransporterAction(object param)
  384. {
  385. InvokeClient.Instance.Service.DoOperation($"{ModuleName.Transporter1}.HomeAll");
  386. }
  387. /// <summary>
  388. /// Loader Transporter Home
  389. /// </summary>
  390. /// <param name="param"></param>
  391. private void HomeLoaderTransporterAction(object param)
  392. {
  393. InvokeClient.Instance.Service.DoOperation($"{ModuleName.Transporter2}.HomeAll");
  394. }
  395. /// <summary>
  396. /// Loader Transporter Home
  397. /// </summary>
  398. /// <param name="param"></param>
  399. private void HomeSRDsAction(object param)
  400. {
  401. InvokeClient.Instance.Service.DoOperation($"{ModuleName.SRD1}.HomeAll");
  402. InvokeClient.Instance.Service.DoOperation($"{ModuleName.SRD2}.HomeAll");
  403. }
  404. /// <summary>
  405. /// N2 Enable
  406. /// </summary>
  407. /// <param name="param"></param>
  408. private void NitrogenOnAction(object param)
  409. {
  410. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.N2Enable");
  411. }
  412. /// <summary>
  413. /// N2 Disable
  414. /// </summary>
  415. /// <param name="param"></param>
  416. private void NitrogenOffAction(object param)
  417. {
  418. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.N2Disable");
  419. }
  420. /// <summary>
  421. /// CDA Enable
  422. /// </summary>
  423. /// <param name="param"></param>
  424. private void CDAOnAction(object param)
  425. {
  426. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.CDAEnable");
  427. }
  428. /// <summary>
  429. /// CDA Disable
  430. /// </summary>
  431. /// <param name="param"></param>
  432. private void CDAOffAction(object param)
  433. {
  434. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.CDADisable");
  435. }
  436. /// <summary>
  437. /// External CDA Enable
  438. /// </summary>
  439. /// <param name="param"></param>
  440. private void ExternalCDAOnAction(object param)
  441. {
  442. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.ExternalCDAEnable");
  443. }
  444. /// <summary>
  445. /// External CDA Disable
  446. /// </summary>
  447. /// <param name="param"></param>
  448. private void ExternalCDAOffAction(object param)
  449. {
  450. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.ExternalCDADisable");
  451. }
  452. /// <summary>
  453. /// DI Water Enable
  454. /// </summary>
  455. /// <param name="param"></param>
  456. private void DiWaterOnAction(object param)
  457. {
  458. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.DiWaterEnable");
  459. }
  460. /// <summary>
  461. /// DI Water Disable
  462. /// </summary>
  463. /// <param name="param"></param>
  464. private void DiWaterOffAction(object param)
  465. {
  466. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.DiWaterDisable");
  467. }
  468. /// <summary>
  469. /// House Chilled Water Enable
  470. /// </summary>
  471. /// <param name="param"></param>
  472. private void HouseChilledWaterOnAction(object param)
  473. {
  474. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.HouseChilledWaterEnable");
  475. }
  476. /// <summary>
  477. /// House Chilled Water Disable
  478. /// </summary>
  479. /// <param name="param"></param>
  480. private void HouseChilledWaterOffAction(object param)
  481. {
  482. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.HouseChilledWaterDisable");
  483. }
  484. /// <summary>
  485. /// DI Fill Enable
  486. /// </summary>
  487. /// <param name="param"></param>
  488. private void DiFillEnableAction(object param)
  489. {
  490. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.DiFillEnable");
  491. }
  492. /// <summary>
  493. /// DI Fill Disable
  494. /// </summary>
  495. /// <param name="param"></param>
  496. private void DiFillDisableAction(object param)
  497. {
  498. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.DiFillDisable");
  499. }
  500. /// <summary>
  501. /// DI Replen Enable
  502. /// </summary>
  503. /// <param name="param"></param>
  504. private void DiReplenEnableAction(object param)
  505. {
  506. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.DiReplenEnable");
  507. }
  508. /// <summary>
  509. /// DI Replen Disable
  510. /// </summary>
  511. /// <param name="param"></param>
  512. private void DiReplenDisableAction(object param)
  513. {
  514. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.DiReplenDisable");
  515. }
  516. /// <summary>
  517. /// Loader DI Enable
  518. /// </summary>
  519. /// <param name="param"></param>
  520. private void LoaderDiEnableAction(object param)
  521. {
  522. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.LoaderDiEnable");
  523. }
  524. /// <summary>
  525. /// Loader DI Disable
  526. /// </summary>
  527. /// <param name="param"></param>
  528. private void LoaderDiDisableAction(object param)
  529. {
  530. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.LoaderDiDisable");
  531. }
  532. /// <summary>
  533. /// Filter Purge Enable
  534. /// </summary>
  535. /// <param name="param"></param>
  536. private void FilterPurgeEnableAction(object param)
  537. {
  538. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.FilterPurgeEnable");
  539. }
  540. /// <summary>
  541. /// Filter Purge Disable
  542. /// </summary>
  543. /// <param name="param"></param>
  544. private void FilterPurgeDisableAction(object param)
  545. {
  546. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.FilterPurgeDisable");
  547. }
  548. /// <summary>
  549. /// All On
  550. /// </summary>
  551. /// <param name="param"></param>
  552. private void AllOnAction(object param)
  553. {
  554. NitrogenOnAction(param);
  555. CDAOnAction(param);
  556. DiWaterOnAction(param);
  557. HouseChilledWaterOnAction(param);
  558. DiFillEnableAction(param);
  559. DiReplenEnableAction(param);
  560. LoaderDiEnableAction(param);
  561. }
  562. /// <summary>
  563. /// All Off
  564. /// </summary>
  565. /// <param name="param"></param>
  566. private void AllOffAction(object param)
  567. {
  568. NitrogenOffAction(param);
  569. CDAOffAction(param);
  570. DiWaterOffAction(param);
  571. HouseChilledWaterOffAction(param);
  572. DiFillDisableAction(param);
  573. DiReplenDisableAction(param);
  574. LoaderDiDisableAction(param);
  575. }
  576. /// <summary>
  577. /// Sample Enable
  578. /// </summary>
  579. /// <param name="param"></param>
  580. private void SampleEnableAction(object param)
  581. {
  582. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.SampleEnable");
  583. }
  584. /// <summary>
  585. /// Sample Disable
  586. /// </summary>
  587. /// <param name="param"></param>
  588. private void SampleDisableAction(object param)
  589. {
  590. InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.SampleDisable");
  591. }
  592. #endregion
  593. }
  594. }