Skip to content

Commit 437a0da

Browse files
committed
Merge origin/master into marcschier/3907-repository-layout
2 parents 8538f53 + 80889b0 commit 437a0da

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

samples/PumpDeviceIntegrationServer/Program.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@
9494
// the simulated supervision flags shared across both pumps).
9595
pump.Device.AddDeviceHealth(ctx.Manager.SystemContext);
9696
pump.WithDeviceHealth(DeviceHealthEnumeration.NORMAL);
97+
98+
// The DeviceHealth child was added to the in-memory DeviceState
99+
// subtree after the device itself was registered, so it must be
100+
// registered with the manager explicitly. Without this the node
101+
// is browsable but its attributes never resolve, so the DI
102+
// companion-spec checker cannot map it to the declared DeviceHealth node.
103+
await ctx.Manager
104+
.AddPredefinedNodeAsync(pump.Device.DeviceHealth!, ctx.CancellationToken)
105+
.ConfigureAwait(false);
106+
97107
((PumpNodeManager)ctx.Manager)
98108
.RegisterSupervisedDeviceHealth(pump.Device.DeviceHealth);
99109

src/Opc.Ua.Di.Server/Builders/SoftwareUpdateFacetWiring.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,13 @@ public static SoftwareUpdateState BuildAndAttach(
102102
su.BrowseName = new QualifiedName(SoftwareUpdateBrowseName, diNs);
103103
su.DisplayName = new LocalizedText(SoftwareUpdateBrowseName);
104104
su.NodeId = context.NodeIdFactory.New(context, su);
105-
su.ReferenceTypeId = Types.ReferenceTypeIds.HasComponent;
105+
// OPC 10000-100 models the SoftwareUpdate object as an AddIn on
106+
// its host, referenced via HasAddIn (a subtype of HasComponent)
107+
// rather than a plain HasComponent. Using HasAddIn keeps the
108+
// facet spec-correct and lets companion-spec checkers treat it
109+
// as an added-in component instead of validating it against the
110+
// host type's OptionalPlaceholder children (GEN-07 noise).
111+
su.ReferenceTypeId = Types.ReferenceTypeIds.HasAddIn;
106112
su.ModellingRuleId = NodeId.Null;
107113

108114
// Loading subtype (the address-space slot is non-abstract;

tests/Opc.Ua.Di.Tests/DeviceBuilderSoftwareUpdateTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ public async Task WithSoftwareUpdateAttachesSoftwareUpdateSubtree()
8585
"SoftwareUpdate child must be attached to the device.");
8686
Assert.That(su, Is.TypeOf<SoftwareUpdateState>(),
8787
"SoftwareUpdate child must be a SoftwareUpdateState instance.");
88+
89+
// OPC 10000-100 models the SoftwareUpdate object as an AddIn,
90+
// so it must be referenced from its host via HasAddIn rather
91+
// than a plain HasComponent.
92+
Assert.That(((BaseInstanceState)su!).ReferenceTypeId,
93+
Is.EqualTo(Opc.Ua.Types.ReferenceTypeIds.HasAddIn),
94+
"SoftwareUpdate must be attached via the HasAddIn reference.");
8895
}
8996

9097
[Test]

0 commit comments

Comments
 (0)