refactor: migrate client applications to OPC UA SDK 2.0

This commit is contained in:
Joseph Doherty
2026-11-10 10:08:18 -05:00
parent d2076e75c6
commit 0ecea3c6be
21 changed files with 247 additions and 165 deletions
@@ -123,14 +123,14 @@ public class SubscribeCommand : CommandBase
try
{
var key = e.NodeId.ToString();
lastStatus[key] = (e.Value.StatusCode, DateTime.UtcNow, e.Value.Value);
lastStatus[key] = (e.Value.StatusCode, DateTime.UtcNow, ZB.MOM.WW.OtOpcUa.Client.Shared.Helpers.ValueConverter.ToClrObject(e.Value.WrappedValue));
updateCount.AddOrUpdate(key, 1, (_, v) => v + 1);
if (!StatusCode.IsGood(e.Value.StatusCode))
everBad.TryAdd(key, 0);
if (!Quiet)
{
var line =
$"[{e.Value.SourceTimestamp:O}] {displayNameByNodeId.GetValueOrDefault(key, key)} = {e.Value.Value} ({e.Value.StatusCode})";
$"[{e.Value.SourceTimestamp:O}] {displayNameByNodeId.GetValueOrDefault(key, key)} = {ZB.MOM.WW.OtOpcUa.Client.Shared.Helpers.ValueConverter.ToClrObject(e.Value.WrappedValue)} ({e.Value.StatusCode})";
outputChannel.Writer.TryWrite(line);
}
}
@@ -271,7 +271,7 @@ public class SubscribeCommand : CommandBase
var childPath = $"{parentPath}/{child.DisplayName}";
if (child.NodeClass == "Variable")
{
into.Add((nodeId, childPath));
into.Add((nodeId.Value, childPath));
}
if (child.HasChildren)
{