Show the boxes N1MM shows for each contest
The entry window had a fixed set of boxes with a Name and Comment box beside the exchange. N1MM lays out one row of boxes per contest and nothing else, so this does the same: general logging keeps Name and Comment, and a contest gets the boxes it exchanges. Two new members on `Contest` carry the cases where the boxes and the log columns are not the same list: - `FromExchange1` spreads what was typed in one box across the log columns. Where the other station sends a serial or a district code depending on where it is, N1MM gives it one box and sorts the value into the number, section or zone column from there, so the score and the Cabrillo file read it from the same column N1MM does. - `LogFieldsFor` gives the log window its own column list. Sweepstakes takes the whole exchange in one box and logs it in four columns; `SweepstakesExchange` parses `72 A 74 SCV` in any order, reading from the last word back as N1MM does. The sent serial is now marked as not required and space steps over it along with the two report boxes, because nobody types the number going out. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015NZkFxHde1iifAQemFTHxf
This commit is contained in:
@@ -17,19 +17,29 @@ public sealed class Arrl10Metre : Contest
|
||||
|
||||
public string CabrilloName => "ARRL-10";
|
||||
|
||||
public IReadOnlyList<ExchangeField> ExchangeFieldsFor(StationInfo me) =>
|
||||
[
|
||||
new ExchangeField("RST", ExchangeSlot.ReceivedReport, ExchangeFieldKind.Report),
|
||||
new ExchangeField("S/P", ExchangeSlot.Section, ExchangeFieldKind.UsStateOrCanadianProvince),
|
||||
new ExchangeField("Nr", ExchangeSlot.Exchange1, ExchangeFieldKind.Number),
|
||||
];
|
||||
/// One box takes the state, province or serial number the other station
|
||||
/// sends, as N1MM has it. The sent serial box is there only where this
|
||||
/// station sends a number rather than a state.
|
||||
public IReadOnlyList<ExchangeField> ExchangeFieldsFor(StationInfo me) => SendsState(me.CountryPrefix)
|
||||
?
|
||||
[
|
||||
new ExchangeField("Snt", ExchangeSlot.SentReport, ExchangeFieldKind.Report, IsRequired: false),
|
||||
new ExchangeField("Rcv", ExchangeSlot.ReceivedReport, ExchangeFieldKind.Report),
|
||||
new ExchangeField("Exch", ExchangeSlot.Exchange1, ExchangeFieldKind.Text) { Width = 6 },
|
||||
]
|
||||
:
|
||||
[
|
||||
new ExchangeField("Snt", ExchangeSlot.SentReport, ExchangeFieldKind.Report, IsRequired: false),
|
||||
new ExchangeField("SentNR", ExchangeSlot.SentNumber, ExchangeFieldKind.Number, IsRequired: false),
|
||||
new ExchangeField("Rcv", ExchangeSlot.ReceivedReport, ExchangeFieldKind.Report),
|
||||
new ExchangeField("Exch", ExchangeSlot.Exchange1, ExchangeFieldKind.Text) { Width = 6 },
|
||||
];
|
||||
|
||||
public bool SkipsField(ExchangeField field, CountryLookup? their) => field.Slot switch
|
||||
{
|
||||
ExchangeSlot.Section => their is not null && !SendsState(their.Entity.PrimaryPrefix),
|
||||
ExchangeSlot.Exchange1 => their is not null && SendsState(their.Entity.PrimaryPrefix),
|
||||
_ => false,
|
||||
};
|
||||
/// A number is a serial and anything else is a state or province.
|
||||
public Qso FromExchange1(Qso qso, string typed) =>
|
||||
int.TryParse(typed, out int number)
|
||||
? qso with { ReceivedNumber = number, Section = "" }
|
||||
: qso with { ReceivedNumber = 0, Section = typed.Trim().ToUpperInvariant() };
|
||||
|
||||
public IReadOnlyList<string> MultiplierNames => ["States", "Countries"];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user