Skip to content

AetherSweep: Phase 2#2320

Merged
ten9876 merged 2 commits intoten9876:mainfrom
jensenpat:swr-sweep-polish
May 3, 2026
Merged

AetherSweep: Phase 2#2320
ten9876 merged 2 commits intoten9876:mainfrom
jensenpat:swr-sweep-polish

Conversation

@jensenpat
Copy link
Copy Markdown
Collaborator

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

  • Render the SWR trace on a logarithmic SWR scale for cleaner low-ratio detail.
  • Change the corner readout to report the best measured SWR and resonant frequency instead of the latest/worst-looking sample.
  • Trim resonant frequency display to kHz precision.
  • Add visual start/end notches on the sweep trace.
  • Add a resonance caret and marker at the best SWR point.
  • Add subtle threshold shading for SWR quality bands: 1.0-1.5, 1.5-2.0, and above 2.0.
  • Calculate usable bandwidth around the resonance point for SWR <= 1.5 and SWR <= 2.0, including interpolated threshold crossings between measured samples.
  • Draw compact bandwidth brackets on the completed plot and include a concise BW readout in the corner label.
  • Clear completed sweep plots when the swept TX slice changes bands.
  • If a band change happens while a sweep is running, stop and clear the sweep without restoring the old frequency/pan range afterward, so cleanup does not fight the user-requested band switch.

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:

env -u CPLUS_INCLUDE_PATH cmake --build build --parallel 22

Also launched the resulting app bundle locally for manual test setup:

open -n /Users/patj/Documents/AetherSDR-swr-sweep-polish/build/AetherSDR.app

@jensenpat jensenpat changed the title Polish SWR sweep analyzer AetherSweep: Phase 2 May 3, 2026
@jensenpat jensenpat marked this pull request as ready for review May 3, 2026 20:13
@jensenpat jensenpat requested a review from ten9876 as a code owner May 3, 2026 20:13
Copy link
Copy Markdown
Contributor

@aethersdr-agent aethersdr-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ten9876 ten9876 merged commit 61e71a7 into ten9876:main May 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants