Skip to content

Sync panadapter RX antenna status#2862

Open
rfoust wants to merge 1 commit into
aethersdr:mainfrom
rfoust:codex/rx-antenna-sync
Open

Sync panadapter RX antenna status#2862
rfoust wants to merge 1 commit into
aethersdr:mainfrom
rfoust:codex/rx-antenna-sync

Conversation

@rfoust
Copy link
Copy Markdown
Collaborator

@rfoust rfoust commented May 18, 2026

Summary:

  • track panadapter rxant status and drive overlay antenna selection from radio echo
  • send overlay RX antenna changes with display pan set, matching FlexLib panadapter behavior
  • keep overlay RF gain panadapter-authoritative and cover rxant/rfgain status in a focused test

Verification:

  • cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
  • cmake --build build -j8
  • ctest --test-dir build -R panadapter_model_rx_antenna_test --output-on-failure

Copilot AI review requested due to automatic review settings May 18, 2026 20:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes panadapter RX antenna state radio-authoritative and routes overlay antenna changes through display pan set, aligning overlay behavior with panadapter-level status echoes.

Changes:

  • Adds rxAntenna state/signaling to PanadapterModel.
  • Updates SpectrumOverlayMenu to track the owning panadapter, prefer panadapter antenna/RF gain state, and send RX antenna changes as pan commands.
  • Adds a focused CTest covering panadapter rxant and rfgain status change behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/models/PanadapterModel.h Adds RX antenna accessor, signal, and backing state.
src/models/PanadapterModel.cpp Parses rxant from pan status and emits changes.
src/gui/SpectrumOverlayMenu.h Adds panadapter tracking and helper declarations.
src/gui/SpectrumOverlayMenu.cpp Routes overlay RX antenna selection via pan commands and syncs from panadapter state.
tests/panadapter_model_rx_antenna_test.cpp Adds regression coverage for rxant and rfgain status updates.
CMakeLists.txt Registers the new panadapter model test target with CTest.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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 @rfoust — this looks good. The design mirrors how wnb/rfgain are already handled (panadapter-authoritative, with display pan set <panId> rxant=), and the new rxAntenna field in PanadapterModel::applyPanStatus follows the same dedup-then-emit pattern as the surrounding keys.

A few small things worth confirming, none blocking:

  • Slice fallback path in the combo handler is effectively dead. With setPanId() and setRadioModel() always called before setSlice() in MainWindow::buildPanadapter, the else if (m_slice) branch in SpectrumOverlayMenu.cpp:319 only runs during early construction. That's fine and matches the stated intent ("send overlay RX antenna changes with display pan set"), but it means VFO-widget RxAntenna and the overlay combo now diverge in transport — the overlay always targets the pan, VfoWidget/RxApplet still target the slice. Worth a sanity check that this doesn't cause the panadapter overlay combo to drift out of sync with VFO-side selections in a multi-slice pan when the user only touches one path.

  • Implicit ordering dependency. setPanId() and setRadioModel() both call wirePanadapterRxAntenna(), and it only does anything once both have run — which works today because of the MainWindow call order at src/gui/MainWindow.cpp:10348-10350. Not a bug, just a latent constraint if anyone reorders those calls later. A short comment on wirePanadapterRxAntenna() noting "no-op until both panId and radioModel are set" would save a future reader.

  • The QPointer<PanadapterModel> m_panadapter plus reset in setRadioModel(nullptr) correctly guards against RadioModel teardown — nice.

Test coverage is appropriately focused (rxant set/dedup/change + rfgain dedup). LGTM.

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