Compare commits

...

6 Commits

Author SHA1 Message Date
Kimdiego2098
edc208f96b update 3.0.0.2 2023-10-05 15:32:50 +08:00
Diego2098
1fb0296ee7 update Directory.Build.props 2023-10-05 15:21:51 +08:00
Kimdiego2098
6488d3df87 修复重启共享通道中的单个设备时,导致通道内其他设备变量异常 2023-10-05 00:34:12 +08:00
Kimdiego2098
56189d78e0 update opcuaclient 2023-10-04 17:12:47 +08:00
Kimdiego2098
bff18127b8 update opcuaclient 2023-10-04 16:59:15 +08:00
Kimdiego2098
363206e0ba update nuget 2023-10-04 02:04:09 +08:00
15 changed files with 62 additions and 45 deletions

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>3.0.0.1</Version>
<Version>3.0.0.2</Version>
<LangVersion>latest</LangVersion>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<Authors>Diego</Authors>

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>3.0.0.1</Version>
<Version>3.0.0.2</Version>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<LangVersion>latest</LangVersion>
<TargetFrameworks>net45;netstandard2.0;net6.0;net7.0</TargetFrameworks>

View File

@@ -692,15 +692,9 @@ public class OPCUAClient : IDisposable
#endregion
#region session
/// <inheritdoc/>
public Task<Node> ReadNodeAsync(
NodeId nodeId,
CancellationToken ct = default)
{
return ReadNodeAsync(nodeId, NodeClass.Unspecified, true, ct);
}
#region session
/// <inheritdoc/>
public async Task<Node> ReadNodeAsync(
@@ -790,6 +784,8 @@ public class OPCUAClient : IDisposable
attributeId == Attributes.Description ||
attributeId == Attributes.RolePermissions ||
attributeId == Attributes.UserRolePermissions ||
attributeId == Attributes.DataTypeDefinition ||
attributeId == Attributes.AccessLevelEx ||
attributeId == Attributes.UserWriteMask ||
attributeId == Attributes.WriteMask)
{

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>3.0.0.1</Version>
<Version>3.0.0.2</Version>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
@@ -11,14 +11,13 @@
<SignAssembly>True</SignAssembly>
<DelaySign>False</DelaySign>
<SatelliteResourceLanguages>zh-Hans</SatelliteResourceLanguages>
<EnableDynamicLoading>true</EnableDynamicLoading>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup>
<!--<PropertyGroup>
<EnableDynamicLoading>true</EnableDynamicLoading>
</PropertyGroup>
</PropertyGroup>-->
<ItemGroup>

View File

@@ -9,10 +9,10 @@
<PackageReference Include="Confluent.Kafka" Version="2.2.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Web\ThingsGateway.Gateway.Application\ThingsGateway.Gateway.Application.csproj" />
</ItemGroup>
<PropertyGroup>
<EnableDynamicLoading>true</EnableDynamicLoading>
</PropertyGroup>
</Project>

View File

@@ -9,12 +9,6 @@
</Target>
<ItemGroup>
<ProjectReference Include="..\..\Web\ThingsGateway.Gateway.Application\ThingsGateway.Gateway.Application.csproj" />
</ItemGroup>

View File

@@ -36,7 +36,8 @@
<ExcludeAssets>runtime</ExcludeAssets>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<EnableDynamicLoading>true</EnableDynamicLoading>
</PropertyGroup>
</Project>

View File

@@ -7,12 +7,8 @@
<ItemGroup>
<PackageReference Include="RabbitMQ.Client" Version="6.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Web\ThingsGateway.Gateway.Application\ThingsGateway.Gateway.Application.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>3.0.0.1</Version>
<Version>3.0.0.2</Version>
<LangVersion>latest</LangVersion>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<Authors>Diego</Authors>

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>3.0.0.1</Version>
<Version>3.0.0.2</Version>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>

View File

@@ -5,10 +5,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.8.8.44" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.8.8.44" />
<PackageReference Include="Furion.Pure" Version="4.8.8.44" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.107" />
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.8.8.45" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.8.8.45" />
<PackageReference Include="Furion.Pure" Version="4.8.8.45" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.108" />
<PackageReference Include="UAParser" Version="3.1.47" />
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
</ItemGroup>

View File

@@ -32,7 +32,7 @@
<ItemGroup>
<PackageReference Include="Hardware.Info" Version="100.0.0" />
<PackageReference Include="CS-Script" Version="4.8.1" />
<PackageReference Include="CS-Script" Version="4.8.3" />
<!--CS-Script与Furion冲突直接安装覆盖版本-->
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.7.0" />
<PackageReference Include="MQTTnet" Version="4.3.1.873" />

View File

@@ -275,7 +275,7 @@ public class CollectDeviceCore
/// <summary>
/// 初始化
/// </summary>
internal bool Init(CollectDeviceRunTime device)
internal bool Init(CollectDeviceRunTime device, bool upDevice = false)
{
if (device == null)
{
@@ -292,10 +292,13 @@ public class CollectDeviceCore
//更新插件信息
CreatDriver();
//全局数据更新
if (isUpDevice)
if (isUpDevice || upDevice)
{
GlobalDeviceData.CollectDevices.RemoveWhere(it => it.Id == device.Id);
GlobalDeviceData.CollectDevices.Add(device);
lock (GlobalDeviceData.CollectDevices)
{
GlobalDeviceData.CollectDevices.RemoveWhere(it => it.Id == device.Id);
GlobalDeviceData.CollectDevices.Add(device);
}
}
return true;
}

View File

@@ -132,7 +132,6 @@ public class CollectDeviceWorker : BackgroundService
if (devThread == null) { throw Oops.Bah($"更新设备线程失败,不存在{devId}为id的设备"); }
//这里先停止采集,操作会使线程取消,需要重新恢复线程
await devThread.StopThreadAsync();
CollectDeviceRunTime dev = isUpdateDb ? (await App.GetService<ICollectDeviceService>().GetCollectDeviceRuntimeAsync(devId)).FirstOrDefault() : devCore.Device;
if (dev == null)
@@ -155,6 +154,14 @@ public class CollectDeviceWorker : BackgroundService
{
CollectDeviceThreads.Remove(devThread);
}
else
{
//单个设备重启时,注意同一线程的其他设备也会停止,需要重新初始化
foreach (var item in devThread.CollectDeviceCores)
{
item.Init(item.Device, true);
}
}
//需判断是否同一通道
var newDevThread = DeviceThread(devCore);
@@ -393,6 +400,14 @@ public class CollectDeviceWorker : BackgroundService
{
CollectDeviceThreads.Remove(devThread);
}
else
{
//单个设备重启时,注意同一线程的其他设备也会停止,需要重新初始化
foreach (var item in devThread.CollectDeviceCores)
{
item.Init(item.Device, true);
}
}
//需判断是否同一通道
var newDevThread = DeviceThread(devCore);
await newDevThread.StartThreadAsync();

View File

@@ -153,6 +153,13 @@ public class UploadDeviceWorker : BackgroundService
{
UploadDeviceThreads.Remove(devThread);
}
else
{
foreach (var item in devThread.UploadDeviceCores)
{
item.Init(item.Device);
}
}
}
else
{
@@ -165,7 +172,13 @@ public class UploadDeviceWorker : BackgroundService
{
UploadDeviceThreads.Remove(devThread);
}
else
{
foreach (var item in devThread.UploadDeviceCores)
{
item.Init(item.Device);
}
}
//需判断是否同一通道
var newDevThread = DeviceThread(devCore);
await newDevThread.StartThreadAsync();