mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-29 14:43:59 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
edc208f96b | ||
|
|
1fb0296ee7 | ||
|
|
6488d3df87 | ||
|
|
56189d78e0 | ||
|
|
bff18127b8 | ||
|
|
363206e0ba |
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -9,12 +9,6 @@
|
||||
</Target>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Web\ThingsGateway.Gateway.Application\ThingsGateway.Gateway.Application.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,8 @@
|
||||
<ExcludeAssets>runtime</ExcludeAssets>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
||||
<PropertyGroup>
|
||||
<EnableDynamicLoading>true</EnableDynamicLoading>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user