review(Driver.FOCAS.Contracts): first review; keep Writable=true default (re-triaged)

First review at 7286d320. -001 re-triaged Won't-Fix: the 'FOCAS is read-only' premise was
WRONG (FOCAS supports PMC/data writes); flipping Writable default to false broke 6 consuming
write tests -> reverted to true, doc corrected. -003/-004 doc fixes resolved. -002
(WriteIdempotent not threaded, Driver.FOCAS) Open.
This commit is contained in:
Joseph Doherty
2026-06-19 12:22:53 -04:00
parent 26662aa2ec
commit 97020d0527
2 changed files with 135 additions and 0 deletions
@@ -109,6 +109,20 @@ public sealed class FocasAlarmProjectionOptions
/// address validation at <c>FocasDriver.InitializeAsync</c>; leave as
/// <see cref="FocasCncSeries.Unknown"/> to skip validation (legacy behaviour).
/// </summary>
/// <param name="HostAddress">
/// FOCAS TCP endpoint in <c>focas://{ip}[:{port}]</c> form, e.g.
/// <c>focas://10.20.30.40:8193</c>. The port defaults to 8193 when omitted.
/// Parsed by <c>FocasHostAddress.TryParse</c> at <c>FocasDriver.InitializeAsync</c>.
/// </param>
/// <param name="DeviceName">
/// Optional human-readable label shown in the OPC UA address-space folder for this
/// device. Defaults to <paramref name="HostAddress"/> when <c>null</c>.
/// </param>
/// <param name="Series">
/// CNC controller series. Used by <see cref="FocasCapabilityMatrix"/> to gate which
/// FOCAS addresses are valid. Leave as <see cref="FocasCncSeries.Unknown"/> (the
/// default) to skip range validation and preserve legacy behaviour.
/// </param>
/// <param name="PositionDecimalPlaces">
/// Axis positions returned by <c>cnc_rddynamic2</c> are scaled integers. The driver
/// divides AbsolutePosition / MachinePosition / RelativePosition / DistanceToGo by
@@ -136,6 +150,17 @@ public sealed record FocasDeviceOptions(
/// address string that parses via <c>FocasAddress.TryParse</c> —
/// <c>X0.0</c> / <c>R100</c> / <c>PARAM:1815/0</c> / <c>MACRO:500</c>.
/// </summary>
/// <param name="Writable">
/// Whether the tag is declared writable in config. Reflected at the
/// <c>DiscoverAsync</c> address-space advertisement seam and gates the driver's
/// write path — FOCAS supports PMC/data writes (see <c>FocasPmcBitRmwTests</c> /
/// <c>FocasReadWriteTests</c>). Defaults to <c>true</c>.
/// </param>
/// <param name="WriteIdempotent">
/// Whether repeated writes of the same value are safe. Carried for parity; not yet
/// threaded through to <c>DriverAttributeInfo</c> in <c>DiscoverAsync</c> (see
/// Driver.FOCAS.Contracts-002). Defaults to <c>false</c>.
/// </param>
public sealed record FocasTagDefinition(
string Name,
string DeviceHostAddress,
@@ -144,6 +169,12 @@ public sealed record FocasTagDefinition(
bool Writable = true,
bool WriteIdempotent = false);
/// <summary>
/// Controls periodic connectivity probing. One <c>cnc_rdcncstat</c> call per
/// configured device per tick; transitions fire <c>OnHostStatusChanged</c>.
/// Enabled by default so the driver surfaces a fast host-state transition when
/// a CNC goes offline between data reads.
/// </summary>
public sealed class FocasProbeOptions
{
/// <summary>Gets or sets a value indicating whether probing is enabled.</summary>