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:
@@ -261,4 +261,35 @@ public class UdcScoringTests
|
||||
Assert.True(Contest("ZoneType=IARU").UsesItuZones);
|
||||
Assert.False(Contest("ZoneType=CQ").UsesItuZones);
|
||||
}
|
||||
|
||||
/// The received exchange of a contest where one side sends a section and
|
||||
/// the other a serial number lands in the same column, and only the
|
||||
/// section counts. N1MM checks it against the contest's section list; the
|
||||
/// lists are not held here, so an exchange that is all digits is taken for
|
||||
/// a serial number.
|
||||
[Fact]
|
||||
public void ASerialNumberIsNoSectionMultiplier()
|
||||
{
|
||||
UserDefinedContest contest = Contest("MultSqlString=Section", "IsMultPer=1");
|
||||
Assert.Empty(LogFor(contest).Judge(TestLog.Contact("IK2XYZ", section: "058")).NewMultipliers);
|
||||
Assert.Single(LogFor(contest).Judge(TestLog.Contact("OM3XYZ", section: "NOV")).NewMultipliers);
|
||||
}
|
||||
|
||||
/// `Country` is what a published file writes where the editor writes
|
||||
/// `CountryPrefix`.
|
||||
[Fact]
|
||||
public void CountryIsTheSameSourceAsCountryPrefix() =>
|
||||
Assert.Equal(
|
||||
"I",
|
||||
LogFor(Contest("MultSqlString=Country", "IsMultPer=4"))
|
||||
.Judge(TestLog.Contact("IK2XYZ"))
|
||||
.NewMultipliers.Single().Value);
|
||||
|
||||
[Fact]
|
||||
public void OtherCountryIsEveryCountryButMine()
|
||||
{
|
||||
UserDefinedContest contest = Contest("PointsPerContact=MyCountry, 0, OtherCountry, 2");
|
||||
Assert.Equal(0, Points(contest, TestLog.Contact("DL9XYZ")));
|
||||
Assert.Equal(2, Points(contest, TestLog.Contact("JA1XYZ")));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user