Start the scenery editor from its own button and note launches

With no scenery selected the button starts a new one in the editor. Each launch
notes the scenery, the timetable number and the vehicles for the tapes. Tools
work on the selected scenery, and an emptied consist stays listed.
This commit is contained in:
maj00r
2026-11-01 16:06:16 +01:00
parent 6e45f5de59
commit 2ebff91316
9 changed files with 670 additions and 124 deletions

View File

@@ -32,8 +32,39 @@ public class SimulatorAftermathTests
var installation = new TestInstallation(new InMemoryFileSystem()
.WithFile(TestInstallation.At("log.txt"), "first\r\nsecond\r\n\r\nthird\r\n"));
var tail = new SimulatorAftermath(installation.Files, installation.Paths, installation.Log).SimulatorLogTail(2);
var started = installation.Files.LastWriteTimeUtc.AddMinutes(-1);
var tail = new SimulatorAftermath(installation.Files, installation.Paths, installation.Log)
.SimulatorLogTail(2, started);
Assert.Equal(new[] { "second", "third" }, tail);
}
[Fact]
public void A_log_not_written_since_the_start_says_nothing_of_this_run()
{
// Dead before it opened its log: what is there is the session before.
var installation = new TestInstallation(new InMemoryFileSystem()
.WithFile(TestInstallation.At("log.txt"), "yesterday's error\r\n"));
var started = installation.Files.LastWriteTimeUtc.AddMinutes(10);
var tail = new SimulatorAftermath(installation.Files, installation.Paths, installation.Log)
.SimulatorLogTail(2, started);
Assert.Empty(tail);
}
[Fact]
public void A_log_written_a_moment_before_the_start_was_taken_counts()
{
// The start is taken just after the launch, as for the crash dumps.
var installation = new TestInstallation(new InMemoryFileSystem()
.WithFile(TestInstallation.At("log.txt"), "opening\r\n"));
var started = installation.Files.LastWriteTimeUtc.AddSeconds(3);
var tail = new SimulatorAftermath(installation.Files, installation.Paths, installation.Log)
.SimulatorLogTail(2, started);
Assert.Equal(new[] { "opening" }, tail);
}
}