v3(b1-modbus): RawPath identity seam — RawTagEntry-driven Modbus driver
Wave-B EXEMPLAR. Retire the pre-declared/blob-parse tag model; the driver now builds its RawPath -> definition table from the artifact's RawTagEntry set via a pure mapper. - Contracts: rename ModbusEquipmentTagParser -> ModbusTagDefinitionFactory; TryParse(reference) -> FromTagConfig(tagConfig, rawPath) (def.Name = rawPath, no leading-brace heuristic); add inverse ToTagConfig(def) serializer; keep all strict-enum reads + guards; also read stringByteOrder/deadband/coalesceProhibited so a RawTagEntry round-trips the full authored def. Inspect() unchanged. - Options: Tags(IReadOnlyList<ModbusTagDefinition>) -> RawTags(IReadOnlyList<RawTagEntry>). - Driver: _tagsByName -> _tagsByRawPath (Ordinal); resolver byRawPath-only; build the table from RawTags at Initialize threading entry.WriteIdempotent onto each def; Discover/Teardown updated. - Factory: remove ModbusTagDto/BuildTag/ValidateStringLength + ConfigDto.Tags; bind RawTags from driver-config JSON. - CLI ModbusCommandBase.BuildOptions: serialise typed defs -> RawTagEntry via ToTagConfig. - Tests: migrate Tags= -> RawTags via ModbusRawTags.Entries helper; parser tests -> FromTagConfig(rawPath); factory String-length/enum tests re-seated on the mapper seam. - Propagated rename to ControlPlane EquipmentTagConfigInspector (outside Modbus projects). Modbus.Tests 315/315, Addressing.Tests 161/161, Cli.Tests 72/72 green. Docker-gated Driver.Modbus.IntegrationTests left untouched (won't compile against the new API; expected).
This commit is contained in:
+8
-4
@@ -92,9 +92,9 @@ public sealed class ModbusCommandBaseTests
|
||||
options.UnitId.ShouldBe((byte)17);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that BuildOptions forwards the tag list verbatim.</summary>
|
||||
/// <summary>Verifies that BuildOptions serialises each typed tag into a RawTagEntry (RawPath = name).</summary>
|
||||
[Fact]
|
||||
public void BuildOptions_forwards_tag_list_verbatim()
|
||||
public void BuildOptions_serialises_tags_into_raw_tag_entries()
|
||||
{
|
||||
var sut = new ProbeOnly { Host = "h" };
|
||||
var tag = new ModbusTagDefinition(
|
||||
@@ -102,8 +102,12 @@ public sealed class ModbusCommandBaseTests
|
||||
|
||||
var options = sut.Invoke([tag]);
|
||||
|
||||
options.Tags.Count.ShouldBe(1);
|
||||
options.Tags[0].ShouldBeSameAs(tag);
|
||||
options.RawTags.Count.ShouldBe(1);
|
||||
options.RawTags[0].RawPath.ShouldBe("T");
|
||||
// The blob the driver's factory reads round-trips back to the same definition.
|
||||
ModbusTagDefinitionFactory.FromTagConfig(options.RawTags[0].TagConfig, "T", out var def).ShouldBeTrue();
|
||||
def.Region.ShouldBe(ModbusRegion.HoldingRegisters);
|
||||
def.DataType.ShouldBe(ModbusDataType.UInt16);
|
||||
}
|
||||
|
||||
// --- Driver.Modbus.Cli-003: parse-time endpoint validation -------------------------------
|
||||
|
||||
Reference in New Issue
Block a user