Add CW keying, function key messages and the documentation

The function keys send through cwdaemon or a WinKeyer, with N1MM's message
macros. Escape stops sending.

Settings are read with the reflection serializer rather than a generated one:
the generated one hands back null for every property the file leaves out
instead of the value the property is declared with, which crashed the program
the first time a new setting was added.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Erik
2026-08-27 11:23:30 +00:00
parent d96cbe146b
commit f5aa77ece3
25 changed files with 1002 additions and 26 deletions

View File

@@ -1,22 +1,58 @@
using Nonemm.Core;
namespace Nonemm.App;
/// The function key messages. The text uses N1MM's macro names so a message
/// file written for either program means the same thing.
/// written for either program says the same thing.
public static class Messages
{
public static readonly IReadOnlyList<(string Key, string Label, string Text)> Defaults =
public static readonly IReadOnlyList<(string Key, string Label)> Keys =
[
("F1", "CQ", "CQ TEST {MYCALL} {MYCALL}"),
("F2", "Exch", "{SENTRST} {EXCH}"),
("F3", "TU", "TU {MYCALL}"),
("F4", "MyCall", "{MYCALL}"),
("F5", "HisCall", "{CALL}"),
("F6", "Repeat", "{EXCH} {EXCH}"),
("F7", "?", "?"),
("F8", "Agn", "AGN"),
("F9", "Nr?", "NR?"),
("F10", "Call?", "CALL?"),
("F11", "Spot", ""),
("F12", "Wipe", ""),
("F1", "CQ"), ("F2", "Exch"), ("F3", "TU"), ("F4", "MyCall"),
("F5", "HisCall"), ("F6", "Repeat"), ("F7", "?"), ("F8", "Agn"),
("F9", "Nr?"), ("F10", "Call?"), ("F11", "Spot"), ("F12", "Wipe"),
];
public static readonly IReadOnlyList<string> DefaultCw =
[
"CQ TEST {MYCALL} {MYCALL}",
"{SENTRST} {EXCH}",
"TU {MYCALL}",
"{MYCALL}",
"{CALL}",
"{EXCH} {EXCH}",
"?",
"AGN",
"NR?",
"CALL?",
"",
"",
];
/// Phone messages name a recording to play; the text is what would be said.
public static readonly IReadOnlyList<string> DefaultPhone =
[
"CQ CONTEST {MYCALL}",
"{EXCH}",
"THANK YOU {MYCALL}",
"{MYCALL}",
"{CALL}",
"{EXCH} {EXCH}",
"PLEASE REPEAT",
"AGAIN",
"NUMBER PLEASE",
"YOUR CALL PLEASE",
"",
"",
];
public static IReadOnlyList<string> For(
ModeCategory mode,
IReadOnlyList<string> cw,
IReadOnlyList<string> phone)
{
IReadOnlyList<string> stored = mode == ModeCategory.Phone ? phone : cw;
IReadOnlyList<string> fallback = mode == ModeCategory.Phone ? DefaultPhone : DefaultCw;
return stored.Count == Keys.Count ? stored : fallback;
}
}