Mark the CQ frequency on the bandmap and leave Run when the radio moves off it

Starting Run stores the frequency in the position. The bandmap draws a
purple, bold "CQ Frequency" pseudospot there, which is not added to the
shared bandmap, and a click on it tunes back and sets Run. A move of more
than 3 kHz (a setting on the telnet Filters tab) while running switches
to search and pounce.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 12:12:35 +00:00
co-authored by Claude Sonnet 5.5
parent ab98c1b871
commit 1e0fb3eb08
14 changed files with 154 additions and 15 deletions
@@ -25,6 +25,45 @@ public class OperatingPositionTests
CountryPrefix = "DL",
};
[Fact]
public void RunningRemembersTheFrequencyItStartedOn()
{
OperatingPosition position = Session();
position.Tune(Frequency.FromKilohertz(14_025));
position.IsRunning = true;
position.Tune(Frequency.FromKilohertz(14_026));
Assert.Equal(Frequency.FromKilohertz(14_025), position.CqFrequency);
Assert.True(position.IsRunning);
}
[Fact]
public void MovingFarOffTheCqFrequencyGoesBackToSearching()
{
OperatingPosition position = Session();
position.Tune(Frequency.FromKilohertz(14_025));
position.IsRunning = true;
position.Tune(Frequency.FromKilohertz(14_028.5));
Assert.False(position.IsRunning);
Assert.Equal(Frequency.FromKilohertz(14_025), position.CqFrequency);
}
[Fact]
public void TheDistanceThatEndsRunningIsSet()
{
OperatingPosition position = Session();
position.CqLeaveHertz = 1_000;
position.Tune(Frequency.FromKilohertz(14_025));
position.IsRunning = true;
position.Tune(Frequency.FromKilohertz(14_026.5));
Assert.False(position.IsRunning);
}
/// N1MM's `{FORCELOG}`: a contact the checks refuse still goes in the log,
/// because one that was never logged cannot be fixed afterwards.
[Fact]
@@ -73,4 +73,21 @@ public class SpotDescriptionTests
Assert.Equal("14025.0 by SHACK-2, 41m ago", SpotDescription.Of(spot, Now));
}
[Fact]
public void TheCqFrequencyPseudospotSaysSo() =>
Assert.Equal("14025.0, your CQ frequency", SpotDescription.Of(Spot.CqFrequency(Frequency.FromKilohertz(14_025), At), Now));
[Theory]
[InlineData("CW 26 dB 1205Z", "CW 26 dB")]
[InlineData("1205Z", "")]
[InlineData("QRP 5W1205Z", "QRP 5W1205Z")]
public void TheTimeAtTheEndOfAClusterLineIsLeftOut(string comment, string expected)
{
Spot spot = new(
Callsign.Parse("JA1XYZ"), Frequency.FromKilohertz(14_025), At, SpotSource.Cluster,
"K1TTT", comment);
string second = SpotDescription.Of(spot, Now).Split('\n').ElementAtOrDefault(1) ?? "";
Assert.Equal(expected, second);
}
}