Lay the menu bar out the way N1MM lays it out, and fill in the Edit menu
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>
This commit is contained in:
@@ -30,7 +30,7 @@ public class AvailableStationsTests
|
||||
|
||||
private static readonly Frequency On20 = Frequency.FromKilohertz(14_030);
|
||||
|
||||
private static (RadioPosition Position, Bandmap Bandmap, AvailableStations Available) Station(
|
||||
private static (OperatingPosition Position, Bandmap Bandmap, AvailableStations Available) Station(
|
||||
Contest? contest = null,
|
||||
CallHistory? history = null)
|
||||
{
|
||||
@@ -47,7 +47,7 @@ public class AvailableStationsTests
|
||||
Me,
|
||||
CountryFile.Parse(Countries),
|
||||
history);
|
||||
RadioPosition position = new(session);
|
||||
OperatingPosition position = new(session);
|
||||
Bandmap bandmap = new();
|
||||
return (position, bandmap, new AvailableStations(position, bandmap));
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class AvailableStationsTests
|
||||
private static Spot At(string call, Frequency where) =>
|
||||
new(Callsign.Parse(call), where, DateTime.UtcNow, SpotSource.Cluster, "OK1TEST");
|
||||
|
||||
private static void Work(RadioPosition position, string call, string zone, Frequency where)
|
||||
private static void Work(OperatingPosition position, string call, string zone, Frequency where)
|
||||
{
|
||||
position.Tune(where);
|
||||
position.Entry.Call = call;
|
||||
@@ -96,7 +96,7 @@ public class AvailableStationsTests
|
||||
[Fact]
|
||||
public void AStationAlreadyWorkedOnThatBandIsLeftOut()
|
||||
{
|
||||
(RadioPosition position, Bandmap bandmap, AvailableStations available) = Station();
|
||||
(OperatingPosition position, Bandmap bandmap, AvailableStations available) = Station();
|
||||
Work(position, "JA1XYZ", "25", On20);
|
||||
bandmap.Add(At("JA1XYZ", On20));
|
||||
|
||||
@@ -106,7 +106,7 @@ public class AvailableStationsTests
|
||||
[Fact]
|
||||
public void TheSameStationOnAnotherBandIsStillWorthWorking()
|
||||
{
|
||||
(RadioPosition position, Bandmap bandmap, AvailableStations available) = Station();
|
||||
(OperatingPosition position, Bandmap bandmap, AvailableStations available) = Station();
|
||||
Work(position, "JA1XYZ", "25", On20);
|
||||
bandmap.Add(At("JA1XYZ", Frequency.FromKilohertz(7_030)));
|
||||
|
||||
@@ -118,7 +118,7 @@ public class AvailableStationsTests
|
||||
[Fact]
|
||||
public void AStationThatBringsNoMultiplierIsStillOfferedForItsPoints()
|
||||
{
|
||||
(RadioPosition position, Bandmap bandmap, AvailableStations available) = Station();
|
||||
(OperatingPosition position, Bandmap bandmap, AvailableStations available) = Station();
|
||||
Work(position, "JA1XYZ", "25", On20);
|
||||
bandmap.Add(At("JA2ABC", On20));
|
||||
|
||||
@@ -130,7 +130,7 @@ public class AvailableStationsTests
|
||||
[Fact]
|
||||
public void MultipliersComeFirst()
|
||||
{
|
||||
(RadioPosition position, Bandmap bandmap, AvailableStations available) = Station();
|
||||
(OperatingPosition position, Bandmap bandmap, AvailableStations available) = Station();
|
||||
Work(position, "JA1XYZ", "25", On20);
|
||||
bandmap.Add(At("JA2ABC", Frequency.FromKilohertz(14_010)));
|
||||
bandmap.Add(At("W1AW", Frequency.FromKilohertz(14_040)));
|
||||
|
||||
@@ -28,7 +28,7 @@ public class ContestSessionTests
|
||||
return new ContestSession(store, new CqWpx(ModeCategory.Cw), instance, Me, null);
|
||||
}
|
||||
|
||||
private static void Type(RadioPosition radio, string call, string number)
|
||||
private static void Type(OperatingPosition radio, string call, string number)
|
||||
{
|
||||
radio.Entry.Call = call;
|
||||
radio.Entry.Set(ExchangeSlot.ReceivedReport, "599");
|
||||
@@ -39,8 +39,8 @@ public class ContestSessionTests
|
||||
public void BothRadiosLogIntoTheSameLog()
|
||||
{
|
||||
ContestSession session = Session();
|
||||
RadioPosition first = new(session, 1);
|
||||
RadioPosition second = new(session, 2);
|
||||
OperatingPosition first = new(session, 1);
|
||||
OperatingPosition second = new(session, 2);
|
||||
|
||||
Type(first, "JA1XYZ", "1");
|
||||
first.LogContact();
|
||||
@@ -57,8 +57,8 @@ public class ContestSessionTests
|
||||
public void SerialNumbersCountUpAcrossBothRadios()
|
||||
{
|
||||
ContestSession session = Session();
|
||||
RadioPosition first = new(session, 1);
|
||||
RadioPosition second = new(session, 2);
|
||||
OperatingPosition first = new(session, 1);
|
||||
OperatingPosition second = new(session, 2);
|
||||
|
||||
Type(first, "JA1XYZ", "1");
|
||||
Assert.Equal(1, first.LogContact().SentNumber);
|
||||
@@ -73,8 +73,8 @@ public class ContestSessionTests
|
||||
public void AStationWorkedOnOneRadioIsADupeOnTheOther()
|
||||
{
|
||||
ContestSession session = Session();
|
||||
RadioPosition first = new(session, 1);
|
||||
RadioPosition second = new(session, 2);
|
||||
OperatingPosition first = new(session, 1);
|
||||
OperatingPosition second = new(session, 2);
|
||||
|
||||
Type(first, "JA1XYZ", "1");
|
||||
first.LogContact();
|
||||
@@ -89,8 +89,8 @@ public class ContestSessionTests
|
||||
public void EachRadioKeepsItsOwnFrequencyAndRunState()
|
||||
{
|
||||
ContestSession session = Session();
|
||||
RadioPosition first = new(session, 1);
|
||||
RadioPosition second = new(session, 2);
|
||||
OperatingPosition first = new(session, 1);
|
||||
OperatingPosition second = new(session, 2);
|
||||
|
||||
first.Tune(Frequency.FromKilohertz(14_025));
|
||||
first.IsRunning = true;
|
||||
@@ -106,8 +106,8 @@ public class ContestSessionTests
|
||||
public void WhatIsTypedOnOneRadioStaysThere()
|
||||
{
|
||||
ContestSession session = Session();
|
||||
RadioPosition first = new(session, 1);
|
||||
RadioPosition second = new(session, 2);
|
||||
OperatingPosition first = new(session, 1);
|
||||
OperatingPosition second = new(session, 2);
|
||||
|
||||
Type(first, "JA1XYZ", "1");
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Nonemm.Session.Tests;
|
||||
|
||||
public class MessageExpanderTests
|
||||
{
|
||||
private static RadioPosition Session(CallHistory? history = null, int radioNumber = 1)
|
||||
private static OperatingPosition Session(CallHistory? history = null, int radioNumber = 1)
|
||||
{
|
||||
FakeLogStore store = new();
|
||||
ContestInstance instance = store.AddContest(new ContestInstance
|
||||
@@ -17,7 +17,7 @@ public class MessageExpanderTests
|
||||
ContestName = "CQWW",
|
||||
SentExchange = "14",
|
||||
});
|
||||
return new RadioPosition(
|
||||
return new OperatingPosition(
|
||||
new ContestSession(
|
||||
store,
|
||||
new CqWorldWide(ModeCategory.Cw),
|
||||
@@ -31,7 +31,7 @@ public class MessageExpanderTests
|
||||
[Fact]
|
||||
public void MyCallAndTheirCallAreFilledIn()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
session.Entry.Call = "JA1XYZ";
|
||||
Assert.Equal("JA1XYZ DE DL1ABC", MessageExpander.Expand("{CALL} DE {MYCALL}", session));
|
||||
}
|
||||
@@ -59,7 +59,7 @@ public class MessageExpanderTests
|
||||
[Fact]
|
||||
public void TheSingleCharacterMacrosAreTheirCallMyCallAndTheSerial()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
session.Entry.Call = "JA1XYZ";
|
||||
|
||||
Assert.Equal("JA1XYZ 599 1 DE DL1ABC", MessageExpander.Expand("! 599 # DE *", session));
|
||||
@@ -68,7 +68,7 @@ public class MessageExpanderTests
|
||||
[Fact]
|
||||
public void TheirCallFallsBackToTheLastOneLogged()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
session.Entry.Call = "JA1XYZ";
|
||||
session.Entry.Set(ExchangeSlot.ReceivedReport, "599");
|
||||
session.Entry.Set(ExchangeSlot.Zone, "25");
|
||||
@@ -80,7 +80,7 @@ public class MessageExpanderTests
|
||||
[Fact]
|
||||
public void TheFrequencySendsRForTheDecimalPointOnCw()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
session.Tune(Frequency.FromKilohertz(14_025.5));
|
||||
|
||||
Assert.Equal("14025R5 14026", MessageExpander.Expand("{FREQ} {FREQROUND}", session));
|
||||
@@ -89,8 +89,8 @@ public class MessageExpanderTests
|
||||
[Fact]
|
||||
public void TheOtherRadioFillsInTheOtherMacros()
|
||||
{
|
||||
RadioPosition here = Session();
|
||||
RadioPosition there = Session(radioNumber: 2);
|
||||
OperatingPosition here = Session();
|
||||
OperatingPosition there = Session(radioNumber: 2);
|
||||
there.Tune(Frequency.FromKilohertz(3_525));
|
||||
|
||||
Assert.Equal("3525R0 3R5 80M", MessageExpander.Expand("{OTHERFREQ} {OTHERMHZ} {OTHERBAND}", here, there));
|
||||
@@ -103,7 +103,7 @@ public class MessageExpanderTests
|
||||
[Fact]
|
||||
public void TheNameComesFromTheCallHistoryWhenTheContestHasNoNameBox()
|
||||
{
|
||||
RadioPosition session = Session(CallHistory.Parse("!!Order!!,Call,Name\nJA1XYZ,Ken"));
|
||||
OperatingPosition session = Session(CallHistory.Parse("!!Order!!,Call,Name\nJA1XYZ,Ken"));
|
||||
session.Entry.Call = "JA1XYZ";
|
||||
|
||||
Assert.Equal("TU Ken GL", MessageExpander.Expand("TU {NAMEANDSPACE}GL", session));
|
||||
@@ -112,7 +112,7 @@ public class MessageExpanderTests
|
||||
[Fact]
|
||||
public void MyGridAndTheirsAreDifferentMacros()
|
||||
{
|
||||
RadioPosition session = Session(CallHistory.Parse("!!Order!!,Call,LOC1\nJA1XYZ,PM95"));
|
||||
OperatingPosition session = Session(CallHistory.Parse("!!Order!!,Call,LOC1\nJA1XYZ,PM95"));
|
||||
session.Entry.Call = "JA1XYZ";
|
||||
|
||||
Assert.Equal("JN88 PM95", MessageExpander.Expand("{GRID} {GRIDSQUARE}", session));
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Nonemm.Session.Tests;
|
||||
|
||||
public class MessagePlanTests
|
||||
{
|
||||
private static RadioPosition Session()
|
||||
private static OperatingPosition Session()
|
||||
{
|
||||
FakeLogStore store = new();
|
||||
ContestInstance instance = store.AddContest(new ContestInstance
|
||||
@@ -16,7 +16,7 @@ public class MessagePlanTests
|
||||
ContestName = "CQWW",
|
||||
SentExchange = "14",
|
||||
});
|
||||
return new RadioPosition(new ContestSession(
|
||||
return new OperatingPosition(new ContestSession(
|
||||
store,
|
||||
new CqWorldWide(ModeCategory.Cw),
|
||||
instance,
|
||||
|
||||
@@ -7,7 +7,7 @@ using Nonemm.Storage;
|
||||
|
||||
namespace Nonemm.Session.Tests;
|
||||
|
||||
public class RadioPositionTests
|
||||
public class OperatingPositionTests
|
||||
{
|
||||
private const string Countries = """
|
||||
Germany: 14: 28: EU: 51.00: -10.00: -1.0: DL:
|
||||
@@ -25,7 +25,7 @@ public class RadioPositionTests
|
||||
CountryPrefix = "DL",
|
||||
};
|
||||
|
||||
private static RadioPosition Session(Contest? contest = null) =>
|
||||
private static OperatingPosition Session(Contest? contest = null) =>
|
||||
new(Shared(new FakeLogStore(), contest));
|
||||
|
||||
private static ContestSession Shared(FakeLogStore store, Contest? contest = null)
|
||||
@@ -43,7 +43,7 @@ public class RadioPositionTests
|
||||
CountryFile.Parse(Countries));
|
||||
}
|
||||
|
||||
private static void Type(RadioPosition session, string call, string zone)
|
||||
private static void Type(OperatingPosition session, string call, string zone)
|
||||
{
|
||||
session.Entry.Call = call;
|
||||
session.Entry.Set(ExchangeSlot.ReceivedReport, "599");
|
||||
@@ -53,7 +53,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void LoggingAContactPutsItInTheLogAndClearsTheEntry()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
Type(session, "JA1XYZ", "25");
|
||||
Qso logged = session.LogContact();
|
||||
|
||||
@@ -67,7 +67,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void CountryAndPrefixAreFilledInFromTheCountryFile()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
Type(session, "JA1XYZ", "25");
|
||||
Qso logged = session.LogContact();
|
||||
|
||||
@@ -79,7 +79,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void AnIncompleteExchangeIsNotLogged()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
session.Entry.Call = "JA1XYZ";
|
||||
Assert.Throws<InvalidOperationException>(() => session.LogContact());
|
||||
}
|
||||
@@ -87,7 +87,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void TheSameStationOnTheSameBandReadsAsADupe()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
Type(session, "JA1XYZ", "25");
|
||||
session.LogContact();
|
||||
Type(session, "JA1XYZ", "25");
|
||||
@@ -97,7 +97,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void MovingBandClearsTheDupe()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
Type(session, "JA1XYZ", "25");
|
||||
session.LogContact();
|
||||
session.Tune(Frequency.FromKilohertz(7_025));
|
||||
@@ -108,7 +108,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void SerialNumbersCountUp()
|
||||
{
|
||||
RadioPosition session = Session(new CqWpx(ModeCategory.Cw));
|
||||
OperatingPosition session = Session(new CqWpx(ModeCategory.Cw));
|
||||
Assert.Equal(1, session.SentNumber);
|
||||
session.Entry.Call = "JA1XYZ";
|
||||
session.Entry.Set(ExchangeSlot.ReceivedReport, "599");
|
||||
@@ -121,7 +121,7 @@ public class RadioPositionTests
|
||||
public void SpaceStepsOverTheReportAndComesBackToTheCall()
|
||||
{
|
||||
// CQ WW's boxes are the call, the report and the zone
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
|
||||
Assert.Equal(0, session.Entry.Focus);
|
||||
session.Entry.Advance();
|
||||
@@ -133,7 +133,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void GoingBackStepsOverTheReportToo()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
session.Entry.FocusOn(2);
|
||||
|
||||
session.Entry.Retreat();
|
||||
@@ -144,7 +144,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void TheReportBoxesAreFilledInWithWhatWouldBeSentAnyway()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
|
||||
Assert.True(session.FillReports());
|
||||
|
||||
@@ -155,7 +155,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void AReportTheOperatorTypedIsLeftAlone()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
session.Entry.Set(ExchangeSlot.ReceivedReport, "559");
|
||||
|
||||
Assert.False(session.FillReports());
|
||||
@@ -168,7 +168,7 @@ public class RadioPositionTests
|
||||
[InlineData("7025.5", 7_025_500)]
|
||||
public void AFrequencyTypedIntoTheCallBoxIsRecognised(string typed, long hertz)
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
session.Entry.Call = typed;
|
||||
Assert.Equal(hertz, session.PendingQsy()?.Hertz);
|
||||
}
|
||||
@@ -178,7 +178,7 @@ public class RadioPositionTests
|
||||
[InlineData("12000")]
|
||||
public void ACallOrAnOutOfBandNumberIsNotAQsy(string typed)
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
session.Entry.Call = typed;
|
||||
Assert.Null(session.PendingQsy());
|
||||
}
|
||||
@@ -186,7 +186,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void AContactDeletedFromTheLogGivesItsMultiplierBack()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
Type(session, "JA1XYZ", "25");
|
||||
Qso first = session.LogContact();
|
||||
Type(session, "JA2XYZ", "25");
|
||||
@@ -202,7 +202,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void AContactWorkedSplitRecordsWhereWeTransmitted()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
session.Tune(
|
||||
Frequency.FromKilohertz(14_025),
|
||||
Modes.Cw,
|
||||
@@ -218,7 +218,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void AContactRecordsWhichRadioMadeIt()
|
||||
{
|
||||
RadioPosition session = new(Shared(new FakeLogStore()), 2);
|
||||
OperatingPosition session = new(Shared(new FakeLogStore()), 2);
|
||||
Type(session, "JA1XYZ", "25");
|
||||
|
||||
Assert.Equal(2, session.LogContact().RadioNumber);
|
||||
@@ -229,7 +229,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void TuningWithoutASplitLeavesTheOneAlreadySet()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
session.Tune(Frequency.FromKilohertz(14_025), null, Frequency.FromKilohertz(14_200));
|
||||
|
||||
session.Tune(Frequency.FromKilohertz(14_030));
|
||||
@@ -240,7 +240,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void EditingAContactRescoresTheLog()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
Type(session, "JA1XYZ", "25");
|
||||
Qso logged = session.LogContact();
|
||||
Assert.Equal(3, session.Log.Tally.Points);
|
||||
@@ -255,7 +255,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void ARefusedEditLeavesTheLogAlone()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
Type(session, "JA1XYZ", "25");
|
||||
Qso logged = session.LogContact();
|
||||
|
||||
@@ -270,7 +270,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void AnEditReportsWhatTheContactUsedToBe()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
Type(session, "JA1XYZ", "25");
|
||||
Qso logged = session.LogContact();
|
||||
QsoChange? change = null;
|
||||
@@ -288,7 +288,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void CorrectingTheCountryChangesTheScore()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
Type(session, "JA1XYZ", "25");
|
||||
Qso logged = session.LogContact();
|
||||
Assert.Equal(3, session.Log.Tally.Points);
|
||||
@@ -301,7 +301,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void ADeleteReportsTheContactThatWent()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
Type(session, "JA1XYZ", "25");
|
||||
Qso logged = session.LogContact();
|
||||
Qso? gone = null;
|
||||
@@ -316,11 +316,11 @@ public class RadioPositionTests
|
||||
public void StoredContactsAreReadBackWhenTheSessionStarts()
|
||||
{
|
||||
FakeLogStore store = new();
|
||||
RadioPosition first = new(Shared(store));
|
||||
OperatingPosition first = new(Shared(store));
|
||||
Type(first, "JA1XYZ", "25");
|
||||
first.LogContact();
|
||||
|
||||
RadioPosition second = new(new ContestSession(
|
||||
OperatingPosition second = new(new ContestSession(
|
||||
store,
|
||||
new CqWorldWide(ModeCategory.Cw),
|
||||
first.Instance,
|
||||
@@ -330,7 +330,7 @@ public class RadioPositionTests
|
||||
Assert.Equal(3, second.Log.Tally.Points);
|
||||
}
|
||||
|
||||
private static RadioPosition WithHistory(Contest contest, string file)
|
||||
private static OperatingPosition WithHistory(Contest contest, string file)
|
||||
{
|
||||
FakeLogStore store = new();
|
||||
ContestInstance instance = store.AddContest(new ContestInstance
|
||||
@@ -338,7 +338,7 @@ public class RadioPositionTests
|
||||
ContestNumber = 0,
|
||||
ContestName = contest.Name,
|
||||
});
|
||||
return new RadioPosition(new ContestSession(
|
||||
return new OperatingPosition(new ContestSession(
|
||||
store,
|
||||
contest,
|
||||
instance,
|
||||
@@ -350,7 +350,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void TheCallHistoryFillsTheExchangeIn()
|
||||
{
|
||||
RadioPosition session = WithHistory(
|
||||
OperatingPosition session = WithHistory(
|
||||
new Sweepstakes(ModeCategory.Cw),
|
||||
"!!Order!!,Call,Sect,CK\nW3LPL,MDC,56");
|
||||
session.Entry.Call = "W3LPL";
|
||||
@@ -365,7 +365,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void WhatIsAlreadyTypedIsNotOverwritten()
|
||||
{
|
||||
RadioPosition session = WithHistory(
|
||||
OperatingPosition session = WithHistory(
|
||||
new Sweepstakes(ModeCategory.Cw),
|
||||
"!!Order!!,Call,Sect\nW3LPL,MDC");
|
||||
session.Entry.Call = "W3LPL";
|
||||
@@ -379,7 +379,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void ACallTheHistoryDoesNotHoldFillsNothing()
|
||||
{
|
||||
RadioPosition session = WithHistory(
|
||||
OperatingPosition session = WithHistory(
|
||||
new Sweepstakes(ModeCategory.Cw),
|
||||
"!!Order!!,Call,Sect\nW3LPL,MDC");
|
||||
session.Entry.Call = "JA1XYZ";
|
||||
@@ -392,7 +392,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void TheZoneComesFromTheColumnTheContestAsksFor()
|
||||
{
|
||||
RadioPosition session = WithHistory(
|
||||
OperatingPosition session = WithHistory(
|
||||
new CqWorldWide(ModeCategory.Cw),
|
||||
"!!Order!!,Call,CqZone,ITUZone\nJA1XYZ,25,45");
|
||||
session.Entry.Call = "JA1XYZ";
|
||||
@@ -406,7 +406,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void TheStateFillsASectionWhenTheFileHasNoSection()
|
||||
{
|
||||
RadioPosition session = WithHistory(
|
||||
OperatingPosition session = WithHistory(
|
||||
new Sweepstakes(ModeCategory.Cw),
|
||||
"!!Order!!,Call,Sect,State\nK1TTT,,CT");
|
||||
session.Entry.Call = "K1TTT";
|
||||
@@ -419,7 +419,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void TheNameAndCommentBoxesReachTheLog()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
session.Entry.Call = "JA1XYZ";
|
||||
session.Entry.Set(ExchangeSlot.ReceivedReport, "599");
|
||||
session.Entry.Set(ExchangeSlot.Zone, "25");
|
||||
@@ -437,7 +437,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void WipingClearsTheNameAndTheComment()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
session.OtherName = "Ken";
|
||||
session.Comment = "up 2";
|
||||
|
||||
@@ -450,7 +450,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void CqWwRttyStepsOverTheStateBoxForAStationOutsideTheUsAndCanada()
|
||||
{
|
||||
RadioPosition session = Session(new CqWorldWide(ModeCategory.Digital));
|
||||
OperatingPosition session = Session(new CqWorldWide(ModeCategory.Digital));
|
||||
session.Entry.Call = "JA1XYZ";
|
||||
|
||||
// the boxes are the call, the report, the zone and the state
|
||||
@@ -463,7 +463,7 @@ public class RadioPositionTests
|
||||
[Fact]
|
||||
public void CqWwRttyStopsOnTheStateBoxForAUsStation()
|
||||
{
|
||||
RadioPosition session = Session(new CqWorldWide(ModeCategory.Digital));
|
||||
OperatingPosition session = Session(new CqWorldWide(ModeCategory.Digital));
|
||||
session.Entry.Call = "K1ABC";
|
||||
|
||||
session.MoveFocus(forward: true);
|
||||
@@ -471,4 +471,72 @@ public class RadioPositionTests
|
||||
session.MoveFocus(forward: true);
|
||||
Assert.Equal(3, session.Entry.Focus);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void QuickEditLoadsTheLastContactAndSavesTheChangeBack()
|
||||
{
|
||||
OperatingPosition session = Session();
|
||||
Type(session, "JA1XYZ", "25");
|
||||
Qso logged = session.LogContact();
|
||||
Type(session, "DL9ZZZ", "14");
|
||||
|
||||
Assert.True(session.QuickEdit(forward: false));
|
||||
Assert.Equal(logged.Id, session.Editing?.Id);
|
||||
Assert.Equal("JA1XYZ", session.Entry.Call);
|
||||
Assert.Equal("25", session.Entry.ValueOf(ExchangeSlot.Zone));
|
||||
|
||||
session.Entry.Set(ExchangeSlot.Zone, "24");
|
||||
Qso? saved = session.SaveQuickEdit();
|
||||
|
||||
Assert.Equal(24, saved?.Zone);
|
||||
Assert.Equal(24, session.Log.Qsos[0].Zone);
|
||||
Assert.Null(session.Editing);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LeavingQuickEditPutsBackWhatWasBeingTyped()
|
||||
{
|
||||
OperatingPosition session = Session();
|
||||
Type(session, "JA1XYZ", "25");
|
||||
session.LogContact();
|
||||
Type(session, "DL9ZZZ", "14");
|
||||
|
||||
session.QuickEdit(forward: false);
|
||||
session.LeaveQuickEdit();
|
||||
|
||||
Assert.Null(session.Editing);
|
||||
Assert.Equal("DL9ZZZ", session.Entry.Call);
|
||||
Assert.Equal("14", session.Entry.ValueOf(ExchangeSlot.Zone));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void QuickEditForwardPastTheNewestContactLeavesQuickEdit()
|
||||
{
|
||||
OperatingPosition session = Session();
|
||||
Type(session, "JA1XYZ", "25");
|
||||
session.LogContact();
|
||||
Type(session, "DL9ZZZ", "14");
|
||||
|
||||
session.QuickEdit(forward: false);
|
||||
Assert.True(session.QuickEdit(forward: true));
|
||||
|
||||
Assert.Null(session.Editing);
|
||||
Assert.Equal("DL9ZZZ", session.Entry.Call);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void QuickEditStepsBackThroughTheLog()
|
||||
{
|
||||
OperatingPosition session = Session();
|
||||
Type(session, "JA1XYZ", "25");
|
||||
session.LogContact();
|
||||
Type(session, "DL9ZZZ", "14");
|
||||
session.LogContact();
|
||||
|
||||
session.QuickEdit(forward: false);
|
||||
Assert.Equal("DL9ZZZ", session.Entry.Call);
|
||||
session.QuickEdit(forward: false);
|
||||
Assert.Equal("JA1XYZ", session.Entry.Call);
|
||||
Assert.False(session.QuickEdit(forward: false));
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public class QtcTrafficTests
|
||||
CountryPrefix = "K",
|
||||
};
|
||||
|
||||
private static (RadioPosition Position, QtcTraffic Traffic) Station(
|
||||
private static (OperatingPosition Position, QtcTraffic Traffic) Station(
|
||||
ModeCategory mode,
|
||||
StationInfo? me = null)
|
||||
{
|
||||
@@ -49,12 +49,12 @@ public class QtcTrafficTests
|
||||
});
|
||||
ContestSession session = new(
|
||||
store, new Wae(mode), instance, me ?? Slovakia, CountryFile.Parse(Countries));
|
||||
RadioPosition position = new(session);
|
||||
OperatingPosition position = new(session);
|
||||
return (position, new QtcTraffic(position));
|
||||
}
|
||||
|
||||
private static Qso Contact(
|
||||
RadioPosition position,
|
||||
OperatingPosition position,
|
||||
string call,
|
||||
int receivedNumber,
|
||||
int sentNumber,
|
||||
@@ -111,7 +111,7 @@ public class QtcTrafficTests
|
||||
[Fact]
|
||||
public void TenLinesIsAllAnyStationGets()
|
||||
{
|
||||
(RadioPosition position, QtcTraffic traffic) = Station(ModeCategory.Digital);
|
||||
(OperatingPosition position, QtcTraffic traffic) = Station(ModeCategory.Digital);
|
||||
for (int at = 1; at <= 10; at++)
|
||||
{
|
||||
position.Session.Add(new WaeQtc(
|
||||
@@ -127,7 +127,7 @@ public class QtcTrafficTests
|
||||
[Fact]
|
||||
public void WhatIsSentIsTheContactsNotReportedYetOldestFirst()
|
||||
{
|
||||
(RadioPosition position, QtcTraffic traffic) = Station(ModeCategory.Digital);
|
||||
(OperatingPosition position, QtcTraffic traffic) = Station(ModeCategory.Digital);
|
||||
Contact(position, "DL1AAA", receivedNumber: 16, sentNumber: 1, minute: 46);
|
||||
Contact(position, "DL2BBB", receivedNumber: 40, sentNumber: 2, minute: 47);
|
||||
Contact(position, "JA1XYZ", receivedNumber: 7, sentNumber: 3, minute: 48);
|
||||
@@ -143,7 +143,7 @@ public class QtcTrafficTests
|
||||
[Fact]
|
||||
public void AContactAlreadyReportedIsNotReportedAgain()
|
||||
{
|
||||
(RadioPosition position, QtcTraffic traffic) = Station(ModeCategory.Digital);
|
||||
(OperatingPosition position, QtcTraffic traffic) = Station(ModeCategory.Digital);
|
||||
Contact(position, "DL1AAA", receivedNumber: 16, sentNumber: 1, minute: 46);
|
||||
Contact(position, "DL2BBB", receivedNumber: 40, sentNumber: 2, minute: 47);
|
||||
WaeQtc first = traffic.ToSend(Callsign.Parse("JA1XYZ"))[0];
|
||||
@@ -157,7 +157,7 @@ public class QtcTrafficTests
|
||||
[Fact]
|
||||
public void SeriesAreNumberedAcrossTheContest()
|
||||
{
|
||||
(RadioPosition position, QtcTraffic traffic) = Station(ModeCategory.Digital);
|
||||
(OperatingPosition position, QtcTraffic traffic) = Station(ModeCategory.Digital);
|
||||
Assert.Equal(1, traffic.NextSeries());
|
||||
|
||||
position.Session.Add(new WaeQtc(
|
||||
|
||||
@@ -20,7 +20,7 @@ public class StationPathTests
|
||||
JA;
|
||||
""");
|
||||
|
||||
private static RadioPosition Session(string myGrid = "", CallHistory? history = null)
|
||||
private static OperatingPosition Session(string myGrid = "", CallHistory? history = null)
|
||||
{
|
||||
FakeLogStore store = new();
|
||||
ContestInstance instance = store.AddContest(new ContestInstance
|
||||
@@ -29,7 +29,7 @@ public class StationPathTests
|
||||
ContestName = "CQWW",
|
||||
SentExchange = "15",
|
||||
});
|
||||
return new RadioPosition(new ContestSession(
|
||||
return new OperatingPosition(new ContestSession(
|
||||
store,
|
||||
new CqWorldWide(ModeCategory.Cw),
|
||||
instance,
|
||||
@@ -45,7 +45,7 @@ public class StationPathTests
|
||||
[Fact]
|
||||
public void TheCountryFilePlacesAStationWhoseGridIsNotKnown()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
session.Entry.Call = "JA1XYZ";
|
||||
|
||||
StationPath path = Assert.IsType<StationPath>(StationPath.For(session, Now));
|
||||
@@ -59,11 +59,11 @@ public class StationPathTests
|
||||
[Fact]
|
||||
public void AGridFromTheCallHistoryBeatsTheCountryFile()
|
||||
{
|
||||
RadioPosition known = Session(
|
||||
OperatingPosition known = Session(
|
||||
myGrid: "JN88",
|
||||
history: CallHistory.Parse("!!Order!!,Call,LOC1\nJA1XYZ,PM95"));
|
||||
known.Entry.Call = "JA1XYZ";
|
||||
RadioPosition unknown = Session(myGrid: "JN88");
|
||||
OperatingPosition unknown = Session(myGrid: "JN88");
|
||||
unknown.Entry.Call = "JA1XYZ";
|
||||
|
||||
StationPath fromGrid = Assert.IsType<StationPath>(StationPath.For(known, Now));
|
||||
@@ -76,7 +76,7 @@ public class StationPathTests
|
||||
[Fact]
|
||||
public void TheSunTimesAreTheOtherStationsOwn()
|
||||
{
|
||||
RadioPosition session = Session();
|
||||
OperatingPosition session = Session();
|
||||
session.Entry.Call = "JA1XYZ";
|
||||
|
||||
StationPath path = Assert.IsType<StationPath>(StationPath.For(session, Now));
|
||||
|
||||
Reference in New Issue
Block a user