feat(opcua): add EquipmentVirtualTagPlan to Phase7 composition

Adds the EquipmentVirtualTagPlan sealed record (VirtualTagId, EquipmentId,
FolderPath, Name, DataType, Expression, DependencyRefs) and the
EquipmentVirtualTags init-only member on Phase7CompositionResult, mirroring
the existing EquipmentTagPlan / EquipmentTags pattern. Type-only: no producer
logic yet. Two new tests cover the default-empty guarantee and the record shape.
This commit is contained in:
Joseph Doherty
2026-06-07 04:51:14 -04:00
parent d5fb8f9142
commit 45fa198494
2 changed files with 44 additions and 0 deletions
@@ -91,6 +91,26 @@ public sealed class Phase7ComposerPurityTests
node.DisplayName.ShouldNotBe("FILLING-EQ"); // not the colloquial MachineCode
}
[Fact]
public void Composition_carries_empty_equipment_virtualtags_by_default()
{
var r = new Phase7CompositionResult(
Array.Empty<EquipmentNode>(), Array.Empty<DriverInstancePlan>(), Array.Empty<ScriptedAlarmPlan>());
r.EquipmentVirtualTags.ShouldBeEmpty();
}
[Fact]
public void EquipmentVirtualTagPlan_holds_id_equipment_name_datatype_expression_and_deps()
{
var p = new EquipmentVirtualTagPlan("vt-1", "eq-1", "", "speed-rpm", "Float64",
"return ctx.GetTag(\"TestMachine_001.TestDouble\").Value;",
new[] { "TestMachine_001.TestDouble" });
p.VirtualTagId.ShouldBe("vt-1");
p.EquipmentId.ShouldBe("eq-1");
p.Name.ShouldBe("speed-rpm");
p.DependencyRefs.ShouldHaveSingleItem();
}
private static Equipment NewEquipment(string id) => new()
{
EquipmentId = id,