From 50d953803f8d3793081181e6d804e9106ae770a9 Mon Sep 17 00:00:00 2001 From: HCL <1625932291@qq.com> Date: Sat, 12 Oct 2024 13:23:18 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=88=86=E5=BC=80=E9=9A=94=E7=83=AD=E7=BD=A9?= =?UTF-8?q?Do=E5=A4=8D=E4=BD=8DTimer=202.=E5=A4=8D=E4=BD=8D=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E7=94=B1500ms=E6=94=B9=E4=B8=BA1s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Devices/IoConfinementRing.cs | 57 ++++++++++++++----- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/MECF.Framework.RT.EquipmentLibrary/Devices/IoConfinementRing.cs b/MECF.Framework.RT.EquipmentLibrary/Devices/IoConfinementRing.cs index 078fda8..b5019c5 100644 --- a/MECF.Framework.RT.EquipmentLibrary/Devices/IoConfinementRing.cs +++ b/MECF.Framework.RT.EquipmentLibrary/Devices/IoConfinementRing.cs @@ -161,7 +161,12 @@ namespace Aitex.Core.RT.Device.Devices /// public bool RingInpDown => DoubleUtil.IsEqual(RingCurPos, RingDownPos); - private DeviceTimer _timer = new DeviceTimer(); + private DeviceTimer _timerServoStop = new DeviceTimer(); + private DeviceTimer _timerJogUp = new DeviceTimer(); + private DeviceTimer _timerJogDown = new DeviceTimer(); + private DeviceTimer _timerMoveUp = new DeviceTimer(); + private DeviceTimer _timerMoveDown = new DeviceTimer(); + private DeviceTimer _timerServoReset = new DeviceTimer(); private SCConfigItem _scUpPos; private SCConfigItem _scDownPos; @@ -301,7 +306,7 @@ namespace Aitex.Core.RT.Device.Devices if (!_doRingStop.SetValue(true, out reason)) return false; - _timer.Start(500); + _timerServoStop.Start(1000); return true; } @@ -339,7 +344,7 @@ namespace Aitex.Core.RT.Device.Devices if (!_doRingJogUp.SetValue(true, out reason)) return false; - _timer.Start(500); + _timerJogUp.Start(1000); return true; } @@ -367,7 +372,7 @@ namespace Aitex.Core.RT.Device.Devices if (!_doRingJogDown.SetValue(true, out reason)) return false; - _timer.Start(500); + _timerJogDown.Start(1000); return true; } @@ -422,7 +427,7 @@ namespace Aitex.Core.RT.Device.Devices return false; } - _timer.Start(500); + _timerMoveUp.Start(1000); return true; } @@ -466,23 +471,47 @@ namespace Aitex.Core.RT.Device.Devices return false; } - _timer.Start(500); + _timerMoveDown.Start(1000); return true; } protected override void HandleMonitor() { - if (_timer.IsTimeout()) + if (_timerJogUp.IsTimeout()) { _doRingJogUp.Value = false; - _doRingJogDown.Value = false; - _doRingMoveUp.Value = false; - _doRingMoveDown.Value = false; - _doRingServoReset.Value = false; - _doRingStop.Value = false; + _timerJogUp.Stop(); + } - _timer.Stop(); + if (_timerJogDown.IsTimeout()) + { + _doRingJogDown.Value = false; + _timerJogDown.Stop(); + } + + if (_timerMoveUp.IsTimeout()) + { + _doRingMoveUp.Value = false; + _timerMoveUp.Stop(); + } + + if (_timerMoveDown.IsTimeout()) + { + _doRingMoveDown.Value = false; + _timerMoveDown.Stop(); + } + + if (_timerServoStop.IsTimeout()) + { + _doRingStop.Value = false; + _timerServoStop.Stop(); + } + + if (_timerServoReset.IsTimeout()) + { + _doRingServoReset.Value = false; + _timerServoReset.Stop(); } } @@ -496,7 +525,7 @@ namespace Aitex.Core.RT.Device.Devices if (!_doRingServoReset.SetValue(true, out reason)) return; - _timer.Start(500); + _timerServoReset.Start(1000); } } }