MMTTY and 2Tone have no socket or pipe interface: N1MM hosts XMMT.ocx and exchanges window messages with the engine. A Linux process cannot load that control, so bridge/nonemm-mmtty-bridge.exe hosts it under Wine and passes lines over its standard input and output. docs/digital-bridge.md states the protocol and what the control needs. The window is N1MM's: receive pane with coloured callsigns, grab list, call stacking, twenty-four macro buttons and the engine controls. One left click copies what is under it — a callsign to the callsign box, anything else to the exchange box the contest keeps for that kind of value. Config > Digital registers XMMT.ocx in the Wine prefix on its own, making the prefix first if it is not there. The engine, the bridge and the control start at the copies shipped beside the program. The bridge reads the control's own events. OnTranslateMessage carries only the messages the control has no event for, so nothing was ever decoded through it. hamlib's data mode names read as digital modes now, and a mode typed into the callsign box changes mode the way a frequency changes band, so a station with no radio can reach RTTY at all. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RoGtneMQaz4M9w7Kk49AVD
99 lines
3.5 KiB
C#
99 lines
3.5 KiB
C#
using Nonemm.Core;
|
|
using Nonemm.Session;
|
|
|
|
namespace Nonemm.App;
|
|
|
|
/// The function key messages, held as the text of an N1MM `.mc` file so the
|
|
/// same file works in either program. The macro names are N1MM's too.
|
|
public static class Messages
|
|
{
|
|
/// What an operator gets before touching anything. Twelve lines, so the
|
|
/// same messages are sent running and searching until the operator writes
|
|
/// the second twelve.
|
|
public const string DefaultCw =
|
|
"""
|
|
# CW function keys. The first twelve lines are F1 to F12 while running;
|
|
# add twelve more for the keys while searching.
|
|
F1 CQ,CQ TEST {MYCALL} {MYCALL}
|
|
F2 Exch,{SENTRST} {EXCH}
|
|
F3 TU,TU {MYCALL}
|
|
F4 MyCall,{MYCALL}
|
|
F5 HisCall,!
|
|
F6 QSO B4,QSO B4
|
|
F7 ?,?
|
|
F8 Agn,AGN
|
|
F9 Nr?,NR?
|
|
F10 Call?,CALL?
|
|
F11 Spot,
|
|
F12 Wipe,
|
|
""";
|
|
|
|
/// Phone messages name a recording to play; the text is what would be said.
|
|
public const string DefaultPhone =
|
|
"""
|
|
# Phone function keys.
|
|
F1 CQ,CQ CONTEST {MYCALL}
|
|
F2 Exch,{EXCH}
|
|
F3 TU,THANK YOU {MYCALL}
|
|
F4 MyCall,{MYCALL}
|
|
F5 HisCall,!
|
|
F6 QSO B4,QSO BEFORE
|
|
F7 ?,PLEASE REPEAT
|
|
F8 Agn,AGAIN
|
|
F9 Nr?,NUMBER PLEASE
|
|
F10 Call?,YOUR CALL PLEASE
|
|
F11 Spot,
|
|
F12 Wipe,
|
|
""";
|
|
|
|
/// The digital window's twenty-four buttons. N1MM keeps its own set in its
|
|
/// admin database, which is not a file this program reads, so these are
|
|
/// written from N1MM's published digital macro list: `{TX}` starts the
|
|
/// transmission, `{RX}` ends it, and the text macros are the ones every
|
|
/// other message uses.
|
|
public const string DefaultDigital =
|
|
"""
|
|
# The digital window's macro buttons, three rows of eight.
|
|
CQ,{TX}CQ CQ DE {MYCALL} {MYCALL} CQ K{ENTER}{RX}
|
|
Exch,{TX}{CALL} DE {MYCALL} {SENTRST} {EXCH} {SENTRST} {EXCH} K{ENTER}{RX}
|
|
TU,{TX}{CALL} TU DE {MYCALL} QRZ{ENTER}{RX}{LOG}
|
|
MyCall,{TX}{MYCALL} {MYCALL} K{ENTER}{RX}
|
|
HisCall,{TX}{CALL} DE {MYCALL} K{ENTER}{RX}
|
|
QSO B4,{TX}{CALL} QSO B4 QRZ DE {MYCALL}{ENTER}{RX}
|
|
Agn?,{TX}AGN AGN DE {MYCALL} K{ENTER}{RX}
|
|
Nr?,{TX}NR? NR? DE {MYCALL} K{ENTER}{RX}
|
|
Call?,{TX}CALL? CALL? DE {MYCALL} K{ENTER}{RX}
|
|
RST?,{TX}RST? RST? DE {MYCALL} K{ENTER}{RX}
|
|
QRZ,{TX}QRZ DE {MYCALL} {MYCALL} K{ENTER}{RX}
|
|
5NN,{TX}{SENTRST} {SENTRST} K{ENTER}{RX}
|
|
Test,{TX}RYRYRYRYRYRYRYRY{ENTER}{RX}
|
|
Grab,{TX}{CALL} DE {MYCALL} K{ENTER}{RX}
|
|
Wipe,{WIPE}
|
|
Log,{LOG}
|
|
Run,{RUN}
|
|
S&&P,{S&P}
|
|
Stack,{STACKANOTHER}
|
|
Pop,{LOGTHENPOP}
|
|
Spot,{SPOTME}
|
|
73,{TX}73 GL DE {MYCALL}{ENTER}{RX}
|
|
QRL?,{TX}QRL? DE {MYCALL}{ENTER}{RX}
|
|
Stop,{STOPTX}
|
|
""";
|
|
|
|
/// The stored digital macros, or the built-in ones while the operator has
|
|
/// not written their own.
|
|
public static DigitalMacros Digital(string stored) =>
|
|
DigitalMacros.Parse(stored.Trim().Length > 0 ? stored : DefaultDigital);
|
|
|
|
public static string DefaultFor(ModeCategory mode) =>
|
|
mode == ModeCategory.Phone ? DefaultPhone : DefaultCw;
|
|
|
|
/// The stored file for that mode, or the built-in one while the operator
|
|
/// has not written their own.
|
|
public static MessageFile For(ModeCategory mode, string cw, string phone)
|
|
{
|
|
string stored = mode == ModeCategory.Phone ? phone : cw;
|
|
return MessageFile.Parse(stored.Trim().Length > 0 ? stored : DefaultFor(mode));
|
|
}
|
|
}
|