ReservoirsCatholyteViewModel.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. using Aitex.Core.RT.DataCenter;
  2. using Aitex.Core.RT.Log;
  3. using Aitex.Core.UI.MVVM;
  4. using CyberX8_Core;
  5. using CyberX8_MainPages.Model;
  6. using CyberX8_Themes.CustomControls;
  7. using ExcelLibrary.BinaryFileFormat;
  8. using MECF.Framework.Common.CommonData.Metal;
  9. using MECF.Framework.Common.CommonData.Reservoir;
  10. using MECF.Framework.Common.CommonData.TemperatureControl;
  11. using MECF.Framework.Common.DataCenter;
  12. using MECF.Framework.Common.OperationCenter;
  13. using MECF.Framework.Common.Persistent.Reservoirs;
  14. using MECF.Framework.Common.RecipeCenter;
  15. using MECF.Framework.Common.Utilities;
  16. using OpenSEMI.ClientBase.Command;
  17. using Prism.Mvvm;
  18. using System;
  19. using System.Collections.Generic;
  20. using System.Collections.ObjectModel;
  21. using System.Linq;
  22. using System.Text;
  23. using System.Threading.Tasks;
  24. using System.Windows.Input;
  25. using System.Windows.Threading;
  26. namespace CyberX8_MainPages.ViewModels
  27. {
  28. public class ReservoirsCatholyteViewModel : BindableBase
  29. {
  30. #region 常量
  31. private const string RESERVOIRS_DATA = "ReservoirsData";
  32. private const string RESERVOIRS = "reservoirs";
  33. private const string PERSISTENT_VALUE = "PersistentValue";
  34. #endregion
  35. #region 内部变量
  36. private string _module;
  37. private string _recipeContent;
  38. private string _operatingMode;
  39. private string _state;
  40. private string _recipeMode;
  41. private List<string> _rtDataKeys = new List<string>();
  42. DispatcherTimer _timer;
  43. private Dictionary<string, object> _rtDataValueDic = new Dictionary<string, object>();
  44. private ObservableCollection<RecipeNode> _recipeNodes;
  45. private string _currentRecipeFileName;
  46. private string _recipeType;
  47. private string _tcName;
  48. private double _caPumpSpeed;
  49. private bool _isDIReplenFault;
  50. private double _flowAdjustDelta;
  51. private double _maxFlowDelta;
  52. private bool _isFolwDeltaUnBlance = false;
  53. private bool _isHighLevel;
  54. private bool _isLowLevel;
  55. private bool _isLeakDetected;
  56. private bool _cdaOn;
  57. private bool _isError;
  58. private ResRecipe _currentRecipe;
  59. private double _avgCALevel;
  60. /// <summary>
  61. /// 是否配置Exhaust
  62. /// </summary>
  63. private bool _isEvaporatorConfig;
  64. /// <summary>
  65. /// 是否正在手动注水
  66. /// </summary>
  67. private bool _isManualReplen;
  68. /// <summary>
  69. /// 手动注水时长(秒)
  70. /// </summary>
  71. private int _manualFillSeconds;
  72. /// <summary>
  73. /// DIValveMaxOnTime
  74. /// </summary>
  75. private double _diValveMaxOnTime;
  76. /// <summary>
  77. /// TemperatureControl Module Name
  78. /// </summary>
  79. private TemperatureControllerData _temperatureControlData;
  80. /// <summary>
  81. /// Persistent
  82. /// </summary>
  83. private ReservoirsPersistentValue _reservoirsPersistent;
  84. /// <summary>
  85. /// Reservoir数据
  86. /// </summary>
  87. private CompactMembranReservoirData _reservoirData;
  88. /// <summary>
  89. /// CellModuleName集合
  90. /// </summary>
  91. private ObservableCollection<string> _cellModuleNameCollection = new ObservableCollection<string>();
  92. /// <summary>
  93. /// Cell A面Flow集合
  94. /// </summary>
  95. private ObservableCollection<double> _cellModuleNameFlowCollection = new ObservableCollection<double>();
  96. /// <summary>
  97. /// MetalData
  98. /// </summary>
  99. private ObservableCollection<CompactMembranMetalDeviceData> _metalDatas = new ObservableCollection<CompactMembranMetalDeviceData>();
  100. /// <summary>
  101. /// MetalData的CellFlow集合
  102. /// </summary>
  103. private ObservableCollection<double> _metalCellFlowDatas = new ObservableCollection<double>();
  104. /// <summary>
  105. /// 页面功能启用
  106. /// </summary>
  107. private bool _isEnabled;
  108. /// <summary>
  109. /// AutoMode页面功能启用
  110. /// </summary>
  111. private bool _isAutoEnabled;
  112. /// <summary>
  113. /// Meatl UI数据
  114. /// </summary>
  115. private ObservableCollection<ReservoirsUIData> _reservoirsUIDatas = new ObservableCollection<ReservoirsUIData>();
  116. /// <summary>
  117. /// TC Enable状态
  118. /// </summary>
  119. private string _tcEnableStatus;
  120. #endregion
  121. #region 属性
  122. public double AvgCALevel
  123. {
  124. get { return _avgCALevel; }
  125. set { SetProperty(ref _avgCALevel, value); }
  126. }
  127. public string CurrentRecipeFileName
  128. {
  129. get { return _currentRecipeFileName; }
  130. set { SetProperty(ref _currentRecipeFileName, value); }
  131. }
  132. public ObservableCollection<RecipeNode> RecipeNodes
  133. {
  134. get { return _recipeNodes; }
  135. set { SetProperty(ref _recipeNodes, value); }
  136. }
  137. public string Module { get { return _module; } set { SetProperty(ref _module, value); } }
  138. public string ReservoirRecipeContent
  139. {
  140. get { return _recipeContent; }
  141. set { SetProperty(ref _recipeContent, value); }
  142. }
  143. public string OperatingMode
  144. {
  145. get { return _operatingMode; }
  146. set { SetProperty(ref _operatingMode, value); }
  147. }
  148. public string State
  149. {
  150. get { return _state; }
  151. set { SetProperty(ref _state, value); }
  152. }
  153. public string RecipeMode
  154. {
  155. get { return _recipeMode; }
  156. set { SetProperty(ref _recipeMode, value); }
  157. }
  158. public string RecipeType
  159. {
  160. get { return _recipeType; }
  161. set { SetProperty(ref _recipeType, value); }
  162. }
  163. public double CAPumpSpeed
  164. {
  165. get { return _caPumpSpeed; }
  166. set
  167. {
  168. SetProperty(ref _caPumpSpeed, value);
  169. }
  170. }
  171. public ResRecipe CurrentRecipe
  172. {
  173. get { return _currentRecipe; }
  174. set { SetProperty(ref _currentRecipe, value); }
  175. }
  176. /// <summary>
  177. /// Threshold
  178. /// </summary>
  179. public ReservoirsPersistentValue ReservoirsPersistent
  180. {
  181. get { return _reservoirsPersistent; }
  182. set { SetProperty(ref _reservoirsPersistent, value); }
  183. }
  184. /// <summary>
  185. /// CellModuleName集合
  186. /// </summary>
  187. public ObservableCollection<string> CellModuleNameCollection
  188. {
  189. get { return _cellModuleNameCollection; }
  190. set { SetProperty(ref _cellModuleNameCollection, value); }
  191. }
  192. /// <summary>
  193. /// 模块Flow集合
  194. /// </summary>
  195. public ObservableCollection<double> CellModuleNameFlowCollection
  196. {
  197. get { return _cellModuleNameFlowCollection; }
  198. set { SetProperty(ref _cellModuleNameFlowCollection, value); }
  199. }
  200. /// <summary>
  201. /// Reservoir数据
  202. /// </summary>
  203. public CompactMembranReservoirData ReservoirData
  204. {
  205. get { return _reservoirData; }
  206. set { SetProperty(ref _reservoirData, value); }
  207. }
  208. /// <summary>
  209. /// MetalData
  210. /// </summary>
  211. public ObservableCollection<CompactMembranMetalDeviceData> MetalDatas
  212. {
  213. get { return _metalDatas; }
  214. set { SetProperty(ref _metalDatas, value); }
  215. }
  216. /// <summary>
  217. /// MetalDataCellFlow
  218. /// </summary>
  219. public ObservableCollection<double> MetalCellFlowDatas
  220. {
  221. get { return _metalCellFlowDatas; }
  222. set { SetProperty(ref _metalCellFlowDatas, value); }
  223. }
  224. /// <summary>
  225. /// 是否Error
  226. /// </summary>
  227. public bool IsError
  228. {
  229. get { return _isError; }
  230. set { SetProperty(ref _isError, value); }
  231. }
  232. /// <summary>
  233. /// 正在手动注水
  234. /// </summary>
  235. public bool IsManualReplen
  236. {
  237. get { return _isManualReplen; }
  238. set { SetProperty(ref _isManualReplen, value); }
  239. }
  240. /// <summary>
  241. /// 手动注水时长
  242. /// </summary>
  243. public int ManualFillSeconds
  244. {
  245. get { return _manualFillSeconds; }
  246. set { SetProperty(ref _manualFillSeconds, value); }
  247. }
  248. /// <summary>
  249. /// 单次注水最大时长
  250. /// </summary>
  251. public double DIValveMaxOnTime
  252. {
  253. get { return _diValveMaxOnTime; }
  254. set { SetProperty(ref _diValveMaxOnTime, value); }
  255. }
  256. /// <summary>
  257. /// 是否补水异常
  258. /// </summary>
  259. public bool IsDIReplenFault
  260. {
  261. get { return _isDIReplenFault; }
  262. set { SetProperty(ref _isDIReplenFault, value); }
  263. }
  264. /// <summary>
  265. /// metal cell 水位最大值和最小值之差
  266. /// </summary>
  267. public double FlowAdjustDelta
  268. {
  269. get { return _flowAdjustDelta; }
  270. set { SetProperty(ref _flowAdjustDelta, value); }
  271. }
  272. /// <summary>
  273. /// 流量误差是否超过0.5
  274. /// </summary>
  275. public bool IsFolwDeltaUnBlance
  276. {
  277. get { return _isFolwDeltaUnBlance; }
  278. set { SetProperty(ref _isFolwDeltaUnBlance, value); }
  279. }
  280. /// <summary>
  281. /// 是否触发高水位
  282. /// </summary>
  283. public bool IsHighLevel
  284. {
  285. get { return _isHighLevel; }
  286. set { SetProperty(ref _isHighLevel, value); }
  287. }
  288. /// <summary>
  289. /// 是否触发低水位
  290. /// </summary>
  291. public bool IsLowLevel
  292. {
  293. get { return _isLowLevel; }
  294. set { SetProperty(ref _isLowLevel, value); }
  295. }
  296. /// <summary>
  297. /// TemperatureControl Module Name
  298. /// </summary>
  299. public TemperatureControllerData TemperatureControlData
  300. {
  301. get { return _temperatureControlData; }
  302. set { SetProperty(ref _temperatureControlData, value); }
  303. }
  304. /// <summary>
  305. /// 页面功能启用
  306. /// </summary>
  307. public bool IsEnabled
  308. {
  309. get { return _isEnabled; }
  310. set { SetProperty(ref _isEnabled, value); }
  311. }
  312. /// <summary>
  313. /// AutoMode页面功能启用
  314. /// </summary>
  315. public bool IsAutoEnabled
  316. {
  317. get { return _isAutoEnabled; }
  318. set { SetProperty(ref _isAutoEnabled, value); }
  319. }
  320. /// <summary>
  321. /// metal ui数据
  322. /// </summary>
  323. public ObservableCollection<ReservoirsUIData> ReservoirsUIDatas
  324. {
  325. get { return _reservoirsUIDatas; }
  326. set { SetProperty(ref _reservoirsUIDatas, value); }
  327. }
  328. /// <summary>
  329. /// 是否配有排气模块
  330. /// </summary>
  331. public bool IsEvaporatorConfig
  332. {
  333. get { return _isEvaporatorConfig; }
  334. set { SetProperty(ref _isEvaporatorConfig, value); }
  335. }
  336. /// <summary>
  337. /// 排期模块是否检测到漏液
  338. /// </summary>
  339. public bool IsLeakDetected
  340. {
  341. get { return _isLeakDetected; }
  342. set { SetProperty(ref _isLeakDetected, value); }
  343. }
  344. /// <summary>
  345. /// 排气是否打开
  346. /// </summary>
  347. public bool CdaOn
  348. {
  349. get { return _cdaOn; }
  350. set { SetProperty(ref _cdaOn, value); }
  351. }
  352. /// <summary>
  353. /// TC Enable状态
  354. /// </summary>
  355. public string TCEnableStatus
  356. {
  357. get { return _tcEnableStatus; }
  358. set { SetProperty(ref _tcEnableStatus, value); }
  359. }
  360. #endregion
  361. #region 指令
  362. public ICommand ControlValveCommand { get; private set; }
  363. public ICommand ManualDireplenCommand { get; set; }
  364. public ICommand ResetTotalCommand { get; set; }
  365. public ICommand CAPumpSpeedCommand { get; private set; }
  366. public ICommand BackCommand { get; set; }
  367. public ICommand JumpToTCCommand { get; set; }
  368. #endregion
  369. public ReservoirsCatholyteViewModel()
  370. {
  371. ControlValveCommand = new DelegateCommand<object>(OnControlValve);
  372. ManualDireplenCommand = new DelegateCommand<object>(ManualDireplenAction);
  373. ResetTotalCommand = new DelegateCommand<object>(ResetTotalAction);
  374. CAPumpSpeedCommand = new DelegateCommand<object>(CAPumpSpeedAction);
  375. BackCommand = new DelegateCommand<object>(BackAction);
  376. JumpToTCCommand = new DelegateCommand<object>(JumpToTCAction);
  377. }
  378. #region 命令方法
  379. /// <summary>
  380. /// 回到Reservoir主页面
  381. /// </summary>
  382. /// <param name="param"></param>
  383. private void BackAction(object param)
  384. {
  385. GlobalEvents.OnSwitchFixedChildSubItem(Module, Module);
  386. }
  387. /// <summary>
  388. /// 跳转到对应的TC页面
  389. /// </summary>
  390. /// <param name="param"></param>
  391. private void JumpToTCAction(object param)
  392. {
  393. if (_tcName != null)
  394. {
  395. GlobalEvents.OnSwitchFixedTabItem("HardWare", "TemperatureController", $"{_tcName.Substring(0, 3)}");
  396. }
  397. else
  398. {
  399. GlobalEvents.OnSwitchFixedTabItem("HardWare", "TemperatureController", "");
  400. }
  401. }
  402. /// <summary>
  403. /// Control Valve
  404. /// </summary>
  405. /// <param name="obj"></param>
  406. private void OnControlValve(object obj)
  407. {
  408. CommonValveControl commonValveControl = (CommonValveControl)obj;
  409. if (commonValveControl.IsCanEdit == true)
  410. {
  411. string cmd = commonValveControl.OperationName;
  412. if (!commonValveControl.Status)
  413. {
  414. commonValveControl.Status = !commonValveControl.Status;
  415. InvokeClient.Instance.Service.DoOperation($"{cmd}On");
  416. }
  417. else
  418. {
  419. commonValveControl.Status = !commonValveControl.Status;
  420. InvokeClient.Instance.Service.DoOperation($"{cmd}Off");
  421. }
  422. }
  423. }
  424. /// <summary>
  425. /// CA Pump调速
  426. /// </summary>
  427. /// <param name="obj"></param>
  428. private void CAPumpSpeedAction(object obj)
  429. {
  430. object[] objects = (object[])obj;
  431. if (objects.Length >= 2)
  432. {
  433. InvokeClient.Instance.Service.DoOperation($"{Module}.CAPumpSpeed", objects[1]);
  434. }
  435. }
  436. /// <summary>
  437. /// 手动注水
  438. /// </summary>
  439. /// <param name="param"></param>
  440. private void ManualDireplenAction(object param)
  441. {
  442. InvokeClient.Instance.Service.DoOperation($"{Module}.ManualCADiReplen", ManualFillSeconds);
  443. }
  444. /// <summary>
  445. /// 重置TotalTime
  446. /// </summary>
  447. private void ResetTotalAction(object param)
  448. {
  449. InvokeClient.Instance.Service.DoOperation($"{Module}.ResetTotalTime");
  450. }
  451. #endregion
  452. public void LoadData(string systemName)
  453. {
  454. RecipeType = "res";
  455. Module = systemName;
  456. _rtDataKeys.Clear();
  457. _rtDataKeys.Add($"{Module}.Metals");
  458. Dictionary<string, object> tmpMetals = QueryDataClient.Instance.Service.PollData(_rtDataKeys);
  459. if (tmpMetals != null)
  460. {
  461. List<string> strMetals = CommonFunction.GetValue<List<string>>(tmpMetals, $"{Module}.Metals");
  462. int cellsCount = strMetals.Count;
  463. if (strMetals != null)
  464. {
  465. CellModuleNameCollection.Clear();
  466. CellModuleNameFlowCollection.Clear();
  467. MetalDatas.Clear();
  468. MetalCellFlowDatas.Clear();
  469. ReservoirsUIDatas.Clear();
  470. for (int i = 0; i < cellsCount; i++)
  471. {
  472. CellModuleNameCollection.Add(strMetals[i]);
  473. CellModuleNameFlowCollection.Add(0);
  474. MetalDatas.Add(null);
  475. MetalCellFlowDatas.Add(0);
  476. ReservoirsUIData reservoirsUIData = new ReservoirsUIData();
  477. reservoirsUIData.Name = strMetals[i];
  478. ReservoirsUIDatas.Add(reservoirsUIData);
  479. }
  480. }
  481. }
  482. _rtDataKeys.Clear();
  483. for (int i = 0; i < CellModuleNameCollection.Count; i++)
  484. {
  485. _rtDataKeys.Add($"{CellModuleNameCollection[i]}.CellFlow");
  486. _rtDataKeys.Add($"{CellModuleNameCollection[i]}.MetalData");
  487. }
  488. _rtDataKeys.Add($"{Module}.{PERSISTENT_VALUE}");
  489. _rtDataKeys.Add($"{Module}.ReservoirData");
  490. _rtDataKeys.Add($"{Module}.IsManualCAReplen");
  491. _rtDataKeys.Add($"{Module}.DIValveMaxOnTime");
  492. _rtDataKeys.Add($"{Module}.CAPumpSpeed");
  493. _rtDataKeys.Add($"{Module}.IsCAHighLevel");
  494. _rtDataKeys.Add($"{Module}.IsCALowLevel");
  495. _rtDataKeys.Add($"{Module}.IsDIReplenInFault");
  496. _rtDataKeys.Add($"{Module}.TemperatureControllerData");
  497. _rtDataKeys.Add($"{Module}.CurrentRecipe");
  498. _rtDataKeys.Add($"{Module}.FsmState");
  499. _rtDataKeys.Add($"{Module}.EvaporatorType");
  500. _rtDataKeys.Add($"{Module}.ReservoirAverageCALevel");
  501. _rtDataKeys.Add($"System.Facilities.CDAEnable");
  502. if (_timer == null)
  503. {
  504. _timer = new DispatcherTimer();
  505. _timer.Interval = TimeSpan.FromMilliseconds(200);
  506. _timer.Tick += Timer_Tick;
  507. }
  508. _timer.Start();
  509. }
  510. private void Timer_Tick(object sender, EventArgs e)
  511. {
  512. if (_rtDataKeys.Count != 0)
  513. {
  514. _rtDataValueDic = QueryDataClient.Instance.Service.PollData(_rtDataKeys);
  515. if (_rtDataValueDic != null)
  516. {
  517. State = CommonFunction.GetValue<string>(_rtDataValueDic, $"{Module}.FsmState");
  518. IsError = "Error".Equals(State) ? true : false;
  519. ReservoirsPersistent = CommonFunction.GetValue<ReservoirsPersistentValue>(_rtDataValueDic, $"{Module}.{PERSISTENT_VALUE}");
  520. ReservoirData = CommonFunction.GetValue<CompactMembranReservoirData>(_rtDataValueDic, $"{Module}.ReservoirData");
  521. AvgCALevel = CommonFunction.GetValue<double>(_rtDataValueDic, $"{Module}.ReservoirAverageCALevel");
  522. CurrentRecipe = CommonFunction.GetValue<ResRecipe>(_rtDataValueDic, $"{Module}.CurrentRecipe");
  523. IsManualReplen = CommonFunction.GetValue<bool>(_rtDataValueDic, $"{Module}.IsManualCAReplen");
  524. DIValveMaxOnTime = CommonFunction.GetValue<double>(_rtDataValueDic, $"{Module}.DIValveMaxOnTime");
  525. CAPumpSpeed = CommonFunction.GetValue<double>(_rtDataValueDic, $"{Module}.CAPumpSpeed");
  526. IsHighLevel = CommonFunction.GetValue<bool>(_rtDataValueDic, $"{Module}.IsCAHighLevel");
  527. IsLowLevel = CommonFunction.GetValue<bool>(_rtDataValueDic, $"{Module}.IsCALowLevel");
  528. IsDIReplenFault = CommonFunction.GetValue<bool>(_rtDataValueDic, $"{Module}.IsDIReplenInFault");
  529. CdaOn = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.Facilities.CDAEnable");
  530. TemperatureControlData = CommonFunction.GetValue<TemperatureControllerData>(_rtDataValueDic, $"{Module}.TemperatureControllerData");
  531. TCEnableStatus = TemperatureControlData.ControlOperationModel == 0 ? "Disable" : "Enable";
  532. _tcName = TemperatureControlData.Name;
  533. for (int i = 0; i < CellModuleNameCollection.Count; i++)
  534. {
  535. CellModuleNameFlowCollection[i] = CommonFunction.GetValue<double>(_rtDataValueDic, $"{CellModuleNameCollection[i]}.CellFlow");
  536. MetalDatas[i] = CommonFunction.GetValue<CompactMembranMetalDeviceData>(_rtDataValueDic, $"{CellModuleNameCollection[i]}.MetalData");
  537. MetalCellFlowDatas[i] = MetalDatas[i].CellFlow;
  538. ReservoirsUIDatas[i].MetalCellFlow = MetalCellFlowDatas[i];
  539. ReservoirsUIDatas[i].IsFlowing3 = MetalDatas[i].CellFlowValve;
  540. ReservoirsUIDatas[i].IsFlowing2 = MetalDatas[i].WHUnclamp;
  541. ReservoirsUIDatas[i].IsFlowing1 = MetalDatas[i].WHClamp;
  542. ReservoirsUIDatas[i].IsEnable = IsEnabled;
  543. ReservoirsUIDatas[i].IsAutoEnable = IsAutoEnabled;
  544. }
  545. //list记录参与循环的metal阴极的流量情况
  546. List<double> list = new List<double>();
  547. for (int i = 0; i < CellModuleNameCollection.Count; i++)
  548. {
  549. if (MetalDatas[i].CellFlowValve)
  550. {
  551. list.Add(MetalDatas[i].CellFlow);
  552. }
  553. }
  554. //如果参与循环的流量全是0或者没有参与循环的metal,直接跳过流量差相关逻辑
  555. if (list.Count==0 || list.All(num => num == 0))
  556. {
  557. for (int i = 0; i < CellModuleNameCollection.Count; i++)
  558. {
  559. ReservoirsUIDatas[i].IsMetalCellHigh = false;
  560. ReservoirsUIDatas[i].IsMetalCellLow = false;
  561. }
  562. }
  563. else
  564. {
  565. FlowAdjustDelta = list.Max() - list.Min();
  566. IsFolwDeltaUnBlance = FlowAdjustDelta > 0.5 ? true : false;
  567. if (IsFolwDeltaUnBlance)
  568. {
  569. for (int i = 0; i < CellModuleNameCollection.Count; i++)
  570. {
  571. if (list.Max() == MetalDatas[i].CellFlow && MetalDatas[i].CellFlowValve)
  572. {
  573. ReservoirsUIDatas[i].IsMetalCellHigh = true;
  574. }
  575. else
  576. {
  577. ReservoirsUIDatas[i].IsMetalCellHigh = false;
  578. }
  579. if (list.Min() == MetalDatas[i].CellFlow && MetalDatas[i].CellFlowValve)
  580. {
  581. ReservoirsUIDatas[i].IsMetalCellLow = true;
  582. }
  583. else
  584. {
  585. ReservoirsUIDatas[i].IsMetalCellLow = false;
  586. }
  587. }
  588. }
  589. else
  590. {
  591. for (int i = 0; i < CellModuleNameCollection.Count; i++)
  592. {
  593. ReservoirsUIDatas[i].IsMetalCellHigh = false;
  594. ReservoirsUIDatas[i].IsMetalCellLow = false;
  595. }
  596. }
  597. }
  598. list.Clear();
  599. if ("Manual".Equals(ReservoirsPersistent.OperatingMode))
  600. {
  601. IsEnabled = true;
  602. IsAutoEnabled = true;
  603. }
  604. else if ("Auto".Equals(ReservoirsPersistent.OperatingMode))
  605. {
  606. IsAutoEnabled = true;
  607. IsEnabled = false;
  608. }
  609. else
  610. {
  611. State = "Stopped";
  612. IsEnabled = false;
  613. IsAutoEnabled = false;
  614. }
  615. string evaporatorType = CommonFunction.GetValue<string>(_rtDataValueDic, $"{Module}.EvaporatorType");
  616. if ("STD".Equals(evaporatorType))
  617. {
  618. IsEvaporatorConfig = true;
  619. }
  620. else
  621. {
  622. IsEvaporatorConfig = false;
  623. }
  624. }
  625. }
  626. }
  627. /// <summary>
  628. /// 隐藏
  629. /// </summary>
  630. public void Hide()
  631. {
  632. if (_timer != null)
  633. {
  634. _timer.Stop();
  635. }
  636. }
  637. }
  638. }