[opcuaclient] OpcUaClient — Per-tag advanced subscription tuning incl. deadband #332

Merged
dohertj2 merged 1 commits from auto/opcuaclient/2 into auto/driver-gaps 2026-04-25 15:27:53 -04:00
Owner

Summary

Per-tag advanced subscription tuning on ISubscribable, with cross-driver back-compat preserved via default-impl.

Core.Abstractions/ISubscribable.cs:

  • New MonitoredTagSpec record: TagName + nullable SamplingIntervalMs / QueueSize / DiscardOldest / MonitoringMode / DataChangeFilter.
  • New DataChangeFilterSpec sub-record: Trigger + DeadbandType + DeadbandValue.
  • New SDK-free enums: DataChangeTrigger (Status / StatusValue / StatusValueTimestamp), DeadbandType (None / Absolute / Percent), SubscriptionMonitoringMode (Disabled / Sampling / Reporting).
  • Additive SubscribeAsync(IReadOnlyList<MonitoredTagSpec>, ...) overload with a default interface implementation that delegates to the legacy string-based overload. Modbus / S7 / TwinCAT / FOCAS / Galaxy.Proxy / AbCip / AbLegacy compile unchanged.

Driver.OpcUaClient/OpcUaClientDriver.cs:

  • Legacy SubscribeAsync(IReadOnlyList<string>, ...) now routes through the new overload.
  • Internal BuildMonitoredItem helper maps every per-tag knob onto the SDK's MonitoredItem options (Filter = new DataChangeFilter { Trigger, DeadbandType, DeadbandValue }).
  • PercentDeadband's BadFilterNotAllowed is caught around CreateItemsAsync so other items in the batch still create.

Disambiguated three pre-existing cref="ISubscribable.SubscribeAsync" doc comments to silence ambiguous-reference errors under TreatWarningsAsErrors.

Test plan

  • dotnet build — Core.Abstractions + OpcUaClient + 7 sibling drivers (Modbus/S7/TwinCAT/FOCAS/AbLegacy/AbCip/Galaxy.Proxy) all clean (0 / 0)
  • dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Tests95 / 95 passed (12 new in OpcUaClientMonitoredTagSpecTests: defaults match legacy, sampling/queue/discard overrides, MonitoringMode mapping theory, absolute + percent deadband filter, trigger/deadband enum round-trips, default-impl routing through StubSubscribableDriver)
  • dotnet test tests/ZB.MOM.WW.OtOpcUa.Core.Abstractions.Tests37 / 37 passed
  • Integration tests — skipped (live UA server required)

🤖 Auto-generated by the Mode-B execution loop. Closes #274.

Closes #274

## Summary Per-tag advanced subscription tuning on `ISubscribable`, with cross-driver back-compat preserved via default-impl. **`Core.Abstractions/ISubscribable.cs`**: - New `MonitoredTagSpec` record: `TagName` + nullable `SamplingIntervalMs` / `QueueSize` / `DiscardOldest` / `MonitoringMode` / `DataChangeFilter`. - New `DataChangeFilterSpec` sub-record: `Trigger` + `DeadbandType` + `DeadbandValue`. - New SDK-free enums: `DataChangeTrigger` (Status / StatusValue / StatusValueTimestamp), `DeadbandType` (None / Absolute / Percent), `SubscriptionMonitoringMode` (Disabled / Sampling / Reporting). - Additive `SubscribeAsync(IReadOnlyList<MonitoredTagSpec>, ...)` overload with a **default interface implementation** that delegates to the legacy string-based overload. Modbus / S7 / TwinCAT / FOCAS / Galaxy.Proxy / AbCip / AbLegacy compile unchanged. **`Driver.OpcUaClient/OpcUaClientDriver.cs`**: - Legacy `SubscribeAsync(IReadOnlyList<string>, ...)` now routes through the new overload. - Internal `BuildMonitoredItem` helper maps every per-tag knob onto the SDK's `MonitoredItem` options (Filter = `new DataChangeFilter { Trigger, DeadbandType, DeadbandValue }`). - `PercentDeadband`'s `BadFilterNotAllowed` is caught around `CreateItemsAsync` so other items in the batch still create. Disambiguated three pre-existing `cref="ISubscribable.SubscribeAsync"` doc comments to silence ambiguous-reference errors under `TreatWarningsAsErrors`. ## Test plan - [x] `dotnet build` — Core.Abstractions + OpcUaClient + 7 sibling drivers (Modbus/S7/TwinCAT/FOCAS/AbLegacy/AbCip/Galaxy.Proxy) all clean (0 / 0) - [x] `dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Tests` — **95 / 95 passed** (12 new in `OpcUaClientMonitoredTagSpecTests`: defaults match legacy, sampling/queue/discard overrides, MonitoringMode mapping theory, absolute + percent deadband filter, trigger/deadband enum round-trips, default-impl routing through StubSubscribableDriver) - [x] `dotnet test tests/ZB.MOM.WW.OtOpcUa.Core.Abstractions.Tests` — **37 / 37 passed** - [ ] Integration tests — skipped (live UA server required) 🤖 Auto-generated by the Mode-B execution loop. Closes #274. Closes #274
dohertj2 added 1 commit 2026-04-25 15:27:49 -04:00
dohertj2 merged commit 9f1e033e83 into auto/driver-gaps 2026-04-25 15:27:53 -04:00
dohertj2 deleted branch auto/opcuaclient/2 2026-04-25 15:27:53 -04:00
Sign in to join this conversation.