diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 10669cf32..bc2bc4838 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,10 +1,11 @@ - 10.9.19 - 10.9.19 - 2.9.9 - 10.9.9 + 10.9.22 + 10.9.22 + 10.9.22 + 2.9.12 + 10.9.12 8.0.17 9.0.6 zh-Hans;en-US diff --git a/src/Gateway/ThingsGateway.Gateway.Application/Common/Tasks/TaskSchedulerLoop.cs b/src/Gateway/ThingsGateway.Gateway.Application/Common/Tasks/TaskSchedulerLoop.cs index f91eed949..c8cc7098b 100644 --- a/src/Gateway/ThingsGateway.Gateway.Application/Common/Tasks/TaskSchedulerLoop.cs +++ b/src/Gateway/ThingsGateway.Gateway.Application/Common/Tasks/TaskSchedulerLoop.cs @@ -20,7 +20,7 @@ public class TaskSchedulerLoop task.Start(); } } - + public bool Stoped => Tasks.All(a => !a.Enable); public void Stop() { foreach (var task in Tasks) diff --git a/src/Gateway/ThingsGateway.Gateway.Application/Driver/Business/Cache/BusinessBaseWithCacheAlarm.cs b/src/Gateway/ThingsGateway.Gateway.Application/Driver/Business/Cache/BusinessBaseWithCacheAlarm.cs index 55aaa62f4..75d61474b 100644 --- a/src/Gateway/ThingsGateway.Gateway.Application/Driver/Business/Cache/BusinessBaseWithCacheAlarm.cs +++ b/src/Gateway/ThingsGateway.Gateway.Application/Driver/Business/Cache/BusinessBaseWithCacheAlarm.cs @@ -78,6 +78,7 @@ public abstract class BusinessBaseWithCacheAlarm : BusinessBaseWithCache { if (CurrentDevice?.Pause != false) return; + if (TaskSchedulerLoop.Stoped) return; if (AlarmModelEnable) return; // 如果业务属性的缓存为间隔上传,则不执行后续操作 diff --git a/src/Gateway/ThingsGateway.Gateway.Application/Driver/Business/Cache/BusinessBaseWithCacheInterval.cs b/src/Gateway/ThingsGateway.Gateway.Application/Driver/Business/Cache/BusinessBaseWithCacheInterval.cs index 6390bfcb9..124a8101c 100644 --- a/src/Gateway/ThingsGateway.Gateway.Application/Driver/Business/Cache/BusinessBaseWithCacheInterval.cs +++ b/src/Gateway/ThingsGateway.Gateway.Application/Driver/Business/Cache/BusinessBaseWithCacheInterval.cs @@ -248,6 +248,7 @@ public abstract class BusinessBaseWithCacheInterval : BusinessBaseWithCache { if (CurrentDevice?.Pause != false) return; + if (TaskSchedulerLoop.Stoped) return; if (!AlarmModelEnable) return; // 如果业务属性的缓存为间隔上传,则不执行后续操作 @@ -304,6 +305,7 @@ public abstract class BusinessBaseWithCacheInterval : BusinessBaseWithCache { if (CurrentDevice?.Pause != false) return; + if (TaskSchedulerLoop.Stoped) return; if (!DevModelEnable) return; // 如果业务属性的缓存为间隔上传,则不执行后续操作 //if (_businessPropertyWithCacheInterval?.IsInterval != true) @@ -324,6 +326,8 @@ public abstract class BusinessBaseWithCacheInterval : BusinessBaseWithCache if (CurrentDevice?.Pause != false) return; if (!VarModelEnable) return; + if (TaskSchedulerLoop.Stoped) return; + // 如果业务属性的缓存为间隔上传,则不执行后续操作 //if (_businessPropertyWithCacheInterval?.IsInterval != true) { diff --git a/src/Plugin/ThingsGateway.Plugin.Modbus/ModbusSlave/ModbusSlave.cs b/src/Plugin/ThingsGateway.Plugin.Modbus/ModbusSlave/ModbusSlave.cs index 9ae01281f..bb2612867 100644 --- a/src/Plugin/ThingsGateway.Plugin.Modbus/ModbusSlave/ModbusSlave.cs +++ b/src/Plugin/ThingsGateway.Plugin.Modbus/ModbusSlave/ModbusSlave.cs @@ -248,6 +248,7 @@ public class ModbusSlave : BusinessBase { if (CurrentDevice?.Pause != false) return; + if (TaskSchedulerLoop.Stoped) return; var address = variableRuntime.GetPropertyValue(DeviceId, nameof(_variablePropertys.ServiceAddress)); if (address != null && variableRuntime.Value != null) { diff --git a/src/Plugin/ThingsGateway.Plugin.OpcDa/OpcDaMaster/OpcDaMaster.cs b/src/Plugin/ThingsGateway.Plugin.OpcDa/OpcDaMaster/OpcDaMaster.cs index 7b6e2935b..b3e495c57 100644 --- a/src/Plugin/ThingsGateway.Plugin.OpcDa/OpcDaMaster/OpcDaMaster.cs +++ b/src/Plugin/ThingsGateway.Plugin.OpcDa/OpcDaMaster/OpcDaMaster.cs @@ -219,6 +219,7 @@ public class OpcDaMaster : CollectBase { if (CurrentDevice.Pause) return; + if (TaskSchedulerLoop.Stoped) return; if (DisposedValue) return; LogMessage?.Trace($"{ToString()} Change:{Environment.NewLine} {values?.ToSystemTextJsonString()}"); @@ -227,6 +228,7 @@ public class OpcDaMaster : CollectBase { if (CurrentDevice.Pause) return; + if (TaskSchedulerLoop.Stoped) return; if (DisposedValue) return; var type = data.Value.GetType(); @@ -240,6 +242,7 @@ public class OpcDaMaster : CollectBase { if (CurrentDevice.Pause) return; + if (TaskSchedulerLoop.Stoped) return; if (DisposedValue) return; var value = data.Value; diff --git a/src/Plugin/ThingsGateway.Plugin.OpcUa/OpcUaMaster/OpcUaMaster.cs b/src/Plugin/ThingsGateway.Plugin.OpcUa/OpcUaMaster/OpcUaMaster.cs index 64967631b..db9c34ee8 100644 --- a/src/Plugin/ThingsGateway.Plugin.OpcUa/OpcUaMaster/OpcUaMaster.cs +++ b/src/Plugin/ThingsGateway.Plugin.OpcUa/OpcUaMaster/OpcUaMaster.cs @@ -363,12 +363,9 @@ public class OpcUaMaster : CollectBase return; if (DisposedValue) return; + if (TaskSchedulerLoop.Stoped) return; - if (CurrentDevice.Pause) - { - return; - } LogMessage?.Trace($"Change: {Environment.NewLine} {data.monitoredItem.StartNodeId} : {data.jToken?.ToString()}"); @@ -390,6 +387,7 @@ public class OpcUaMaster : CollectBase return; if (DisposedValue) return; + if (TaskSchedulerLoop.Stoped) return; if (isGood) { diff --git a/src/Plugin/ThingsGateway.Plugin.OpcUa/OpcUaServer/OpcUaServer.cs b/src/Plugin/ThingsGateway.Plugin.OpcUa/OpcUaServer/OpcUaServer.cs index 7d6f36549..9842a4c70 100644 --- a/src/Plugin/ThingsGateway.Plugin.OpcUa/OpcUaServer/OpcUaServer.cs +++ b/src/Plugin/ThingsGateway.Plugin.OpcUa/OpcUaServer/OpcUaServer.cs @@ -397,6 +397,7 @@ public partial class OpcUaServer : BusinessBase { if (CurrentDevice.Pause) return; + if (TaskSchedulerLoop.Stoped) return; if (DisposedValue) return; if (IdVariableRuntimes.ContainsKey(variableData.Id)) CollectVariableRuntimes.AddOrUpdate(variableData.Id, id => variableData, (id, addValue) => variableData); diff --git a/src/Version.props b/src/Version.props index 1f4f9a4c9..fc9392014 100644 --- a/src/Version.props +++ b/src/Version.props @@ -1,6 +1,6 @@ - 10.9.19 + $(DefaultVersion)