Take WAE QTC traffic down

Ctrl+Z opens the QTC window for the station being worked, which is the key N1MM
puts it on, and the window is laid out the way N1MM lays it out: the header,
ten lines of time, callsign and serial number, an Agn and a Cfm button beside
each, Clear, Close and Cancel underneath, and the same colours — green for a
line that will be saved, red for one still empty, yellow for one that cannot be
read. Enter and Tab move forward and space moves within a line, so a line can be
walked while listening to it.

Sending, the lines are filled from the log and cannot be edited: the contacts
not reported to anybody yet, oldest first, never the station being worked, and
never past the ten any station may have. The rule for what has been reported is
N1MM's — a contact counts as reported when a QTC row carries its call and the
serial we sent it — so the pair is kept in the row the way N1MM keeps it.

Which way traffic goes is not the operator's choice on CW and SSB: Europe
receives and the rest of the world sends. On RTTY it goes both ways, and there
the window carries a switch. That is the one piece of the workflow that is ours
rather than N1MM's, which toggles a QTC mode outside the window instead.

Nothing here transmits. N1MM sends the lines on CW and RTTY and plays recorded
voice messages on SSB; we have no QTC message templates, no voice keyer and no
digital window, so Agn, Cfm and RX Ready move the cursor and the operator sends
by hand.

Running it caught what the tests could not: focus set in the constructor does
not stick, so the first thing typed into a freshly opened window was dropped and
every field after it took the value of the one before.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-28 00:02:47 +00:00
parent 8961677354
commit 9ae5078c84
11 changed files with 886 additions and 11 deletions

View File

@@ -254,6 +254,10 @@ public sealed partial class EntryWindow : Window
e.Handled = true;
MoveFocus(forward: !e.KeyModifiers.HasFlag(KeyModifiers.Shift));
break;
case Key.Z when e.KeyModifiers.HasFlag(KeyModifiers.Control):
e.Handled = true;
_ = OpenQtcWindow();
break;
case Key.B when e.KeyModifiers.HasFlag(KeyModifiers.Control):
e.Handled = true;
ToggleAlternatingCq();
@@ -456,6 +460,50 @@ public sealed partial class EntryWindow : Window
}
}
/// WAE QTC traffic, on Ctrl+Z as in N1MM. The contact is logged first if it
/// is still in the boxes: the traffic belongs to a station that has been
/// worked.
private async Task OpenQtcWindow()
{
if (Logging is null)
{
return;
}
QtcTraffic traffic = new(Logging);
if (!traffic.IsWaeContest)
{
Status("QTC traffic is a WAE thing");
return;
}
if (Logging.Entry.Call.Trim().Length > 0 && Logging.Entry.IsComplete)
{
OnEnter();
}
string typed = Logging.Entry.Call.Trim();
Callsign station = Callsign.Parse(
typed.Length > 0 ? typed : Logging.Log.Qsos.LastOrDefault()?.Call.Text ?? "");
QtcDirection direction = traffic.DirectionFor(station, out string why);
if (direction == QtcDirection.None)
{
Status(why);
return;
}
if (direction is QtcDirection.Send && traffic.ToSend(station).Count == 0)
{
Status("nothing left to report to " + station.Text);
return;
}
QtcWindow window = new(session, Logging, station, direction);
bool saved = await window.ShowDialog<bool>(this);
Logging.Wipe();
SyncBoxes();
boxes[0].Focus();
Refresh();
Status(saved
? $"QTC traffic with {station.Text} logged"
: $"QTC traffic with {station.Text} left alone");
}
/// Alternating CQ: CQ on this radio, then the other as each message ends.
/// N1MM calls it dueling CQs and puts it on the same key.
private void ToggleAlternatingCq()