N1MM's Send All: the whole series as one message — the heading, every
line with the operator's spacing between them, then the ending, with
`{TX}` and `{RX}` around it so it keys the transmitter and drops it
again. The shape is N1MM's, from `QTCWindow.cs:3609`. A line is the three
fields joined with hyphens, which is how N1MM writes them, and Snd n
sends one line again for a station that missed it.
One message rather than a button per line because a series is close to a
minute of transmission at 45 baud: the type-ahead buffer holds it and
paces the engine.
Three settings with N1MM's names and defaults — `WAESendAllHeadingText`,
`WAESendAllEndingText` and `WAESQTCSpacing` — on the QTC window's setup
dialog. `{ENTERLF}` is new to the expander and stands for a carriage
return and a line feed; `{QTC}` is filled in by the window, which is the
only place that knows which series is going out.
The messages are tested as text. Nothing has gone on the air.
Left out: N1MM's four SSB recordings, which need a voice keyer, and its
RTTY messages for the station taking traffic down, which are typed into
the digital window's transmit pane here.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdAYHcdRktqKry7nk414TU
99 lines
3.0 KiB
C#
99 lines
3.0 KiB
C#
namespace Nonemm.Session.Tests;
|
|
|
|
public class QtcMessagesTests
|
|
{
|
|
[Fact]
|
|
public void ALineIsTheTimeTheCallAndTheSerialNumber()
|
|
{
|
|
Assert.Equal(
|
|
"1234 DL1ABC 123",
|
|
QtcMessages.Line("1234", "DL1ABC", "123", QtcMessages.DefaultFieldSpacing));
|
|
}
|
|
|
|
/// N1MM writes the spacing with `S` for a space, so an operator who wants
|
|
/// two writes `SS`.
|
|
[Fact]
|
|
public void TheSpacingIsWrittenWithSForASpace()
|
|
{
|
|
Assert.Equal("1234 DL1ABC 123", QtcMessages.Line("1234", "DL1ABC", "123", "SS"));
|
|
}
|
|
|
|
[Fact]
|
|
public void AnythingElseInTheSpacingGoesOutAsItIs()
|
|
{
|
|
Assert.Equal("1234/DL1ABC/123", QtcMessages.Line("1234", "DL1ABC", "123", "/"));
|
|
}
|
|
|
|
/// N1MM lets the TU message name the series it is closing.
|
|
[Fact]
|
|
public void TheTuMessageCanCarryTheHeader()
|
|
{
|
|
Assert.Equal("TU QTC 3/10 73", QtcMessages.Tu("TU {QTC} 73", "QTC 3/10"));
|
|
}
|
|
|
|
[Fact]
|
|
public void ATuMessageWithoutTheHeaderIsLeftAlone()
|
|
{
|
|
Assert.Equal("TU 73", QtcMessages.Tu("TU 73", "QTC 3/10"));
|
|
}
|
|
|
|
/// N1MM joins the three fields with hyphens on RTTY and offers no setting
|
|
/// for it.
|
|
[Fact]
|
|
public void ARttyLineIsTheThreeFieldsJoinedWithHyphens()
|
|
{
|
|
Assert.Equal("1234-DL1ABC-123", QtcMessages.RttyLine(" 1234 ", " DL1ABC ", " 123 "));
|
|
}
|
|
|
|
/// The shape is N1MM's, from `QTCWindow.cs:3609`: the heading, the spacing,
|
|
/// then every line with a space and the spacing behind it, then the ending.
|
|
/// The macros are left for the expander; `{QTC}` is the one filled in here.
|
|
[Fact]
|
|
public void SendAllReadsTheWholeSeriesOutInOneMessage()
|
|
{
|
|
string message = QtcMessages.SendAll(
|
|
QtcMessages.DefaultSendAllHeading,
|
|
QtcMessages.DefaultSendAllEnding,
|
|
QtcMessages.DefaultRttySpacing,
|
|
"QTC 3/10",
|
|
["1234-DL1ABC-123", "1240-G3XYZ-124"]);
|
|
|
|
Assert.Equal(
|
|
"{TX}{ENTERLF}QTC 3/10 QTC 3/10{ENTER}"
|
|
+ "1234-DL1ABC-123 {ENTER}"
|
|
+ "1240-G3XYZ-124 {ENTER}"
|
|
+ "{ENTERLF}QSL?? BK DE {MYCALL} K{RX}",
|
|
message);
|
|
}
|
|
|
|
[Fact]
|
|
public void SendAllWithNoLinesSendsNothing()
|
|
{
|
|
Assert.Equal(
|
|
"",
|
|
QtcMessages.SendAll(
|
|
QtcMessages.DefaultSendAllHeading,
|
|
QtcMessages.DefaultSendAllEnding,
|
|
QtcMessages.DefaultRttySpacing,
|
|
"QTC 3/10",
|
|
[]));
|
|
}
|
|
|
|
/// One line asked for again, which N1MM wraps in the spacing on both sides.
|
|
[Fact]
|
|
public void OneLineKeysAndDropsTheTransmitterOfItsOwn()
|
|
{
|
|
Assert.Equal(
|
|
"{TX}{ENTER}1234-DL1ABC-123{ENTER}{RX}",
|
|
QtcMessages.SendOne(QtcMessages.DefaultRttySpacing, "1234-DL1ABC-123"));
|
|
}
|
|
|
|
[Fact]
|
|
public void WhatIsInTheBoxesIsTrimmed()
|
|
{
|
|
Assert.Equal(
|
|
"1234 DL1ABC 123",
|
|
QtcMessages.Line(" 1234 ", " DL1ABC ", " 123 ", QtcMessages.DefaultFieldSpacing));
|
|
}
|
|
}
|