The menu tree comes from N1MM's EntryWindow.Designer.cs: File, Edit, View, Tools, Config, Window, with the items under the names N1MM gives them. The window list moved out of View into Window; the call history file moved from Config into File > Import. Ctrl+W, Ctrl+L and Ctrl+M now work, so the keys printed in the menu are real. Two commands that had no menu item before: the CW and SSB function key definitions, and the QTC setup area. The rest of the Edit menu: - Ctrl+N asks for a note and puts it in the comment of the contact in the boxes, or of the last logged contact when nothing is typed. - Edit Current Contact opens the Edit Contact form over what is typed but not logged. Update hands the values back to the entry boxes. - Ctrl+Q and Ctrl+A load a logged contact into the boxes and paint them pale yellow. Enter writes the change back, Esc puts back what was being typed, and stepping forward past the newest contact leaves quick edit. - Ctrl+U raises the received serial, or a numeric exchange box when the contest has no serial. - Ctrl+F shows the call being typed in the log window, then the next contact with that call. RadioPosition is now OperatingPosition: it is the operator at one radio, not a place on a band. Looked at under Xvfb on a 3775-contact log: quick edit back and forward, Esc, the note dialog, find, and Edit Current Contact putting a zone back into the entry boxes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
95 lines
2.6 KiB
C#
95 lines
2.6 KiB
C#
using Nonemm.Contests;
|
|
using Nonemm.Contests.Rules;
|
|
using Nonemm.Core;
|
|
using Nonemm.Storage;
|
|
|
|
namespace Nonemm.Session.Tests;
|
|
|
|
public class MessagePlanTests
|
|
{
|
|
private static OperatingPosition Session()
|
|
{
|
|
FakeLogStore store = new();
|
|
ContestInstance instance = store.AddContest(new ContestInstance
|
|
{
|
|
ContestNumber = 0,
|
|
ContestName = "CQWW",
|
|
SentExchange = "14",
|
|
});
|
|
return new OperatingPosition(new ContestSession(
|
|
store,
|
|
new CqWorldWide(ModeCategory.Cw),
|
|
instance,
|
|
new StationInfo { Callsign = "DL1ABC", CqZone = 14 },
|
|
null));
|
|
}
|
|
|
|
[Fact]
|
|
public void AMessageWithNoMacrosIsJustText()
|
|
{
|
|
MessagePlan plan = MessagePlan.Read("TEST DE DL1ABC", Session());
|
|
|
|
Assert.Equal("TEST DE DL1ABC", plan.Text);
|
|
Assert.Empty(plan.Before);
|
|
Assert.Empty(plan.After);
|
|
}
|
|
|
|
[Fact]
|
|
public void AnActionMacroRunsBeforeTheMessageAndDoesNotGoOnTheAir()
|
|
{
|
|
MessagePlan plan = MessagePlan.Read("{RUN}CQ TEST *", Session());
|
|
|
|
Assert.Equal("CQ TEST DL1ABC", plan.Text);
|
|
Assert.Equal([new MessageAction(MessageCommand.Run)], plan.Before);
|
|
}
|
|
|
|
[Fact]
|
|
public void WhatFollowsEndRunsAfterTheMessage()
|
|
{
|
|
MessagePlan plan = MessagePlan.Read("TU {LOG}{END}{WIPE}", Session());
|
|
|
|
Assert.Equal("TU ", plan.Text);
|
|
Assert.Equal([new MessageAction(MessageCommand.Log)], plan.Before);
|
|
Assert.Equal([new MessageAction(MessageCommand.Wipe)], plan.After);
|
|
}
|
|
|
|
[Fact]
|
|
public void TextAfterEndIsDropped()
|
|
{
|
|
MessagePlan plan = MessagePlan.Read("TU{END} 5NN {MYCALL}", Session());
|
|
|
|
Assert.Equal("TU", plan.Text);
|
|
}
|
|
|
|
[Fact]
|
|
public void AMacroWithACommandAfterItKeepsTheCommandAsTyped()
|
|
{
|
|
MessagePlan plan = MessagePlan.Read("{Telnet sh/dx 20}{OTRSP TX2}", Session());
|
|
|
|
Assert.Equal(
|
|
[
|
|
new MessageAction(MessageCommand.Telnet, "sh/dx 20"),
|
|
new MessageAction(MessageCommand.Otrsp, "TX2"),
|
|
],
|
|
plan.Before);
|
|
Assert.Equal("", plan.Text);
|
|
}
|
|
|
|
[Fact]
|
|
public void CtrlFSendsThatKeyOnTheOtherRadio()
|
|
{
|
|
MessagePlan plan = MessagePlan.Read("TU {CTRLF9}", Session());
|
|
|
|
Assert.Equal([new MessageAction(MessageCommand.SendOnOtherRadio, "9")], plan.Before);
|
|
}
|
|
|
|
[Fact]
|
|
public void AMacroThisProgramDoesNotActOnIsPassedOver()
|
|
{
|
|
MessagePlan plan = MessagePlan.Read("CQ {STEREOOFF}TEST", Session());
|
|
|
|
Assert.Equal("CQ TEST", plan.Text);
|
|
Assert.Empty(plan.Before);
|
|
}
|
|
}
|