refactor(gui): relocate WFM demod lifecycle into MainWindow_DigitalModes.cpp (#3407 follow-up)#3562
Conversation
follow-up) Pure code motion — no behaviour change. activateWFM / deactivateWFM / reflectWfmButtons move from MainWindow.cpp into MainWindow_DigitalModes.cpp, beside the analogous RADE/FreeDV/DAX demod-surface lifecycles carved out in the #3351 Phase 1e split. They stay MainWindow:: members (header unchanged), matching how activateRADE/deactivateRADE already live in that TU. The RxApplet/VfoWidget wfmActivated connect handlers stay in MainWindow.cpp — that's consistent with the RADE connects right next to them. - MainWindow.cpp: −140 lines; drops the now-unused WfmDemodulator/ WfmDeviceDialog/WfmSettings includes (m_wfmDemod only needs the existing forward-decl in MainWindow.h). - MainWindow_DigitalModes.cpp: +147; carries the three WFM headers + RxApplet.h explicitly (Qt 6.4.2 floor — no reliance on transitive includes). Builds clean; full suite (34 tests incl. wfm_dsp_test) green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Reviewed as a pure code-motion follow-up to #3407. Looks good — happy to see this land. ✅
Verification
- Verbatim relocation confirmed. Diffing the block removed from
MainWindow.cppagainst the one added toMainWindow_DigitalModes.cpp, the three methods (activateWFM/deactivateWFM/reflectWfmButtons) are character-identical. No behavioural edits crept in under cover of the move — exactly what a "pure code motion" PR should look like. - Include hygiene is right.
MainWindow.cppdrops the three now-unused WFM headers; the sibling TU picks them up plusRxApplet.h, which is genuinely required here (reflectWfmButtonsdereferences the fullRxApplettype viarx->setWfmActive()). Carrying it explicitly rather than leaning on a transitive include is the correct call for the Qt 6.4.2 floor. - CI green across the board —
build(the Linux/Qt 6.4.2 floor),check-macos,check-windows, CodeQL,analyze (cpp), and accessibility all pass. That compile pass is the proof the includes dropped fromMainWindow.cppweren't load-bearing for anything else in the TU.
Conventions / scope — no MainWindow.h change (consistent with how activateRADE/deactivateRADE already live in this TU), no new AppSettings keys, RAII/ownership semantics preserved exactly, and both files are within the stated scope. The placement beside the DAX IQ lifecycle that WFM actually consumes is a sensible home, and keeping the wfmActivated connect handlers in MainWindow.cpp next to the RADE ones is the right consistency choice.
Nothing blocking and nothing to nitpick. Thanks for the tidy follow-up, @ten9876.
🤖 aethersdr-agent · cost: $2.0937 · model: claude-opus-4-8
There was a problem hiding this comment.
Reviewed as a pure code-motion follow-up to #3407. Looks good to merge. ✅
Verification
- The three relocated methods (
activateWFM/deactivateWFM/reflectWfmButtons) are byte-for-byte identical between the removed and added blocks — genuinely verbatim, no behavioural drift. - Include accounting is correct on both sides:
MainWindow.cppdrops the three now-unused WFM headers (keeping the unrelatedPanadapterStream.h), and the remainingwfmActivatedconnect handlers only touch members declared inMainWindow.h, so nothing is orphaned.MainWindow_DigitalModes.cppcarries all four headers the moved code needs (RxApplet.h,WfmDeviceDialog.h,WfmDemodulator.h,WfmSettings.h) explicitly — no transitive-include reliance, the right move for the Qt 6.4.2 floor. - All six CI checks (build / check-macos / check-windows / CodeQL / analyze / accessibility) are green, which is the decisive signal for a code-motion change — it compiles and links on every platform.
The new home is well-chosen: WFM reads the same DAX IQ stream that startDax/wireDaxSlice manage in this TU, and it now sits beside the analogous RADE/FreeDV per-slice lifecycles. Keeping the toggle connects in MainWindow.cpp next to the RADE ones is consistent.
Nothing outside the stated scope; no AppSettings/RAII/null-safety concerns introduced by a relocation. Thanks @ten9876 — nice continuation of the #3351 decomposition.
🤖 aethersdr-agent · cost: $1.5555 · model: claude-opus-4-8
There was a problem hiding this comment.
Reviewed as a pure code-motion follow-up to #3407 — and it checks out as exactly that. Thanks for the clean, well-scoped relocation, @ten9876.
Verification I ran:
- Methods moved verbatim.
activateWFM/deactivateWFM/reflectWfmButtonsare byte-identical between the removed and added hunks — no behavioural drift. - MainWindow.cpp include removals are safe. The only references to
WfmSettings,WfmDemodulator, andWfmDeviceDialogin that TU lived entirely inside the moved methods. The surviving WFM references (thewfmActivatedconnect handlers and them_wfmSliceIdguard in the pan-follow path) touch only plain members andSliceModel, so dropping the three includes can't break the translation unit. - Destination TU has what it needs.
MainWindow_DigitalModes.cppalready pulled inAppletPanel.h,VfoWidget.h,SpectrumWidget.h,<QTimer>, and already usesspectrumForSlice(). The four explicit adds (RxApplet.h,WfmDeviceDialog.h,WfmDemodulator.h,WfmSettings.h) cover the rest, andQDialog::Acceptedresolves transitively viaWfmDeviceDialog.h— good call not relying on transitive includes given the Qt 6.4.2 floor. - CI green across the board — Linux build, Windows, macOS, CodeQL, and accessibility all pass on
3dec333.
One minor nit (non-blocking): the relocated section-divider comment picked up a UTF-8 corruption — // ─��─ WFM software demodulator — where the original in MainWindow.cpp had clean box-drawing chars (// ─── WFM software demodulator ───). Worth fixing the two mangled bytes on your next push so the divider matches the surrounding activateRADE section, but it's cosmetic and doesn't affect the build.
Nice continuation of the #3351 decomposition direction — sitting WFM beside the DAX IQ lifecycle it reads from is the right home.
🤖 aethersdr-agent · cost: $3.8841 · model: claude-opus-4-8
…des.cpp (aethersdr#3351/aethersdr#3407 follow-up) (aethersdr#3562) Pure code motion: move activateWFM/deactivateWFM/reflectWfmButtons from MainWindow.cpp into MainWindow_DigitalModes.cpp beside the RADE/FreeDV/DAX lifecycles, with the WFM includes carried explicitly into the sibling TU. No behaviour change; MainWindow.cpp net-zero. Continues the aethersdr#3351 decomposition.
What
Pure code motion follow-up to #3407 (just merged). Moves the WFM software-demod
lifecycle out of
MainWindow.cppand intoMainWindow_DigitalModes.cpp, whereit sits beside the analogous per-slice demod-surface lifecycles (RADE, FreeDV,
DAX) that were carved out in the #3351 Phase 1e split.
activateWFM/deactivateWFM/reflectWfmButtonsstayMainWindow::members (no
MainWindow.hchange) — exactly howactivateRADE/deactivateRADEalready live in that TU. WFM literally reads the DAX IQ streamthat
startDax/wireDaxSlicemanage in the same file, so it's a natural home.Why
Keeps net-new feature lifecycle out of the
MainWindow.cppmonolith, continuingthe #3351 decomposition direction. This is the maintainer-owned tidy-up flagged
in the #3407 review (the WFM logic landed in
MainWindow.cppto keep that PR'sdiff small; this relocates it without touching behaviour).
Scope / non-goals
RxApplet/VfoWidgetwfmActivatedconnect handlers stay inMainWindow.cpp— consistent with the RADE connects sitting right next tothem. Not moved.
MainWindowclass entirely into dedicated controllers is the separate Refactor Phase 2: extract SwrSweepController + FreeDvSessionController from MainWindow (header member reduction) #3557track; this PR keeps them as members, just in the sibling TU.
Changes
MainWindow.cpp: −140 lines; drops the now-unusedWfmDemodulator/WfmDeviceDialog/WfmSettingsincludes (m_wfmDemodonly needs theexisting forward-decl in
MainWindow.h).MainWindow_DigitalModes.cpp: +147; carries the three WFM headers +RxApplet.hexplicitly (Qt 6.4.2 floor — no reliance on transitive includes),plus a file-header bullet.
Verification
Builds clean locally; full suite (34 tests incl.
wfm_dsp_test) green.🤖 Generated with Claude Code