mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-20 18:51:28 +08:00
opcua读取值JValue转为object
This commit is contained in:
@@ -179,7 +179,15 @@ public class OPCUAClient : CollectBase
|
||||
var itemReads = _deviceVariables.Where(it => it.VariableAddress == data.id).ToList();
|
||||
foreach (var item in itemReads)
|
||||
{
|
||||
var value = data.jToken;
|
||||
object value;
|
||||
if (data.jToken is JValue jValue)
|
||||
{
|
||||
value = jValue.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = data.jToken;
|
||||
}
|
||||
var quality = StatusCode.IsGood(data.dataValue.StatusCode);
|
||||
|
||||
var time = data.dataValue.SourceTimestamp;
|
||||
|
@@ -356,7 +356,7 @@
|
||||
<MTooltip Bottom Context="tip">
|
||||
<ActivatorContent>
|
||||
<MButton Disabled=@(!UserResoures.IsHasPageWithRole("/tgruntime/devicevariable")) Class="mx-2" @attributes="@tip.Attrs" Dark Fab Small Loading=isRestart
|
||||
OnClick=@(()=>NavigationManager.NavigateTo("/tgruntime/devicevariable?devicename="+item.Device?.Name))>
|
||||
OnClick=@(()=>NavigationManager.NavigateTo("/tgruntime/devicevariable?uploaddevicename="+item.Device?.Name))>
|
||||
<MIcon>mdi-information-outline</MIcon>
|
||||
</MButton>
|
||||
</ActivatorContent>
|
||||
@@ -378,7 +378,7 @@
|
||||
</MTooltip>
|
||||
<MTooltip Bottom Context="tip">
|
||||
<ActivatorContent>
|
||||
<MButton Disabled=@(!UserResoures.IsHasButtonWithRole("tgdevicerestart")) Class="mx-2" @attributes="@tip.Attrs" Dark Fab Small Loading=isRestart OnClick=@(()=>Restart(item.DeviceId))>
|
||||
<MButton Disabled=@(!UserResoures.IsHasButtonWithRole("tgdevicerestart")) Class="mx-2" @attributes="@tip.Attrs" Dark Fab Small Loading=isRestart OnClick=@(()=>UpRestart(item.DeviceId))>
|
||||
<MIcon>mdi-restart</MIcon>
|
||||
</MButton>
|
||||
</ActivatorContent>
|
||||
|
@@ -32,7 +32,9 @@ namespace ThingsGateway.Web.Page
|
||||
[Parameter]
|
||||
[SupplyParameterFromQuery]
|
||||
public string DeviceName { get; set; }
|
||||
|
||||
[Parameter]
|
||||
[SupplyParameterFromQuery]
|
||||
public string UploadDeviceName { get; set; }
|
||||
VariablePageInput _searchModel { get; set; } = new();
|
||||
[Inject]
|
||||
IUploadDeviceService _uploadDeviceService { get; set; }
|
||||
@@ -63,6 +65,11 @@ namespace ThingsGateway.Web.Page
|
||||
_searchModel.DeviceName = DeviceName;
|
||||
await datatableQuery();
|
||||
}
|
||||
if (_searchModel.UploadDeviceName != UploadDeviceName && !UploadDeviceName.IsNullOrEmpty())
|
||||
{
|
||||
_searchModel.UploadDeviceName = UploadDeviceName;
|
||||
await datatableQuery();
|
||||
}
|
||||
|
||||
CollectDeviceHostService = ServiceExtensions.GetBackgroundService<CollectDeviceWorker>();
|
||||
_deviceGroups = _globalDeviceData.CollectDevices.Adapt<List<CollectDevice>>().GetTree();
|
||||
|
Reference in New Issue
Block a user