Files
Marc Schier 4756e7c245 DI (OPC 10000-100) with samples (Pump, SW Update), fluent API gap closures and model dependency implementation (#3808)
This PR implements the **OPC UA Device Integration (DI, OPC 10000-100)**
companion-spec library trio (`Opc.Ua.Di` / `Opc.Ua.Di.Server` /
`Opc.Ua.Di.Client`) plus a worked example
(`Applications/MinimalPumpServer`) demonstrating the OPC 40223 Pumps
companion specification end-to-end with full simulation. It also closes
11 fluent-API gaps in `Opc.Ua.Server.Fluent`, three source-generator
bugs, integrates the DI layer into the unified `services.AddOpcUa()`
Microsoft.Extensions DI hosting pattern, and adds 250+ new tests.

**Worked example — `Applications/MinimalPumpServer/`**
- AOT-compatible console host using `Host.CreateApplicationBuilder` +
`AddOpcUa()`.
- `PumpNodeManager` inherits from `DiNodeManager`; multi-namespace (DI +
Machinery + Pumps) via runtime NodeSet2 loading and
`ModelLoaderBuilder`.
- Demonstrates declarative second-pump creation via
`.ConfigureDevicesFor<PumpNodeManager>(...)` and software-package
seeding from the same configurator.
- Full simulation: pressure, temperatures, power, flow, efficiency,
level, cavitation/overheat fault injection, alarm setup, NAMUR-style
supervision.

**Documentation**
- `Docs/Opc.Ua.Di/` — README, DeviceBuilder, Hosting, LockService,
SoftwareUpdate, ClientHelpers (6 new developer guides).
- `Docs/Opc.Ua.Di/ComplianceMatrix.md` — every DI declaration mapped to
In-v1 / Generated / Deferred / Excluded.
- `Docs/CompanionSpecLibraries.md` — packaging guide for new
companion-spec libraries.
- `Docs/FluentApiGaps.md` — historical record of G1–G11.
- `Docs/SourceGeneratedNodeManagers.md` updated for richer node
managers.
- `Docs/plans/StateMachineBuilder.md` — deferred state-machine builder
design.
2026-06-04 05:57:57 +02:00

309 lines
16 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<opc:ModelDesign
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:opc="http://opcfoundation.org/UA/ModelDesign.xsd"
xmlns:ua="http://opcfoundation.org/UA/"
xmlns:gds="http://opcfoundation.org/UA/GDS/"
xmlns="http://opcfoundation.org/UA/Onboarding/"
xmlns:uax="http://opcfoundation.org/UA/2008/02/Types.xsd"
TargetNamespace="http://opcfoundation.org/UA/Onboarding/"
TargetVersion="1.05.05"
TargetPublicationDate="2025-01-08T00:00:00Z"
>
<opc:Namespaces>
<opc:Namespace Name="OpcUaOnboarding" Prefix="Opc.Ua.Onboarding" XmlNamespace="http://opcfoundation.org/UA/Onboarding/Types.xsd" XmlPrefix="Onboarding">http://opcfoundation.org/UA/Onboarding/</opc:Namespace>
<opc:Namespace Name="OpcUaGds" Prefix="Opc.Ua.Gds" XmlNamespace="http://opcfoundation.org/UA/GDS/Types.xsd" XmlPrefix="GDS">http://opcfoundation.org/UA/GDS/</opc:Namespace>
<opc:Namespace Name="OpcUa" Version="1.05.04" PublicationDate="2025-01-08T00:00:00Z" Prefix="Opc.Ua" InternalPrefix="Opc.Ua.Server" XmlNamespace="http://opcfoundation.org/UA/2008/02/Types.xsd" XmlPrefix="OpcUa">http://opcfoundation.org/UA/</opc:Namespace>
</opc:Namespaces>
<opc:Object SymbolicName="OPCUAOnboardingNamespaceMetadata" TypeDefinition="ua:NamespaceMetadataType" PartNo="21">
<opc:BrowseName>http://opcfoundation.org/UA/Onboarding/</opc:BrowseName>
<opc:Children>
<opc:Property SymbolicName="ua:NamespaceUri" DataType="ua:String">
<opc:DefaultValue>
<uax:String>http://opcfoundation.org/UA/Onboarding/</uax:String>
</opc:DefaultValue>
</opc:Property>
<opc:Property SymbolicName="ua:NamespaceVersion" DataType="ua:String">
<opc:DefaultValue>
<uax:String>1.05.04</uax:String>
</opc:DefaultValue>
</opc:Property>
<opc:Property SymbolicName="ua:ModelVersion" DataType="ua:SemanticVersionString">
<opc:DefaultValue>
<uax:String>1.5.4</uax:String>
</opc:DefaultValue>
</opc:Property>
<opc:Property SymbolicName="ua:NamespacePublicationDate" DataType="ua:DateTime">
<opc:DefaultValue>
<uax:DateTime>2025-01-08T00:00:00Z</uax:DateTime>
</opc:DefaultValue>
</opc:Property>
<opc:Property SymbolicName="ua:IsNamespaceSubset" DataType="ua:Boolean">
<opc:DefaultValue>
<uax:Boolean>false</uax:Boolean>
</opc:DefaultValue>
</opc:Property>
<opc:Property SymbolicName="ua:StaticNodeIdTypes" DataType="ua:IdType" ValueRank="Array">
<opc:DefaultValue>
<uax:ListOfInt32>
<uax:Int32>0</uax:Int32>
</uax:ListOfInt32>
</opc:DefaultValue>
</opc:Property>
<opc:Property SymbolicName="ua:StaticNumericNodeIdRange" DataType="ua:NumericRange" ValueRank="Array">
<opc:DefaultValue>
<uax:ListOfString>
<uax:String>1:65535</uax:String>
</uax:ListOfString>
</opc:DefaultValue>
</opc:Property>
<opc:Property SymbolicName="ua:StaticStringNodeIdPattern" DataType="ua:String">
<opc:DefaultValue>
<uax:String></uax:String>
</opc:DefaultValue>
</opc:Property>
<opc:Property SymbolicName="ua:DefaultRolePermissions" ModellingRule="Mandatory" />
<opc:Property SymbolicName="ua:DefaultUserRolePermissions" ModellingRule="Mandatory" />
<opc:Property SymbolicName="ua:DefaultAccessRestrictions" ModellingRule="Mandatory" />
</opc:Children>
<opc:References>
<opc:Reference IsInverse="true">
<opc:ReferenceType>ua:HasComponent</opc:ReferenceType>
<opc:TargetId>ua:Server_Namespaces</opc:TargetId>
</opc:Reference>
</opc:References>
</opc:Object>
<opc:Object SymbolicName="WellKnownRole_RegistrarAdmin" TypeDefinition="ua:RoleType">
<opc:BrowseName>RegistrarAdmin</opc:BrowseName>
<opc:DisplayName>RegistrarAdmin</opc:DisplayName>
<opc:Description DoNotIgnore="true">Has rights to manage the Registrar and approve Devices when automatic authentication was not possible.</opc:Description>
<opc:Children>
<opc:Property SymbolicName="ApplicationsExclude" ModellingRule="Mandatory" />
<opc:Property SymbolicName="Applications" ModellingRule="Mandatory" />
<opc:Property SymbolicName="EndpointsExclude" ModellingRule="Mandatory" />
<opc:Property SymbolicName="Endpoints" ModellingRule="Mandatory" />
<opc:Property SymbolicName="CustomConfiguration" ModellingRule="Mandatory" />
<opc:Method SymbolicName="AddIdentity" ModellingRule="Mandatory" />
<opc:Method SymbolicName="RemoveIdentity" ModellingRule="Mandatory" />
<opc:Method SymbolicName="AddApplication" ModellingRule="Mandatory" />
<opc:Method SymbolicName="RemoveApplication" ModellingRule="Mandatory" />
<opc:Method SymbolicName="AddEndpoint" ModellingRule="Mandatory" />
<opc:Method SymbolicName="RemoveEndpoint" ModellingRule="Mandatory" />
</opc:Children>
<opc:References>
<opc:Reference IsInverse="true">
<opc:ReferenceType>ua:HasComponent</opc:ReferenceType>
<opc:TargetId>ua:Server_ServerCapabilities_RoleSet</opc:TargetId>
</opc:Reference>
</opc:References>
</opc:Object>
<opc:DataType SymbolicName="CertificateAuthorityType" BaseType="ua:Structure" IsAbstract="false" PartNo="21">
<opc:Fields>
<opc:Field Name="AuthorityCertificate" DataType="ua:ByteString" ValueRank="Scalar"></opc:Field>
<opc:Field Name="IssuerCertificates" DataType="ua:ByteString" ValueRank="Array"></opc:Field>
</opc:Fields>
</opc:DataType>
<opc:DataType SymbolicName="BaseTicketType" BaseType="ua:Structure" IsAbstract="true" PartNo="21">
<opc:Fields>
<opc:Field Name="ManufacturerName" DataType="ua:String" ValueRank="Scalar"></opc:Field>
<opc:Field Name="ModelName" DataType="ua:String" ValueRank="Scalar"></opc:Field>
<opc:Field Name="ModelVersion" DataType="ua:String" ValueRank="Scalar"></opc:Field>
<opc:Field Name="HardwareRevision" DataType="ua:String" ValueRank="Scalar"></opc:Field>
<opc:Field Name="SoftwareRevision" DataType="ua:String" ValueRank="Scalar"></opc:Field>
<opc:Field Name="SerialNumber" DataType="ua:String" ValueRank="Scalar"></opc:Field>
<opc:Field Name="ManufactureDate" DataType="ua:DateTime" ValueRank="Scalar"></opc:Field>
<opc:Field Name="Authorities" DataType="CertificateAuthorityType" ValueRank="Array"></opc:Field>
</opc:Fields>
</opc:DataType>
<opc:DataType SymbolicName="DeviceIdentityTicketType" BaseType="BaseTicketType" IsAbstract="false" PartNo="21">
<opc:Fields>
<opc:Field Name="ProductInstanceUri" DataType="ua:UriString" ValueRank="Scalar"></opc:Field>
</opc:Fields>
</opc:DataType>
<opc:DataType SymbolicName="CompositeIdentityTicketType" BaseType="BaseTicketType" IsAbstract="false" PartNo="21">
<opc:Fields>
<opc:Field Name="CompositeInstanceUri" DataType="ua:UriString" ValueRank="Scalar"></opc:Field>
<opc:Field Name="Devices" DataType="ua:UriString" ValueRank="Array"></opc:Field>
<opc:Field Name="Composites" DataType="ua:UriString" ValueRank="Array"></opc:Field>
</opc:Fields>
</opc:DataType>
<opc:DataType SymbolicName="TicketListType" BaseType="ua:Structure" IsAbstract="false" PartNo="21">
<opc:Fields>
<opc:Field Name="Devices" DataType="ua:EncodedTicket" ValueRank="Array"></opc:Field>
<opc:Field Name="Composites" DataType="ua:EncodedTicket" ValueRank="Array"></opc:Field>
</opc:Fields>
</opc:DataType>
<opc:DataType SymbolicName="ManagerDescription" BaseType="ua:Structure" IsAbstract="false" PartNo="21">
<opc:Fields>
<opc:Field Name="Name" DataType="ua:LocalizedText" ValueRank="Scalar"></opc:Field>
<opc:Field Name="IsRequired" DataType="ua:Boolean" ValueRank="Scalar"></opc:Field>
<opc:Field Name="PurposeUri" DataType="ua:UriString" ValueRank="Scalar"></opc:Field>
<opc:Field Name="ProtocolUri" DataType="ua:UriString" ValueRank="Scalar"></opc:Field>
<opc:Field Name="EndpointUrls" DataType="ua:String" ValueRank="Array"></opc:Field>
</opc:Fields>
</opc:DataType>
<opc:Method SymbolicName="RegisterTicketsMethodType">
<opc:InputArguments>
<opc:Argument Name="Tickets" DataType="ua:EncodedTicket" ValueRank="Array"></opc:Argument>
</opc:InputArguments>
<opc:OutputArguments>
<opc:Argument Name="Results" DataType="ua:StatusCode" ValueRank="Array"></opc:Argument>
</opc:OutputArguments>
</opc:Method>
<opc:Method SymbolicName="UnregisterTicketsMethodType">
<opc:InputArguments>
<opc:Argument Name="Tickets" DataType="ua:EncodedTicket" ValueRank="Array"></opc:Argument>
</opc:InputArguments>
<opc:OutputArguments>
<opc:Argument Name="Results" DataType="ua:StatusCode" ValueRank="Array"></opc:Argument>
</opc:OutputArguments>
</opc:Method>
<opc:ObjectType SymbolicName="DeviceRegistrarAdminType" BaseType="ua:BaseObjectType" PartNo="21">
<opc:Children>
<opc:Method SymbolicName="RegisterTickets" TypeDefinition="RegisterTicketsMethodType" ModellingRule="Mandatory" />
<opc:Method SymbolicName="UnregisterTickets" TypeDefinition="UnregisterTicketsMethodType" ModellingRule="Mandatory" />
<opc:Object SymbolicName="TicketAuthorities" TypeDefinition="ua:TrustListType" ModellingRule="Mandatory">
<opc:ReferenceType>ua:HasComponent</opc:ReferenceType>
</opc:Object>
<opc:Object SymbolicName="DeviceIdentityAuthorities" TypeDefinition="ua:TrustListType" ModellingRule="Mandatory">
<opc:ReferenceType>ua:HasComponent</opc:ReferenceType>
</opc:Object>
</opc:Children>
</opc:ObjectType>
<opc:Method SymbolicName="ProvideIdentitiesMethodType">
<opc:InputArguments>
<opc:Argument Name="Identities" DataType="ua:ByteString" ValueRank="Array"></opc:Argument>
<opc:Argument Name="Issuers" DataType="ua:ByteString" ValueRank="Array"></opc:Argument>
<opc:Argument Name="Tickets" DataType="ua:EncodedTicket" ValueRank="Array"></opc:Argument>
</opc:InputArguments>
<opc:OutputArguments>
<opc:Argument Name="SelectedIdentity" DataType="ua:ByteString" ValueRank="Scalar"></opc:Argument>
<opc:Argument Name="MatchingTicket" DataType="BaseTicketType" ValueRank="Scalar"></opc:Argument>
<opc:Argument Name="ApplicationId" DataType="ua:NodeId" ValueRank="Scalar"></opc:Argument>
<opc:Argument Name="SoftwareUpdateManager" DataType="ManagerDescription" ValueRank="Scalar"></opc:Argument>
</opc:OutputArguments>
</opc:Method>
<opc:Method SymbolicName="UpdateSoftwareStatusMethodType">
<opc:InputArguments>
<opc:Argument Name="ProductInstanceUri" DataType="ua:String" ValueRank="Scalar"></opc:Argument>
<opc:Argument Name="Status" DataType="ua:Boolean" ValueRank="Scalar"></opc:Argument>
<opc:Argument Name="SoftwareRevision" DataType="ua:String" ValueRank="Scalar"></opc:Argument>
</opc:InputArguments>
</opc:Method>
<opc:Method SymbolicName="RegisterDeviceEndpointMethodType">
<opc:InputArguments>
<opc:Argument Name="Application" DataType="ua:ApplicationDescription" ValueRank="Scalar"></opc:Argument>
</opc:InputArguments>
</opc:Method>
<opc:Method SymbolicName="GetManagersMethodType">
<opc:OutputArguments>
<opc:Argument Name="Managers" DataType="ManagerDescription" ValueRank="Array"></opc:Argument>
</opc:OutputArguments>
</opc:Method>
<opc:Method SymbolicName="RegisterManagedApplicationMethodType">
<opc:InputArguments>
<opc:Argument Name="Application" DataType="gds:ApplicationRecordDataType" ValueRank="Scalar"></opc:Argument>
<opc:Argument Name="ProtocolUri" DataType="ua:UriString" ValueRank="Scalar"></opc:Argument>
</opc:InputArguments>
<opc:OutputArguments>
<opc:Argument Name="ApplicationId" DataType="ua:NodeId" ValueRank="Scalar"></opc:Argument>
</opc:OutputArguments>
</opc:Method>
<opc:ObjectType SymbolicName="DeviceRegistrarType" BaseType="ua:BaseObjectType" PartNo="21">
<opc:Children>
<opc:Method SymbolicName="ProvideIdentities" TypeDefinition="ProvideIdentitiesMethodType" ModellingRule="Mandatory" />
<opc:Method SymbolicName="UpdateSoftwareStatus" TypeDefinition="UpdateSoftwareStatusMethodType" ModellingRule="Mandatory" />
<opc:Method SymbolicName="RegisterDeviceEndpoint" TypeDefinition="RegisterDeviceEndpointMethodType" ModellingRule="Mandatory" />
<opc:Method SymbolicName="GetManagers" TypeDefinition="GetManagersMethodType" ModellingRule="Mandatory" />
<opc:Method SymbolicName="RegisterManagedApplication" TypeDefinition="RegisterManagedApplicationMethodType" ModellingRule="Mandatory" />
<opc:Object SymbolicName="Administration" TypeDefinition="DeviceRegistrarAdminType" ModellingRule="Optional">
<opc:ReferenceType>ua:HasComponent</opc:ReferenceType>
</opc:Object>
</opc:Children>
</opc:ObjectType>
<opc:Object SymbolicName="DeviceRegistrar" TypeDefinition="DeviceRegistrarType">
<opc:Children>
<opc:Object SymbolicName="Administration" ModellingRule="Mandatory">
<opc:Children>
<opc:Object SymbolicName="TicketAuthorities" TypeDefinition="ua:TrustListType" ModellingRule="Mandatory">
<opc:Children>
<opc:Method SymbolicName="ua:OpenWithMasks" ModellingRule="Mandatory" />
<opc:Method SymbolicName="ua:CloseAndUpdate" ModellingRule="Mandatory" />
<opc:Method SymbolicName="ua:AddCertificate" ModellingRule="Mandatory" />
<opc:Method SymbolicName="ua:RemoveCertificate" ModellingRule="Mandatory" />
</opc:Children>
</opc:Object>
<opc:Object SymbolicName="DeviceIdentityAuthorities" TypeDefinition="ua:TrustListType" ModellingRule="Mandatory">
<opc:Children>
<opc:Method SymbolicName="ua:OpenWithMasks" ModellingRule="Mandatory" />
<opc:Method SymbolicName="ua:CloseAndUpdate" ModellingRule="Mandatory" />
<opc:Method SymbolicName="ua:AddCertificate" ModellingRule="Mandatory" />
<opc:Method SymbolicName="ua:RemoveCertificate" ModellingRule="Mandatory" />
</opc:Children>
</opc:Object>
</opc:Children>
</opc:Object>
</opc:Children>
<opc:References>
<opc:Reference IsInverse="true">
<opc:ReferenceType>ua:Organizes</opc:ReferenceType>
<opc:TargetId>ua:ObjectsFolder</opc:TargetId>
</opc:Reference>
</opc:References>
</opc:Object>
<opc:Method SymbolicName="RequestTicketsMethodType">
<opc:OutputArguments>
<opc:Argument Name="Tickets" DataType="ua:EncodedTicket" ValueRank="Array"></opc:Argument>
</opc:OutputArguments>
</opc:Method>
<opc:Method SymbolicName="SetRegistrarEndpointsMethodType">
<opc:InputArguments>
<opc:Argument Name="Registrars" DataType="ua:ApplicationDescription" ValueRank="Array"></opc:Argument>
</opc:InputArguments>
</opc:Method>
<opc:ObjectType SymbolicName="DeviceRegistrationAuditEventType" BaseType="ua:AuditEventType" IsAbstract="true" PartNo="21">
<opc:Children>
<opc:Property SymbolicName="ProductInstanceUri" DataType="ua:UriString" ModellingRule="Mandatory" />
</opc:Children>
</opc:ObjectType>
<opc:ObjectType SymbolicName="DeviceIdentityAcceptedAuditEventType" BaseType="DeviceRegistrationAuditEventType" IsAbstract="true" PartNo="21">
<opc:Children>
<opc:Property SymbolicName="Certificate" DataType="ua:ByteString" ModellingRule="Mandatory" />
<opc:Property SymbolicName="Ticket" DataType="ua:EncodedTicket" ModellingRule="Mandatory" />
<opc:Property SymbolicName="Composite" DataType="ua:EncodedTicket" ModellingRule="Mandatory" />
</opc:Children>
</opc:ObjectType>
<opc:ObjectType SymbolicName="DeviceSoftwareUpdatedAuditEventType" BaseType="DeviceRegistrationAuditEventType" IsAbstract="true" PartNo="21">
<opc:Children>
<opc:Property SymbolicName="Status" DataType="ua:Boolean" ModellingRule="Mandatory" />
<opc:Property SymbolicName="SoftwareRevision" DataType="ua:String" ModellingRule="Mandatory" />
</opc:Children>
</opc:ObjectType>
</opc:ModelDesign>