RTTY sends one shift character to say whether the codes that follow are letters or figures. When it is lost to noise the printer stays in the wrong case for the rest of the line, so 599 prints as TOO, 73 as UE and CQ TEST as :1 53'5. Baudot.LettersFigs swaps the case of a word using the US teleprinter table, which is the one N1MM uses in DigitalMMTYIo.Letters_Figs. N1MM converts a letter to its figure but not a figure back to its letter, so its box turns VE4AEO into ;3R-39 and cannot turn it back. The table here is read both ways, which is what MMTTY's own right click does: a call printed in the wrong case is the case an operator has to read. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RoGtneMQaz4M9w7Kk49AVD
48 lines
1.1 KiB
C#
48 lines
1.1 KiB
C#
using Nonemm.Session;
|
|
|
|
namespace Nonemm.Session.Tests;
|
|
|
|
/// The Letters/Figs box: a word printed in the case it was not printed in.
|
|
/// The examples are the ones in N1MM's manual.
|
|
public class BaudotTests
|
|
{
|
|
[Fact]
|
|
public void ALostFiguresShiftPrints599AsToo()
|
|
{
|
|
Assert.Equal("TOO", Baudot.LettersFigs("599"));
|
|
Assert.Equal("599", Baudot.LettersFigs("TOO"));
|
|
}
|
|
|
|
[Fact]
|
|
public void SeventyThreePrintsAsUe()
|
|
{
|
|
Assert.Equal("UE", Baudot.LettersFigs("73"));
|
|
}
|
|
|
|
[Fact]
|
|
public void ACallsignGoesToFiguresAndBack()
|
|
{
|
|
Assert.Equal(";3R-39", Baudot.LettersFigs("VE4AEO"));
|
|
Assert.Equal("VE4AEO", Baudot.LettersFigs(";3R-39"));
|
|
}
|
|
|
|
[Fact]
|
|
public void PunctuationCarriesTheSpacesAcross()
|
|
{
|
|
Assert.Equal(":1 53'5", Baudot.LettersFigs("CQ TEST"));
|
|
}
|
|
|
|
[Fact]
|
|
public void ASerialNumberComesBackFromLetters()
|
|
{
|
|
Assert.Equal("012", Baudot.LettersFigs("PQW"));
|
|
}
|
|
|
|
[Fact]
|
|
public void WhatTheTableHasNoPairForIsLeftAlone()
|
|
{
|
|
Assert.Equal("J", Baudot.LettersFigs("J"));
|
|
Assert.Equal("", Baudot.LettersFigs(""));
|
|
}
|
|
}
|