P2: primary secondary measurement context workflow#49
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 549a7b2de3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| SvMeasurementValueDomain.PrimaryEngineering when context.DisplayDomain == SvMeasurementValueDomain.SecondaryEquivalent | ||
| => ratio.SecondaryNominal / ratio.PrimaryNominal, | ||
| SvMeasurementValueDomain.SecondaryEquivalent when context.DisplayDomain == SvMeasurementValueDomain.PrimaryEngineering | ||
| => ratio.PrimaryNominal / ratio.SecondaryNominal, |
There was a problem hiding this comment.
Move CT/VT conversion into the shared engine
This reimplements the primary/secondary conversion in the WPF view model instead of consuming an engine contract. Decoded rows use SvMeasurementDomainResolver, while waveform and phasor conversion use this separate multiplier; any correction to conversion semantics or validation can therefore make the grid disagree with the plots/RMS output. Centralize this conversion in ARSVIN.Engine and have all Subscriber presentations consume the same typed result.
AGENTS.md reference: AGENTS.md:L14-L16
Useful? React with 👍 / 👎.
| var duplicateKeys = Streams | ||
| .Where(item => !string.IsNullOrWhiteSpace(item.StreamKey)) | ||
| .GroupBy(item => item.StreamKey, StringComparer.Ordinal) |
There was a problem hiding this comment.
Reject null stream arrays during JSON import
A syntactically valid import such as {"streams":null} deserializes with Streams set to null, then this dereference throws NullReferenceException. FromJson only converts JsonException to InvalidDataException, and the UI import handler catches only IO, authorization, and invalid-data exceptions, so importing this malformed-but-valid JSON can escape the handler rather than show the intended validation error.
Useful? React with 👍 / 👎.
Scope
This phase turns the P1 primary/secondary conversion API into a user-facing, repeatable engineering workflow.
Implemented
Validation at head
549a7b2Safety boundary
Context changes presentation only. Raw bytes and protocol-scaled wire values remain preserved. No ratio is inferred from vendor identity, APPID, MAC address, amplitude, or naming.
Pending after this tranche