Phase 2 PR 12 � richer historian quality mapping #11

Merged
dohertj2 merged 1 commits from phase-2-pr12-quality-mapper into v2 2026-04-18 07:22:45 -04:00
Owner

Replace the category-only inline helper in MxAccessGalaxyBackend with a new public HistorianQualityMapper that preserves specific OPC DA subcodes (BadNotConnected, UncertainSubNormal, etc.) instead of collapsing to the 3 family defaults. No wire-contract change (StatusCode is already uint). 21 new tests, 56/56 Host.Tests Unit pass. Branches off v2.

Replace the category-only inline helper in MxAccessGalaxyBackend with a new public HistorianQualityMapper that preserves specific OPC DA subcodes (BadNotConnected, UncertainSubNormal, etc.) instead of collapsing to the 3 family defaults. No wire-contract change (StatusCode is already uint). 21 new tests, 56/56 Host.Tests Unit pass. Branches off v2.
dohertj2 added 1 commit 2026-04-18 07:12:44 -04:00
Phase 2 PR 12 — richer historian quality mapping. Replace MxAccessGalaxyBackend's inline MapHistorianQualityToOpcUa category-only helper (192+→Good, 64-191→Uncertain, 0-63→Bad) with a new public HistorianQualityMapper.Map utility that preserves specific OPC DA subcodes — BadNotConnected(8)→0x808A0000u instead of generic Bad(0x80000000u), UncertainSubNormal(88)→0x40950000u instead of generic Uncertain, Good_LocalOverride(216)→0x00D80000u instead of generic Good, etc. Mirrors v1 QualityMapper.MapToOpcUaStatusCode byte-for-byte without pulling in OPC UA types — the function returns uint32 literals that are the canonical OPC UA StatusCode wire encoding, surfaced directly as DataValueSnapshot.StatusCode on the Proxy side with no additional translation. Unknown subcodes fall back to the family category (255→Good, 150→Uncertain, 50→Bad) so a future SDK change that adds a quality code we don't map yet still gets a sensible bucket. GalaxyDataValue wire shape unchanged (StatusCode stays uint) — this is a pure fidelity upgrade on the Host side. Downstream callers (Admin UI status dashboard, OPC UA clients receiving historian samples) can now distinguish e.g. a transport outage (BadNotConnected) from a sensor fault (BadSensorFailure) from a warm-up delay (BadWaitingForInitialData) without a second round-trip or dashboard heuristic. 21 new tests (HistorianQualityMapperTests): theory with 15 rows covering every specific mapping from the v1 QualityMapper table, plus 6 fallback tests verifying unknown-subcode codes in each family (Good/Uncertain/Bad) collapse to the family default. Galaxy.Host.Tests Unit suite 56/0 (21 new + 35 existing). Galaxy.Host builds clean (0/0). Branches off v2. f24f969a85
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dohertj2 merged commit 4448db8207 into v2 2026-04-18 07:22:45 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#11