fix(ablegacy): Test Connect normalises the probe address like the driver (#660)

Claude-Session: https://claude.ai/code/session_01Ef2ozxS7QPanGT8uoATbTe
This commit is contained in:
Joseph Doherty
2026-10-09 06:01:35 -04:00
parent 98c00904e7
commit c0fbe74693
5 changed files with 78 additions and 3 deletions
@@ -0,0 +1,16 @@
using ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.PlcFamilies;
namespace ZB.MOM.WW.OtOpcUa.Driver.AbLegacy;
/// <summary>
/// The single authority that turns an operator-authored probe address into the name handed to the tag
/// factory: family-aware parse (PLC-5 <c>I:</c>/<c>O:</c> octal indices become decimal) then
/// <see cref="AbLegacyAddress.ToLibplctagName"/> — the same normalisation tag paths get. Shared by the
/// driver's probe loop and the Test Connect probe (#660).
/// </summary>
internal static class AbLegacyProbeAddress
{
/// <summary>Returns the normalised name, or null when <paramref name="address"/> does not parse for the family.</summary>
public static string? Normalise(string? address, AbLegacyPlcFamily family) =>
AbLegacyAddress.TryParse(address, family)?.ToLibplctagName();
}