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
118 lines
2.8 KiB
C#
118 lines
2.8 KiB
C#
namespace Nonemm.Session.Tests;
|
|
|
|
public class CallStackTests
|
|
{
|
|
[Fact]
|
|
public void ACallThatIsNotAMultiplierGoesToTheBack()
|
|
{
|
|
CallStack stack = new();
|
|
|
|
stack.Add("DL1ABC", isMultiplier: false);
|
|
stack.Add("G4ABC", isMultiplier: false);
|
|
|
|
Assert.Equal(["DL1ABC", "G4ABC"], stack.Calls);
|
|
}
|
|
|
|
[Fact]
|
|
public void AMultiplierGoesToTheFront()
|
|
{
|
|
CallStack stack = new();
|
|
stack.Add("DL1ABC", isMultiplier: false);
|
|
stack.Add("G4ABC", isMultiplier: false);
|
|
|
|
stack.Add("JA1XYZ", isMultiplier: true);
|
|
|
|
Assert.Equal(["JA1XYZ", "DL1ABC", "G4ABC"], stack.Calls);
|
|
}
|
|
|
|
[Fact]
|
|
public void ACallAlreadyOnTheStackIsMovedRatherThanRepeated()
|
|
{
|
|
CallStack stack = new();
|
|
stack.Add("DL1ABC", isMultiplier: false);
|
|
stack.Add("G4ABC", isMultiplier: false);
|
|
|
|
stack.Add("DL1ABC", isMultiplier: true);
|
|
|
|
Assert.Equal(["DL1ABC", "G4ABC"], stack.Calls);
|
|
}
|
|
|
|
[Fact]
|
|
public void ACallTooShortToBeOneIsNotStacked()
|
|
{
|
|
CallStack stack = new();
|
|
|
|
stack.Add("D", isMultiplier: false);
|
|
|
|
Assert.True(stack.IsEmpty);
|
|
}
|
|
|
|
[Fact]
|
|
public void TheCallsComeOffTheFront()
|
|
{
|
|
CallStack stack = new();
|
|
stack.Add("DL1ABC", isMultiplier: false);
|
|
stack.Add("G4ABC", isMultiplier: false);
|
|
|
|
Assert.Equal("DL1ABC", stack.Next());
|
|
Assert.Equal("G4ABC", stack.Next());
|
|
Assert.Equal("", stack.Next());
|
|
}
|
|
|
|
[Fact]
|
|
public void MoveToTopBringsACallForward()
|
|
{
|
|
CallStack stack = new();
|
|
stack.Add("DL1ABC", isMultiplier: false);
|
|
stack.Add("G4ABC", isMultiplier: false);
|
|
|
|
stack.MoveToTop("G4ABC");
|
|
|
|
Assert.Equal(["G4ABC", "DL1ABC"], stack.Calls);
|
|
}
|
|
|
|
[Fact]
|
|
public void MoveToTopLeavesACallThatIsNotThereAlone()
|
|
{
|
|
CallStack stack = new();
|
|
stack.Add("DL1ABC", isMultiplier: false);
|
|
|
|
stack.MoveToTop("G4ABC");
|
|
|
|
Assert.Equal(["DL1ABC"], stack.Calls);
|
|
}
|
|
|
|
/// The digital window's call stacking modes.
|
|
[Fact]
|
|
public void FirstInFirstOutKeepsTheOrderTheyArrivedIn()
|
|
{
|
|
CallStack stack = new() { Order = StackOrder.FirstIn };
|
|
|
|
stack.Add("OM5M", isMultiplier: false);
|
|
stack.Add("S53M", isMultiplier: true);
|
|
|
|
Assert.Equal(["OM5M", "S53M"], stack.Calls);
|
|
}
|
|
|
|
[Fact]
|
|
public void LastInFirstOutTakesTheNewestFirst()
|
|
{
|
|
CallStack stack = new() { Order = StackOrder.LastIn };
|
|
|
|
stack.Add("OM5M", isMultiplier: false);
|
|
stack.Add("S53M", isMultiplier: false);
|
|
|
|
Assert.Equal(["S53M", "OM5M"], stack.Calls);
|
|
}
|
|
|
|
[Fact]
|
|
public void NothingIsStackedWhenStackingIsOff()
|
|
{
|
|
CallStack stack = new() { Order = StackOrder.Disabled };
|
|
|
|
stack.Add("OM5M", isMultiplier: true);
|
|
|
|
Assert.True(stack.IsEmpty);
|
|
}
|
|
}
|