Trim panadapter frequency scale trailing zeros#3504
Conversation
There was a problem hiding this comment.
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.0580→21.058). - Switched
drawFreqScale()to use the new formatter for all grid labels.
|
@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
left a comment
There was a problem hiding this comment.
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.
…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>
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 as21.0580, and very zoomed-in sub-kHz ticks display labels such as21.26080and21.26100.The fixed-width formatting made the scale harder to scan without adding useful information.
Change
formatFreqScaleLabel()helper that trims trailing zeroes from finer-scale labels while keeping at least three decimals.Examples:
21.0580->21.05814.0200->14.02021.26080->21.260821.26100->21.261This only changes the panadapter scale labels. VFO frequency display, slice flag formatting, and TNF frequency formatting are unchanged.
Validation
git diff --checkpython3 tools/check_a11y.py src/gui/SpectrumWidget.cppcmake --build build --parallelctest --test-dir build -E theme_manager_test --output-on-failure(31/31 passed;theme_manager_testis excluded here because this checkout has local persistent theme test state under the user preferences path, unrelated to the spectrum label formatter)