diff --git a/StarterNG.Tests/SettingsStoreTests.cs b/StarterNG.Tests/SettingsStoreTests.cs
index 1abd865..d07fcff 100644
--- a/StarterNG.Tests/SettingsStoreTests.cs
+++ b/StarterNG.Tests/SettingsStoreTests.cs
@@ -1371,6 +1371,41 @@ public class SettingsStoreTests
Assert.Equal("blackbox yes", LineFor(installation, "blackbox"));
}
+ [Theory]
+ [InlineData("physicslog no\n", false, false)]
+ [InlineData("physicslog no\nphysicslog.trains yes\n", true, true)]
+ [InlineData("physicslog no\nphysicslog.trains yes\nblackbox no\n", true, false)]
+ public void The_logs_of_the_trains_are_read_and_bring_the_black_box_as_the_simulator_has_it(string ini, bool trains, bool recorded)
+ {
+ var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, ini));
+
+ installation.SettingsStore.Load();
+
+ Assert.Equal(trains, installation.SettingsStore.Settings.PhysicsLogTrains);
+ Assert.Equal(recorded, installation.SettingsStore.Settings.BlackBox);
+ }
+
+ [Fact]
+ public void The_logs_of_the_trains_are_written_only_once_on_or_where_the_file_has_them()
+ {
+ var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, "physicslog no\n"));
+ installation.SettingsStore.Load();
+ installation.SettingsStore.Save();
+ Assert.Null(LineFor(installation, "physicslog.trains"));
+
+ installation.SettingsStore.Settings.PhysicsLogTrains = true;
+ installation.SettingsStore.Settings.BlackBox = true;
+ installation.SettingsStore.Save();
+ Assert.Equal("physicslog.trains yes", LineFor(installation, "physicslog.trains"));
+ // it says no more than the logs of the trains bring
+ Assert.Null(LineFor(installation, "blackbox"));
+
+ installation.SettingsStore.Load();
+ installation.SettingsStore.Settings.PhysicsLogTrains = false;
+ installation.SettingsStore.Save();
+ Assert.Equal("physicslog.trains no", LineFor(installation, "physicslog.trains"));
+ }
+
[Fact]
public void A_black_box_line_written_once_goes_away_when_it_says_no_more()
{
diff --git a/StarterNG/Application/StartSimulation.cs b/StarterNG/Application/StartSimulation.cs
index cd310e1..d0d833e 100644
--- a/StarterNG/Application/StartSimulation.cs
+++ b/StarterNG/Application/StartSimulation.cs
@@ -144,7 +144,7 @@ public sealed class StartSimulation
if (saveSettings)
_settings.CaptureAndSave();
- if (_settings.Settings.PhysicsLog || _settings.Settings.BlackBox)
+ if (_settings.Settings.PhysicsLog || _settings.Settings.BlackBox || _settings.Settings.PhysicsLogTrains)
_tapes.RecordLaunch(scenery, trainset, freeFly ? null : vehicle);
string[] arguments = freeFly || string.IsNullOrEmpty(vehicle)
diff --git a/StarterNG/Domain/Settings/SimulatorSettings.cs b/StarterNG/Domain/Settings/SimulatorSettings.cs
index 8e34200..b62bf3e 100644
--- a/StarterNG/Domain/Settings/SimulatorSettings.cs
+++ b/StarterNG/Domain/Settings/SimulatorSettings.cs
@@ -140,6 +140,13 @@ public sealed class SimulatorSettings
public bool BlackBox;
/// Whether eu07.ini had a line of its own for the black box when read: it is kept saying what is wanted.
public bool BlackBoxInIni;
+ ///
+ /// The physics logs (.dat) of the trains only, "physicslog.trains": of each driver of rail vehicles, not of the
+ /// passengers nor of the vehicles of the roads. The tapes of every train, far fewer files than the log of every vehicle.
+ ///
+ public bool PhysicsLogTrains;
+ /// Whether eu07.ini had a line for the logs of the trains when read: kept, else written only when on.
+ public bool PhysicsLogTrainsInIni;
public bool DebugLog = true;
public bool MultipleLogs;
public bool DisplaySimulation = true;
diff --git a/StarterNG/Infrastructure/Settings/SettingsSerializer.cs b/StarterNG/Infrastructure/Settings/SettingsSerializer.cs
index 0d7227b..43198f8 100644
--- a/StarterNG/Infrastructure/Settings/SettingsSerializer.cs
+++ b/StarterNG/Infrastructure/Settings/SettingsSerializer.cs
@@ -157,9 +157,11 @@ public sealed class SettingsSerializer
s.EnableTraction = c.GetBool("enabletraction", true);
s.LiveTraction = c.GetBool("livetraction", true);
s.PhysicsLog = c.GetBool("physicslog", false);
- // the simulator records the black box along with the physics log when the ini says nothing of it
+ s.PhysicsLogTrainsInIni = c.Has("physicslog.trains");
+ s.PhysicsLogTrains = c.GetBool("physicslog.trains", false);
+ // the simulator records the black box along with the physics logs when the ini says nothing of it
s.BlackBoxInIni = c.Has("blackbox");
- s.BlackBox = s.BlackBoxInIni ? c.GetBool("blackbox", false) : s.PhysicsLog;
+ s.BlackBox = s.BlackBoxInIni ? c.GetBool("blackbox", false) : s.PhysicsLog || s.PhysicsLogTrains;
int debugLog = c.GetInt("debuglog", 3);
s.DebugLog = (debugLog & 1) != 0;
s.DebugLogVisible = (debugLog & 2) != 0;
@@ -373,10 +375,13 @@ public sealed class SettingsSerializer
c.SetBool("enabletraction", s.EnableTraction);
c.SetBool("livetraction", s.LiveTraction);
c.SetBool("physicslog", s.PhysicsLog);
- // written where it says more than the physics log, or where the file has it already: an ini without it
+ // written where it says more than the physics logs, or where the file has it already: an ini without it
// stays so, and a line written once and no longer saying more goes away on the next save
- if (s.BlackBoxInIni || s.BlackBox != s.PhysicsLog)
+ if (s.BlackBoxInIni || s.BlackBox != (s.PhysicsLog || s.PhysicsLogTrains))
c.SetBool("blackbox", s.BlackBox);
+ // a simulator before it doesn't know the line: an ini without it stays so while it is off
+ if (s.PhysicsLogTrainsInIni || s.PhysicsLogTrains)
+ c.SetBool("physicslog.trains", s.PhysicsLogTrains);
c.SetInt("debuglog",
(s.DebugLog ? 1 : 0) | (s.DebugLogVisible ? 2 : 0) | s.DebugLogExtraBits);
c.SetBool("multiplelogs", s.MultipleLogs);
diff --git a/StarterNG/MainWindow.axaml.cs b/StarterNG/MainWindow.axaml.cs
index 4388013..db87da5 100644
--- a/StarterNG/MainWindow.axaml.cs
+++ b/StarterNG/MainWindow.axaml.cs
@@ -709,7 +709,8 @@ public partial class MainWindow : Window
///
private static void FollowLastRun()
{
- if (AppServices.Current.Settings.PhysicsLog || AppServices.Current.Settings.BlackBox)
+ var settings = AppServices.Current.Settings;
+ if (settings.PhysicsLog || settings.BlackBox || settings.PhysicsLogTrains)
_ = Task.Run(AppServices.Current.Tapes.FollowLastRun);
}
diff --git a/StarterNG/Views/Settings.axaml b/StarterNG/Views/Settings.axaml
index b49cc4d..af447a6 100644
--- a/StarterNG/Views/Settings.axaml
+++ b/StarterNG/Views/Settings.axaml
@@ -556,6 +556,9 @@
+
+
+
diff --git a/StarterNG/Views/Settings.axaml.cs b/StarterNG/Views/Settings.axaml.cs
index bebe2b1..d2d74d3 100644
--- a/StarterNG/Views/Settings.axaml.cs
+++ b/StarterNG/Views/Settings.axaml.cs
@@ -330,6 +330,7 @@ public partial class Settings : UserControl, ISettingsCapture
{
SpeedometerTapesCb.IsChecked = AppServices.Current.Settings.PhysicsLog;
BlackBoxCb.IsChecked = AppServices.Current.Settings.BlackBox;
+ TrainTapesCb.IsChecked = AppServices.Current.Settings.PhysicsLogTrains;
SimLogsCb.IsChecked = AppServices.Current.Settings.DebugLog;
});
@@ -443,6 +444,7 @@ public partial class Settings : UserControl, ISettingsCapture
OverheadOnlyCb.IsChecked = s.LiveTraction;
SpeedometerTapesCb.IsChecked = s.PhysicsLog;
BlackBoxCb.IsChecked = s.BlackBox;
+ TrainTapesCb.IsChecked = s.PhysicsLogTrains;
SimLogsCb.IsChecked = s.DebugLog;
KeepLogsCb.IsChecked = s.MultipleLogs;
DisplaySimulationCb.IsChecked = s.DisplaySimulation;
@@ -877,6 +879,7 @@ public partial class Settings : UserControl, ISettingsCapture
s.LiveTraction = IsChecked(OverheadOnlyCb);
s.PhysicsLog = IsChecked(SpeedometerTapesCb);
s.BlackBox = IsChecked(BlackBoxCb);
+ s.PhysicsLogTrains = IsChecked(TrainTapesCb);
s.DebugLog = IsChecked(SimLogsCb);
s.MultipleLogs = IsChecked(KeepLogsCb);
s.DisplaySimulation = IsChecked(DisplaySimulationCb);
diff --git a/StarterNG/Views/Tapes/HaslerTapeWindow.cs b/StarterNG/Views/Tapes/HaslerTapeWindow.cs
index d5dc3c2..e34c1d4 100644
--- a/StarterNG/Views/Tapes/HaslerTapeWindow.cs
+++ b/StarterNG/Views/Tapes/HaslerTapeWindow.cs
@@ -163,7 +163,12 @@ public sealed class HaslerTapeWindow : Window
Content = _view
};
- _recordingOff = Strip("HaslerRecordingOff", "HaslerRecordingEnable", settings => settings.BlackBox = true);
+ // the black box, with the tapes of the player's vehicles, and the tapes of every train
+ _recordingOff = Strip("HaslerRecordingOff", "HaslerRecordingEnable", settings =>
+ {
+ settings.BlackBox = true;
+ settings.PhysicsLogTrains = true;
+ });
_logOff = Strip("HaslerLogOff", "HaslerLogEnable", settings => settings.DebugLog = true);
var folder = ToolButton(App.Loc["HaslerOpenFolder"]);
@@ -229,7 +234,7 @@ public sealed class HaslerTapeWindow : Window
private void ShowWhatIsKnown()
{
var settings = AppServices.Current.Settings;
- bool recording = settings.PhysicsLog || settings.BlackBox;
+ bool recording = settings.PhysicsLog || settings.BlackBox || settings.PhysicsLogTrains;
_recordingOff.IsVisible = !recording;
_logOff.IsVisible = recording && !settings.DebugLog;
diff --git a/StarterNG/startercfg/lang/cz.xml b/StarterNG/startercfg/lang/cz.xml
index 3bd9b22..8177d3d 100644
--- a/StarterNG/startercfg/lang/cz.xml
+++ b/StarterNG/startercfg/lang/cz.xml
@@ -500,6 +500,8 @@
Napájení jen pod trolejí
Nahrávat černou skříňku a pásky rychloměru
Nahrává jízdu do jednoho souboru ve složce physicslog/ a průběžně, každé 2 s, zapisuje pásky (.dat) vozidel, ve kterých jste.
+ Nahrávat pásky rychloměru všech vlaků
+ Průběžně, každé 2 s, zapisuje pásky (.dat) každého vlaku scenérie do složky physicslog/: jednu na strojvedoucího kolejových vozidel, bez silničních vozidel a cestujících. Mnohem méně souborů než fyzikální log každého vozidla.
Ukládat fyzikální log všech vozidel
Ukládat log simulace
Zachovat předchozí logy
diff --git a/StarterNG/startercfg/lang/en.xml b/StarterNG/startercfg/lang/en.xml
index 3c10bf1..2e37b91 100644
--- a/StarterNG/startercfg/lang/en.xml
+++ b/StarterNG/startercfg/lang/en.xml
@@ -519,6 +519,8 @@
When disabled, a raised pantograph can power the vehicle even without touching the wire.
Record the black box and the speedometer tapes
Records the session to one file in the physicslog/ folder and writes the tapes (.dat) of the vehicles you are in as it goes, every 2 s.
+ Record the speedometer tapes of every train
+ Writes the tapes (.dat) of every train of the scenery to the physicslog/ folder as it goes, every 2 s: one per driver of rail vehicles, not of road vehicles nor passengers. Far fewer files than the physics log of every vehicle.
Save the physics log of every vehicle
Writes the log of every vehicle of the scenery to the physicslog/ folder: a line every 0.05 s, added every 2 s. For diagnostics: on a large scenery that is hundreds of files.
Save simulation log
diff --git a/StarterNG/startercfg/lang/hu.xml b/StarterNG/startercfg/lang/hu.xml
index 2b4cf38..b77a00d 100644
--- a/StarterNG/startercfg/lang/hu.xml
+++ b/StarterNG/startercfg/lang/hu.xml
@@ -500,6 +500,8 @@
Táplálás csak felsővezeték alatt
Fekete doboz és sebességmérő-szalagok rögzítése
A menetet egy fájlba rögzíti a physicslog/ mappában, és menet közben, 2 másodpercenként kiírja azoknak a járműveknek a szalagjait (.dat), amelyekben ülsz.
+ Minden vonat sebességmérő-szalagjának rögzítése
+ Menet közben, 2 másodpercenként kiírja a pálya minden vonatának szalagját (.dat) a physicslog/ mappába: egyet a sínjárművek minden vezetőjének, közúti járművek és utasok nélkül. Jóval kevesebb fájl, mint minden jármű fizikai naplója.
Minden jármű fizikai naplójának mentése
Szimulációs napló mentése
Korábbi naplók megtartása
diff --git a/StarterNG/startercfg/lang/pl.xml b/StarterNG/startercfg/lang/pl.xml
index 8d02a3f..37d3e05 100644
--- a/StarterNG/startercfg/lang/pl.xml
+++ b/StarterNG/startercfg/lang/pl.xml
@@ -519,6 +519,8 @@
Gdy wyłączone, podniesiony pantograf zasila pojazd nawet bez kontaktu z drutem.
Zapisuj czarną skrzynkę i taśmy prędkościomierza
Nagrywa przejazd do jednego pliku w folderze physicslog/ i na bieżąco, co 2 s, zapisuje taśmy (.dat) pojazdów, w których jesteś.
+ Zapisuj taśmy prędkościomierza wszystkich pociągów
+ Na bieżąco, co 2 s, zapisuje taśmy (.dat) każdego pociągu scenerii do folderu physicslog/: jedną na maszynistę pojazdów szynowych, bez pojazdów drogowych i pasażerów. Znacznie mniej plików niż log fizyki każdego pojazdu.
Zapisuj log parametrów fizycznych wszystkich pojazdów
Zapisuje log każdego pojazdu scenerii do folderu physicslog/: wiersz co 0,05 s, dopisywany co 2 s. Do diagnostyki: na dużej scenerii to setki plików.
Zapisuj log z symulacji
diff --git a/StarterNG/startercfg/lang/ru.xml b/StarterNG/startercfg/lang/ru.xml
index 2bca963..669d65c 100644
--- a/StarterNG/startercfg/lang/ru.xml
+++ b/StarterNG/startercfg/lang/ru.xml
@@ -500,6 +500,8 @@
Питание только под контактной сетью
Записывать чёрный ящик и ленты скоростемера
Записывает поездку в один файл в папке physicslog/ и по ходу, каждые 2 с, сохраняет ленты (.dat) тех единиц, в которых вы находитесь.
+ Записывать ленты скоростемера всех поездов
+ По ходу, каждые 2 с, сохраняет ленты (.dat) каждого поезда сценария в папку physicslog/: по одной на машиниста рельсового состава, без автомобилей и пассажиров. Гораздо меньше файлов, чем физический журнал каждой единицы.
Сохранять физический лог всех единиц
Сохранять журнал симуляции
Сохранять предыдущие журналы