From c4d5c8a41ce3a7cc84223d703f9397b550b47aef Mon Sep 17 00:00:00 2001 From: iioter <535915157@qq.com> Date: Thu, 13 Oct 2022 15:24:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=95=B0=E6=8D=AE=E4=BC=A0?= =?UTF-8?q?=E8=BE=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IoTGateway/IoTGateway.csproj | 2 ++ Plugins/Plugin/DeviceThread.cs | 5 +++-- Plugins/Plugin/Plugin.csproj | 34 ++++++++++++++++++---------------- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/IoTGateway/IoTGateway.csproj b/IoTGateway/IoTGateway.csproj index 4986f36..330cb03 100644 --- a/IoTGateway/IoTGateway.csproj +++ b/IoTGateway/IoTGateway.csproj @@ -7,6 +7,8 @@ zh-Hans,en true Linux + false + true diff --git a/Plugins/Plugin/DeviceThread.cs b/Plugins/Plugin/DeviceThread.cs index 1e9c273..bba0ce7 100644 --- a/Plugins/Plugin/DeviceThread.cs +++ b/Plugins/Plugin/DeviceThread.cs @@ -41,6 +41,7 @@ namespace Plugin if (Device.AutoStart) { _logger.LogInformation($"线程已启动:{Device.DeviceName}"); + Task.Delay(8000); if (Device.DeviceVariables != null) { @@ -79,7 +80,7 @@ namespace Plugin { foreach (var item in Device.DeviceVariables.OrderBy(x => x.Index)) { - Thread.Sleep((int)Device.CmdPeriod); + Task.Delay((int)Device.CmdPeriod); var ret = new DriverReturnValueModel(); var ioarg = new DriverAddressIoArgModel @@ -188,7 +189,7 @@ namespace Plugin } - Thread.Sleep((int)Driver.MinPeriod); + Task.Delay((int)Driver.MinPeriod); } }, TaskCreationOptions.LongRunning); } diff --git a/Plugins/Plugin/Plugin.csproj b/Plugins/Plugin/Plugin.csproj index e52292c..5b7286d 100644 --- a/Plugins/Plugin/Plugin.csproj +++ b/Plugins/Plugin/Plugin.csproj @@ -1,22 +1,24 @@  - - net6.0 - enable - enable - + + net6.0 + enable + enable + false + true + - - - - - - + + + + + + - - - - - + + + + +