Skip to content

Fix VFO filter width indicator showing 0.1 kHz too low (#2197)#2435

Merged
ten9876 merged 1 commit into
mainfrom
aether/issue-2197-filter-width-indicator
May 7, 2026
Merged

Fix VFO filter width indicator showing 0.1 kHz too low (#2197)#2435
ten9876 merged 1 commit into
mainfrom
aether/issue-2197-filter-width-indicator

Conversation

@jensenpat

@jensenpat jensenpat commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Closes #2197

Summary

  • VfoWidget::updateFilterLabel() computed filterHigh - filterLow, which for SSB/digital modes is ~100 Hz less than the nominal preset width because of the intentional low-cut (e.g. USB lo=95, hi=2800 → "2.7K" displayed for what is actually a "2.8K" filter).
  • The RX applet's filter readout already uses a mode-aware formatter, RxApplet::formatFilterWidth(). Promote it to public and have VfoWidget call it directly so the two labels share one source of truth.

Why a shared call instead of duplicating the logic

The same drift caused #794, #1225, and now #2197. PR #881 made both readouts mode-aware in the same commit, then 61251e9 reverted only the VFO side to "match the buttons" — but the buttons were already mode-aware, so the revert created the opposite imbalance reported here. Calling one shared function is the smallest change that prevents the next swap.

Test plan

  • USB 2.8K preset → both VFO label and RX applet label read "2.8K" (was "2.7K" / "2.8K")
  • LSB 2.7K preset → both read "2.7K"
  • CW 500 preset → both read "500"
  • AM 6.0K preset → both read "6.0K"
  • FM (no presets) → both readouts behave consistently

🤖 Generated with Claude Code

VfoWidget::updateFilterLabel() used `filterHigh - filterLow`, which is
~100 Hz less than the nominal SSB/digital preset width because of the
intentional low-cut offset (e.g. USB lo=95, hi=2800 → 2705 → "2.7K"
displayed for an actual "2.8K" filter).

The RxApplet filter readout already uses a mode-aware formatter
(formatFilterWidth) that returns the high edge for USB/DIGU/FDV/NT,
abs(low edge) for LSB/DIGL, and (hi - lo) elsewhere. Promote it to
public and have VfoWidget call it directly so the two labels can never
drift again — the same drift caused #794, #1225, and now #2197.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@jensenpat jensenpat requested a review from ten9876 as a code owner May 7, 2026 00:48

@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.

Thanks @jensenpat — looks good.

Verified:

  • RxApplet::formatFilterWidth() already handles USB/LSB/DIGU/DIGL/FDV/NT via the side-aware branches and falls back to hi - lo for symmetric modes (CW, AM, FM, RTTY, etc.), so the VFO readout now matches the applet readout for every mode.
  • SliceModel::mode() returns the same QString the applet's existing callers pass, so no conversion concerns.
  • Promoting the helper to public is the right call here — the alternative (duplicating the logic in VfoWidget) is exactly what regressed this twice already (#794, #1225, #2197). Sharing the function makes the next swap impossible by construction.

Scope is appropriately tight (9/9 lines across 2 files), no AppSettings/RAII concerns, no error-handling gaps at boundaries.

@ten9876 ten9876 merged commit f82bf7b into main May 7, 2026
5 checks passed
@ten9876 ten9876 deleted the aether/issue-2197-filter-width-indicator branch May 7, 2026 02:51
@ten9876

ten9876 commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Claude here — exactly the right structural fix for a thrice-reported drift bug. The history walk (PR #881 + revert 61251e9) makes it clear that duplicating the logic invites drift, and the comment in updateFilterLabel citing #794/#1225/#2197 should keep the next maintainer from reverting this for the wrong reason. Promoting the static + stateless formatter is the minimal change that prevents the fourth recurrence. Merged.

73, Jeremy KK7GWY & Claude (AI dev partner)

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.

Filter width indicator incorrect

2 participants