Let the published .udc files score the contests they are written for

I wrote SA 10 and OK/OM DX SSB in code after two failed attempts at the
download. The download works — the page posts a nonce with the form — and the
files say I got both contests wrong.

SA 10 is deleted from the code. Its file scores the station's log to the
contact, where the code had the wrong Cabrillo name and counted its multipliers
once in the contest rather than once per mode.

OK/OM DX now covers the CW running only, which is what N1MM's class is for and
what N1MM's own documentation says: the SSB running has different rules and a
pair of .udc files, one for each side. The CW rules go back to the class, so
Czechia and Slovakia are one side of the contest again. With the SSB files in
place both of the station's SSB logs score to the contact.

Reading those files turned up four things in the .udc reader: a file whose
extension is upper case was passed over, `Country` was not read as a
multiplier source, `OtherCountry` was not a points condition, and a section
multiplier counted the serial numbers the other side of a contest sends.

All Asian stays in code — N1MM has a class for it after all — with the Cabrillo
name and the band table it uses.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoGtneMQaz4M9w7Kk49AVD
This commit is contained in:
2026-08-31 10:00:21 +00:00
parent 264036f0f2
commit 38e9010802
13 changed files with 151 additions and 155 deletions

View File

@@ -86,13 +86,13 @@ public sealed class UdcMultiplier
private string? ValueFor(QsoContext qso) => source switch
{
"COUNTRYPREFIX" => qso.CountryPrefix,
"COUNTRYPREFIX" or "COUNTRY" => qso.CountryPrefix,
"EU_COUNTRY" or "AS_COUNTRY" or "NA_COUNTRY" or "SA_COUNTRY" or "AF_COUNTRY" or "OC_COUNTRY" =>
CountryOnContinent(qso, source[..2]),
"WPXPREFIX" => qso.Qso.Call.WpxPrefix(),
"2LPREFIX" => Truncate(qso.Qso.Call.Text, 2),
"LASTLETTER" => LastLetter(qso.Qso.Call.Text),
"SECTION" or "SECT" => Upper(qso.Qso.Section),
"SECTION" or "SECT" => SectionName(qso.Qso.Section),
"EXCHANGE" or "EXCH" => Upper(qso.Qso.Exchange1),
"MISC" or "MISCTEXT" => Upper(qso.Qso.MiscText),
"COMMENT" => Upper(qso.Qso.Comment),
@@ -127,6 +127,18 @@ public sealed class UdcMultiplier
private static string Upper(string text) => text.Trim().ToUpperInvariant();
/// A section multiplier ignores a value that is all digits. N1MM checks the
/// received exchange against the section list the contest names, and a file
/// whose section column also carries the serial numbers the other side of
/// the contest sends — OK/OM DX SSB is one — would otherwise count every
/// serial number as a multiplier. The section lists themselves are not held
/// here.
private static string? SectionName(string text)
{
string section = Upper(text);
return section.Length > 0 && section.All(char.IsAsciiDigit) ? null : section;
}
private static string? LastLetter(string call)
{
string trimmed = call.Trim().ToUpperInvariant();