Log the time the BARTG exchange went out
The BARTG RTTY contest sends the time with the serial number, and both stations log the time the other one sent. The entry window now has the report, serial and time boxes N1MM's has, and the time this station sent is stamped into the MiscText column as the exchange message goes out, or at log time when nothing sent it. The Cabrillo line writes that time and falls back to the time of the contact when the column is empty, which is what N1MM writes, in N1MM's columns. The total score was points times every multiplier. N1MM's class works out points times the countries and areas together, times the continents. Per-contact points and multiplier flags do not change, so the station's 2022 log still scores contact for contact as N1MM did. N1MM has a class each for the March HF RTTY contest and the September sprint. This program has one contest holding the March rules under the sprint's name, and docs/unfinished.md now says so. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RoGtneMQaz4M9w7Kk49AVD
This commit is contained in:
@@ -55,6 +55,11 @@ public interface Contest
|
||||
/// contests the same question.
|
||||
bool UsesItuZones => false;
|
||||
|
||||
/// True for a contest that sends the time of the exchange as part of it.
|
||||
/// The time this station sent goes in the `MiscText` column, stamped as
|
||||
/// the message goes out. Only the BARTG RTTY contest asks for it.
|
||||
bool StampsSentTime => false;
|
||||
|
||||
/// True for a contest whose log carries QTC traffic as rows of its own.
|
||||
/// The log window then shows the series they belong to.
|
||||
bool HasQtcTraffic => false;
|
||||
|
||||
@@ -2,12 +2,19 @@ using Nonemm.Core;
|
||||
|
||||
namespace Nonemm.Contests.Rules;
|
||||
|
||||
/// The BARTG RTTY Sprint. Every contact is one point; the multipliers are the
|
||||
/// The BARTG RTTY contest. Every contact is one point. The multipliers are the
|
||||
/// countries and the US and Canadian call areas once per band, and the
|
||||
/// continents once in the contest.
|
||||
/// continents once in the contest; the score is the points times the countries
|
||||
/// and areas together, times the continents.
|
||||
///
|
||||
/// The exchange is a serial number. N1MM also writes the time of the contact
|
||||
/// into the exchange column, which the Cabrillo line carries.
|
||||
/// The exchange is a report, a serial number and the time the exchange was
|
||||
/// sent. The time this station sends is stamped into the `MiscText` column as
|
||||
/// the message goes out, which is the column N1MM keeps it in.
|
||||
///
|
||||
/// The rules are N1MM's `CBARTGSpring`, the March HF contest the station has
|
||||
/// logs of. N1MM's September sprint is a class of its own with a shorter
|
||||
/// exchange, and both of N1MM's names for these two contests open a log here
|
||||
/// with the rules below.
|
||||
public sealed class BartgSprint : Contest
|
||||
{
|
||||
public string Name => "BARTGRTTYS";
|
||||
@@ -18,9 +25,15 @@ public sealed class BartgSprint : Contest
|
||||
|
||||
public IReadOnlyList<ExchangeField> ExchangeFieldsFor(StationInfo me) =>
|
||||
[
|
||||
new ExchangeField("RST", ExchangeSlot.ReceivedReport, ExchangeFieldKind.Report),
|
||||
new ExchangeField("Nr", ExchangeSlot.SerialNumber, ExchangeFieldKind.Number),
|
||||
new ExchangeField("Time", ExchangeSlot.Exchange1, ExchangeFieldKind.Text) { Width = 4 },
|
||||
];
|
||||
|
||||
/// The time this station sent goes in the `MiscText` column, as it does in
|
||||
/// N1MM.
|
||||
public bool StampsSentTime => true;
|
||||
|
||||
public IReadOnlyList<string> MultiplierNames => ["Countries", "Areas", "Continents"];
|
||||
|
||||
public DupeScope DupeScope => DupeScope.PerBand;
|
||||
@@ -54,18 +67,34 @@ public sealed class BartgSprint : Contest
|
||||
}
|
||||
|
||||
public int TotalScore(ScoreTally tally, ContestEntry entry) =>
|
||||
tally.Points * tally.TotalMultipliers;
|
||||
tally.Points
|
||||
* (tally.MultiplierCount(1) + tally.MultiplierCount(2))
|
||||
* Math.Max(1, tally.MultiplierCount(3));
|
||||
|
||||
public CabrilloExchange CabrilloExchange(Qso qso, StationInfo me, ContestEntry entry) =>
|
||||
new(
|
||||
[
|
||||
new CabrilloField(me.Callsign, 13),
|
||||
new CabrilloField($"{qso.SentNumber:000}", 4),
|
||||
new CabrilloField(qso.TimestampUtc.ToString("HHmm"), 4),
|
||||
new CabrilloField(me.Callsign, 10),
|
||||
new CabrilloField(qso.SentReport, 3),
|
||||
new CabrilloField($"{qso.SentNumber:0000}", 4),
|
||||
new CabrilloField(SentTime(qso), 4),
|
||||
],
|
||||
[
|
||||
new CabrilloField(qso.Call.Text, 13),
|
||||
new CabrilloField($"{qso.ReceivedNumber:000}", 4),
|
||||
new CabrilloField(qso.Exchange1, 4),
|
||||
new CabrilloField(qso.Call.Text, 10),
|
||||
new CabrilloField(qso.ReceivedReport, 3),
|
||||
new CabrilloField($"{qso.ReceivedNumber:0000}", 4),
|
||||
new CabrilloField(FourDigits(qso.Exchange1), 4),
|
||||
]);
|
||||
|
||||
/// The time this station sent, and the time of the contact for a contact
|
||||
/// logged before that was filled in. N1MM writes the same two.
|
||||
private static string SentTime(Qso qso) =>
|
||||
qso.MiscText.Trim().Length > 0
|
||||
? FourDigits(qso.MiscText)
|
||||
: qso.TimestampUtc.ToString("HHmm");
|
||||
|
||||
/// `905` is written `0905`, which is what N1MM writes for a time typed
|
||||
/// without its leading zero.
|
||||
private static string FourDigits(string time) =>
|
||||
int.TryParse(time.Trim(), out int minutes) ? $"{minutes:0000}" : time.Trim();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user