64e3fbe035
v2-ci / build (push) Failing after 1m43s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
Adds <summary>, <param>, <typeparam>, and <inheritdoc/> tags to public members surfaced by commentchecker — resolves 5,847 of 5,869 issues (99.6%) across three /fixdocs passes.
57 lines
3.1 KiB
C#
57 lines
3.1 KiB
C#
using ZB.MOM.WW.OtOpcUa.Commons.OpcUa;
|
|
|
|
namespace ZB.MOM.WW.OtOpcUa.OpcUaServer;
|
|
|
|
/// <summary>
|
|
/// Production <see cref="IOpcUaAddressSpaceSink"/> binding for v2 — bridges
|
|
/// OpcUaPublishActor's writes to the SDK address space owned by
|
|
/// <see cref="OtOpcUaNodeManager"/>. The host wires this in once the StandardServer has
|
|
/// been started (so the node manager exists).
|
|
/// </summary>
|
|
public sealed class SdkAddressSpaceSink : IOpcUaAddressSpaceSink
|
|
{
|
|
private readonly OtOpcUaNodeManager _nodeManager;
|
|
|
|
/// <summary>Initializes a new instance of the SdkAddressSpaceSink class.</summary>
|
|
/// <param name="nodeManager">The OPC UA node manager.</param>
|
|
public SdkAddressSpaceSink(OtOpcUaNodeManager nodeManager)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(nodeManager);
|
|
_nodeManager = nodeManager;
|
|
}
|
|
|
|
/// <summary>Writes a value to the OPC UA address space.</summary>
|
|
/// <param name="nodeId">The OPC UA node identifier.</param>
|
|
/// <param name="value">The value being written.</param>
|
|
/// <param name="quality">The OPC UA quality status.</param>
|
|
/// <param name="sourceTimestampUtc">The source timestamp in UTC.</param>
|
|
public void WriteValue(string nodeId, object? value, OpcUaQuality quality, DateTime sourceTimestampUtc)
|
|
=> _nodeManager.WriteValue(nodeId, value, quality, sourceTimestampUtc);
|
|
|
|
/// <summary>Writes alarm state to the OPC UA address space.</summary>
|
|
/// <param name="alarmNodeId">The alarm node identifier.</param>
|
|
/// <param name="active">Whether the alarm is active.</param>
|
|
/// <param name="acknowledged">Whether the alarm is acknowledged.</param>
|
|
/// <param name="sourceTimestampUtc">The source timestamp in UTC.</param>
|
|
public void WriteAlarmState(string alarmNodeId, bool active, bool acknowledged, DateTime sourceTimestampUtc)
|
|
=> _nodeManager.WriteAlarmState(alarmNodeId, active, acknowledged, sourceTimestampUtc);
|
|
|
|
/// <summary>Ensures a folder node exists in the address space.</summary>
|
|
/// <param name="folderNodeId">The folder node identifier.</param>
|
|
/// <param name="parentNodeId">The parent folder node identifier.</param>
|
|
/// <param name="displayName">The display name for the folder.</param>
|
|
public void EnsureFolder(string folderNodeId, string? parentNodeId, string displayName)
|
|
=> _nodeManager.EnsureFolder(folderNodeId, parentNodeId, displayName);
|
|
|
|
/// <summary>Ensures a variable node exists in the address space.</summary>
|
|
/// <param name="variableNodeId">The variable node identifier.</param>
|
|
/// <param name="parentFolderNodeId">The parent folder node identifier.</param>
|
|
/// <param name="displayName">The display name for the variable.</param>
|
|
/// <param name="dataType">The OPC UA data type.</param>
|
|
public void EnsureVariable(string variableNodeId, string? parentFolderNodeId, string displayName, string dataType)
|
|
=> _nodeManager.EnsureVariable(variableNodeId, parentFolderNodeId, displayName, dataType);
|
|
|
|
/// <summary>Rebuilds the entire OPC UA address space.</summary>
|
|
public void RebuildAddressSpace() => _nodeManager.RebuildAddressSpace();
|
|
}
|