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"> - -