feat(flexcontrol): add CWX F1-F12 macro actions to button mappings (#2721). Principle I.#2725
Merged
Conversation
…2721). Principle I. Extends the FlexControl per-button action list with CwxF1..CwxF12 so operators can trigger CWX memories from the knob's tap/double-tap gestures. Dispatch routes through CwxModel::sendMacro(), which emits the radio-global "cwx macro send N" command — FlexLib routes it to the active CW slice (per FlexLib protocol authority), so no extra slice plumbing is needed. Matches the on-screen F-key click behavior (no mode-gate); user explicitly mapped the button. Blast radius: risk_score=0.210, 3 high-risk affected (top: MainWindow::MainWindow, MainWindow::wirePanadapter, MainWindow::buildMenuBar). The hook reported file-level risk for RadioSetupDialog.cpp, but the edit is purely additive (new combo entries + a new else-if branch) and reuses the existing AppSettings/sendMacro paths, so no behavioral change for existing callers. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2 tasks
The CWX F1-F12 commit (781358a) was generated against a SpectrumWidget snapshot from before PR #2717 landed and inadvertently reverted those ~107 lines: removed the m_draggingDbmRange / m_dbmDragStartRange / m_dbmDragStartBottom members and undid the matching press/move/release handling, the isDraggingDbmScale() update, the noise-floor guard swap, and the paint-order fix. Restore src/gui/SpectrumWidget.{cpp,h} to the current main state so the CWX F1-F12 additions in MainWindow.cpp and RadioSetupDialog.cpp can land without reverting #2717. Same pattern as the restoration commit on PR #2714 earlier today — worth investigating the agent's snapshot/cache behaviour upstream. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
There was a problem hiding this comment.
Reviewed the diff — looks good. The implementation is small and focused:
actionName.startsWith("CwxF")+mid(4).toInt(&ok)is a robust parse, and the[1,12]bound matchesCwxModel::sendMacro's own guard (src/models/CwxModel.cpp:38), so out-of-range entries silently no-op as expected.- Dropdown additions in
RadioSetupDialogare alongside the existing actions and pick up theAppSettings-backed persistence path already in use for FlexControl button actions — no convention drift. - Dispatch is consistent with the existing button-action handler block (sits next to
WheelXit), so all 12 macros funnel through the same path used byCwxPanel.
Minor non-blocking note: the PR body lists SpectrumWidget.cpp/h as modified, but the diff only touches MainWindow.cpp and RadioSetupDialog.cpp. That's just a stale description; the actual change is correctly scoped.
Thanks for the patch — nice small, contained addition.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2721
What was changed
feat(flexcontrol): add CWX F1-F12 macro actions to button mappings (#2721). Principle I.
Files modified
src/gui/MainWindow.cppsrc/gui/RadioSetupDialog.cppsrc/gui/SpectrumWidget.cppsrc/gui/SpectrumWidget.hGenerated by AetherClaude (automated agent for AetherSDR)