v3(ablegacy): apply Modbus exemplar — RawTags delivery + RawPath mapper
- Rename AbLegacyEquipmentTagParser → AbLegacyTagDefinitionFactory; TryParse →
FromTagConfig(tagConfig, rawPath, out def). Drop the leading-{ heuristic and the
deviceHostAddress key; def.Name = rawPath. Add inverse ToTagConfig. Keep strict-enum
guards + Inspect.
- Options: Tags(IReadOnlyList<AbLegacyTagDefinition>) → RawTags(IReadOnlyList<RawTagEntry>).
- Driver: _tagsByRawPath (Ordinal); byName-only resolver; build table from _options.RawTags
via FromTagConfig, threading WriteIdempotent + resolving RawTagEntry.DeviceName to the
owning device host (ResolveDeviceHost; TODO(v3 WaveC) for the live Device-row host).
DiscoverAsync + family-profile validation iterate the built table. Probe picks its address
from RawTags via the mapper.
- Factory: retire the pre-declared tag DTO path; bind List<RawTagEntry>? RawTags; keep Devices.
- Cli BuildOptions: deliver typed defs as RawTagEntry via ToTagConfig.
- Tests: AbLegacyRawTags helper; migrate Tags= → RawTags; parser tests → FromTagConfig;
equipment-ref driver/ResolveHost tests re-authored as RawTagEntry + read by RawPath.
Driver+Contracts+Cli green; 213 driver + 36 Cli tests pass.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using ZB.MOM.WW.OtOpcUa.Core.Abstractions;
|
||||
using ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.PlcFamilies;
|
||||
|
||||
namespace ZB.MOM.WW.OtOpcUa.Driver.AbLegacy;
|
||||
@@ -14,8 +15,15 @@ public sealed class AbLegacyDriverOptions
|
||||
/// <summary>Gets or sets the list of PCCC devices to connect to.</summary>
|
||||
public IReadOnlyList<AbLegacyDeviceOptions> Devices { get; init; } = [];
|
||||
|
||||
/// <summary>Gets or sets the list of PCCC tag definitions.</summary>
|
||||
public IReadOnlyList<AbLegacyTagDefinition> Tags { get; init; } = [];
|
||||
/// <summary>
|
||||
/// Authored raw tags this driver serves. The deploy artifact hands each authored raw
|
||||
/// <c>Tag</c> as a <see cref="RawTagEntry"/> (RawPath identity + driver <c>TagConfig</c> blob +
|
||||
/// WriteIdempotent flag + owning <see cref="RawTagEntry.DeviceName"/>); the driver maps each
|
||||
/// through <see cref="AbLegacyTagDefinitionFactory.FromTagConfig"/> into its RawPath → definition
|
||||
/// table, routing each to its device by <see cref="RawTagEntry.DeviceName"/>. AbLegacy has no
|
||||
/// discovery protocol — the driver serves exactly these.
|
||||
/// </summary>
|
||||
public IReadOnlyList<RawTagEntry> RawTags { get; init; } = [];
|
||||
|
||||
/// <summary>Gets or sets the probe (connectivity check) options.</summary>
|
||||
public AbLegacyProbeOptions Probe { get; init; } = new();
|
||||
|
||||
Reference in New Issue
Block a user