Put the bands down the side of the entry window

N1MM has two columns of band buttons beside its entry window, CW in one and
phone in the other, with the band the radio is on marked. This has the same.

A button does not jump to the band edge every time: BandMemory keeps the
frequency the operator was last on for each band and mode, so leaving 20 metres
at 14032 and coming back lands on 14032. The first visit to a band starts where
that part of it starts, which the band plan says — the bottom edge for CW, the
CW-to-phone boundary for phone — and a band the plan says nothing about starts
at its bottom edge.

Phone picks the sideband the band calls for, so 40 metres is lower sideband and
20 is upper.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-28 08:45:42 +00:00
parent a06bbde3f9
commit 86d1f71ffe
7 changed files with 211 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
using Nonemm.Core;
namespace Nonemm.Session.Tests;
public class BandMemoryTests
{
[Fact]
public void AnUnvisitedBandStartsWhereThatPartOfItStarts()
{
BandMemory memory = new();
Assert.Equal(Bands.Band20M.Low, memory.Where(Bands.Band20M, ModeCategory.Cw, BandPlan.Default));
Assert.Equal(
Frequency.FromKilohertz(14_150),
memory.Where(Bands.Band20M, ModeCategory.Phone, BandPlan.Default));
}
[Fact]
public void TheBandComesBackWhereItWasLeft()
{
BandMemory memory = new();
memory.Remember(Frequency.FromKilohertz(14_032), Modes.Cw);
memory.Remember(Frequency.FromKilohertz(7_012), Modes.Cw);
Assert.Equal(
Frequency.FromKilohertz(14_032),
memory.Where(Bands.Band20M, ModeCategory.Cw, BandPlan.Default));
Assert.Equal(
Frequency.FromKilohertz(7_012),
memory.Where(Bands.Band40M, ModeCategory.Cw, BandPlan.Default));
}
[Fact]
public void EachModeOnABandIsRememberedOnItsOwn()
{
BandMemory memory = new();
memory.Remember(Frequency.FromKilohertz(14_032), Modes.Cw);
memory.Remember(Frequency.FromKilohertz(14_240), Modes.Usb);
Assert.Equal(
Frequency.FromKilohertz(14_032),
memory.Where(Bands.Band20M, ModeCategory.Cw, BandPlan.Default));
Assert.Equal(
Frequency.FromKilohertz(14_240),
memory.Where(Bands.Band20M, ModeCategory.Phone, BandPlan.Default));
}
[Fact]
public void ABandWithNoPlanStartsAtItsBottomEdge()
{
BandMemory memory = new();
Assert.Equal(
Bands.Band60M.Low,
memory.Where(Bands.Band60M, ModeCategory.Phone, BandPlan.Default));
}
}