Skip to content

Trim panadapter frequency scale trailing zeros#3504

Merged
jensenpat merged 1 commit into
aethersdr:mainfrom
rfoust:codex/fix-3480-frequency-scale
Jun 10, 2026
Merged

Trim panadapter frequency scale trailing zeros#3504
jensenpat merged 1 commit into
aethersdr:mainfrom
rfoust:codex/fix-3480-frequency-scale

Conversation

@rfoust

@rfoust rfoust commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #3480.

This trims non-informative trailing zero padding from the panadapter frequency-scale labels while preserving enough precision for the current grid spacing.

Root Cause

SpectrumWidget::drawFreqScale() formatted grid labels with a fixed number of decimal places derived from the grid step. That made whole-kHz ticks display with extra zeroes, such as 21.0580, and very zoomed-in sub-kHz ticks display labels such as 21.26080 and 21.26100.

The fixed-width formatting made the scale harder to scan without adding useful information.

Change

  • Removed the 4-decimal branch for 1-10 kHz grid spacing, so whole-kHz ticks use three MHz decimals.
  • Added a local formatFreqScaleLabel() helper that trims trailing zeroes from finer-scale labels while keeping at least three decimals.
  • Left the existing precision selection intact for sub-kHz spacing so adjacent tick labels remain distinct at tight zoom levels.

Examples:

  • 21.0580 -> 21.058
  • 14.0200 -> 14.020
  • 21.26080 -> 21.2608
  • 21.26100 -> 21.261

This only changes the panadapter scale labels. VFO frequency display, slice flag formatting, and TNF frequency formatting are unchanged.

Validation

  • git diff --check
  • python3 tools/check_a11y.py src/gui/SpectrumWidget.cpp
  • cmake --build build --parallel
  • ctest --test-dir build -E theme_manager_test --output-on-failure (31/31 passed; theme_manager_test is excluded here because this checkout has local persistent theme test state under the user preferences path, unrelated to the spectrum label formatter)

@rfoust rfoust requested a review from a team as a code owner June 10, 2026 03:19
Copilot AI review requested due to automatic review settings June 10, 2026 03:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the panadapter frequency-scale label formatting in SpectrumWidget to remove non-informative trailing zeros while keeping enough precision for the current grid spacing (fixing #3480).

Changes:

  • Introduced a local formatFreqScaleLabel() helper to trim trailing zero padding for higher-precision labels while keeping at least 3 decimals.
  • Adjusted the decimal-precision selection so 1–10 kHz grid spacings no longer force 4 decimals (e.g., 21.058021.058).
  • Switched drawFreqScale() to use the new formatter for all grid labels.

@jensenpat

jensenpat commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

@AetherClaude can you check formatting compiles for transverter bands? including 144mhz and 1.2ghz. do they stay tunable? i submitted 3 transverter pan fixes this week and i dont want to break satellite users which should now be working.

@jensenpat jensenpat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the label-formatting change in drawFreqScale(): render-only, no tuning impact. Verified every reachable grid step (auto 1-2-5 and manual 1/2/5/10/25/50/100 kHz) keeps adjacent tick labels distinct on HF and transverter bands (2m/70cm/1296 MHz), including sub-kHz trim cases. CI green. LGTM.

@jensenpat jensenpat merged commit ce2437a into aethersdr:main Jun 10, 2026
6 checks passed
G6PWY-Chris pushed a commit to G6PWY-Chris/AetherSDR that referenced this pull request Jun 22, 2026
…ethersdr#3480) (aethersdr#3504)

Trim non-informative trailing zero padding from the panadapter
frequency-scale labels while keeping enough precision for the current
grid spacing. Whole-kHz ticks now use three MHz decimals (21.0580 ->
21.058), and a formatFreqScaleLabel() helper trims trailing zeros from
sub-kHz labels while keeping at least three decimals so adjacent ticks
stay distinct at tight zoom. Render-only; VFO display, slice flags, and
TNF formatting are unchanged.

Fixes aethersdr#3480.

Squashed-from: aethersdr#3504

Co-authored-by: Robbie Foust <2991296+rfoust@users.noreply.github.com>
Signed-off-by: Pat Jensen <pat@jensencloud.net>
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.

Remove extra zero from a panadapter frequency

3 participants