using ZB.MOM.WW.OtOpcUa.Driver.AbCip;
namespace ZB.MOM.WW.OtOpcUa.Driver.AbCip.IntegrationTests;
///
/// Per-family marker for the ab_server Docker compose profile a given test
/// targets. The compose file (Docker/docker-compose.yml) is the canonical
/// source of truth for which tags a family seeds + which --plc mode the
/// simulator boots in; this record just ties a family enum to operator-facing
/// notes so fixture + test code can filter / branch by family.
///
/// OtOpcUa driver family this profile targets.
/// The docker compose --profile name that brings
/// this family's ab_server up. Matches the service key in the compose file.
/// Operator-facing description of coverage + any quirks.
public sealed record AbServerProfile(
AbCipPlcFamily Family,
string ComposeProfile,
string Notes)
{
/// Default ab_server port — matches the compose-file port-map + the
/// CIP / EtherNet/IP standard.
public const int DefaultPort = 44818;
}
/// Canonical profiles covering every AB CIP family shipped in PRs 9–12.
public static class KnownProfiles
{
public static readonly AbServerProfile ControlLogix = new(
Family: AbCipPlcFamily.ControlLogix,
ComposeProfile: "controllogix",
Notes: "Widest-coverage profile — PR 9 baseline. UDTs unit-tested via golden Template Object buffers; ab_server lacks full UDT emulation.");
public static readonly AbServerProfile CompactLogix = new(
Family: AbCipPlcFamily.CompactLogix,
ComposeProfile: "compactlogix",
Notes: "ab_server doesn't enforce the narrower ConnectionSize; driver-side profile caps it per PR 10.");
public static readonly AbServerProfile Micro800 = new(
Family: AbCipPlcFamily.Micro800,
ComposeProfile: "micro800",
Notes: "--plc=Micro800 mode (unconnected-only, empty path). Driver-side enforcement verified in the unit suite.");
public static readonly AbServerProfile GuardLogix = new(
Family: AbCipPlcFamily.GuardLogix,
ComposeProfile: "guardlogix",
Notes: "ab_server has no safety subsystem — _S-suffixed seed tag triggers driver-side ViewOnly classification only.");
public static IReadOnlyList All { get; } =
[ControlLogix, CompactLogix, Micro800, GuardLogix];
public static AbServerProfile ForFamily(AbCipPlcFamily family) =>
All.FirstOrDefault(p => p.Family == family)
?? throw new ArgumentOutOfRangeException(nameof(family), family, "No integration profile for this family.");
}