AetherSweep: Phase 2#2320
Conversation
There was a problem hiding this comment.
Thanks @jensenpat — nice polish pass. The log SWR scale, resonance caret, threshold-band shading, and interpolated bandwidth math are all easy to follow and read cleanly on the diff. Confirmed originalBandName is set/cleared in all the right spots (startSwrSweep, clearSwrSweepPlot, clearSwrSweepForBandChange, completeSwrSweepFinish), and preserveBandSwitchOnFinish correctly skips both the freq and pan-range restoration in finishSwrSweepAfterTuneStopped so cleanup doesn't fight the new band switch.
One concern worth a look:
clearSwrSweepForBandChange(-1, bandName) from wirePanadapter is panadapter-agnostic. The call site at MainWindow.cpp:9205 fires for any applet's band change, but the function is invoked with sliceId=-1, which bypasses the sliceId != m_swrSweep.sliceId guard. In a multi-panadapter setup, switching the band on a panadapter that isn't the swept one will still match newBandName != m_swrSweep.originalBandName and either clear a completed plot or abort a running sweep on the unrelated panadapter. That seems contrary to the PR's stated intent ("Clear completed sweep plots when the swept TX slice changes bands").
Suggested fix — either gate the call on the applet's pan id, e.g.:
if (m_swrSweep.panId.isEmpty() || applet->panId() == m_swrSweep.panId)
clearSwrSweepForBandChange(-1, bandName);or pass the panId into clearSwrSweepForBandChange and add a panId == m_swrSweep.panId check alongside the existing slice filter. The TX-slice frequencyChanged path at MainWindow.cpp:7712 is fine since it correctly filters on sliceId.
Minor nit (take or leave): bestSwr is the clamp-to-1.0 value, so the corner readout displays SWR 1.00:1 for any sample below 1.0. That's physically reasonable, but if the underlying meter ever hands you something pathological, the displayed best won't match the raw sample. Probably fine as-is.
Otherwise looks good — no AppSettings/RAII issues, scope is tight to the three files, and the existing TGXL/tune/timer paths are preserved as documented.
Add a "Limit range" checkbox and From/To frequency fields to the SWR sweep controls so operators can confine a sweep to a licence sub-band or a slice of interest instead of always sweeping the whole band. Off by default — the full-band sweep behaviour is unchanged. Ticking the box enables the fields and seeds them with the current band's edges (via BandSettings). The seed is refreshed whenever the fields are empty or no longer lie within the active band, so changing band and re-opening the range always starts from a sensible in-band point while a range narrowed within the current band is preserved. The chosen bounds are passed through swrSweepStartRequested() to startSwrSweep(), where they are intersected with the existing in-region safe range. They can therefore only ever narrow the sweep — never widen it past what the regional band plan already permits (aethersdr#2800) — preserving the out-of-region transmit guard. A positive-but-inverted range (From > To) is rejected up front with a warning rather than silently falling through to a full-band sweep, and a range that does not overlap the band by at least one step is likewise rejected. Part of aethersdr#2241 (the resonance/bandwidth display landed earlier in aethersdr#2320).
Adds the user-bounded sweep range from #2241 (rnash2's request to "manually set the start and end sweep frequency to respect his operating privileges"). A **Limit range** checkbox with **From**/**To** fields in the SWR sweep controls lets an operator confine a sweep to a licence sub-band or a slice of interest instead of always sweeping the whole band. - **Off by default** — full-band sweep behaviour is unchanged. - Ticking the box enables the fields and **seeds them with the current band's edges** (via `BandSettings`) as a starting point to narrow from. - The bounds pass through `swrSweepStartRequested()` to `startSwrSweep()`, where they are **intersected with the existing in-region safe range** — so they can only ever *narrow* the sweep, never widen it past what the regional band plan already permits (#2800). The out-of-region transmit guard is preserved. - A range that doesn't overlap the band by at least one step is rejected with a warning. **Tested** live on a FLEX-6600: ticked Limit range (auto-seeded 14.000–14.350 on 20 m), narrowed To to 14.150, and confirmed the sweep trace covered only 14.000–14.150 instead of the full band. Note: the resonance/bandwidth-marker portion of #2241 already landed in #2320, so this completes the remaining actionable scope.
Summary
This PR polishes the SWR sweep analyzer overlay so completed sweeps are easier to read and safer to carry across operating changes.
What Changed
Notes
The radio command/timer path for normal SWR sweeps is intentionally left intact: the existing TGXL bypass handling, tune power restore, fresh meter checks, sample ordering, and intra-band frequency stepping are preserved. The new band-change path only changes finish behavior when the user leaves the swept band.
Validation
Built locally with the required 22 parallel jobs:
Also launched the resulting app bundle locally for manual test setup: