Keep an operator's windows, colours and recordings
Ctrl+O asks who is at the radio, as it does in N1MM, and the callsign goes on
every contact logged from then on. A multi-operator station changes hands every
few hours, so each operator also keeps what he wants the program to look like:
where the windows sit, the theme, and the folder his recordings are in.
The windows on the screen are stored against the operator leaving, before the
dialog opens, and the operator taking over gets his own back. A window he opens
later is placed as it appears. An operator who is new to the list starts with
whatever is on the screen.
Nothing plays the recordings yet, so the folder is stored and waits on voice
keying. {OPERATOR} in a message sends the callsign.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoGtneMQaz4M9w7Kk49AVD
This commit is contained in:
@@ -92,4 +92,44 @@ public class SettingsTests : IDisposable
|
||||
|
||||
Assert.Equal("F1 CQ,CQ", settings.CwMessageFile);
|
||||
}
|
||||
|
||||
/// An operator's windows and colours survive a trip through the file, and a
|
||||
/// file written before operators existed reads as a station with none.
|
||||
[Fact]
|
||||
public void OperatorsAreStoredAndReadBack()
|
||||
{
|
||||
Settings settings = new()
|
||||
{
|
||||
CurrentOperator = "OM3KFF",
|
||||
Operators =
|
||||
[
|
||||
new StoredOperator
|
||||
{
|
||||
Callsign = "OM3KFF",
|
||||
Theme = "dark",
|
||||
WavPath = "/home/erik/wav/om3kff",
|
||||
Windows = [new StoredWindow { Name = "BandmapWindow", X = 10, Y = 20, Width = 300, Height = 400 }],
|
||||
},
|
||||
],
|
||||
};
|
||||
settings.Save(path);
|
||||
|
||||
Settings read = Settings.Load(path);
|
||||
|
||||
StoredOperator stored = Assert.Single(read.Operators);
|
||||
Assert.Equal("OM3KFF", read.CurrentOperator);
|
||||
Assert.Equal("dark", stored.Theme);
|
||||
Assert.Equal("/home/erik/wav/om3kff", stored.WavPath);
|
||||
StoredWindow window = Assert.Single(stored.Windows);
|
||||
Assert.Equal(("BandmapWindow", 10, 20), (window.Name, window.X, window.Y));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AFileFromBeforeOperatorsHasNone()
|
||||
{
|
||||
Settings read = Load("""{ "Theme": "light" }""");
|
||||
|
||||
Assert.Empty(read.Operators);
|
||||
Assert.Equal("", read.CurrentOperator);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,4 +117,18 @@ public class MessageExpanderTests
|
||||
|
||||
Assert.Equal("JN88 PM95", MessageExpander.Expand("{GRID} {GRIDSQUARE}", session));
|
||||
}
|
||||
|
||||
/// N1MM's {OPERATOR}: who is at the radio, which is not always whose
|
||||
/// callsign the station is on the air with.
|
||||
[Fact]
|
||||
public void TheOperatorIsWhoeverIsAtTheRadio()
|
||||
{
|
||||
OperatingPosition session = Session();
|
||||
|
||||
Assert.Equal("DL1ABC", MessageExpander.Expand("{OPERATOR}", session));
|
||||
|
||||
session.Session.Operator = "OM3KFF";
|
||||
|
||||
Assert.Equal("OM3KFF", MessageExpander.Expand("{OPERATOR}", session));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user