Work QTC traffic on RTTY the way N1MM does

The QTC window put nothing on the air on RTTY except the lines themselves,
so the operator typed the rest into the digital window's transmit pane and
copied the lines by hand. N1MM sends a message for each step and fills the
lines in from a click. Both are here now, with N1MM's messages, N1MM's
defaults and N1MM's settings behind them.

The messages, all of them settings in the QTC window's setup area:

- RX Ready, `WAERXReadyText`, `{ENTERLF}I AM QRV BK`
- All Agn, `WAEAllAgnText`, `{ENTERLF}ALL AGN ALL AGN BK`
- Agn n, `WAEAGNText`, `{ENTERLF}AGN QTC: $ $ $ `, where `$` is the line
- Save, `WAESaveQTCText`, `{ENTERLF}R R R ALL OK BK`
- R U QRV, `WAERUQRVText`, `{ENTERLF}R U QRV BK`
- Save, reading traffic out, `WAESSaveQTCText`, `{ENTERLF}GL DE {MYCALL}`

Each keys the transmitter, sends the text and drops it again, and an empty
one sends nothing. The line spacing default is N1MM's `{ENTERLF}` rather
than `{ENTER}`, which was wrong.

The buttons: R U QRV and Snd Hdr were hidden while reading traffic out on
RTTY, though that is where N1MM starts — R U QRV is the first button
pressed. All Agn is new, and so is the S button on each line, which strikes
a line through a QTC that arrived too broken to read so the rows after it
keep their places; Agn n clears the strike and asks for that line again.

Clicking a line in the digital window fills the next row, which is how the
series is copied on RTTY: the other station sends the header and all ten
lines in one transmission. A click anywhere in a line hands the whole line
to the QTC window, which reads the time, the callsign and the serial number
out of it by shape and flashes the line to show it was taken. A line that is
not a QTC is left to mean what a click always means there.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0157i7PiZyqBkquxS9A6FTdQ
This commit is contained in:
2026-09-10 20:03:18 +00:00
co-authored by Claude Opus 5
parent e0f307968e
commit f24cab0ae5
11 changed files with 418 additions and 27 deletions
@@ -3,7 +3,9 @@ using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.Threading;
using Avalonia.VisualTree;
using Nonemm.App.Theming;
using Nonemm.Session;
namespace Nonemm.App.Windows;
@@ -229,6 +231,10 @@ public sealed partial class DigitalWindow
RightClick(e);
return;
}
if (TakenAsQtc(e))
{
return;
}
string clicked = e.Source is TextBlock block ? DigitalReceiver.Scrub(block.Text ?? "") : "";
if (clicked.Length == 0)
{
@@ -250,6 +256,51 @@ public sealed partial class DigitalWindow
Copy(clicked, keys.HasFlag(KeyModifiers.Alt), e.ClickCount > 1);
}
/// While the QTC window is taking traffic down on RTTY, a click anywhere in
/// a line hands the whole line to it rather than picking the word out: the
/// other station sends the header and the whole series in one
/// transmission, and the operator clicks each line as it prints. The line
/// flashes to show which one was taken, which is what N1MM does with it.
/// False when there is no QTC window, or the line is not a QTC, and then
/// the click means what it always means.
private bool TakenAsQtc(PointerPressedEventArgs e)
{
if (session.QtcLines is not { } take || LineUnder(e.Source as Visual) is not { } border)
{
return false;
}
string text = DigitalReceiver.Scrub(string.Concat(
Body(border).Children.OfType<TextBlock>().Select(b => b.Text ?? "")));
if (text.Trim().Length == 0 || !take(text))
{
return false;
}
Flash(border);
return true;
}
/// The line a clicked control belongs to: the border a printed line lives
/// in, walking up from whatever was under the pointer.
private static Border? LineUnder(Visual? clicked)
{
for (Visual? at = clicked; at is not null; at = at.GetVisualParent())
{
if (at is Border border && border.Child is WrapPanel)
{
return border;
}
}
return null;
}
/// A moment of colour behind the line that was taken.
private static void Flash(Border border)
{
IBrush was = border.Background ?? Brushes.Transparent;
border.Background = Themes.Brush(Themes.Current.QuickEdit);
DispatcherTimer.RunOnce(() => border.Background = was, TimeSpan.FromMilliseconds(400));
}
/// Where a clicked word goes. N1MM's order: an empty callsign box takes a
/// call, a callsign box that already holds one takes another only onto the
/// call stack or on a double click, and everything else is an exchange