Write what N1MM needs before it will open a log
Checked by opening a log this program wrote in N1MM 1.0.11031. Three things it rejected: - a log naming a contest with no row in the Contest table throws "No current row" in Contest.FromRow, so the definition row is written whenever a contest is opened; - an empty overlay category is answered with "Invalid Overlay Category:", so an entry with no overlay now says "N/A", and the dialog offers N1MM's list; - the sent exchange omits the report, which is what N1MM's own contest dialog asks for. With those three fixed N1MM opens the log and shows the contacts. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -92,11 +92,17 @@ public sealed class AppSession : IDisposable
|
||||
return stored;
|
||||
}
|
||||
|
||||
/// N1MM reads the `Contest` table when it opens a log, so the definition is
|
||||
/// written again whenever a contest is opened, not only when it is created.
|
||||
private void SaveDefinition(Contest contest) =>
|
||||
Store.SaveContestDefinition(ContestDefinitions.For(contest));
|
||||
|
||||
public void OpenContest(int contestNumber)
|
||||
{
|
||||
ContestInstance instance = Store.Contest(contestNumber)
|
||||
?? throw new InvalidOperationException($"no contest numbered {contestNumber} in the log");
|
||||
Contest contest = Registry.Create(instance.ContestName, ModeCategoryOf(instance));
|
||||
SaveDefinition(contest);
|
||||
Logging = new LoggingSession(Store, contest, instance, Settings.Station.ToStationInfo(), Countries);
|
||||
Logging.Changed += (_, _) => Changed?.Invoke(this, EventArgs.Empty);
|
||||
Logging.Logged += (_, qso) => Bandmap.Add(new Spot(
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<ComboBox Name="TransmitterBox" Grid.Row="5" Grid.Column="2" HorizontalAlignment="Stretch" />
|
||||
|
||||
<TextBlock Grid.Row="6" Text="Overlay" FontSize="11" Opacity="0.7" Margin="0,6,0,0" />
|
||||
<TextBox Name="OverlayBox" Grid.Row="7" />
|
||||
<ComboBox Name="OverlayBox" Grid.Row="7" HorizontalAlignment="Stretch" />
|
||||
<TextBlock Grid.Row="6" Grid.Column="2" Text="Operators" FontSize="11" Opacity="0.7" Margin="0,6,0,0" />
|
||||
<TextBox Name="OperatorsBox" Grid.Row="7" Grid.Column="2" />
|
||||
</Grid>
|
||||
|
||||
@@ -31,6 +31,11 @@ public sealed partial class ContestSetupDialog : Window
|
||||
AssistedBox.SelectedIndex = 0;
|
||||
TransmitterBox.ItemsSource = new[] { "ONE", "TWO", "LIMITED", "UNLIMITED", "SWL" };
|
||||
TransmitterBox.SelectedIndex = 0;
|
||||
OverlayBox.ItemsSource = new[]
|
||||
{
|
||||
"N/A", "ROOKIE", "BAND-LIMITED", "TB-WIRES", "OVER-50", "HQ", "NOVICE-TECH", "EXPERT",
|
||||
};
|
||||
OverlayBox.SelectedIndex = 0;
|
||||
OperatorsBox.Text = session.Settings.Station.Callsign;
|
||||
ShowChosen();
|
||||
}
|
||||
@@ -67,7 +72,7 @@ public sealed partial class ContestSetupDialog : Window
|
||||
ModeCategory = Text(ModeBox),
|
||||
AssistedCategory = Text(AssistedBox),
|
||||
TransmitterCategory = Text(TransmitterBox),
|
||||
OverlayCategory = OverlayBox.Text ?? "",
|
||||
OverlayCategory = Text(OverlayBox),
|
||||
Operators = OperatorsBox.Text ?? "",
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user