Act on the .udc session, off-time and band-change settings

Four settings were read by nothing.

MultipleSessions = 0000/30 runs the contest in half-hour sessions from
00:00 UTC. The session is part of the dupe key, so a station worked in
an earlier one may be worked again, and ResetMultsEverySession and
ResetSNEverySession start the multipliers and the serial numbers over.

DupeQSOMinutesAgo is the other way back to a station: after so many
minutes rather than in the next session. The log holds the time of the
last contact per dupe key instead of only the key, and the setting's
IgnoreBand and ThisMode decide the scope, because a file that uses it
turns DupeType off.

MinimumOffTime drives the time on and time off the score summary now
shows under the score, and beside them are the band changes made against
the allowance for a contest that limits them. N1MM's countdown for the
minutes you have to stay on a new band needs its info window and is not
here.

UdcFile.Flag now takes 1 and 0 as well as True and False, which is what
these settings are written as and what N1MM reads.

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 13:32:01 +00:00
parent e3fa979584
commit 6c2ee0f78f
15 changed files with 551 additions and 28 deletions

View File

@@ -1,4 +1,5 @@
using Avalonia.Controls;
using Nonemm.Contests;
using Nonemm.Core;
namespace Nonemm.App.Windows;
@@ -59,9 +60,32 @@ public sealed partial class ScoreWindow : RefreshableWindow
session.Logging.Log.Tally.TotalMultipliers.ToString(),
header: true);
TotalText.Text = $"Claimed score {session.Logging.Log.TotalScore:N0}";
TimeSpan on = OperatingTime.On(
session.Logging.Log.Qsos,
session.Logging.Contest.MinimumOffTime);
TimeSpan off = OperatingTime.Off(
session.Logging.Log.Qsos,
session.Logging.Contest.MinimumOffTime);
TotalText.Text =
$"Claimed score {session.Logging.Log.TotalScore:N0}"
+ $" on {Hours(on)} off {Hours(off)}"
+ BandChanges();
}
/// The band changes made and the allowance, for a contest that limits
/// them, and nothing at all for the contests that do not.
private string BandChanges()
{
BandChangeRules rules = session.Logging!.Contest.BandChangesFor(session.Logging.Log.Entry);
return rules.IsCounted
? $" band changes {rules.CountedIn(session.Logging.Log.Qsos, DateTime.UtcNow)}/{rules.Max}"
: "";
}
/// Hours and minutes, which is how a sponsor asks for operating time.
private static string Hours(TimeSpan time) =>
$"{(int)time.TotalHours}:{time.Minutes:00}";
private static int MultiplierCount(Qso qso) =>
(qso.IsMultiplier1 ? 1 : 0) + (qso.IsMultiplier2 ? 1 : 0) + (qso.IsMultiplier3 ? 1 : 0);