f2f6eeb74e
Adds a uniform [Range(1, 60)] ProbeTimeoutSeconds property to all 9 driver Options classes (Modbus 5s, AbCip 5s, AbLegacy 5s, S7 5s, TwinCAT 10s, FOCAS 10s, OpcUaClient 15s, Galaxy 30s, Historian 15s). Powers the AdminUI Test Connect button (Phase 7 of the plan).
44 lines
2.3 KiB
C#
44 lines
2.3 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace ZB.MOM.WW.OtOpcUa.Driver.Historian.Wonderware.Client;
|
|
|
|
/// <summary>
|
|
/// Connection options for <c>WonderwareHistorianClient</c>.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// <b>Retry / backoff ownership (finding 006):</b> this module performs exactly one
|
|
/// in-place transport reconnect inside <c>PipeChannel.InvokeAsync</c> with no delay,
|
|
/// and does NOT implement exponential reconnect backoff. Broader retry/backoff is the
|
|
/// caller's responsibility — the alarm drain worker
|
|
/// (<c>Core.AlarmHistorian.SqliteStoreAndForwardSink</c>) and the read-side
|
|
/// history router are expected to layer their own backoff on top.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <param name="PipeName">Named-pipe name the sidecar listens on (matches the sidecar's <c>OTOPCUA_HISTORIAN_PIPE</c>).</param>
|
|
/// <param name="SharedSecret">Per-process shared secret the sidecar will verify in the Hello frame.</param>
|
|
/// <param name="PeerName">Diagnostic peer identifier sent in Hello — typically the OtOpcUa instance id.</param>
|
|
/// <param name="ConnectTimeout">Cap on the named-pipe connect + Hello round trip on each (re)connect.</param>
|
|
/// <param name="CallTimeout">Cap on a single read/write call once connected.</param>
|
|
public sealed record WonderwareHistorianClientOptions(
|
|
string PipeName,
|
|
string SharedSecret,
|
|
string PeerName = "OtOpcUa",
|
|
TimeSpan? ConnectTimeout = null,
|
|
TimeSpan? CallTimeout = null)
|
|
{
|
|
/// <summary>Gets the effective connect timeout, using the default if not explicitly set.</summary>
|
|
public TimeSpan EffectiveConnectTimeout => ConnectTimeout ?? TimeSpan.FromSeconds(10);
|
|
|
|
/// <summary>Gets the effective call timeout, using the default if not explicitly set.</summary>
|
|
public TimeSpan EffectiveCallTimeout => CallTimeout ?? TimeSpan.FromSeconds(30);
|
|
|
|
/// <summary>
|
|
/// Timeout for the AdminUI Test Connect probe, in seconds. The AdminUI clamps to a
|
|
/// 60s server-side maximum; this default is what the form pre-fills for new instances.
|
|
/// </summary>
|
|
[Display(Name = "Probe timeout (seconds)", Description = "Connection test timeout. Default 15s.", GroupName = "Diagnostics")]
|
|
[Range(1, 60)]
|
|
public int ProbeTimeoutSeconds { get; init; } = 15;
|
|
}
|