Auto: abcip-2.6 — AOI input/output handling

AOI-aware browse paths: AOI instances now fan out under directional
sub-folders (Inputs/, Outputs/, InOut/) instead of a flat layout. The
sub-folders only appear when at least one member carries a non-Local
AoiQualifier, so plain UDT tags keep the pre-2.6 flat structure.

- Add AoiQualifier enum (Local / Input / Output / InOut) + new property
  on AbCipStructureMember (defaults to Local).
- L5K parser learns ADD_ON_INSTRUCTION_DEFINITION blocks; PARAMETER
  entries' Usage attribute flows through L5kMember.Usage.
- L5X parser captures the Usage attribute on <Parameter> elements.
- L5kIngest maps Usage strings (Input/Output/InOut) to AoiQualifier;
  null + unknown values map to Local.
- AbCipDriver.DiscoverAsync groups directional members under
  Inputs / Outputs / InOut sub-folders when any member is non-Local.
- Tests for L5K AOI block parsing, L5X Usage capture, ingest mapping
  (both formats), and AOI-vs-plain UDT discovery fan-out.

Closes #234
This commit is contained in:
Joseph Doherty
2026-04-25 18:58:49 -04:00
parent 177d75784b
commit e3c0750f7d
9 changed files with 373 additions and 9 deletions

View File

@@ -150,6 +150,36 @@ public sealed class L5kParserTests
doc.Tags[0].Name.ShouldBe("Real_Tag");
}
[Fact]
public void AOI_definition_block_collects_parameters_with_Usage()
{
// PR abcip-2.6 — ADD_ON_INSTRUCTION_DEFINITION blocks with PARAMETER entries carrying
// Usage := Input / Output / InOut. The parser surfaces them as L5kDataType members so
// AOI-typed tags pick up a layout the same way UDT-typed tags do.
const string body = """
ADD_ON_INSTRUCTION_DEFINITION MyValveAoi (Revision := "1.0")
PARAMETERS
PARAMETER Cmd : BOOL (Usage := Input) := 0;
PARAMETER Status : DINT (Usage := Output, ExternalAccess := Read Only) := 0;
PARAMETER Buffer : DINT (Usage := InOut) := 0;
PARAMETER Internal : DINT := 0;
END_PARAMETERS
LOCAL_TAGS
Working : DINT := 0;
END_LOCAL_TAGS
END_ADD_ON_INSTRUCTION_DEFINITION
""";
var doc = L5kParser.Parse(new StringL5kSource(body));
var aoi = doc.DataTypes.Single(d => d.Name == "MyValveAoi");
aoi.Members.Count.ShouldBe(4);
aoi.Members.Single(m => m.Name == "Cmd").Usage.ShouldBe("Input");
aoi.Members.Single(m => m.Name == "Status").Usage.ShouldBe("Output");
aoi.Members.Single(m => m.Name == "Buffer").Usage.ShouldBe("InOut");
aoi.Members.Single(m => m.Name == "Internal").Usage.ShouldBeNull();
}
[Fact]
public void Multi_line_TAG_entry_is_concatenated()
{