Skip to content

refactor(gui): relocate WFM demod lifecycle into MainWindow_DigitalModes.cpp (#3407 follow-up)#3562

Merged
ten9876 merged 1 commit into
mainfrom
refactor/wfm-decomp
Jun 14, 2026
Merged

refactor(gui): relocate WFM demod lifecycle into MainWindow_DigitalModes.cpp (#3407 follow-up)#3562
ten9876 merged 1 commit into
mainfrom
refactor/wfm-decomp

Conversation

@ten9876

@ten9876 ten9876 commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

What

Pure code motion follow-up to #3407 (just merged). Moves the WFM software-demod
lifecycle out of MainWindow.cpp and into MainWindow_DigitalModes.cpp, where
it sits beside the analogous per-slice demod-surface lifecycles (RADE, FreeDV,
DAX) that were carved out in the #3351 Phase 1e split.

activateWFM / deactivateWFM / reflectWfmButtons stay MainWindow::
members (no MainWindow.h change) — exactly how activateRADE /
deactivateRADE already live in that TU. WFM literally reads the DAX IQ stream
that startDax/wireDaxSlice manage in the same file, so it's a natural home.

Why

Keeps net-new feature lifecycle out of the MainWindow.cpp monolith, continuing
the #3351 decomposition direction. This is the maintainer-owned tidy-up flagged
in the #3407 review (the WFM logic landed in MainWindow.cpp to keep that PR's
diff small; this relocates it without touching behaviour).

Scope / non-goals

Changes

  • 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),
    plus a file-header bullet.

Verification

Builds clean locally; full suite (34 tests incl. wfm_dsp_test) green.

🤖 Generated with Claude Code

 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>
@ten9876 ten9876 requested a review from a team as a code owner June 13, 2026 21:27

@aethersdr-agent aethersdr-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.cpp against the one added to MainWindow_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.cpp drops the three now-unused WFM headers; the sibling TU picks them up plus RxApplet.h, which is genuinely required here (reflectWfmButtons dereferences the full RxApplet type via rx->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 boardbuild (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 from MainWindow.cpp weren'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

@aethersdr-agent aethersdr-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.cpp drops the three now-unused WFM headers (keeping the unrelated PanadapterStream.h), and the remaining wfmActivated connect handlers only touch members declared in MainWindow.h, so nothing is orphaned. MainWindow_DigitalModes.cpp carries 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

@aethersdr-agent aethersdr-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 / reflectWfmButtons are byte-identical between the removed and added hunks — no behavioural drift.
  • MainWindow.cpp include removals are safe. The only references to WfmSettings, WfmDemodulator, and WfmDeviceDialog in that TU lived entirely inside the moved methods. The surviving WFM references (the wfmActivated connect handlers and the m_wfmSliceId guard in the pan-follow path) touch only plain members and SliceModel, so dropping the three includes can't break the translation unit.
  • Destination TU has what it needs. MainWindow_DigitalModes.cpp already pulled in AppletPanel.h, VfoWidget.h, SpectrumWidget.h, <QTimer>, and already uses spectrumForSlice(). The four explicit adds (RxApplet.h, WfmDeviceDialog.h, WfmDemodulator.h, WfmSettings.h) cover the rest, and QDialog::Accepted resolves transitively via WfmDeviceDialog.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

@ten9876 ten9876 merged commit 6822cb1 into main Jun 14, 2026
6 checks passed
@ten9876 ten9876 deleted the refactor/wfm-decomp branch June 14, 2026 04:47
G6PWY-Chris pushed a commit to G6PWY-Chris/AetherSDR that referenced this pull request Jun 22, 2026
…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.
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.

1 participant