feat(mtconnect): warn at Test Connect and deploy when SampleCount >= the Agent bufferSize (#825)

Parse the /probe Header bufferSize; MTConnectDriverProbe reads sampleCount
(default 1000) and answers Ok with a WARNING message (amber chip in the
Test Connect button); InitializeAsync logs the same Warning and exposes
agentBufferSize on the diagnostics bag. Live-checked against the shared
cppagent fixture (bufferSize 16384).
This commit is contained in:
Joseph Doherty
2026-11-11 01:23:33 -05:00
parent 40969e5c4b
commit f8f6781a24
9 changed files with 258 additions and 5 deletions
@@ -3333,6 +3333,15 @@ public sealed partial class MTConnectDriver
// ---- commit point: everything below is non-throwing bookkeeping ----
Volatile.Write(ref _options, options);
// lmxopcua#825 — a SampleCount the Agent will refuse is a configuration error; say so at deploy rather than
// leaving it to surface as three progress-free re-baselines and a Degraded stream.
Interlocked.Exchange(ref _agentBufferSize, probe.BufferSize ?? 0);
if (SampleCountBufferWarning(options.SampleCount, probe.BufferSize) is { } bufferWarning)
{
_logger.LogWarning("MTConnect driver {DriverInstanceId} ({AgentUri}): {Warning}",
_driverInstanceId, AgentDisplay(options), bufferWarning);
}
// Derived from the options AND the /probe model just fetched: a raw tag whose TagConfig
// blob declares no type takes the type the Agent itself declares for that DataItem, so a
// browse-committed tag (whose blob carries only the address) publishes as the number it