using EonaCat.Connections.OpcUa.Infrastructure; using EonaCat.Connections.OpcUa.Models; using Opc.Ua; using Opc.Ua.Server; namespace EonaCat.Connections.OpcUa.Server; internal sealed class EonaCatOpcUaServer : StandardServer { private readonly string _namespaceUri; private readonly IReadOnlyCollection _nodes; private readonly IReadOnlyCollection _methods; public EonaCatOpcUaServer( string namespaceUri, IReadOnlyCollection nodes, IReadOnlyCollection methods) : base(OpcUaRuntime.Telemetry) { _namespaceUri = namespaceUri; _nodes = nodes; _methods = methods; } public OpcUaAddressSpace? AddressSpace { get; private set; } protected override MasterNodeManager CreateMasterNodeManager( IServerInternal server, ApplicationConfiguration configuration) { AddressSpace = new OpcUaAddressSpace(server, configuration, _namespaceUri, _nodes, _methods); return new MasterNodeManager(server, configuration, null, AddressSpace); } protected override ServerProperties LoadServerProperties() => new() { ManufacturerName = "EonaCat", ProductName = "EonaCat Generic OPC UA Server", ProductUri = "urn:EonaCat:Connector:OpcUa", SoftwareVersion = Utils.GetAssemblySoftwareVersion(), BuildNumber = Utils.GetAssemblyBuildNumber(), BuildDate = Utils.GetAssemblyTimestamp() }; }