From b32c09aeefaadb551fa7e8542688fee179e7549b Mon Sep 17 00:00:00 2001 From: ericek111 Date: Sat, 24 Oct 2026 12:12:35 +0000 Subject: [PATCH] Add a 60 kHz bandmap zoom, a mode-wide zoom and denser scale ticks The zoom list gains 60 kHz and a "mode" level that shows the CW, digital or phone part of the band the receiver is in, before "band". For views from 40 to 200 kHz wide, the scale picks the smallest round step that keeps three lines of text between ticks. The font size buttons are removed; Ctrl with the wheel or plus and minus still change the size. Co-Authored-By: Claude Sonnet 5.5 --- src/Nonemm.App/Configuration/Settings.cs | 3 +- src/Nonemm.App/Windows/BandmapView.cs | 6 ++- src/Nonemm.App/Windows/BandmapWindow.axaml | 6 --- src/Nonemm.App/Windows/BandmapWindow.axaml.cs | 52 +++++++++---------- src/Nonemm.Core/BandPlan.cs | 10 ++++ src/Nonemm.Spotting/BandmapLayout.cs | 8 +++ src/Nonemm.Spotting/BandmapSlice.cs | 14 +++++ .../BandmapLayoutTests.cs | 13 +++++ .../BandmapSliceTests.cs | 30 +++++++++++ .../SpotDescriptionTests.cs | 1 + 10 files changed, 108 insertions(+), 35 deletions(-) diff --git a/src/Nonemm.App/Configuration/Settings.cs b/src/Nonemm.App/Configuration/Settings.cs index 6a0a4b1..449b3a9 100644 --- a/src/Nonemm.App/Configuration/Settings.cs +++ b/src/Nonemm.App/Configuration/Settings.cs @@ -53,7 +53,8 @@ public sealed record Settings /// How long a spot stays on the bandmap. N1MM's own default is 60. public int SpotTimeoutMinutes { get; init; } = 60; - /// The width of the slice the bandmap shows, in hertz. Zero is the whole band. + /// The width of the slice the bandmap shows, in hertz. Zero is the whole band + /// and minus one is the CW, digital or phone part the receiver is in. public int BandmapSpanHertz { get; init; } = 40_000; /// The bandmap keeps the receiver in the middle instead of moving only when diff --git a/src/Nonemm.App/Windows/BandmapView.cs b/src/Nonemm.App/Windows/BandmapView.cs index caebb4d..4e2b1f5 100644 --- a/src/Nonemm.App/Windows/BandmapView.cs +++ b/src/Nonemm.App/Windows/BandmapView.cs @@ -78,6 +78,10 @@ public sealed class BandmapView : Control /// The step between the frequency numbers down the scale. public Frequency TickStep { get; set; } = Frequency.FromKilohertz(5); + /// Sets the step from the height of the window instead: as many ticks as + /// fit with room for three lines of text between them. + public bool DenseTicks { get; set; } + public event EventHandler? SpotPicked; /// Clicking where no station is asks for the radio, not a callsign. @@ -139,7 +143,7 @@ public sealed class BandmapView : Control { Pen line = new(Opaque(ink, 0.7), 1); context.DrawLine(line, new Point(ScaleX, Inset), new Point(ScaleX, Inset + scale.Height)); - foreach (Frequency tick in BandmapLayout.Ticks(scale, TickStep)) + foreach (Frequency tick in BandmapLayout.Ticks(scale, DenseTicks ? BandmapLayout.StepFor(scale, 3 * LabelHeight) : TickStep)) { double y = Math.Round(scale.YFor(tick) + Inset) + 0.5; context.DrawLine(line, new Point(ScaleX - TickLength, y), new Point(ScaleX, y)); diff --git a/src/Nonemm.App/Windows/BandmapWindow.axaml b/src/Nonemm.App/Windows/BandmapWindow.axaml index e2c0bf6..8f32399 100644 --- a/src/Nonemm.App/Windows/BandmapWindow.axaml +++ b/src/Nonemm.App/Windows/BandmapWindow.axaml @@ -5,12 +5,6 @@ Title="Bandmap" Width="320" Height="620"> - -