IoMFC.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. using Aitex.Core.Common.DeviceData;
  2. using Aitex.Core.RT.DataCenter;
  3. using Aitex.Core.RT.Device;
  4. using Aitex.Core.RT.Event;
  5. using Aitex.Core.RT.IOCore;
  6. using Aitex.Core.RT.Log;
  7. using Aitex.Core.RT.OperationCenter;
  8. using Aitex.Core.RT.SCCore;
  9. using Aitex.Core.RT.Tolerance;
  10. using Aitex.Core.Util;
  11. using Aitex.Core.Utilities;
  12. using MECF.Framework.Common.Event;
  13. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.MFCs;
  14. using System;
  15. using System.Collections;
  16. using System.Collections.Generic;
  17. using System.Xml;
  18. namespace FurnaceRT.Equipments.PMs.Devices
  19. {
  20. public class IoMFC : BaseDevice, IDevice, IMfc
  21. {
  22. public string Unit
  23. {
  24. get; set;
  25. }
  26. public double Scale
  27. {
  28. get
  29. {
  30. if (_scN2Scale == null || _scScaleFactor == null)
  31. return 0;
  32. return _scN2Scale.DoubleValue * _scScaleFactor.DoubleValue;
  33. }
  34. }
  35. private double _setpoint;
  36. public double SetPoint
  37. {
  38. get
  39. {
  40. return _setpoint;
  41. }
  42. set
  43. {
  44. _setpoint = value;
  45. if (_aoFlow != null)
  46. {
  47. //var setpoint = Scale != 0 ? (float)(value * _maxScale / Scale) : value;
  48. if (_isFloatAioType)
  49. _aoFlow.FloatValue = (float)value;
  50. else
  51. _aoFlow.Value = (short)value;
  52. }
  53. }
  54. }
  55. public double DefaultSetPoint
  56. {
  57. get
  58. {
  59. if (_scDefaultSetPoint != null)
  60. return _scDefaultSetPoint.DoubleValue;
  61. return 0;
  62. }
  63. }
  64. public double FeedBack
  65. {
  66. get
  67. {
  68. if (_aiFlow != null)
  69. {
  70. return _isFloatAioType ? _aiFlow.FloatValue : _aiFlow.Value;
  71. //var phy = _aiFlow == null ? 0 : (_isFloatAioType ? _aiFlow.FloatValue : _aiFlow.Value);
  72. //return Converter.Phy2Logic(phy, 0, Scale, 0, _phyScale);
  73. //return _maxScale != 0 ? aiValue * Scale / _maxScale : aiValue;
  74. }
  75. return 0;
  76. }
  77. }
  78. public bool EnableAlarm
  79. {
  80. get
  81. {
  82. if (_scEnableAlarm != null)
  83. return _scEnableAlarm.BoolValue;
  84. return false;
  85. }
  86. }
  87. public bool IsStable
  88. {
  89. get
  90. {
  91. if (!_stableDelayTimer.IsIdle() && _stableDelayTimer.GetElapseTime() >= _stableDelayTime * 1000)
  92. {
  93. if (!_stableJudgmentTimer.IsIdle())
  94. {
  95. if (FeedBack < SetPoint * (100 - _stableMinValue) / 100 ||
  96. FeedBack > SetPoint * (100 + _stableMaxValue) / 100)
  97. {
  98. _stableJudgmentTimer.Start(0);
  99. }
  100. if (_stableJudgmentTimer.GetElapseTime() >= _stableJudgmentTime * 1000)
  101. {
  102. return true;
  103. }
  104. }
  105. else
  106. {
  107. _stableJudgmentTimer.Start(0);
  108. }
  109. }
  110. return false;
  111. }
  112. }
  113. private AITMfcData DeviceData
  114. {
  115. get
  116. {
  117. AITMfcData data = new AITMfcData()
  118. {
  119. UniqueName = $"{Module}.{Name}",
  120. Type = "MFC",
  121. Module = Module,
  122. DeviceName = Name,
  123. DeviceSchematicId = DeviceID,
  124. DisplayName = DisplayName,
  125. FeedBack = FeedBack < 0 ? 0 : FeedBack,
  126. SetPoint = _rampTarget,
  127. Ramping = _ramping,
  128. AlarmWatchTable = AlarmWatchTable,
  129. Scale = Scale,
  130. //IsWarning = !AlarmToleranceWarning.IsAcknowledged,
  131. //IsError = !AlarmToleranceAlarm.IsAcknowledged,
  132. Unit = Unit,
  133. VirtualSetPoint = (float)VirtualSetPoint,
  134. VirtualFeedBack = (float)VirtualFeedBack,
  135. VirtualAlarmWatchTable = VirtualAlarmWatchTable,
  136. VirtualRamping = VirtualRamping,
  137. };
  138. return data;
  139. }
  140. }
  141. public string DisplayName
  142. {
  143. get
  144. {
  145. if (_scGasName != null)
  146. return _scGasName.StringValue;
  147. return Display;
  148. }
  149. }
  150. public string AlarmWatchTable
  151. {
  152. get;
  153. set;
  154. }
  155. public double VirtualSetPoint;
  156. public double VirtualFeedBack;
  157. public string VirtualAlarmWatchTable;
  158. public float VirtualRamping;
  159. private DeviceTimer _rampTimer = new DeviceTimer();
  160. private double _rampTarget;
  161. private double _rampInitValue;
  162. private int _rampTime;
  163. private float _ramping;
  164. private double _phyScale;
  165. private ToleranceChecker _toleranceCheckerWarning = new ToleranceChecker();
  166. private ToleranceChecker _toleranceCheckerAlarm = new ToleranceChecker();
  167. private AIAccessor _aiFlow;
  168. private AOAccessor _aoFlow;
  169. private bool _isErrorStatus;
  170. private bool _isMFCInstalled;
  171. private int _mfcIndex;
  172. public bool IsMFCInstalled
  173. {
  174. get { return _isMFCInstalled; }
  175. }
  176. public int MFCIndex
  177. {
  178. get { return _mfcIndex; }
  179. }
  180. protected SCConfigItem _scGasName;
  181. protected SCConfigItem _scEnable;
  182. private SCConfigItem _scN2Scale;
  183. private SCConfigItem _scScaleFactor;
  184. private SCConfigItem _scEnableAlarm;
  185. private SCConfigItem _scDefaultSetPoint;
  186. private SCConfigItem _scRegulationFactor;
  187. //tolerance check
  188. private float _alarmJudgmentRange;
  189. private float _warningJudgmentRange;
  190. private float _alarmJudgmentTime;
  191. private float _warningJudgmentTime;
  192. private float _toleranceJudgmentDelayTime;
  193. private DeviceTimer _toleranceJudgmentDelayTimer = new DeviceTimer();
  194. //stable check
  195. private DeviceTimer _stableDelayTimer = new DeviceTimer();
  196. private float _stableDelayTime;
  197. private DeviceTimer _stableJudgmentTimer = new DeviceTimer();
  198. private float _stableJudgmentTime;
  199. private float _stableMinValue;
  200. private float _stableMaxValue;
  201. public AlarmEventItem AlarmToleranceWarning { get; set; }
  202. public AlarmEventItem AlarmToleranceAlarm { get; set; }
  203. private bool _isFloatAioType = false;
  204. public IoMFC(string module, XmlElement node, string ioModule = "")
  205. {
  206. Unit = node.GetAttribute("unit");
  207. base.Module = string.IsNullOrEmpty(node.GetAttribute("module")) ? module : node.GetAttribute("module");
  208. base.Name = node.GetAttribute("id");
  209. base.Display = node.GetAttribute("display");
  210. base.DeviceID = node.GetAttribute("schematicId");
  211. _aiFlow = ParseAiNode("aiFlow", node, ioModule);
  212. _aoFlow = ParseAoNode("aoFlow", node, ioModule);
  213. _isFloatAioType = !string.IsNullOrEmpty(node.GetAttribute("aioType")) && (node.GetAttribute("aioType") == "float");
  214. string scBasePath = node.GetAttribute("scBasePath");
  215. if (string.IsNullOrEmpty(scBasePath))
  216. scBasePath = $"{Module}.{Name}";
  217. else
  218. {
  219. scBasePath = scBasePath.Replace("{module}", Module);
  220. }
  221. _scGasName = SC.GetConfigItem($"{scBasePath}.{Name}.GasName");
  222. _scEnable = SC.GetConfigItem($"{scBasePath}.{Name}.Enable");
  223. //_isMFCInstalled = SC.GetConfigItem($"{scBasePath}.{Name}.IsMFCInstalled").BoolValue;
  224. _scN2Scale = ParseScNode("scN2Scale", node, ioModule, $"{scBasePath}.{Name}.N2Scale");
  225. _scScaleFactor = ParseScNode("scScaleFactor", node, ioModule, $"{scBasePath}.{Name}.ScaleFactor");
  226. _scEnableAlarm = ParseScNode("scEnableAlarm", node, ioModule, $"{scBasePath}.{Name}.EnableAlarm");
  227. _scDefaultSetPoint = ParseScNode("scDefaultSetPoint", node, ioModule, $"{scBasePath}.{Name}.DefaultSetPoint");
  228. _scRegulationFactor = ParseScNode("scFlowRegulationFactor", node, ioModule, $"{scBasePath}.{Name}.RegulationFactor");
  229. if (SC.ContainsItem($"{scBasePath}.{Name}.FlowUnit"))
  230. Unit = SC.GetStringValue($"{scBasePath}.{Name}.FlowUnit");
  231. }
  232. public bool Initialize()
  233. {
  234. DATA.Subscribe($"{Module}.{Name}.DeviceData", () => DeviceData);
  235. DATA.Subscribe($"{Module}.{Name}.Feedback", () => FeedBack);
  236. DATA.Subscribe($"{Module}.{Name}.SetPoint", () => SetPoint);
  237. // DATA.Subscribe($"{Module}.{Name}.ForceOpen", () => _doOpen.Value);
  238. // DATA.Subscribe($"{Module}.{Name}.ForceClose", () => _doClose.Value);
  239. OP.Subscribe($"{Module}.{Name}.Ramp", (out string reason, int time, object[] param) =>
  240. {
  241. double target = Convert.ToDouble(param[0].ToString());
  242. if (target < 0 || target > Scale)
  243. {
  244. reason = $"set {Display} value {target} out of range [0, {Scale}] {Unit}";
  245. return false;
  246. }
  247. Ramp(target, time);
  248. if (time > 0)
  249. {
  250. reason = $"{Display} ramp to {target} {Unit} in {time} seconds";
  251. }
  252. else
  253. {
  254. reason = $"{Display} ramp to {target} {Unit}";
  255. }
  256. return true;
  257. });
  258. OP.Subscribe($"{Module}.{Name}.SetMfcFlow", SetMfcFlow);
  259. OP.Subscribe($"{Module}.{Name}.SetParameters", SetParameters);
  260. OP.Subscribe($"{Module}.{Name}.SetMfcValue", SetMfcValue);
  261. OP.Subscribe($"{Module}.{Name}.SetMfcVirtualValue", SetMfcVirtualValue);
  262. //_phyScale = SC.GetValue<double>($"{Module}.MFC.{Name}.PhyScale");
  263. return true;
  264. }
  265. public void Monitor()
  266. {
  267. MonitorRamping();
  268. MonitorTolerance();
  269. }
  270. public void SetStableParameters(string tableId)
  271. {
  272. if (SC.ContainsItem($"{Module}.RecipeEditParameter.FlowStabilizeTable.Table{tableId}.DelayTime"))
  273. {
  274. var scPath = $"{Module}.RecipeEditParameter.FlowStabilizeTable.Table{tableId}";
  275. _stableDelayTime = (float)SC.GetValue<double>($"{scPath}.DelayTime");
  276. _stableJudgmentTime = (float)SC.GetValue<double>($"{scPath}.JudgmentTime");
  277. _stableMinValue = (float)SC.GetValue<double>($"{scPath}.MinValue");
  278. _stableMaxValue = (float)SC.GetValue<double>($"{scPath}.MaxValue");
  279. _stableDelayTimer.Start(0);
  280. _stableJudgmentTimer.Stop();
  281. }
  282. }
  283. public bool ResetWarningChecker()
  284. {
  285. _toleranceCheckerWarning.Reset(_warningJudgmentTime);
  286. return true;
  287. }
  288. public bool ResetAlarmChecker()
  289. {
  290. _toleranceCheckerAlarm.Reset(_alarmJudgmentTime);
  291. return true;
  292. }
  293. public void Reset()
  294. {
  295. _toleranceCheckerWarning.Reset(_warningJudgmentTime);
  296. _toleranceCheckerAlarm.Reset(_alarmJudgmentTime);
  297. //AlarmToleranceWarning.Reset();
  298. //AlarmToleranceAlarm.Reset();
  299. }
  300. public void Terminate()
  301. {
  302. Ramp(DefaultSetPoint, 0);
  303. }
  304. private bool SetParameters(out string reason, int time, object[] param)
  305. {
  306. reason = string.Empty;
  307. var paras = param[0].ToString().Split(';');//flow;rampTime;alarmTable
  308. float setpoint = 0.0f;
  309. if (paras[0].ToString() == "Continue")
  310. {
  311. EV.PostInfoLog(Module, $"Set {DisplayName} flow to Continue");
  312. return true;
  313. }
  314. else
  315. {
  316. if (System.Text.RegularExpressions.Regex.Match(paras[0].ToString(), @"[a-zA-Z]").Success)
  317. {
  318. var table = paras[0].ToString().Split(':')[0];
  319. if (SC.ContainsItem($"{Module}.RecipeEditParameter.FlowSetting.{Name}.{table}"))
  320. setpoint = (float)SC.GetValue<double>($"{Module}.RecipeEditParameter.FlowSetting.{Name}.{table}");
  321. }
  322. else
  323. {
  324. float.TryParse(paras[0].ToString(), out setpoint);
  325. }
  326. }
  327. if (paras.Length > 1)
  328. float.TryParse(paras[1].ToString(), out _ramping);
  329. if (paras.Length > 2)
  330. {
  331. var alarmWatchTable = paras[2].ToString();
  332. AlarmWatchTable = alarmWatchTable;
  333. if (SC.ContainsItem($"{Module}.RecipeEditParameter.AlarmWatchTable.FlowAlarmWatch.Table{alarmWatchTable}.DelayTime"))
  334. {
  335. var scPath = $"{Module}.RecipeEditParameter.AlarmWatchTable.FlowAlarmWatch.Table{alarmWatchTable}";
  336. _toleranceJudgmentDelayTime = (float)SC.GetValue<double>($"{scPath}.DelayTime");
  337. _alarmJudgmentRange = (float)SC.GetValue<double>($"{scPath}.AlarmJudgment");
  338. _warningJudgmentRange = (float)SC.GetValue<double>($"{scPath}.WarningJudgment");
  339. _alarmJudgmentTime = (float)SC.GetValue<double>($"{scPath}.AlarmJudgmentTime");
  340. _warningJudgmentTime = (float)SC.GetValue<double>($"{scPath}.WarningJudgmentTime");
  341. _toleranceJudgmentDelayTimer.Start(0);
  342. }
  343. else
  344. {
  345. _toleranceJudgmentDelayTime = 0;
  346. _alarmJudgmentRange = 0;
  347. _warningJudgmentRange = 0;
  348. _alarmJudgmentTime = 0;
  349. _warningJudgmentTime = 0;
  350. _toleranceJudgmentDelayTimer.Stop();
  351. }
  352. ResetWarningChecker();
  353. ResetAlarmChecker();
  354. }
  355. _rampTime = _ramping != 0 ? (int)(Math.Abs(setpoint - FeedBack) / _ramping) * 1000 : 0;
  356. return Ramp(setpoint, _rampTime, out reason);
  357. }
  358. private bool SetMfcFlow(out string reason, int time, object[] param)
  359. {
  360. float setpoint = 0.0f;
  361. var paras = param[0].ToString().Split(';');
  362. if (System.Text.RegularExpressions.Regex.Match(paras[0].ToString(), @"[a-zA-Z]").Success)
  363. {
  364. var table = paras[0].ToString().Split(':')[0];
  365. if (SC.ContainsItem($"{Module}.RecipeEditParameter.FlowSetting.{Name}.{table}"))
  366. setpoint = (float)SC.GetValue<double>($"{Module}.RecipeEditParameter.FlowSetting.{Name}.{table}");
  367. }
  368. else
  369. {
  370. float.TryParse(param[0].ToString(), out setpoint);
  371. }
  372. if (paras.Length == 1)
  373. {
  374. Ramp(setpoint, 0, out reason);
  375. }
  376. else
  377. {
  378. Ramp(setpoint, (int)Convert.ToSingle(paras[1]), out reason);
  379. }
  380. return true;
  381. }
  382. private bool SetMfcValue(out string reason, int time, object[] param)
  383. {
  384. reason = string.Empty;
  385. float setpoint = 0.0f;
  386. var paras = param[0].ToString().Split(';'); // setpoint;ramping;alarmWatchTable
  387. if (System.Text.RegularExpressions.Regex.Match(paras[0].ToString(), @"[a-zA-Z]").Success)
  388. {
  389. var table = paras[0].ToString().Split(':')[0];
  390. if (SC.ContainsItem($"{Module}.RecipeEditParameter.FlowSetting.{Name}.{table}"))
  391. setpoint = (float)SC.GetValue<double>($"{Module}.RecipeEditParameter.FlowSetting.{Name}.{table}");
  392. }
  393. else
  394. {
  395. float.TryParse(paras[0].ToString(), out setpoint);
  396. }
  397. if (paras.Length > 1)
  398. float.TryParse(paras[1].ToString(), out _ramping);
  399. if (paras.Length > 2)
  400. {
  401. AlarmWatchTable = paras[2].ToString();
  402. if (SC.ContainsItem($"{Module}.RecipeEditParameter.AlarmWatchTable.FlowAlarmWatch.Table{AlarmWatchTable}.DelayTime"))
  403. {
  404. var scPath = $"{Module}.RecipeEditParameter.AlarmWatchTable.FlowAlarmWatch.Table{AlarmWatchTable}";
  405. _toleranceJudgmentDelayTime = (float)SC.GetValue<double>($"{scPath}.DelayTime");
  406. _alarmJudgmentRange = (float)SC.GetValue<double>($"{scPath}.AlarmJudgment");
  407. _warningJudgmentRange = (float)SC.GetValue<double>($"{scPath}.WarningJudgment");
  408. _alarmJudgmentTime = (float)SC.GetValue<double>($"{scPath}.AlarmJudgmentTime");
  409. _warningJudgmentTime = (float)SC.GetValue<double>($"{scPath}.WarningJudgmentTime");
  410. }
  411. else
  412. {
  413. _toleranceJudgmentDelayTime = 0;
  414. _alarmJudgmentRange = 0;
  415. _warningJudgmentRange = 0;
  416. _alarmJudgmentTime = 0;
  417. _warningJudgmentTime = 0;
  418. }
  419. }
  420. _rampTime = _ramping != 0 ? (int)(Math.Abs(setpoint - FeedBack) / _ramping) * 1000 : 0;
  421. Ramp(setpoint, _rampTime, out reason);
  422. return true;
  423. }
  424. private bool SetMfcVirtualValue(out string reason, int time, object[] param)
  425. {
  426. reason = string.Empty;
  427. float setpoint = 0.0f;
  428. var paras = param[0].ToString().Split(';'); // setpoint;ramping;alarmWatchTable
  429. if (System.Text.RegularExpressions.Regex.Match(paras[0].ToString(), @"[a-zA-Z]").Success)
  430. {
  431. var table = paras[0].ToString().Split(':')[0];
  432. if (SC.ContainsItem($"{Module}.RecipeEditParameter.FlowSetting.{Name}.{table}"))
  433. setpoint = (float)SC.GetValue<double>($"{Module}.RecipeEditParameter.FlowSetting.{Name}.{table}");
  434. }
  435. else
  436. {
  437. float.TryParse(paras[0].ToString(), out setpoint);
  438. }
  439. VirtualSetPoint = setpoint;
  440. VirtualFeedBack = setpoint;
  441. if (paras.Length > 1)
  442. {
  443. float.TryParse(paras[1].ToString(), out _ramping);
  444. VirtualRamping = _ramping;
  445. }
  446. if (paras.Length > 2)
  447. {
  448. VirtualAlarmWatchTable = paras[2].ToString();
  449. }
  450. return true;
  451. }
  452. public bool Ramp(double flowSetPoint, int time, out string reason)
  453. {
  454. if (HasAlarm)
  455. {
  456. reason = $"{DisplayName} in error status, can not flow";
  457. return false;
  458. }
  459. if (flowSetPoint < 0 || flowSetPoint > Scale)
  460. {
  461. reason = $"{DisplayName} range is [0, {Scale}], can not flow {flowSetPoint}";
  462. return false;
  463. }
  464. if (time > 0)
  465. {
  466. EV.PostInfoLog(Module, $"Set {DisplayName} flow to {flowSetPoint} {Unit} in {time / 1000:F0} seconds");
  467. }
  468. else
  469. {
  470. EV.PostInfoLog(Module, $"Set {DisplayName} flow to {flowSetPoint} {Unit}");
  471. }
  472. Ramp(flowSetPoint, time);
  473. reason = string.Empty;
  474. return true;
  475. }
  476. public void Ramp(int time)
  477. {
  478. Ramp(DefaultSetPoint, time);
  479. }
  480. public void Ramp(double target, int time)
  481. {
  482. target = Math.Max(0, target);
  483. target = Math.Min(Scale, target);
  484. _rampInitValue = FeedBack; //ramp 初始值取当前设定值,而非实际读取值.零漂问题
  485. _rampTime = time;
  486. _rampTarget = target;
  487. _rampTimer.Start(time);
  488. }
  489. public void StopRamp()
  490. {
  491. Ramp(SetPoint, 0);
  492. }
  493. private void MonitorRamping()
  494. {
  495. if (!_rampTimer.IsIdle())
  496. {
  497. if (_rampTimer.IsTimeout() || _rampTime == 0)
  498. {
  499. _rampTimer.Stop();
  500. SetPoint = _rampTarget;
  501. }
  502. else
  503. {
  504. SetPoint = _rampInitValue + (_rampTarget - _rampInitValue) * _rampTimer.GetElapseTime() / _rampTime;
  505. }
  506. }
  507. }
  508. private void MonitorTolerance()
  509. {
  510. if (!EnableAlarm || SetPoint < 0.01 ||
  511. _toleranceJudgmentDelayTimer.IsIdle() ||
  512. _toleranceJudgmentDelayTimer.GetElapseTime() < _toleranceJudgmentDelayTime * 1000)
  513. {
  514. _toleranceCheckerWarning.RST = true;
  515. _toleranceCheckerAlarm.RST = true;
  516. return;
  517. }
  518. if (_warningJudgmentRange != 0 && _warningJudgmentTime > 0)
  519. {
  520. _toleranceCheckerWarning.Monitor(FeedBack, (SetPoint - Math.Abs(_warningJudgmentRange)), (SetPoint + Math.Abs(_warningJudgmentRange)), _warningJudgmentTime);
  521. if (_toleranceCheckerWarning.Trig)
  522. {
  523. //AlarmToleranceWarning.Description = $"{Display} flow out of range {_warningJudgmentRange} {Unit} in {_warningJudgmentTime:F0} seconds";
  524. AlarmToleranceWarning.Set($"{Display} flow out of range {_warningJudgmentRange} {Unit} in {_warningJudgmentTime:F0} seconds");
  525. }
  526. }
  527. if (_alarmJudgmentRange != 0 && _alarmJudgmentTime > 0)
  528. {
  529. _toleranceCheckerAlarm.Monitor(FeedBack, (SetPoint - Math.Abs(_alarmJudgmentRange)), (SetPoint + Math.Abs(_alarmJudgmentRange)), _alarmJudgmentTime);
  530. if (_toleranceCheckerAlarm.Trig)
  531. {
  532. //AlarmToleranceAlarm.Description = $"{Display} flow out of range {_alarmJudgmentRange} {Unit} in {_alarmJudgmentTime:F0} seconds";
  533. AlarmToleranceAlarm.Set($"{Display} flow out of range {_alarmJudgmentRange} {Unit} in {_alarmJudgmentTime:F0} seconds");
  534. }
  535. }
  536. }
  537. }
  538. }