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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user