Sync panadapter RX antenna status#2862
Conversation
There was a problem hiding this comment.
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
rxAntennastate/signaling toPanadapterModel. - Updates
SpectrumOverlayMenuto track the owning panadapter, prefer panadapter antenna/RF gain state, and send RX antenna changes as pan commands. - Adds a focused CTest covering panadapter
rxantandrfgainstatus 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.
There was a problem hiding this comment.
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()andsetRadioModel()always called beforesetSlice()inMainWindow::buildPanadapter, theelse if (m_slice)branch inSpectrumOverlayMenu.cpp:319only 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()andsetRadioModel()both callwirePanadapterRxAntenna(), and it only does anything once both have run — which works today because of the MainWindow call order atsrc/gui/MainWindow.cpp:10348-10350. Not a bug, just a latent constraint if anyone reorders those calls later. A short comment onwirePanadapterRxAntenna()noting "no-op until both panId and radioModel are set" would save a future reader. -
The
QPointer<PanadapterModel> m_panadapterplus reset insetRadioModel(nullptr)correctly guards against RadioModel teardown — nice.
Test coverage is appropriately focused (rxant set/dedup/change + rfgain dedup). LGTM.
Summary:
Verification: