A spot an operator put on a bandmap, here or on another computer, is drawn in bold. Its hover text names the computer instead of the spotter's callsign. A spot from another computer carries the name from the ADDSPOT message. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
50 lines
1.6 KiB
C#
50 lines
1.6 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;
|
|
|
|
public bool IsSplit => Qsx.Hertz > 0;
|
|
|
|
public Band? Band => Bands.ForFrequency(Frequency);
|
|
}
|