Keep an excluded contact out of the score the way N1MM does
Three things were wrong with a contact the operator takes out of the claimed score. The decompiled reference gives the rule in four places: - `Contest.cs:437` returns zero points when `IsClaimedQso` is 0. - `ContestInstance.cs:307` builds the where clause `CLAIMEDQSO = 1`, which the dupe search (`DBSupport.cs:1189`) and the multiplier search (`DBSupport.cs:1327`) both use, so an unclaimed contact takes nothing away from a later one. - The score query (`DBSupport.cs:1807`) adds `ContactType <> 'D'`, which the other two do not. A contact marked as a dupe is therefore still searched for dupes and multipliers, and is left out of the score alone. - `Contact.cs:1563`, `3307` and `3881` write `X-QSO:` rather than dropping the contact from the Cabrillo file. `ContestLog` scored an unclaimed contact in full, and the Cabrillo writer left it out of the file. `Qso.IsInScore` now holds the score rule and `StatisticsPivot` uses it instead of its own copy. The same reference also fixes the sent serial in three Cabrillo exporters. ARRL 10M, Ukrainian DX and YO DX HF formatted the sent exchange from the station rather than the contact, so a DX entrant exported `001` on every line. N1MM reads the contact's own number: `CArrl10m.cs:122` writes it unpadded, `CUkrainian.cs:232` and `CYOHFDX.cs:167` pad it to three digits. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015NZkFxHde1iifAQemFTHxf
This commit is contained in:
@@ -54,7 +54,7 @@ public sealed class CabrilloWriter
|
||||
}
|
||||
Line(text, "CREATED-BY", header.CreatedBy);
|
||||
|
||||
foreach (Qso qso in qsos.Where(q => q.IsClaimed).OrderBy(q => q.TimestampUtc))
|
||||
foreach (Qso qso in qsos.OrderBy(q => q.TimestampUtc))
|
||||
{
|
||||
text.Append(QsoLine(qso)).Append("\r\n");
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public sealed class CabrilloWriter
|
||||
public string QsoLine(Qso qso)
|
||||
{
|
||||
CabrilloExchange exchange = contest.CabrilloExchange(qso, me, entry);
|
||||
StringBuilder line = new(contest.IsContact(qso) ? "QSO: " : "QTC: ");
|
||||
StringBuilder line = new(RecordName(qso));
|
||||
line.Append(CabrilloBands.Designator(qso.Frequency).PadLeft(5)).Append(' ');
|
||||
line.Append(qso.Mode.CabrilloCode.PadRight(2)).Append(' ');
|
||||
line.Append(qso.TimestampUtc.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)).Append(' ');
|
||||
@@ -79,6 +79,18 @@ public sealed class CabrilloWriter
|
||||
return line.ToString();
|
||||
}
|
||||
|
||||
/// A contact the operator has excluded from the claimed score is still
|
||||
/// written, under `X-QSO:` rather than `QSO:`. That is what N1MM writes,
|
||||
/// and the sponsors read it as a contact the entrant is not claiming.
|
||||
private string RecordName(Qso qso)
|
||||
{
|
||||
if (!contest.IsContact(qso))
|
||||
{
|
||||
return "QTC: ";
|
||||
}
|
||||
return qso.IsClaimed ? "QSO: " : "X-QSO: ";
|
||||
}
|
||||
|
||||
/// Every column is the width the sponsor asks for and one space, and a
|
||||
/// value longer than its column is cut, which is what N1MM writes.
|
||||
private static void Append(StringBuilder line, IReadOnlyList<CabrilloField> fields)
|
||||
|
||||
Reference in New Issue
Block a user