diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 198d28569..92a35a8fd 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,9 +1,9 @@ - 10.11.70 - 10.11.70 - 10.11.70 + 10.11.71 + 10.11.71 + 10.11.71 10.11.6 10.11.6 8.0.20 diff --git a/src/Foundation/ThingsGateway.Foundation/DataHandleAdapter/DeviceSingleStreamDataHandleAdapter.cs b/src/Foundation/ThingsGateway.Foundation/DataHandleAdapter/DeviceSingleStreamDataHandleAdapter.cs index bf91b4bf2..b3194db69 100644 --- a/src/Foundation/ThingsGateway.Foundation/DataHandleAdapter/DeviceSingleStreamDataHandleAdapter.cs +++ b/src/Foundation/ThingsGateway.Foundation/DataHandleAdapter/DeviceSingleStreamDataHandleAdapter.cs @@ -179,7 +179,12 @@ public class DeviceSingleStreamDataHandleAdapter : CustomDataHandlingA { throw new Exception($"Unable to convert {nameof(requestInfo)} to {nameof(ISendMessage)}"); } - var span = writer.GetSpan(sendMessage.MaxLength); + Span span = default; + if (Logger?.LogLevel <= LogLevel.Trace) + { + span = writer.GetSpan(sendMessage.MaxLength); + } + sendMessage.Build(ref writer); if (Logger?.LogLevel <= LogLevel.Trace) { diff --git a/src/Plugin/ThingsGateway.Foundation.Benchmark/Benchmark/ModbusBenchmark.cs b/src/Plugin/ThingsGateway.Foundation.Benchmark/Benchmark/ModbusBenchmark.cs index 0332b50c9..1024f05be 100644 --- a/src/Plugin/ThingsGateway.Foundation.Benchmark/Benchmark/ModbusBenchmark.cs +++ b/src/Plugin/ThingsGateway.Foundation.Benchmark/Benchmark/ModbusBenchmark.cs @@ -32,7 +32,7 @@ using ModbusMaster = ThingsGateway.Foundation.Modbus.ModbusMaster; namespace ThingsGateway.Foundation; [SimpleJob(RuntimeMoniker.Net80)] -[SimpleJob(RuntimeMoniker.Net10_0)] +//[SimpleJob(RuntimeMoniker.Net10_0)] [MemoryDiagnoser] public class ModbusBenchmark : IDisposable { diff --git a/src/Plugin/ThingsGateway.Foundation.Benchmark/Benchmark/S7Benchmark.cs b/src/Plugin/ThingsGateway.Foundation.Benchmark/Benchmark/S7Benchmark.cs index f884b4518..b63857266 100644 --- a/src/Plugin/ThingsGateway.Foundation.Benchmark/Benchmark/S7Benchmark.cs +++ b/src/Plugin/ThingsGateway.Foundation.Benchmark/Benchmark/S7Benchmark.cs @@ -24,8 +24,8 @@ using TouchSocket.Core; namespace ThingsGateway.Foundation; -//[SimpleJob(RuntimeMoniker.Net80)] -[SimpleJob(RuntimeMoniker.Net10_0)] +[SimpleJob(RuntimeMoniker.Net80)] +//[SimpleJob(RuntimeMoniker.Net10_0)] [MemoryDiagnoser] [BaselineColumn] [RankColumn] @@ -67,7 +67,7 @@ public class S7Benchmark : IDisposable } for (int i = 0; i < Program.ClientCount; i++) { - var plc = new Plc(CpuType.S7300, "127.0.0.1", 102, 0, 0); + var plc = new Plc(CpuType.S71500, "127.0.0.1", 102, 0, 0); await plc.OpenAsync();//打开plc连接 await plc.ReadAsync(DataType.Memory, 1, 0, VarType.Byte, 100); plcs.Add(plc); @@ -95,30 +95,29 @@ public class S7Benchmark : IDisposable await Task.WhenAll(tasks); } - //并发失败 - //[Benchmark] - //public async Task HslCommunication() - //{ - // List tasks = new List(); - // foreach (var siemensS7Net in siemensS7Nets) - // { - // for (int i = 0; i < Program.TaskNumberOfItems; i++) - // { - // tasks.Add(Task.Run(async () => - // { - // for (int i = 0; i < Program.NumberOfItems; i++) - // { - // var result = await siemensS7Net.ReadAsync("M0", 100); - // if (!result.IsSuccess) - // { - // throw new Exception(result.Message); - // } - // } - // })); - // } - // } - // await Task.WhenAll(tasks); - //} + [Benchmark] + public async Task HslCommunication() + { + List tasks = new List(); + foreach (var siemensS7Net in siemensS7Nets) + { + for (int i = 0; i < Program.TaskNumberOfItems; i++) + { + tasks.Add(Task.Run(async () => + { + for (int i = 0; i < Program.NumberOfItems; i++) + { + var result = await siemensS7Net.ReadAsync("M0", 100); + if (!result.IsSuccess) + { + throw new Exception(result.Message); + } + } + })); + } + } + await Task.WhenAll(tasks); + } diff --git a/src/Plugin/ThingsGateway.Foundation.Benchmark/ThingsGateway.Foundation.Benchmark.csproj b/src/Plugin/ThingsGateway.Foundation.Benchmark/ThingsGateway.Foundation.Benchmark.csproj index 57633aab0..244cca8a7 100644 --- a/src/Plugin/ThingsGateway.Foundation.Benchmark/ThingsGateway.Foundation.Benchmark.csproj +++ b/src/Plugin/ThingsGateway.Foundation.Benchmark/ThingsGateway.Foundation.Benchmark.csproj @@ -43,7 +43,7 @@ - + diff --git a/src/Plugin/ThingsGateway.Plugin.OpcUa/Directory.build.targets b/src/Plugin/ThingsGateway.Plugin.OpcUa/Directory.build.targets index a01f3dc6a..5a725a183 100644 --- a/src/Plugin/ThingsGateway.Plugin.OpcUa/Directory.build.targets +++ b/src/Plugin/ThingsGateway.Plugin.OpcUa/Directory.build.targets @@ -12,6 +12,7 @@ + @@ -23,6 +24,7 @@ + @@ -36,6 +38,10 @@ true Content + + true + Content + diff --git a/src/Plugin/ThingsGateway.Plugin.OpcUa/ThingsGateway.Plugin.OpcUa.csproj b/src/Plugin/ThingsGateway.Plugin.OpcUa/ThingsGateway.Plugin.OpcUa.csproj index 09621a6e4..7b0509efa 100644 --- a/src/Plugin/ThingsGateway.Plugin.OpcUa/ThingsGateway.Plugin.OpcUa.csproj +++ b/src/Plugin/ThingsGateway.Plugin.OpcUa/ThingsGateway.Plugin.OpcUa.csproj @@ -48,6 +48,10 @@ contentFiles;build;buildMultitargeting;buildTransitive;analyzers; + + + contentFiles;build;buildMultitargeting;buildTransitive;analyzers; +