using ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.PlcFamilies;
namespace ZB.MOM.WW.OtOpcUa.Driver.AbLegacy;
///
/// The single authority that turns an operator-authored probe address into the name handed to the tag
/// factory: family-aware parse (PLC-5 I:/O: octal indices become decimal) then
/// — the same normalisation tag paths get. Shared by the
/// driver's probe loop and the Test Connect probe.
///
internal static class AbLegacyProbeAddress
{
/// Returns the normalised name, or null when does not parse for the family.
/// The configured probe address.
/// The PLC family used to parse the address.
/// The normalised name, or null when the address does not parse.
public static string? Normalise(string? address, AbLegacyPlcFamily family) =>
AbLegacyAddress.TryParse(address, family)?.ToLibplctagName();
}