Files
Nonemm/src/Nonemm.Spotting/Spot.cs
T
erikbrockoandClaude Sonnet 5.5 1e0fb3eb08 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>
2026-10-24 12:12:35 +00:00

61 lines
2.0 KiB
C#

using Nonemm.Core;
namespace Nonemm.Spotting;
/// One station on the bandmap.
public sealed record Spot(
Callsign Call,
Frequency Frequency,
DateTime AtUtc,
SpotSource Source,
string Spotter = "",
string Comment = "")
{
/// Where the station is listening when it is working split, read out of the
/// comment. Zero when it is not.
public Frequency Qsx { get; init; }
/// False for a mark on the bandmap that is not a station. Nothing judges
/// one, nothing offers it as a call to work, and space does not take it
/// into the callsign box.
public bool IsStation { get; init; } = true;
/// N1MM's Mark button leaves one of these where the radio is, to say the
/// frequency is busy and not to come back to it. The label is N1MM's, and
/// carries the time the mark was left.
public static Spot Mark(Frequency where, DateTime atUtc, string spotter = "") =>
new(
Callsign.Parse($"Busy@{atUtc:HH:mm:ss}"),
where,
atUtc,
SpotSource.Operator,
spotter,
"Non-Counting Station")
{
IsStation = false,
};
/// The computer on the network that put the spot on the bandmap, or empty
/// for a spot that came from the cluster.
public string Computer { get; init; } = "";
/// A spot an operator put on a bandmap, here or on another computer, as
/// opposed to one from the cluster.
public bool IsLocal => Source == SpotSource.Operator && IsStation;
/// The pseudospot that marks where the operator is running. It is drawn on
/// the bandmap and is never added to it.
public bool IsCqFrequency { get; init; }
public static Spot CqFrequency(Frequency where, DateTime atUtc) =>
new(Callsign.Parse("CQ Frequency"), where, atUtc, SpotSource.Operator)
{
IsStation = false,
IsCqFrequency = true,
};
public bool IsSplit => Qsx.Hertz > 0;
public Band? Band => Bands.ForFrequency(Frequency);
}