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:
2026-09-09 20:12:37 +00:00
co-authored by Claude Opus 5
parent 6e24e00ec8
commit bae40bb04e
47 changed files with 702 additions and 277 deletions
@@ -32,4 +32,51 @@ public class SweepstakesTests
[Fact]
public void SomethingThatIsNotASectionCountsForNothing() =>
Assert.Empty(Log().Judge(TestLog.Contact("K1ABC", section: "ZZ")).NewMultipliers);
/// The whole exchange goes in one box, in any order, and comes back out in
/// four columns. These are the shapes N1MM's box takes.
[Theory]
[InlineData("72 A 74 SCV")]
[InlineData("72A 74SCV")]
[InlineData("72 A 74SCV")]
public void TheOneBoxIsReadBackAsFourFields(string typed)
{
SweepstakesExchange exchange = SweepstakesExchange.Parse(typed);
Assert.Equal(72, exchange.Number);
Assert.Equal("A", exchange.Precedence);
Assert.Equal(74, exchange.Check);
Assert.Equal("SCV", exchange.Section);
}
[Fact]
public void TheOneBoxFillsTheContact()
{
Qso logged = new Sweepstakes(ModeCategory.Cw)
.FromExchange1(TestLog.Contact("K1ABC"), "72A 74SCV");
Assert.Equal(72, logged.ReceivedNumber);
Assert.Equal("A", logged.Precedence);
Assert.Equal(74, logged.Check);
Assert.Equal("SCV", logged.Section);
}
/// The exchange is one box and four log columns, as it is in N1MM.
[Fact]
public void TheLogKeepsTheFourPartsApart()
{
Sweepstakes contest = new(ModeCategory.Cw);
Assert.Equal(
[ExchangeSlot.SentNumber, ExchangeSlot.Exchange1],
contest.ExchangeFieldsFor(TestLog.UnitedStates).Select(f => f.Slot).ToList());
Assert.Equal(
[
ExchangeSlot.SerialNumber,
ExchangeSlot.Precedence,
ExchangeSlot.Check,
ExchangeSlot.Section,
],
contest.LogFieldsFor(TestLog.UnitedStates).Select(f => f.Slot).ToList());
}
}