P1C: add native COMTRADE phasor and harmonics workspace views - #294
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5434fe7fa0
ℹ️ 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".
| var viewport = _requestedSourceViewport.FrameCount > 0 | ||
| ? _requestedSourceViewport | ||
| : _loadedSourceViewport.FrameCount > 0 | ||
| ? _loadedSourceViewport | ||
| : ComtradeAbsoluteViewportMath.Full(total); | ||
| viewport = ComtradeAbsoluteViewportMath.Normalize(viewport, total); | ||
| if (viewport.FrameCount == 0) return Math.Min(total - 1, viewport.StartFrame); | ||
| var offset = (viewport.FrameCount - 1) / 2; | ||
| return Math.Min(total - 1, viewport.StartFrame + offset); |
There was a problem hiding this comment.
Use the visible waveform window as the analysis reference
For records with 500,000 frames or fewer, waveform zooming and panning occur only inside ComtradeWaveformView, while _requestedSourceViewport and _loadedSourceViewport remain the full record. Consequently, after a user zooms to a fault and opens Phasor or Harmonics, this method still analyzes the full-record midpoint rather than the visible window's midpoint, producing results for the wrong time despite presenting them as the current analysis reference.
Useful? React with 👍 / 👎.
| var vectors = new List<ComtradePhasorVector>(); | ||
| foreach (var item in candidates.Take(8)) | ||
| { | ||
| token.ThrowIfCancellationRequested(); | ||
| var phasor = _record.ReadPhasor(checked((uint)item.index), referenceFrame); |
There was a problem hiding this comment.
Keep the selected channel in truncated phasor groups
When more than eight channels share the selected channel's units or circuit, Take(8) chooses the first channels in record order and can exclude the channel the user actually selected. Selecting a later channel then renders unrelated vectors while the subtitle and reference metadata still name the selected channel, so the displayed analysis is misleading; reserve a slot for the selected channel before applying the group limit.
Useful? React with 👍 / 👎.
P1C — ARSAS-native COMTRADE analysis views
Build on merged P1B.3 and keep ARSAS as the product shell while reusing ArdIrec's native analysis engine.
Engine
cfcd65adf853b6707ee54a89dd30328db8827f0b.WPF workspace
Waveform | Phasor | Harmonicsanalysis modes.Full analysisremains available as a compatibility/field-validation fallback.Validation
Draft until Build ARSAS, COMTRADE cross-repo integration, SV regression and Windows installer are green on final head.