Let Enter send the message the contact has got to
ESM is how most people run N1MM, and it was not here at all — not in the code,
not even in the list of what is missing. Config ▸ ESM turns it on and it stays
on between runs.
The decision is a table in N1MM's function-key documentation, and it is written
here as one: the state of the callsign and exchange boxes, whether the station
is running or searching, and whether the call and the exchange have gone out
already, give the function keys Enter sends and whether the contact is logged
after them. Esm.Decide is that table and nothing else, so it is tested against
every row rather than by clicking.
Searching: type a call, Enter sends your call, space moves to the exchange, and
once the exchange is filled in Enter sends yours and logs. Running: Enter calls
CQ, a call in the box makes Enter send his call and the exchange, and the next
Enter ends the contact and logs it. A dupe gets QSO B4 while running and nothing
while searching, unless dupes are worked, which is what N1MM recommends and what
this does out of the box. F1 puts a searching station into run mode.
The entry window highlights the keys Enter would send next, so what is about to
happen is on the screen rather than in the operator's head. `=` sends whatever
Enter last sent. Escape and F12 put ESM back to the start of a contact.
Send Corrected Call is in as well: copy SM3AB, send it, fix it to SM3ABC, and
the message that ends the contact goes out as "SM3ABC TU DL1ABC". That is why
N1MM's documentation says to put ! in F5 rather than {CALL}, so the default F5
message is now ! . F6 is QSO B4, which is the message ESM sends a dupe; it used
to repeat the exchange, which no part of the table asks for.
{EXCHSENT} means something again, now that there is an ESM state for it to set.
Worked end to end against a fake cwdaemon: a search-and-pounce contact logged in
four keystrokes, a run contact in three, both with the right text on the keyer
in the right order, and the corrected call in front of the last message.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,7 @@ public sealed partial class EntryWindow : Window
|
||||
private readonly int radioNumber;
|
||||
private EntryWindow? secondRadio;
|
||||
private readonly List<TextBox> boxes = [];
|
||||
private readonly List<Button> functionButtons = [];
|
||||
private readonly DispatcherTimer clock = new() { Interval = TimeSpan.FromSeconds(1) };
|
||||
private readonly Dictionary<Type, Window> openWindows = [];
|
||||
private bool updating;
|
||||
@@ -213,6 +214,10 @@ public sealed partial class EntryWindow : Window
|
||||
return;
|
||||
}
|
||||
Logging.Entry[index] = box.Text ?? "";
|
||||
if (index == 0 && Logging.Entry.Call.Trim().Length == 0)
|
||||
{
|
||||
ResetEsm();
|
||||
}
|
||||
Refresh();
|
||||
}
|
||||
|
||||
@@ -237,9 +242,14 @@ public sealed partial class EntryWindow : Window
|
||||
session.Alternating?.Stop();
|
||||
_ = session.Keyer?.AbortAsync();
|
||||
Logging.Wipe();
|
||||
ResetEsm();
|
||||
SyncBoxes();
|
||||
boxes[0].Focus();
|
||||
break;
|
||||
case Key.OemPlus when IsEsmOn && FocusedIsEntryBox():
|
||||
e.Handled = true;
|
||||
RepeatLastMessage();
|
||||
break;
|
||||
case Key.Tab when e.KeyModifiers.HasFlag(KeyModifiers.Control)
|
||||
&& e.KeyModifiers.HasFlag(KeyModifiers.Shift):
|
||||
e.Handled = true;
|
||||
@@ -297,6 +307,11 @@ public sealed partial class EntryWindow : Window
|
||||
boxes[0].Focus();
|
||||
return;
|
||||
}
|
||||
if (IsEsmOn)
|
||||
{
|
||||
_ = RunEsmAsync();
|
||||
return;
|
||||
}
|
||||
if (!Logging.Entry.IsComplete)
|
||||
{
|
||||
MoveFocus(forward: true);
|
||||
@@ -323,6 +338,7 @@ public sealed partial class EntryWindow : Window
|
||||
Status($"could not log the contact: {e.Message}");
|
||||
return;
|
||||
}
|
||||
ResetEsm();
|
||||
SyncBoxes();
|
||||
boxes[0].Focus();
|
||||
}
|
||||
@@ -379,6 +395,7 @@ public sealed partial class EntryWindow : Window
|
||||
|
||||
private void Refresh()
|
||||
{
|
||||
ShowEsmKeys();
|
||||
if (Logging is null)
|
||||
{
|
||||
VerdictText.Text = "";
|
||||
@@ -436,6 +453,7 @@ public sealed partial class EntryWindow : Window
|
||||
private void BuildFunctionKeys()
|
||||
{
|
||||
FunctionKeys.Children.Clear();
|
||||
functionButtons.Clear();
|
||||
for (int at = 0; at < Messages.Keys.Count; at++)
|
||||
{
|
||||
int index = at;
|
||||
@@ -444,6 +462,7 @@ public sealed partial class EntryWindow : Window
|
||||
button.Classes.Add("fkey");
|
||||
button.Click += (_, _) => RunFunctionKey(index);
|
||||
FunctionKeys.Children.Add(button);
|
||||
functionButtons.Add(button);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -462,11 +481,19 @@ public sealed partial class EntryWindow : Window
|
||||
return;
|
||||
case 11:
|
||||
Logging.Wipe();
|
||||
ResetEsm();
|
||||
SyncBoxes();
|
||||
boxes[0].Focus();
|
||||
return;
|
||||
default:
|
||||
// N1MM reserves F1 for CQ: pressing it while searching starts
|
||||
// running
|
||||
if (index == Esm.CallCq)
|
||||
{
|
||||
Logging.IsRunning = true;
|
||||
}
|
||||
SendMessage(index);
|
||||
Refresh();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user