fix(opcua): UNS equipment folders browse by friendly Name, NodeId stays the logical Id

Equipment folder DisplayName was the colloquial MachineCode; the live rebuild (artifact
ReadEquipmentNode) + composer now use the UNS level-5 Name segment, matching Area/Line
folders + EquipmentNodeWalker. NodeId stays the logical EquipmentId so browse-path
resolution + ACLs are unaffected.
This commit is contained in:
Joseph Doherty
2026-06-06 14:51:12 -04:00
parent df0dc516c3
commit 08cddfe128
5 changed files with 47 additions and 3 deletions
@@ -75,6 +75,22 @@ public sealed class Phase7ComposerPurityTests
.ShouldBe(new[] { "a", "m", "z" });
}
/// <summary>Verifies UNS equipment folders browse by the friendly UNS <c>Name</c> segment
/// (not the colloquial MachineCode, not the logical EquipmentId) while the NodeId stays the
/// logical EquipmentId — so browse-path resolution + ACLs are unaffected (decision #3).</summary>
[Fact]
public void Equipment_node_DisplayName_is_the_UNS_Name_not_MachineCode()
{
var equipment = new[] { NewEquipment("filling-eq") }; // Name="filling-eq", MachineCode="FILLING-EQ"
var node = Phase7Composer.Compose(equipment, Array.Empty<DriverInstance>(), Array.Empty<ScriptedAlarm>())
.EquipmentNodes.ShouldHaveSingleItem();
node.EquipmentId.ShouldBe("filling-eq"); // NodeId stays the logical Id
node.DisplayName.ShouldBe("filling-eq"); // browse name = UNS Name segment
node.DisplayName.ShouldNotBe("FILLING-EQ"); // not the colloquial MachineCode
}
private static Equipment NewEquipment(string id) => new()
{
EquipmentId = id,