From a400d95bc5b9c787b0fca8937e75faf3e456014d Mon Sep 17 00:00:00 2001 From: hanqiangqiang <1364346467@qq.com> Date: Thu, 28 Dec 2023 09:38:53 +0800 Subject: [PATCH] =?UTF-8?q?[RT.EquipmentLibrary]=20TV=E9=98=80=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=A4=8D=E4=BD=8D=E6=93=8D=E4=BD=9C=EF=BC=8C=E4=B8=8A?= =?UTF-8?q?=E4=BD=8D=E6=9C=BA=E6=8C=89=E9=92=AE=E6=8C=89=E4=B8=8B=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E7=BD=AE=E4=BD=8DDO=5FTVReset=EF=BC=8C1=E7=A7=92?= =?UTF-8?q?=E5=90=8E=E5=A4=8D=E4=BD=8DDO=5FTVReset?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Devices/IoThrottleValve2.cs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/MECF.Framework.RT.EquipmentLibrary/Devices/IoThrottleValve2.cs b/MECF.Framework.RT.EquipmentLibrary/Devices/IoThrottleValve2.cs index 6583398..84ca02e 100644 --- a/MECF.Framework.RT.EquipmentLibrary/Devices/IoThrottleValve2.cs +++ b/MECF.Framework.RT.EquipmentLibrary/Devices/IoThrottleValve2.cs @@ -246,6 +246,8 @@ namespace Aitex.Core.RT.Device.Devices private double _rampInitValue1; private int _rampTime1; + private DeviceTimer _resetTimer = new DeviceTimer(); + private AITThrottleValveData DeviceData { get @@ -291,6 +293,8 @@ namespace Aitex.Core.RT.Device.Devices private DOAccessor _doTVValveEnable = null; + private DOAccessor _doTVReset = null; + private string _unitPressure; private Dictionary _ctrlModeIoValue = new Dictionary(); @@ -326,6 +330,7 @@ namespace Aitex.Core.RT.Device.Devices _aiPressureFeedback = ParseAiNode("aiPressureFeedback", node, ioModule); _aoPressureSetPoint = ParseAoNode("aoPressureSetPoint", node, ioModule); _doTVValveEnable = ParseDoNode("doTVValveEnable", node, ioModule); + _doTVReset= ParseDoNode("doTVReset", node, ioModule); _positionDefaultValue = ParseScNode("positionDefaultValue", node, ioModule, $"{scBasePath}.ThrottlePositionDefaultValue"); _pressureDefaultValue = ParseScNode("pressureDefaultValue", node, ioModule, $"{scBasePath}.ThrottlePressureDefaultValue"); @@ -382,6 +387,15 @@ namespace Aitex.Core.RT.Device.Devices return true; }); + OP.Subscribe($"{Module}.{Name}.SetTVReset", (function, args) => + { + bool bOn = Convert.ToBoolean((string)args[0]); + if (SetTVReset(bOn, out string reason)) + _resetTimer.Start(1000); + + return true; + }); + return true; } @@ -668,6 +682,18 @@ namespace Aitex.Core.RT.Device.Devices return true; } + public bool SetTVReset(bool reset, out string reason) + { + bool isResetOK = _doTVReset.SetValue(reset, out _); + reason = $"{Display} reset to {reset} "; + + if (isResetOK) + EV.PostInfoLog(Module, reason); + else + EV.PostAlarmLog(Module, reason); + return isResetOK; + } + public void Terminate() { } @@ -687,6 +713,7 @@ namespace Aitex.Core.RT.Device.Devices MonitorRamping(); MonitorRampingPosition(); //MonitorClose(); + MonitorSetRest();//根据电气要求,按钮复位按钮后,1秒后复位DO信号 } catch (Exception ex) { @@ -793,6 +820,15 @@ namespace Aitex.Core.RT.Device.Devices } } + private void MonitorSetRest() + { + if (_resetTimer.IsTimeout()) + { + _resetTimer.Stop(); + SetTVReset(false, out _); + } + } + public void Reset() {