Compare commits

..

9 Commits

Author SHA1 Message Date
maj00r
c370d1509e Merge main into fix/scenery-file-events
Conflict in MainWindow.axaml.cs, the Activated handler: main (#52) refreshes the list of simulators when
the settings are shown, this branch looks at the scenery files through _sceneryLook. Both kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:02:45 +01:00
3c9b578e6b Merge pull request #55 from MaSzyna-EU07/feat/command-descriptions
Black box: commands described, the protection's buzzer apart from its braking
2026-11-16 09:16:55 +00:00
maj00r
8baf2149ea fix(blackbox): a buzzer named by the lamps of its buzzing samples only 2026-11-16 02:21:23 +01:00
maj00r
aebfaf34ac fix(blackbox): a buzzer cut by the power or the protection switched off is not acknowledged, and is named by every lamp it had
The keys tab's English names the train brake's positions and the dashboard light as the black box does.
2026-11-16 02:20:34 +01:00
maj00r
5bc5da3fbf feat(blackbox): the train protection's buzzer told apart from its braking
The buzzer has a colour of its own on the timeline and in the cab, no longer the braking's red, and an event of its
own: acknowledged after how long, or not acknowledged when the braking follows. The alerter's buzzer needs its lamp,
since a protection with one acknowledgement tells the cab signalling's buzzer as the alerter's too. Braking with no
lamp, the protection with no power, is not shown as the driver's on the timeline and in the cab either.
2026-11-16 02:17:57 +01:00
maj00r
e4d092ab3e fix(blackbox): the command texts set right, and in the old starter's languages as the keys tab has them
Spelling and wording fixed (świateł, piasecznica, dezaktywacja, podgrzewacz wody, the dashboard light, the
locomotive brake), and the train brake's service and full service positions told by what they set, not as the key
file swaps them. In Czech, Hungarian and Russian the commands are named in the old starter's key descriptions.
2026-11-16 02:17:57 +01:00
maj00r
632e1003ee fix(blackbox): the protection braking with no power not counted as the driver's
TSecuritySystem brakes whenever it has no power, a cab not yet started or a power cut, with no lamp
lit. Only braking with the alerter or the cab signalling lamp is the driver's not acknowledging.
2026-11-16 02:04:22 +01:00
maj00r
34ee131d61 feat(blackbox): the commands in the events and on the timeline told by what they do
Every command of a vehicle the simulator can record (input/command.cpp) has a Polish and an English
text: those with a key take the key file's and the starter's own, the rest are written out. A command
with no text keeps its name.
2026-11-16 02:04:22 +01:00
maj00r
31fc4c3fdc fix: scenery files are looked at when they change, not every two seconds
The starter compared every file of every scenery each two seconds: on a full
installation 175 sceneries and 378 files, 15-18 ms a look, thirty looks a
minute with nothing changed. The system now reports changes in the scenery
folder and a look follows once the burst of a save has passed, 400 ms after
the last report.

The reports are only a hint. A look still comes on coming back to the window
and right after the simulator or its editor closes, and every 30 seconds
anyway, for network drives, Wine and Linux past its limit of watches, where
reports may not come. Where the folder cannot be watched at all the look
stays every two seconds as before. A change reported during a look is not
lost: one more look follows it.
2026-11-15 21:18:20 +01:00
17 changed files with 904 additions and 37 deletions

View File

@@ -185,6 +185,9 @@ public sealed class DefaultBlackBoxStrings : IBlackBoxStrings
["EventHornMissed"] = "W6: NO HORN",
["EventCab"] = "Cab {0} of {1}",
["EventSecurityBraking"] = "BRAKING BY {0}",
["EventSecurityAlarm"] = "{0} buzzer",
["EventSecurityAlarmAcknowledged"] = "{0} buzzer, acknowledged after {1:0.0} s",
["EventSecurityAlarmMissed"] = "{0} buzzer, not acknowledged",
["EventTimetable"] = "Timetable {0}, {1}",
["CabSpeed"] = "Speed",
["CabAiTarget"] = "AI {0:0} km/h",
@@ -460,6 +463,9 @@ public sealed class DefaultBlackBoxStrings : IBlackBoxStrings
["EventHornMissed"] = "W6: BEZ TRĄBIENIA",
["EventCab"] = "Kabina {0} w {1}",
["EventSecurityBraking"] = "HAMOWANIE PRZEZ {0}",
["EventSecurityAlarm"] = "Brzęczyk {0}",
["EventSecurityAlarmAcknowledged"] = "Brzęczyk {0}, potwierdzony po {1:0.0} s",
["EventSecurityAlarmMissed"] = "Brzęczyk {0}, bez potwierdzenia",
["EventTimetable"] = "Rozkład {0}, {1}",
["CabSpeed"] = "Prędkość",
["CabAiTarget"] = "AI {0:0} km/h",
@@ -564,7 +570,11 @@ public sealed class DefaultBlackBoxStrings : IBlackBoxStrings
["FileFilter"] = "Czarna skrzynka"
};
/// <summary>The key of the text of a simulator's command: <see cref="CommandPrefix"/> and its name.</summary>
public const string CommandPrefix = "Cmd.";
private readonly Dictionary<string, string> _texts;
private readonly string _languageCode;
public DefaultBlackBoxStrings() : this(CultureInfo.CurrentUICulture)
{
@@ -577,11 +587,15 @@ public sealed class DefaultBlackBoxStrings : IBlackBoxStrings
/// <summary>Polish for "pl", English for any other language.</summary>
public DefaultBlackBoxStrings(string languageCode)
{
_languageCode = languageCode;
_texts = languageCode == "pl" ? Polish : English;
}
/// <summary>The keys there are texts for, for a translation to give them all.</summary>
public static IEnumerable<string> Keys => English.Keys;
public string this[string key] => _texts.TryGetValue(key, out var text) ? text : English.GetValueOrDefault(key, key);
/// <summary>A key of <see cref="CommandPrefix"/> gives what the command does (<see cref="CommandTexts"/>).</summary>
public string this[string key] =>
key.StartsWith(CommandPrefix, System.StringComparison.Ordinal) ? CommandTexts.Of(key[CommandPrefix.Length..], _languageCode)
: _texts.TryGetValue(key, out var text) ? text : English.GetValueOrDefault(key, key);
}

View File

@@ -660,12 +660,12 @@ public sealed class CabPanel : Control
if (s.Security != SecurityFlags.None || s.CabEnd != 0)
{
// A recording which tells them apart.
safety.Add((Strings["DevVigilance"], Security(SecurityFlags.VigilanceBeeping, Palette.LampAlarm) ?? Security(SecurityFlags.Vigilance, Palette.Vigilance)));
safety.Add((Strings["DevCabSignal"], Security(SecurityFlags.CabSignalBeeping, Palette.LampAlarm) ?? Security(SecurityFlags.CabSignal, Palette.CabSignal)));
safety.Add((Strings["DevSecurityBraking"], Security(SecurityFlags.Braking, Palette.LampAlarm)));
safety.Add((Strings["DevVigilance"], s.VigilanceBuzzer ? Palette.Buzzer : Security(SecurityFlags.Vigilance, Palette.Vigilance)));
safety.Add((Strings["DevCabSignal"], s.CabSignalBuzzer ? Palette.Buzzer : Security(SecurityFlags.CabSignal, Palette.CabSignal)));
safety.Add((Strings["DevSecurityBraking"], s.ProtectionBraking ? Palette.LampAlarm : null));
}
else
safety.Add((Strings["DevAlerter"], (s.Flags & CabFlags.AlerterBeeping) != 0 ? Palette.LampAlarm
safety.Add((Strings["DevAlerter"], (s.Flags & CabFlags.AlerterBeeping) != 0 ? Palette.Buzzer
: (s.Flags & CabFlags.AlerterBlinking) != 0 ? Palette.LampWarning : null));
safety.Add(Flag("DevWheelSlip", CabFlags.WheelSlip, Palette.LampAlarm));
safety.Add(On("DevOverloadRelay", CabDevices.OverloadRelay, Palette.LampAlarm));

View File

@@ -0,0 +1,378 @@
using System.Collections.Generic;
namespace Eu07.BlackBox.Views;
/// <summary>
/// What the simulator's commands of a vehicle do, as the black box names them (input/command.cpp): Polish
/// and English. Those with a key carry the texts of the key file (eu07_input-keyboard.ini) and of the starter's
/// English; the rest, worked by the mouse in the cab or by scripts, are written here.
/// </summary>
public static class CommandTexts
{
private static readonly Dictionary<string, (string Polish, string English)> Texts = new()
{
["aidriverenable"] = ("Aktywacja automechanika", "Engage the AI driver"),
["aidriverdisable"] = ("Dezaktywacja automechanika", "Disengage the AI driver"),
["jointcontrollerset"] = ("Ustawienie nastawnika zespolonego", "Set the combined controller"),
["mastercontrollerincrease"] = ("Zwiększenie nastawnika głównego", "Master controller up"),
["mastercontrollerincreasefast"] = ("Szybkie zwiększenie nastawnika głównego", "Master controller up, fast"),
["mastercontrollerdecrease"] = ("Zmniejszenie nastawnika głównego", "Master controller down"),
["mastercontrollerdecreasefast"] = ("Szybkie zmniejszenie nastawnika głównego", "Master controller down, fast"),
["mastercontrollerset"] = ("Ustawienie nastawnika głównego", "Set the master controller"),
["dynamicbrakecontrollerincrease"] = ("Zwiększenie nastawy hamulca elektrodynamicznego", "Increase the dynamic brake"),
["dynamicbrakecontrollerdecrease"] = ("Zmniejszenie nastawy hamulca elektrodynamicznego", "Decrease the dynamic brake"),
["dynamicbrakecontrollerset"] = ("Ustawienie hamulca elektrodynamicznego", "Set the dynamic brake"),
["dynamicbrakecontrollerincreasefast"] = ("Szybkie zwiększenie nastawy hamulca elektrodynamicznego", "Increase the dynamic brake fast"),
["dynamicbrakecontrollerdecreasefast"] = ("Szybkie zmniejszenie nastawy hamulca elektrodynamicznego", "Decrease the dynamic brake fast"),
["secondcontrollerincrease"] = ("Zwiększenie nastawnika boczników", "Shunt controller up"),
["secondcontrollerincreasefast"] = ("Szybkie zwiększenie nastawnika boczników", "Shunt controller up, fast"),
["secondcontrollerdecrease"] = ("Zmniejszenie nastawnika boczników", "Shunt controller down"),
["secondcontrollerdecreasefast"] = ("Szybkie zmniejszenie nastawnika boczników", "Shunt controller down, fast"),
["secondcontrollerset"] = ("Ustawienie nastawnika boczników", "Set the shunt controller"),
["mucurrentindicatorothersourceactivate"] = ("Zmiana członu dla wskaźnika prądu", "Switch the current gauge to the other unit"),
["independentbrakeincrease"] = ("Zwiększenie nastawy hamulca lokomotywy", "Apply more locomotive brake"),
["independentbrakeincreasefast"] = ("Szybkie zwiększenie nastawy hamulca lokomotywy", "Apply more locomotive brake, fast"),
["independentbrakedecrease"] = ("Zmniejszenie nastawy hamulca lokomotywy", "Release locomotive brake"),
["independentbrakedecreasefast"] = ("Szybkie zmniejszenie nastawy hamulca lokomotywy", "Release locomotive brake, fast"),
["independentbrakeset"] = ("Ustawienie hamulca lokomotywy", "Set the locomotive brake"),
["independentbrakebailoff"] = ("Odluźniacz", "Bail off the locomotive brake"),
["universalbrakebutton1"] = ("Aktywacja zdefiniowanych elementów hamulca zespolonego nr 1", "Universal brake button 1"),
["universalbrakebutton2"] = ("Aktywacja zdefiniowanych elementów hamulca zespolonego nr 2", "Universal brake button 2"),
["universalbrakebutton3"] = ("Aktywacja zdefiniowanych elementów hamulca zespolonego nr 3", "Universal brake button 3"),
["trainbrakeincrease"] = ("Zwiększenie stopnia hamowania zaworu maszynisty", "Train brake valve: more braking"),
["trainbrakedecrease"] = ("Zmniejszenie stopnia hamowania zaworu maszynisty", "Train brake valve: less braking"),
["trainbrakeset"] = ("Ustawienie hamulca zespolonego", "Set the train brake"),
["trainbrakecharging"] = ("Napełnianie uderzeniowe przewodu głównego", "Train brake valve: overcharge the brake pipe"),
["trainbrakerelease"] = ("Ustawienie zaworu maszynisty w pozycji jazdy", "Train brake valve: running position"),
["trainbrakefirstservice"] = ("Pozycja pierwszego stopnia hamowania", "Train brake valve: first braking step"),
["trainbrakeservice"] = ("Pozycja hamowania służbowego", "Train brake valve: service braking"),
["trainbrakefullservice"] = ("Pozycja hamowania pełnego", "Train brake valve: full service"),
["trainbrakehandleoff"] = ("Pozycja odcięcia", "Train brake valve: lap position"),
["trainbrakeemergency"] = ("Hamowanie nagłe", "Emergency braking"),
["trainbrakebasepressureincrease"] = ("Zwiększenie poziomu ciśnienia w przewodzie głównym", "Raise the brake pipe pressure level"),
["trainbrakebasepressuredecrease"] = ("Zmniejszenie poziomu ciśnienia w przewodzie głównym", "Lower the brake pipe pressure level"),
["trainbrakebasepressurereset"] = ("Domyślny poziom ciśnienia w przewodzie głównym", "Default brake pipe pressure level"),
["trainbrakeoperationtoggle"] = ("Przełączenie stanu hamulca pojazdu", "Toggle the vehicle's brake"),
["manualbrakeincrease"] = ("Zwiększenie nastawy hamulca ręcznego", "Apply more hand brake"),
["manualbrakedecrease"] = ("Zmniejszenie nastawy hamulca ręcznego", "Release hand brake"),
["alarmchaintoggle"] = ("Przełączenie stanu hamulca bezpieczeństwa", "Toggle the emergency brake"),
["alarmchainenable"] = ("Pociągnięcie hamulca bezpieczeństwa", "Pull the alarm chain"),
["alarmchaindisable"] = ("Zwolnienie hamulca bezpieczeństwa", "Release the alarm chain"),
["wheelspinbrakeactivate"] = ("Aktywacja podhamowania przeciwpoślizgowego", "Anti-slip brake"),
["sandboxactivate"] = ("Aktywacja piasecznicy", "Sander"),
["autosandboxtoggle"] = ("Przełączenie automatycznej piasecznicy", "Toggle the automatic sander"),
["autosandboxactivate"] = ("Włączenie automatycznej piasecznicy", "Turn the automatic sander on"),
["autosandboxdeactivate"] = ("Wyłączenie automatycznej piasecznicy", "Turn the automatic sander off"),
["reverserincrease"] = ("Zwiększenie pozycji nastawnika kierunku", "Reverser up"),
["reverserdecrease"] = ("Zmniejszenie pozycji nastawnika kierunku", "Reverser down"),
["reverserforwardhigh"] = ("Pozycja jazdy do przodu II nastawnika kierunku", "Reverser: forward II"),
["reverserforward"] = ("Pozycja jazdy do przodu nastawnika kierunku", "Reverser: forward"),
["reverserneutral"] = ("Pozycja neutralna nastawnika kierunku", "Reverser: neutral"),
["reverserbackward"] = ("Pozycja jazdy do tyłu nastawnika kierunku", "Reverser: backward"),
["waterpumpbreakertoggle"] = ("Przełączenie stanu wyłącznika samoczynnego pompy wody", "Toggle the water pump circuit breaker"),
["waterpumpbreakerclose"] = ("Załączenie wyłącznika pompy wody", "Close the water pump breaker"),
["waterpumpbreakeropen"] = ("Wyłączenie wyłącznika pompy wody", "Open the water pump breaker"),
["waterpumptoggle"] = ("Przełączenie stanu pompy wody", "Toggle the water pump"),
["waterpumpenable"] = ("Włączenie pompy wody", "Turn the water pump on"),
["waterpumpdisable"] = ("Wyłączenie pompy wody", "Turn the water pump off"),
["waterheaterbreakertoggle"] = ("Przełączenie stanu wyłącznika samoczynnego podgrzewacza wody", "Toggle the water heater circuit breaker"),
["waterheaterbreakerclose"] = ("Załączenie wyłącznika podgrzewacza wody", "Close the water heater breaker"),
["waterheaterbreakeropen"] = ("Wyłączenie wyłącznika podgrzewacza wody", "Open the water heater breaker"),
["waterheatertoggle"] = ("Przełączenie stanu podgrzewacza wody", "Toggle the water heater"),
["waterheaterenable"] = ("Włączenie podgrzewacza wody", "Turn the water heater on"),
["waterheaterdisable"] = ("Wyłączenie podgrzewacza wody", "Turn the water heater off"),
["watercircuitslinktoggle"] = ("Przełączenie stanu połączenia obiegów wody", "Toggle the link between the water circuits"),
["watercircuitslinkenable"] = ("Połączenie obiegów wody", "Link the water circuits"),
["watercircuitslinkdisable"] = ("Rozłączenie obiegów wody", "Unlink the water circuits"),
["fuelpumptoggle"] = ("Przełączenie stanu pompy paliwa", "Toggle the fuel pump"),
["fuelpumpenable"] = ("Włączenie pompy paliwa", "Turn the fuel pump on"),
["fuelpumpdisable"] = ("Wyłączenie pompy paliwa", "Turn the fuel pump off"),
["oilpumptoggle"] = ("Przełączenie stanu pompy oleju", "Toggle the oil pump"),
["oilpumpenable"] = ("Włączenie pompy oleju", "Turn the oil pump on"),
["oilpumpdisable"] = ("Wyłączenie pompy oleju", "Turn the oil pump off"),
["linebreakertoggle"] = ("Przełączenie stanu wyłącznika szybkiego", "Toggle the line breaker"),
["linebreakeropen"] = ("Wyłączenie wyłącznika szybkiego", "Open the line breaker"),
["linebreakerclose"] = ("Załączenie wyłącznika szybkiego", "Close the line breaker"),
["convertertoggle"] = ("Przełączenie stanu przetwornicy", "Toggle the converter"),
["converterenable"] = ("Włączenie przetwornicy", "Turn the converter on"),
["converterdisable"] = ("Wyłączenie przetwornicy", "Turn the converter off"),
["convertertogglelocal"] = ("Przełączenie stanu przetwornicy w obsadzonym członie", "Toggle the converter in the occupied unit"),
["converteroverloadrelayreset"] = ("Odblokowanie przekaźnika nadmiarowego przetwornicy", "Reset the converter overload relay"),
["compressortoggle"] = ("Przełączenie stanu sprężarki", "Toggle the compressor"),
["compressorenable"] = ("Włączenie sprężarki", "Turn the compressor on"),
["compressordisable"] = ("Wyłączenie sprężarki", "Turn the compressor off"),
["compressortogglelocal"] = ("Przełączenie stanu sprężarki w obsadzonym członie", "Toggle the compressor in the occupied unit"),
["compressorpresetactivatenext"] = ("Następny tryb pracy sprężarek", "Next compressor mode"),
["compressorpresetactivateprevious"] = ("Poprzedni tryb pracy sprężarek", "Previous compressor mode"),
["compressorpresetactivatedefault"] = ("Domyślny tryb pracy sprężarek", "Default compressor mode"),
["motoroverloadrelaythresholdtoggle"] = ("Przełączenie rozruchu niskiego/wysokiego", "Switch between low and high starting current"),
["motoroverloadrelaythresholdsetlow"] = ("Niski próg przekaźnika nadmiarowego silników", "Motor overload relay threshold low"),
["motoroverloadrelaythresholdsethigh"] = ("Wysoki próg przekaźnika nadmiarowego silników", "Motor overload relay threshold high"),
["motoroverloadrelayreset"] = ("Odblokowanie przekaźnika nadmiarowego silników", "Reset the traction motor overload relay"),
["universalrelayreset1"] = ("Odblokowanie zdefiniowanych przekaźników nr 1", "Reset the defined relays, set 1"),
["universalrelayreset2"] = ("Odblokowanie zdefiniowanych przekaźników nr 2", "Reset the defined relays, set 2"),
["universalrelayreset3"] = ("Odblokowanie zdefiniowanych przekaźników nr 3", "Reset the defined relays, set 3"),
["notchingrelaytoggle"] = ("Przełączenie stanu przekaźnika samoczynnego rozruchu", "Toggle the automatic notching relay"),
["epbrakecontroltoggle"] = ("Przełączenie stanu hamulca elektropneumatycznego", "Toggle the electro-pneumatic brake"),
["epbrakecontrolenable"] = ("Włączenie hamulca elektropneumatycznego", "Turn the electro-pneumatic brake on"),
["epbrakecontroldisable"] = ("Wyłączenie hamulca elektropneumatycznego", "Turn the electro-pneumatic brake off"),
["trainbrakeoperationmodeincrease"] = ("Zmiana trybu pracy hamulca na bardziej efektywny", "Brake operation mode: more effective"),
["trainbrakeoperationmodedecrease"] = ("Zmiana trybu pracy hamulca na prostszy", "Brake operation mode: simpler"),
["brakeactingspeedincrease"] = ("Wybór szybszego trybu działania hamulca pociągu", "Faster train brake acting speed"),
["brakeactingspeeddecrease"] = ("Wybór wolniejszego trybu działania hamulca pociągu", "Slower train brake acting speed"),
["brakeactingspeedsetcargo"] = ("Wybór trybu hamulca dla pociągu towarowego", "Brake acting speed for a freight train"),
["brakeactingspeedsetpassenger"] = ("Wybór trybu hamulca dla pociągu osobowego", "Brake acting speed for a passenger train"),
["brakeactingspeedsetrapid"] = ("Wybór trybu hamulca dla pociągu pospiesznego", "Brake acting speed for an express train"),
["brakeloadcompensationincrease"] = ("Wybór wyższego przełożenia hamulca", "Higher brake load setting"),
["brakeloadcompensationdecrease"] = ("Wybór niższego przełożenia hamulca", "Lower brake load setting"),
["mubrakingindicatortoggle"] = ("Przełączenie stanu wskaźnika hamowania członów EZT", "Toggle the EMU unit braking indicator"),
["alerteracknowledge"] = ("Wygaszenie czuwaka i SHP", "Acknowledge the vigilance device and cab signalling"),
["cabsignalacknowledge"] = ("Wygaszenie SHP", "Acknowledge the cab signalling"),
["hornlowactivate"] = ("Aktywacja syreny niskotonowej", "Low-tone horn"),
["hornhighactivate"] = ("Aktywacja syreny wysokotonowej", "High-tone horn"),
["whistleactivate"] = ("Aktywacja gwizdka", "Whistle"),
["radiotoggle"] = ("Przełączenie stanu radiotelefonu", "Toggle the radio"),
["radioenable"] = ("Włączenie radiotelefonu", "Turn the radio on"),
["radiodisable"] = ("Wyłączenie radiotelefonu", "Turn the radio off"),
["radiochannelincrease"] = ("Wybór kolejnego kanału radia", "Next radio channel"),
["radiochanneldecrease"] = ("Wybór poprzedniego kanału radia", "Previous radio channel"),
["radiochannelset"] = ("Ustawienie kanału radiotelefonu", "Set the radio channel"),
["radiostopsend"] = ("Emisja radiostopu", "Send radio-stop"),
["radiostopenable"] = ("Włączenie sygnału Radio-Stop", "Send Radio-Stop"),
["radiostopdisable"] = ("Wyłączenie sygnału Radio-Stop", "Stop sending Radio-Stop"),
["radiostoptest"] = ("Lokalny test radiostopu", "Local radio-stop test"),
["radiocall1send"] = ("Wywołanie radiowe 1", "Radio call 1"),
["radiocall3send"] = ("Emisja sygnału zew3", "Send the call-3 signal"),
["radiovolumeincrease"] = ("Zwiększenie głośności radia", "Radio volume up"),
["radiovolumedecrease"] = ("Zmniejszenie głośności radia", "Radio volume down"),
["radiovolumeset"] = ("Ustawienie głośności radiotelefonu", "Set the radio volume"),
["radiofusetoggle"] = ("Przełączenie bezpiecznika radiotelefonu", "Toggle the radio fuse"),
["radiofuseenable"] = ("Załączenie bezpiecznika radiotelefonu", "Close the radio fuse"),
["radiofusedisable"] = ("Wyłączenie bezpiecznika radiotelefonu", "Open the radio fuse"),
["cabchangeforward"] = ("Przejście do sąsiedniego pomieszczenia w kierunku czoła pociągu", "Move to the next compartment towards the front"),
["cabchangebackward"] = ("Przejście do sąsiedniego pomieszczenia w kierunku tyłu pociągu", "Move to the next compartment towards the rear"),
["modernlightdimmerdecrease"] = ("Przyciemnienie oświetlenia", "Dim the lights"),
["modernlightdimmerincrease"] = ("Rozjaśnienie oświetlenia", "Brighten the lights"),
["nearestcarcouplingincrease"] = ("Łączenie sprzęgów", "Couple"),
["nearestcarcouplingdisconnect"] = ("Rozłączenie sprzęgów", "Uncouple"),
["nearestcarcoupleradapterattach"] = ("Nałożenie półsprzęgu", "Attach the coupler adapter"),
["nearestcarcoupleradapterremove"] = ("Demontaż półsprzęgu", "Remove the coupler adapter"),
["occupiedcarcouplingdisconnect"] = ("Rozłączenie sprzęgów po stronie obsadzonej kabiny", "Uncouple at the occupied cab's end"),
["occupiedcarcouplingdisconnectback"] = ("Rozłączenie sprzęgu z tyłu zajmowanego pojazdu", "Uncouple at the back of the occupied car"),
["doortoggleleft"] = ("Przełączenie stanu drzwi lewych", "Toggle the left doors"),
["doortoggleright"] = ("Przełączenie stanu drzwi prawych", "Toggle the right doors"),
["doorpermitleft"] = ("Zezwolenie na otwarcie drzwi lewych", "Permit opening the left doors"),
["doorpermitright"] = ("Zezwolenie na otwarcie drzwi prawych", "Permit opening the right doors"),
["doorpermitpresetactivatenext"] = ("Aktywacja kolejnej konfiguracji zezwolenia na otwarcie drzwi", "Next door permit preset"),
["doorpermitpresetactivateprevious"] = ("Aktywacja poprzedniej konfiguracji zezwolenia na otwarcie drzwi", "Previous door permit preset"),
["dooropenleft"] = ("Otwarcie drzwi z lewej", "Open the left doors"),
["dooropenright"] = ("Otwarcie drzwi z prawej", "Open the right doors"),
["dooropenall"] = ("Otwarcie drzwi z zezwoleniem", "Open the permitted doors"),
["doorcloseleft"] = ("Zamknięcie drzwi lewych", "Close the left doors"),
["doorcloseright"] = ("Zamknięcie drzwi prawych", "Close the right doors"),
["doorcloseall"] = ("Zamknięcie wszystkich drzwi", "Close all doors"),
["doorsteptoggle"] = ("Przełączenie stanu stopnia drzwi", "Toggle the door steps"),
["doormodetoggle"] = ("Przełączenie trybu działania drzwi", "Toggle the door operation mode"),
["mirrorstoggle"] = ("Złożenie lub rozłożenie lusterek", "Fold or unfold the mirrors"),
["departureannounce"] = ("Sygnał odjazdu", "Departure signal"),
["doorlocktoggle"] = ("Przełączenie stanu blokady drzwi", "Toggle the door lock"),
["pantographcompressorvalvetoggle"] = ("Przełączenie stanu kurka trójdrogowego", "Toggle the three-way pantograph valve"),
["pantographcompressorvalveenable"] = ("Otwarcie zaworu sprężarki pantografów", "Open the pantograph compressor valve"),
["pantographcompressorvalvedisable"] = ("Zamknięcie zaworu sprężarki pantografów", "Close the pantograph compressor valve"),
["pantographcompressoractivate"] = ("Aktywacja sprężarki pomocniczej", "Auxiliary pantograph compressor"),
["pantographtogglefront"] = ("Przełączenie stanu pantografu przedniego", "Toggle the front pantograph"),
["pantographtogglerear"] = ("Przełączenie stanu pantografu tylnego", "Toggle the rear pantograph"),
["pantographraisefront"] = ("Podniesienie przedniego pantografu", "Raise the front pantograph"),
["pantographraiserear"] = ("Podniesienie tylnego pantografu", "Raise the rear pantograph"),
["pantographlowerfront"] = ("Opuszczenie przedniego pantografu", "Lower the front pantograph"),
["pantographlowerrear"] = ("Opuszczenie tylnego pantografu", "Lower the rear pantograph"),
["pantographlowerall"] = ("Opuszczenie wszystkich pantografów", "Lower all pantographs"),
["pantographselectnext"] = ("Aktywacja kolejnej konfiguracji wyboru pantografów", "Next pantograph selection preset"),
["pantographselectprevious"] = ("Aktywacja poprzedniej konfiguracji wyboru pantografów", "Previous pantograph selection preset"),
["pantographtoggleselected"] = ("Przełączenie stanu wybranych pantografów", "Toggle the selected pantographs"),
["pantographraiseselected"] = ("Podniesienie wybranych pantografów", "Raise the selected pantographs"),
["pantographlowerselected"] = ("Opuszczenie wybranych pantografów", "Lower the selected pantographs"),
["pantographvalvesupdate"] = ("Ustawienie zaworów pantografów", "Set the pantograph valves"),
["pantographvalvesoff"] = ("Zamknięcie zaworów pantografów", "Close the pantograph valves"),
["heatingtoggle"] = ("Przełączenie stanu ogrzewania pociągu", "Toggle train heating"),
["heatingenable"] = ("Włączenie ogrzewania pociągu", "Turn the train heating on"),
["heatingdisable"] = ("Wyłączenie ogrzewania pociągu", "Turn the train heating off"),
["lightspresetactivatenext"] = ("Aktywacja kolejnej konfiguracji reflektorów", "Next headlight preset"),
["lightspresetactivateprevious"] = ("Aktywacja poprzedniej konfiguracji reflektorów", "Previous headlight preset"),
["headlighttoggleleft"] = ("Przełączenie stanu lewego reflektora", "Toggle the left headlight"),
["headlightenableleft"] = ("Włączenie lewego reflektora z przodu", "Turn the front left headlight on"),
["headlightdisableleft"] = ("Wyłączenie lewego reflektora z przodu", "Turn the front left headlight off"),
["headlighttoggleright"] = ("Przełączenie stanu prawego reflektora", "Toggle the right headlight"),
["headlightenableright"] = ("Włączenie prawego reflektora z przodu", "Turn the front right headlight on"),
["headlightdisableright"] = ("Wyłączenie prawego reflektora z przodu", "Turn the front right headlight off"),
["headlighttoggleupper"] = ("Przełączenie stanu górnego reflektora", "Toggle the upper headlight"),
["headlightenableupper"] = ("Włączenie górnego reflektora z przodu", "Turn the front upper headlight on"),
["headlightdisableupper"] = ("Wyłączenie górnego reflektora z przodu", "Turn the front upper headlight off"),
["redmarkertoggleleft"] = ("Przełączenie lewego światła czerwonego", "Toggle the left red marker"),
["redmarkerenableleft"] = ("Włączenie lewego sygnału końcowego z przodu", "Turn the front left red marker on"),
["redmarkerdisableleft"] = ("Wyłączenie lewego sygnału końcowego z przodu", "Turn the front left red marker off"),
["redmarkertoggleright"] = ("Przełączenie prawego światła czerwonego", "Toggle the right red marker"),
["redmarkerenableright"] = ("Włączenie prawego sygnału końcowego z przodu", "Turn the front right red marker on"),
["redmarkerdisableright"] = ("Wyłączenie prawego sygnału końcowego z przodu", "Turn the front right red marker off"),
["headlighttogglerearleft"] = ("Przełączenie stanu lewego tylnego reflektora", "Toggle the rear left headlight"),
["headlightenablerearleft"] = ("Włączenie lewego reflektora z tyłu", "Turn the rear left headlight on"),
["headlightdisablerearleft"] = ("Wyłączenie lewego reflektora z tyłu", "Turn the rear left headlight off"),
["headlighttogglerearright"] = ("Przełączenie stanu prawego tylnego reflektora", "Toggle the rear right headlight"),
["headlightenablerearright"] = ("Włączenie prawego reflektora z tyłu", "Turn the rear right headlight on"),
["headlightdisablerearright"] = ("Wyłączenie prawego reflektora z tyłu", "Turn the rear right headlight off"),
["headlighttogglerearupper"] = ("Przełączenie stanu górnego tylnego reflektora", "Toggle the rear upper headlight"),
["headlightenablerearupper"] = ("Włączenie górnego reflektora z tyłu", "Turn the rear upper headlight on"),
["headlightdisablerearupper"] = ("Wyłączenie górnego reflektora z tyłu", "Turn the rear upper headlight off"),
["redmarkertogglerearleft"] = ("Przełączenie lewego tylnego światła czerwonego", "Toggle the rear left red marker"),
["redmarkerenablerearleft"] = ("Włączenie lewego sygnału końcowego z tyłu", "Turn the rear left red marker on"),
["redmarkerdisablerearleft"] = ("Wyłączenie lewego sygnału końcowego z tyłu", "Turn the rear left red marker off"),
["redmarkertogglerearright"] = ("Przełączenie prawego tylnego światła czerwonego", "Toggle the rear right red marker"),
["redmarkerenablerearright"] = ("Włączenie prawego sygnału końcowego z tyłu", "Turn the rear right red marker on"),
["redmarkerdisablerearright"] = ("Wyłączenie prawego sygnału końcowego z tyłu", "Turn the rear right red marker off"),
["redmarkerstoggle"] = ("Przełączenie świateł końca pociągu", "Toggle the end-of-train lights"),
["endsignalstoggle"] = ("Przełączenie tabliczek końca pociągu", "Toggle the end-of-train plates"),
["headlightsdimtoggle"] = ("Przełączenie przyciemnienia reflektorów", "Toggle headlight dimming"),
["headlightsdimenable"] = ("Przyciemnienie reflektorów", "Dim the headlights"),
["headlightsdimdisable"] = ("Pełne światło reflektorów", "Headlights at full"),
["motorconnectorsopen"] = ("Rozłączenie styczników liniowych", "Open the line contactors"),
["motorconnectorsclose"] = ("Załączenie styczników liniowych", "Close the line contactors"),
["motordisconnect"] = ("Odłączenie uszkodzonych silników", "Cut out the damaged motors"),
["interiorlighttoggle"] = ("Przełączenie stanu oświetlenia kabiny", "Toggle the cab light"),
["interiorlightenable"] = ("Włączenie oświetlenia kabiny", "Turn the cab light on"),
["interiorlightdisable"] = ("Wyłączenie oświetlenia kabiny", "Turn the cab light off"),
["interiorlightdimtoggle"] = ("Przełączenie przyciemnienia oświetlenia kabiny", "Toggle cab light dimming"),
["interiorlightdimenable"] = ("Przyciemnienie oświetlenia kabiny", "Dim the cab light"),
["interiorlightdimdisable"] = ("Pełne oświetlenie kabiny", "Cab light at full"),
["compartmentlightstoggle"] = ("Przełączenie stanu oświetlenia przedziałów", "Toggle the compartment lights"),
["compartmentlightsenable"] = ("Włączenie oświetlenia przedziałów", "Turn the compartment lights on"),
["compartmentlightsdisable"] = ("Wyłączenie oświetlenia przedziałów", "Turn the compartment lights off"),
["instrumentlighttoggle"] = ("Przełączenie stanu oświetlenia przyrządów", "Toggle the instrument lights"),
["instrumentlightenable"] = ("Włączenie oświetlenia przyrządów", "Turn the instrument lights on"),
["instrumentlightdisable"] = ("Wyłączenie oświetlenia przyrządów", "Turn the instrument lights off"),
["dashboardlighttoggle"] = ("Przełączenie stanu oświetlenia pulpitu", "Toggle the dashboard light"),
["dashboardlightenable"] = ("Włączenie oświetlenia pulpitu", "Turn the dashboard light on"),
["dashboardlightdisable"] = ("Wyłączenie oświetlenia pulpitu", "Turn the dashboard light off"),
["timetablelighttoggle"] = ("Przełączenie stanu oświetlenia rozkładu jazdy", "Toggle the timetable light"),
["timetablelightenable"] = ("Włączenie oświetlenia rozkładu jazdy", "Turn the timetable light on"),
["timetablelightdisable"] = ("Wyłączenie oświetlenia rozkładu jazdy", "Turn the timetable light off"),
["generictoggle0"] = ("Przełączenie elementu uniwersalnego nr 0", "Generic switch 0"),
["generictoggle1"] = ("Przełączenie elementu uniwersalnego nr 1", "Generic switch 1"),
["generictoggle2"] = ("Przełączenie elementu uniwersalnego nr 2", "Generic switch 2"),
["generictoggle3"] = ("Przełączenie elementu uniwersalnego nr 3", "Generic switch 3"),
["generictoggle4"] = ("Przełączenie elementu uniwersalnego nr 4", "Generic switch 4"),
["generictoggle5"] = ("Przełączenie elementu uniwersalnego nr 5", "Generic switch 5"),
["generictoggle6"] = ("Przełączenie elementu uniwersalnego nr 6", "Generic switch 6"),
["generictoggle7"] = ("Przełączenie elementu uniwersalnego nr 7", "Generic switch 7"),
["generictoggle8"] = ("Przełączenie elementu uniwersalnego nr 8", "Generic switch 8"),
["generictoggle9"] = ("Przełączenie elementu uniwersalnego nr 9", "Generic switch 9"),
["generictoggle10"] = ("Przełączenie elementu uniwersalnego nr 10", "Generic switch 10"),
["generictoggle11"] = ("Przełączenie elementu uniwersalnego nr 11", "Generic switch 11"),
["generictoggle12"] = ("Przełączenie elementu uniwersalnego nr 12", "Generic switch 12"),
["generictoggle13"] = ("Przełączenie elementu uniwersalnego nr 13", "Generic switch 13"),
["generictoggle14"] = ("Przełączenie elementu uniwersalnego nr 14", "Generic switch 14"),
["generictoggle15"] = ("Przełączenie elementu uniwersalnego nr 15", "Generic switch 15"),
["generictoggle16"] = ("Przełączenie elementu uniwersalnego nr 16", "Generic switch 16"),
["generictoggle17"] = ("Przełączenie elementu uniwersalnego nr 17", "Generic switch 17"),
["generictoggle18"] = ("Przełączenie elementu uniwersalnego nr 18", "Generic switch 18"),
["generictoggle19"] = ("Przełączenie elementu uniwersalnego nr 19", "Generic switch 19"),
["generictoggle20"] = ("Przełączenie elementu uniwersalnego nr 20", "Generic switch 20"),
["generictoggle21"] = ("Przełączenie elementu uniwersalnego nr 21", "Generic switch 21"),
["generictoggle22"] = ("Przełączenie elementu uniwersalnego nr 22", "Generic switch 22"),
["generictoggle23"] = ("Przełączenie elementu uniwersalnego nr 23", "Generic switch 23"),
["generictoggle24"] = ("Przełączenie elementu uniwersalnego nr 24", "Generic switch 24"),
["generictoggle25"] = ("Przełączenie elementu uniwersalnego nr 25", "Generic switch 25"),
["generictoggle26"] = ("Przełączenie elementu uniwersalnego nr 26", "Generic switch 26"),
["generictoggle27"] = ("Przełączenie elementu uniwersalnego nr 27", "Generic switch 27"),
["generictoggle28"] = ("Przełączenie elementu uniwersalnego nr 28", "Generic switch 28"),
["generictoggle29"] = ("Przełączenie elementu uniwersalnego nr 29", "Generic switch 29"),
["batterytoggle"] = ("Przełączenie stanu akumulatorów", "Toggle the batteries"),
["batteryenable"] = ("Włączenie baterii", "Turn the battery on"),
["batterydisable"] = ("Wyłączenie baterii", "Turn the battery off"),
["cabactivationtoggle"] = ("Przełączenie stanu aktywacji kabiny", "Toggle cab activation"),
["cabactivationenable"] = ("Aktywacja kabiny", "Activate the cab"),
["cabactivationdisable"] = ("Dezaktywacja kabiny", "Deactivate the cab"),
["motorblowerstogglefront"] = ("Przełączenie stanu wentylatorów przednich silników trakcyjnych", "Toggle the front traction motor blowers"),
["motorblowerstogglerear"] = ("Przełączenie stanu wentylatorów tylnych silników trakcyjnych", "Toggle the rear traction motor blowers"),
["motorblowersdisableall"] = ("Wyłączenie wszystkich wentylatorów silników trakcyjnych", "Switch off all traction motor blowers"),
["coolingfanstoggle"] = ("Przełączenie stanu wentylatorów oporów rozruchowych", "Toggle the starting resistor fans"),
["tempomattoggle"] = ("Przełączenie stanu tempomatu", "Toggle the cruise control"),
["springbraketoggle"] = ("Przełączenie stanu hamulca sprężynowego", "Toggle the spring brake"),
["springbrakeenable"] = ("Załączenie hamulca sprężynowego", "Apply the spring brake"),
["springbrakedisable"] = ("Zwolnienie hamulca sprężynowego", "Release the spring brake"),
["springbrakeshutofftoggle"] = ("Przełączenie stanu kurka odcinającego hamulca sprężynowego", "Toggle the spring brake shut-off cock"),
["springbrakeshutoffenable"] = ("Odcięcie hamulca sprężynowego", "Cut the spring brake off"),
["springbrakeshutoffdisable"] = ("Przywrócenie hamulca sprężynowego", "Cut the spring brake back in"),
["springbrakerelease"] = ("Luzowanie hamulca sprężynowego", "Release the spring brake"),
["distancecounteractivate"] = ("Załączenie miernika przejechanego dystansu", "Start the distance counter"),
["speedcontrolincrease"] = ("Zwiększenie prędkości utrzymywanej przez tempomat", "Cruise control speed up"),
["speedcontroldecrease"] = ("Zmniejszenie prędkości utrzymywanej przez tempomat", "Cruise control speed down"),
["speedcontrolpowerincrease"] = ("Zwiększenie maksymalnego poziomu mocy dostępnej dla tempomatu", "More power for the cruise control"),
["speedcontrolpowerdecrease"] = ("Zmniejszenie maksymalnego poziomu mocy dostępnej dla tempomatu", "Less power for the cruise control"),
["speedcontrolbutton0"] = ("Ustalenie dla tempomatu zdefiniowanej prędkości nr 0", "Cruise control preset speed 0"),
["speedcontrolbutton1"] = ("Ustalenie dla tempomatu zdefiniowanej prędkości nr 1", "Cruise control preset speed 1"),
["speedcontrolbutton2"] = ("Ustalenie dla tempomatu zdefiniowanej prędkości nr 2", "Cruise control preset speed 2"),
["speedcontrolbutton3"] = ("Ustalenie dla tempomatu zdefiniowanej prędkości nr 3", "Cruise control preset speed 3"),
["speedcontrolbutton4"] = ("Ustalenie dla tempomatu zdefiniowanej prędkości nr 4", "Cruise control preset speed 4"),
["speedcontrolbutton5"] = ("Ustalenie dla tempomatu zdefiniowanej prędkości nr 5", "Cruise control preset speed 5"),
["speedcontrolbutton6"] = ("Ustalenie dla tempomatu zdefiniowanej prędkości nr 6", "Cruise control preset speed 6"),
["speedcontrolbutton7"] = ("Ustalenie dla tempomatu zdefiniowanej prędkości nr 7", "Cruise control preset speed 7"),
["speedcontrolbutton8"] = ("Ustalenie dla tempomatu zdefiniowanej prędkości nr 8", "Cruise control preset speed 8"),
["speedcontrolbutton9"] = ("Ustalenie dla tempomatu zdefiniowanej prędkości nr 9", "Cruise control preset speed 9"),
["inverterenable1"] = ("Włączenie falownika 1", "Turn inverter 1 on"),
["inverterenable2"] = ("Włączenie falownika 2", "Turn inverter 2 on"),
["inverterenable3"] = ("Włączenie falownika 3", "Turn inverter 3 on"),
["inverterenable4"] = ("Włączenie falownika 4", "Turn inverter 4 on"),
["inverterenable5"] = ("Włączenie falownika 5", "Turn inverter 5 on"),
["inverterenable6"] = ("Włączenie falownika 6", "Turn inverter 6 on"),
["inverterenable7"] = ("Włączenie falownika 7", "Turn inverter 7 on"),
["inverterenable8"] = ("Włączenie falownika 8", "Turn inverter 8 on"),
["inverterenable9"] = ("Włączenie falownika 9", "Turn inverter 9 on"),
["inverterenable10"] = ("Włączenie falownika 10", "Turn inverter 10 on"),
["inverterenable11"] = ("Włączenie falownika 11", "Turn inverter 11 on"),
["inverterenable12"] = ("Włączenie falownika 12", "Turn inverter 12 on"),
["inverterdisable1"] = ("Wyłączenie falownika 1", "Turn inverter 1 off"),
["inverterdisable2"] = ("Wyłączenie falownika 2", "Turn inverter 2 off"),
["inverterdisable3"] = ("Wyłączenie falownika 3", "Turn inverter 3 off"),
["inverterdisable4"] = ("Wyłączenie falownika 4", "Turn inverter 4 off"),
["inverterdisable5"] = ("Wyłączenie falownika 5", "Turn inverter 5 off"),
["inverterdisable6"] = ("Wyłączenie falownika 6", "Turn inverter 6 off"),
["inverterdisable7"] = ("Wyłączenie falownika 7", "Turn inverter 7 off"),
["inverterdisable8"] = ("Wyłączenie falownika 8", "Turn inverter 8 off"),
["inverterdisable9"] = ("Wyłączenie falownika 9", "Turn inverter 9 off"),
["inverterdisable10"] = ("Wyłączenie falownika 10", "Turn inverter 10 off"),
["inverterdisable11"] = ("Wyłączenie falownika 11", "Turn inverter 11 off"),
["inverterdisable12"] = ("Wyłączenie falownika 12", "Turn inverter 12 off"),
["invertertoggle1"] = ("Przełączenie falownika 1", "Toggle inverter 1"),
["invertertoggle2"] = ("Przełączenie falownika 2", "Toggle inverter 2"),
["invertertoggle3"] = ("Przełączenie falownika 3", "Toggle inverter 3"),
["invertertoggle4"] = ("Przełączenie falownika 4", "Toggle inverter 4"),
["invertertoggle5"] = ("Przełączenie falownika 5", "Toggle inverter 5"),
["invertertoggle6"] = ("Przełączenie falownika 6", "Toggle inverter 6"),
["invertertoggle7"] = ("Przełączenie falownika 7", "Toggle inverter 7"),
["invertertoggle8"] = ("Przełączenie falownika 8", "Toggle inverter 8"),
["invertertoggle9"] = ("Przełączenie falownika 9", "Toggle inverter 9"),
["invertertoggle10"] = ("Przełączenie falownika 10", "Toggle inverter 10"),
["invertertoggle11"] = ("Przełączenie falownika 11", "Toggle inverter 11"),
["invertertoggle12"] = ("Przełączenie falownika 12", "Toggle inverter 12"),
["vehiclemoveforwards"] = ("Przesunięcie pojazdu do przodu", "Move the vehicle forwards"),
["vehiclemovebackwards"] = ("Przesunięcie pojazdu do tyłu", "Move the vehicle backwards"),
["vehicleboost"] = ("Przyspieszenie pojazdu", "Boost the vehicle"),
["wiperswitchincrease"] = ("Szybsza praca wycieraczek", "Wipers faster"),
["wiperswitchdecrease"] = ("Wolniejsza praca wycieraczek", "Wipers slower"),
["lightsset"] = ("Ustawienie świateł", "Set the lights"),
["oilfuelpumptoggle"] = ("Przełączenie pomp oleju i paliwa", "Toggle the oil and fuel pumps"),
["linebreakertoggleb"] = ("Przełączenie wyłącznika szybkiego B", "Toggle line breaker B"),
["linebreakeropenb"] = ("Wyłączenie wyłącznika szybkiego B", "Open line breaker B"),
["linebreakercloseb"] = ("Załączenie wyłącznika szybkiego B", "Close line breaker B"),
["linebreakertogglec"] = ("Przełączenie wyłącznika szybkiego C", "Toggle line breaker C"),
["linebreakeropenc"] = ("Wyłączenie wyłącznika szybkiego C", "Open line breaker C"),
["linebreakerclosec"] = ("Załączenie wyłącznika szybkiego C", "Close line breaker C"),
};
/// <summary>The text of <paramref name="command"/>, Polish for "pl", else English; its name when unknown.</summary>
public static string Of(string command, string languageCode) =>
Texts.TryGetValue(command, out var text) ? languageCode == "pl" ? text.Polish : text.English : command;
/// <summary>The commands there are texts for.</summary>
public static IEnumerable<string> Commands => Texts.Keys;
}

View File

@@ -155,7 +155,9 @@ public sealed class EventList : ListBox
var culture = CultureInfo.CurrentCulture;
var events = new List<BlackBoxEvent>();
foreach (var c in recording.UserCommands())
events.Add(new BlackBoxEvent(c.Time, string.Format(culture, strings["EventCommand"], c.Name), Palette.Command, false));
events.Add(new BlackBoxEvent(c.Time, string.Format(culture, strings["EventCommand"],
strings[DefaultBlackBoxStrings.CommandPrefix + c.Name]),
Palette.Command, false));
foreach (var d in recording.DriverChanges)
{
if (recording.CabAt(d.Time + 0.5) is not { } s || s.Vehicle != d.Vehicle)
@@ -176,14 +178,7 @@ public sealed class EventList : ListBox
foreach (var horn in recording.UserHornChecks())
events.Add(new BlackBoxEvent(horn.Request.Time, strings[horn.Sounded ? "EventHornSounded" : "EventHornMissed"],
horn.Sounded ? Palette.HornPoint : Palette.Bad, !horn.Sounded));
foreach (var span in recording.SecurityBrakings())
{
// Which of them was not acknowledged: the lamps blinking when it braked.
string who = recording.CabAt(span.Start) is { } s
? s.Has(SecurityFlags.CabSignal) && s.Has(SecurityFlags.Vigilance) ? "CA/SHP" : s.Has(SecurityFlags.CabSignal) ? "SHP" : "CA"
: "CA";
events.Add(new BlackBoxEvent(span.Start, string.Format(culture, strings["EventSecurityBraking"], who), Palette.Bad, true));
}
AddSecurity(recording, strings, events, culture);
AddCameras(recording, strings, events, culture);
AddCouplings(recording, strings, events, culture);
AddCabChanges(recording, strings, events, culture);
@@ -196,6 +191,45 @@ public sealed class EventList : ListBox
return events.OrderBy(e => e.Time).ToList();
}
/// <summary>
/// The train protection: its buzzer, acknowledged or not, and the braking apart. A lamp acknowledged before the
/// buzzer is the driving as usual, not told.
/// </summary>
private static void AddSecurity(Recording recording, IBlackBoxStrings strings, List<BlackBoxEvent> events, CultureInfo culture)
{
var brakings = recording.SecurityBrakings();
foreach (var span in recording.SecurityAlarms())
{
// The lamps of all its buzzing samples: one buzzer for both, the other may join it before it's acknowledged.
var lamps = recording.Cab.Where(c => c.Time >= span.Start && c.Time <= span.End && (c.VigilanceBuzzer || c.CabSignalBuzzer))
.Aggregate(SecurityFlags.None, (all, c) => all | c.Security);
string who = ProtectionName(lamps);
var before = recording.CabAt(span.Start);
string text = brakings.Any(b => b.Start >= span.Start && b.Start <= span.End)
? string.Format(culture, strings["EventSecurityAlarmMissed"], who)
// Acknowledged when the sample it ended at buzzes no more and doesn't brake, in the same vehicle: not
// the end of the recording or a gap in it, nor the power cut or the protection switched off.
: recording.CabAt(span.End) is { } after && !after.VigilanceBuzzer && !after.CabSignalBuzzer
&& !after.Has(SecurityFlags.Braking) && after.Vehicle == before?.Vehicle
? string.Format(culture, strings["EventSecurityAlarmAcknowledged"], who, span.End - span.Start)
: string.Format(culture, strings["EventSecurityAlarm"], who);
events.Add(new BlackBoxEvent(span.Start, text, Palette.Buzzer, false));
}
foreach (var span in brakings)
events.Add(new BlackBoxEvent(span.Start, string.Format(culture, strings["EventSecurityBraking"],
ProtectionName(recording.CabAt(span.Start)?.Security ?? SecurityFlags.None)),
Palette.Bad, true));
}
/// <summary>Which of them it was: the lamps blinking.</summary>
private static string ProtectionName(SecurityFlags lamps) =>
(lamps & (SecurityFlags.CabSignal | SecurityFlags.Vigilance)) switch
{
SecurityFlags.CabSignal | SecurityFlags.Vigilance => "CA/SHP",
SecurityFlags.CabSignal => "SHP",
_ => "CA"
};
private static void AddUserVehicles(Recording recording, IBlackBoxStrings strings, List<BlackBoxEvent> events, CultureInfo culture)
{
UserVehicleChange? before = null;

View File

@@ -81,6 +81,8 @@ public static class Palette
public static readonly IBrush LampOn = Brush("#4cc46e");
public static readonly IBrush LampWarning = Brush("#e8c547");
public static readonly IBrush LampAlarm = Brush("#f0584a");
/// <summary>The train protection's buzzer: still to be acknowledged, not braking yet.</summary>
public static readonly IBrush Buzzer = Brush("#c77dff");
public static readonly IBrush LightWhite = Brush("#fff6d8");
public static readonly IBrush LightRed = Brush("#ff3b30");
public static readonly IBrush Command = Brush("#8b96a3");

View File

@@ -309,16 +309,16 @@ public sealed class TimelineView : Control
rows[2].Add(x0, x1, s.BrakeCylinder > 0.2f ? BrakeShade(s.BrakeCylinder) : null, BandHeight);
if (s.Security != SecurityFlags.None || s.CabEnd != 0)
{
// The alerter and the cab signalling apart, red when not acknowledged in time.
rows[3].Add(x0, x1, s.Has(SecurityFlags.VigilanceBeeping) ? Palette.LampAlarm
// The alerter and the cab signalling apart: the lamp, then its buzzer, red when it braked.
rows[3].Add(x0, x1, s.VigilanceBuzzer ? Palette.Buzzer
: s.Has(SecurityFlags.Vigilance) ? Palette.Vigilance : null, BandHeight);
rows[4].Add(x0, x1, s.Has(SecurityFlags.CabSignalBeeping) ? Palette.LampAlarm
rows[4].Add(x0, x1, s.CabSignalBuzzer ? Palette.Buzzer
: s.Has(SecurityFlags.CabSignal) ? Palette.CabSignal : null, BandHeight);
if (s.Has(SecurityFlags.Braking))
if (s.ProtectionBraking)
rows[s.Has(SecurityFlags.CabSignal) && !s.Has(SecurityFlags.Vigilance) ? 4 : 3].Add(x0, x1, Palette.Bad, BandHeight);
}
else
rows[3].Add(x0, x1, (s.Flags & CabFlags.AlerterBeeping) != 0 ? Palette.LampAlarm
rows[3].Add(x0, x1, (s.Flags & CabFlags.AlerterBeeping) != 0 ? Palette.Buzzer
: (s.Flags & CabFlags.AlerterBlinking) != 0 ? Palette.Vigilance : null, BandHeight);
// Where the user looked from: the samples go on in time, and so does the camera.
while (camera + 1 < cameras.Count && cameras[camera + 1].Time <= s.Time)
@@ -590,7 +590,8 @@ public sealed class TimelineView : Control
foreach (var d in recording.DriverChanges)
Consider(d.Time, () => Strings[d.Driving == Driver.Ai ? "TlAutopilotOn" : "TlAutopilotOff"]);
foreach (var c in recording.UserCommands())
Consider(c.Time, () => string.Format(culture, Strings["TlCommand"], c.Name));
Consider(c.Time, () => string.Format(culture, Strings["TlCommand"],
Strings[DefaultBlackBoxStrings.CommandPrefix + c.Name]));
}
return found;
}

View File

@@ -520,7 +520,13 @@ public sealed class Recording
}
/// <summary>When the train protection braked the user's train: the alerter or the cab signalling not acknowledged.</summary>
public IReadOnlyList<TimeSpanRange> SecurityBrakings() => CabSpans(s => s.Has(SecurityFlags.Braking));
public IReadOnlyList<TimeSpanRange> SecurityBrakings() => CabSpans(s => s.ProtectionBraking);
/// <summary>
/// When the train protection's buzzer sounded in the user's cab: a lamp not acknowledged in time, the braking to
/// follow unless acknowledged on. Until it ends, braking included.
/// </summary>
public IReadOnlyList<TimeSpanRange> SecurityAlarms() => CabSpans(s => s.VigilanceBuzzer || s.CabSignalBuzzer);
/// <summary>The commands the user gave in a vehicle, presses only.</summary>
public IEnumerable<CommandEntry> UserCommands() => _commands.Where(c => c.Pressed && c.Vehicle != 0);

View File

@@ -371,6 +371,21 @@ public readonly record struct CabSample(double Time, int Vehicle, Position Posit
public bool Has(CabDevices device) => (Devices & device) == device;
public bool Has(SecurityFlags flag) => (Security & flag) == flag;
/// <summary>
/// The alerter's buzzer: its lamp not acknowledged in time. A protection with one acknowledgement for both tells
/// the cab signalling's buzzer as the alerter's too, so the alerter's lamp has to blink with it.
/// </summary>
public bool VigilanceBuzzer => Has(SecurityFlags.VigilanceBeeping) && Has(SecurityFlags.Vigilance);
/// <summary>The cab signalling's buzzer: its lamp not acknowledged in time.</summary>
public bool CabSignalBuzzer => Has(SecurityFlags.CabSignalBeeping);
/// <summary>
/// The train protection braking for an alarm not acknowledged, its lamp blinking. Braking with no lamp is the
/// protection with no power (TSecuritySystem::is_braking), a cab not started or a power cut: no driver's fault.
/// </summary>
public bool ProtectionBraking => Has(SecurityFlags.Braking) && (Has(SecurityFlags.Vigilance) || Has(SecurityFlags.CabSignal));
public bool AiValid => (Flags & CabFlags.AiValid) != 0;
public bool InCab => (Flags & CabFlags.InCab) != 0;
public float AbsSpeedKmh => Math.Abs(SpeedKmh);

View File

@@ -0,0 +1,43 @@
using Eu07.BlackBox;
using Eu07.BlackBox.Views;
namespace StarterNG.Tests.BlackBox;
public class EventTextsTests
{
[Theory]
[InlineData("pl", "aidriverenable", "Aktywacja automechanika")]
[InlineData("en", "aidriverenable", "Engage the AI driver")]
[InlineData("pl", "mastercontrollerset", "Ustawienie nastawnika głównego")]
[InlineData("pl", "headlightenablerearleft", "Włączenie lewego reflektora z tyłu")]
[InlineData("cz", "batteryenable", "Turn the battery on")]
public void A_command_is_told_by_what_it_does(string language, string command, string text) =>
Assert.Equal(text, new DefaultBlackBoxStrings(language)[DefaultBlackBoxStrings.CommandPrefix + command]);
[Fact]
public void A_command_with_no_text_keeps_its_name() =>
Assert.Equal("somethingnew", new DefaultBlackBoxStrings("pl")[DefaultBlackBoxStrings.CommandPrefix + "somethingnew"]);
[Fact]
public void Every_command_has_both_texts_starting_with_a_capital()
{
foreach (string command in CommandTexts.Commands)
foreach (string language in new[] { "pl", "en" })
{
string text = CommandTexts.Of(command, language);
Assert.NotEqual(command, text);
Assert.True(char.IsUpper(text[0]), $"{command} ({language}): {text}");
}
}
[Fact]
public void The_events_name_the_commands_by_what_they_do()
{
var recording = BlackBoxReader.Read(new BlackBoxFile().Info()
.Vehicle(1, "EP07-424").User(0, 1, true).Command(12.0, 1, true, "batteryenable").Stream());
var events = EventList.Collect(recording, new DefaultBlackBoxStrings("pl"));
Assert.Contains(events, e => e.Text == "Włączenie baterii");
}
}

View File

@@ -0,0 +1,88 @@
using System.Globalization;
using Eu07.BlackBox;
using Eu07.BlackBox.Views;
namespace StarterNG.Tests.BlackBox;
public class SecurityBrakingTests
{
// as the simulator writes them: one acknowledgement for both, so the cab signalling's buzzer is the alerter's too
private const byte CabSignal = 0x02, CabSignalBuzzing = 0x0e, CabSignalBraking = 0x1e, NoPower = 0x10;
private static Recording Drive(System.Func<double, byte> security)
{
var file = new BlackBoxFile().Info().Vehicle(1, "EP07-424").User(0, 1, true);
for (double t = 0; t <= 20; t += 0.5)
file.Cab(t, 1, 100, 0, security: security(t));
return BlackBoxReader.Read(file.Stream());
}
private static List<string> Events(Recording recording)
{
var culture = CultureInfo.CurrentCulture;
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
try
{
return EventList.Collect(recording, new DefaultBlackBoxStrings("pl")).Select(e => e.Text).ToList();
}
finally
{
CultureInfo.CurrentCulture = culture;
}
}
[Fact]
public void The_protection_braking_with_no_power_is_not_the_drivers_fault()
{
// no power for the first seconds, then the cab signalling not acknowledged
var recording = Drive(t => t < 5 ? NoPower : t is >= 10 and < 12 ? (byte)0x1a : (byte)0);
var braking = Assert.Single(recording.SecurityBrakings());
Assert.Equal(10, braking.Start, 6);
}
[Fact]
public void A_buzzer_acknowledged_in_time_is_told_apart_from_braking()
{
var recording = Drive(t => t is >= 2 and < 4 ? CabSignal : t is >= 4 and < 5.5 ? CabSignalBuzzing : (byte)0);
var events = Events(recording);
Assert.Contains("Brzęczyk SHP, potwierdzony po 1.5 s", events);
Assert.DoesNotContain(events, e => e.StartsWith("HAMOWANIE", System.StringComparison.Ordinal));
Assert.Empty(recording.SecurityBrakings());
}
[Fact]
public void A_buzzer_cut_by_the_power_is_not_acknowledged()
{
var recording = Drive(t => t is >= 2 and < 4 ? CabSignalBuzzing : t is >= 4 and < 8 ? NoPower : (byte)0);
var events = Events(recording);
Assert.Contains("Brzęczyk SHP", events);
Assert.DoesNotContain(events, e => e.Contains("potwierdzony", System.StringComparison.Ordinal));
}
[Fact]
public void A_buzzer_the_other_joins_is_named_by_both()
{
// the alerter's buzzer, then a magnet passed before it's acknowledged
var recording = Drive(t => t is >= 2 and < 4 ? (byte)0x05 : t is >= 4 and < 5 ? (byte)0x0f : (byte)0);
Assert.Contains("Brzęczyk CA/SHP, potwierdzony po 3.0 s", Events(recording));
}
[Fact]
public void A_buzzer_not_acknowledged_is_followed_by_the_braking()
{
// the cab signalling at the start: the buzzer at once, braking when not acknowledged
var recording = Drive(t => t < 3 ? CabSignalBuzzing : t < 6 ? CabSignalBraking : (byte)0);
var events = Events(recording);
Assert.Equal(["Brzęczyk SHP, bez potwierdzenia", "HAMOWANIE PRZEZ SHP"],
events.Where(e => e.Contains("SHP", System.StringComparison.Ordinal)));
Assert.DoesNotContain(events, e => e.Contains("CA", System.StringComparison.Ordinal));
}
}

View File

@@ -0,0 +1,65 @@
using StarterNG.Infrastructure.Adapters;
namespace StarterNG.Tests;
public sealed class FolderChangesTests : IDisposable
{
private static readonly TimeSpan Patience = TimeSpan.FromSeconds(10);
private readonly string _root = Path.Combine(Path.GetTempPath(), "folder-changes-" + Guid.NewGuid().ToString("N"));
public FolderChangesTests() => Directory.CreateDirectory(Path.Combine(_root, "sub"));
public void Dispose() => Directory.Delete(_root, recursive: true);
private static async Task<bool> Reported(FolderChanges changes, Action change)
{
var told = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
changes.Changed += () => told.TrySetResult();
change();
return await Task.WhenAny(told.Task, Task.Delay(Patience)) == told.Task;
}
[Fact]
public async Task A_file_written_below_the_folder_is_reported()
{
string file = Path.Combine(_root, "sub", "a.scm");
File.WriteAllText(file, "old");
using var changes = new FolderChanges(_root);
Assert.True(changes.Watching);
Assert.True(await Reported(changes, () => File.WriteAllText(file, "new text")));
}
[Fact]
public async Task A_save_through_a_renamed_temp_file_is_reported()
{
string file = Path.Combine(_root, "test.scn");
File.WriteAllText(file, "old");
using var changes = new FolderChanges(_root);
Assert.True(await Reported(changes, () =>
{
string temp = file + ".tmp";
File.WriteAllText(temp, "new");
File.Move(temp, file, overwrite: true);
}));
}
[Fact]
public async Task A_file_removed_is_reported()
{
string file = Path.Combine(_root, "gone.scn");
File.WriteAllText(file, "x");
using var changes = new FolderChanges(_root);
Assert.True(await Reported(changes, () => File.Delete(file)));
}
[Fact]
public void A_missing_folder_is_not_watched_and_does_not_throw()
{
using var changes = new FolderChanges(Path.Combine(_root, "nowhere"));
Assert.False(changes.Watching);
}
}

View File

@@ -0,0 +1,80 @@
using StarterNG.Application;
namespace StarterNG.Tests;
public class OneAtATimeTests
{
private static async Task Until(Func<bool> condition)
{
var giveUp = DateTime.UtcNow.AddSeconds(5);
while (!condition())
{
Assert.True(DateTime.UtcNow < giveUp, "waited too long");
await Task.Delay(10);
}
}
[Fact]
public async Task Asked_once_it_runs_once()
{
int runs = 0;
var once = new OneAtATime(() => { runs++; return Task.CompletedTask; });
await once.RunAsync();
Assert.Equal(1, runs);
Assert.False(once.IsRunning);
}
[Fact]
public async Task Asked_while_running_it_runs_once_more_after_not_alongside()
{
int runs = 0, together = 0, most = 0;
var gates = new Queue<TaskCompletionSource>();
var once = new OneAtATime(async () =>
{
runs++;
most = Math.Max(most, ++together);
var gate = new TaskCompletionSource();
gates.Enqueue(gate);
await gate.Task;
together--;
});
var first = once.RunAsync();
// Three requests during the first run make one more run, not three.
await once.RunAsync();
await once.RunAsync();
await once.RunAsync();
Assert.Equal(1, runs);
gates.Dequeue().SetResult();
await Until(() => Volatile.Read(ref runs) == 2);
await Until(() => gates.Count == 1);
gates.Dequeue().SetResult();
await first;
Assert.Equal(2, runs);
Assert.Equal(1, most);
Assert.False(once.IsRunning);
}
[Fact]
public async Task A_failed_run_does_not_keep_it_busy()
{
bool fail = true;
int runs = 0;
var once = new OneAtATime(() =>
{
runs++;
return fail ? Task.FromException(new IOException("locked")) : Task.CompletedTask;
});
await Assert.ThrowsAsync<IOException>(once.RunAsync);
fail = false;
await once.RunAsync();
Assert.Equal(2, runs);
Assert.False(once.IsRunning);
}
}

View File

@@ -0,0 +1,45 @@
using System;
using System.Threading.Tasks;
namespace StarterNG.Application;
/// <summary>
/// Runs a piece of work one at a time. Asked again while it runs, it does not start a
/// second one alongside, nor forget the request: it runs once more when the first ends,
/// however many times it was asked meanwhile. For the UI thread, which calls it alone.
/// </summary>
public sealed class OneAtATime
{
private readonly Func<Task> _work;
private bool _running;
private bool _again;
public OneAtATime(Func<Task> work) => _work = work;
public bool IsRunning => _running;
public async Task RunAsync()
{
if (_running)
{
_again = true;
return;
}
_running = true;
try
{
do
{
_again = false;
await _work();
}
while (_again);
}
finally
{
_running = false;
_again = false;
}
}
}

View File

@@ -0,0 +1,55 @@
using System;
using System.IO;
namespace StarterNG.Infrastructure.Adapters;
/// <summary>
/// Tells when anything in a folder or below it is written, made, removed or renamed, as
/// the system reports it. Only a hint that it is time to look: a save comes as several
/// reports, and on a network drive, under Wine or past the system's limit of watches it
/// may come as none, so whoever listens still looks now and then on its own.
/// </summary>
public sealed class FolderChanges : IDisposable
{
private readonly FileSystemWatcher? _watcher;
/// <summary>Something changed, or the reports were lost and anything may have: on a thread of the pool.</summary>
public event Action? Changed;
/// <param name="folder">Watched with everything below it; a missing one is not watched.</param>
public FolderChanges(string folder)
{
try
{
if (!Directory.Exists(folder))
return;
var watcher = new FileSystemWatcher(folder)
{
IncludeSubdirectories = true,
NotifyFilter = NotifyFilters.FileName | NotifyFilters.DirectoryName
| NotifyFilters.LastWrite | NotifyFilters.Size,
// Unpacking an update changes hundreds of files at once.
InternalBufferSize = 64 * 1024
};
watcher.Changed += (_, _) => Changed?.Invoke();
watcher.Created += (_, _) => Changed?.Invoke();
watcher.Deleted += (_, _) => Changed?.Invoke();
watcher.Renamed += (_, _) => Changed?.Invoke();
// Too many at once for the buffer: which ones is lost, so all are looked at.
watcher.Error += (_, _) => Changed?.Invoke();
watcher.EnableRaisingEvents = true;
_watcher = watcher;
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or ArgumentException
or PlatformNotSupportedException)
{
// Out of watches on Linux, or a drive that gives none: the slow look alone stays.
}
}
/// <summary>Whether the system reports changes here at all.</summary>
public bool Watching => _watcher is not null;
public void Dispose() => _watcher?.Dispose();
}

View File

@@ -15,6 +15,7 @@ using Avalonia.VisualTree;
using StarterNG.Classes;
using StarterNG.Controls;
using StarterNG.Infrastructure;
using StarterNG.Infrastructure.Adapters;
using StarterNG.Views;
using StarterNG.Application;
using StarterNG.Application.Abstractions;
@@ -40,8 +41,16 @@ public partial class MainWindow : Window
private DateTime _openedUtc = DateTime.UtcNow;
private DateTime _startedUtc = DateTime.MinValue;
private bool _starting;
private bool _lookingAtSceneryFiles;
private readonly DispatcherTimer _sceneryFilesTimer = new() { Interval = TimeSpan.FromSeconds(2) };
// Scenery files: looked at when the system reports a change, once the burst a save makes
// has passed; on coming back to the window or from the simulator; and now and then anyway,
// for the drives and systems where the reports do not come - often where none come at all.
private static readonly TimeSpan SceneryQuiet = TimeSpan.FromMilliseconds(400);
private static readonly TimeSpan SceneryLookWatched = TimeSpan.FromSeconds(30);
private static readonly TimeSpan SceneryLookUnwatched = TimeSpan.FromSeconds(2);
private readonly DispatcherTimer _sceneryQuietTimer = new() { Interval = SceneryQuiet };
private readonly DispatcherTimer _sceneryFilesTimer = new() { Interval = SceneryLookUnwatched };
private readonly OneAtATime _sceneryLook;
private FolderChanges? _sceneryChanges;
public MainWindow()
{
@@ -102,35 +111,60 @@ public partial class MainWindow : Window
AddHandler(KeyDownEvent, OnTabWithNothingFocused, RoutingStrategies.Tunnel);
AppServices.Current.State.Changed += UpdateStartButton;
_sceneryLook = new OneAtATime(LookAtSceneryFilesAsync);
Opened += (_, _) =>
{
_openedUtc = DateTime.UtcNow;
UpdateStartButton();
_sceneryFilesTimer.Start();
WatchSceneryFiles();
FollowLastRun();
};
Activated += (_, _) =>
Activated += async (_, _) =>
{
CheckExternalSettings();
// Back from a build or a download: a new simulator is on the list already.
if (SettingsView.IsVisible)
SettingsView.RefreshExecutables();
await _sceneryLook.RunAsync();
};
_sceneryFilesTimer.Tick += async (_, _) => await LookAtSceneryFilesAsync();
Closed += (_, _) => _sceneryFilesTimer.Stop();
_sceneryFilesTimer.Tick += async (_, _) => await _sceneryLook.RunAsync();
_sceneryQuietTimer.Tick += async (_, _) =>
{
_sceneryQuietTimer.Stop();
await _sceneryLook.RunAsync();
};
Closed += (_, _) =>
{
_sceneryFilesTimer.Stop();
_sceneryQuietTimer.Stop();
_sceneryChanges?.Dispose();
};
}
private void WatchSceneryFiles()
{
_sceneryChanges = new FolderChanges(AppServices.Current.Paths.Scenery);
// Each report puts the look off again, so a save of many files is one look after it.
_sceneryChanges.Changed += () => Dispatcher.UIThread.Post(() =>
{
_sceneryQuietTimer.Stop();
_sceneryQuietTimer.Start();
});
_sceneryFilesTimer.Interval = _sceneryChanges.Watching ? SceneryLookWatched : SceneryLookUnwatched;
_sceneryFilesTimer.Start();
}
/// <summary>
/// Scenery files changed outside the starter are picked up without a reload. Not
/// with the simulator running: it is left in peace, and what it changes comes in after it.
/// Run through <see cref="_sceneryLook"/>, one look at a time.
/// </summary>
private async Task LookAtSceneryFilesAsync()
{
if (_lookingAtSceneryFiles || AppServices.Current.State.SimulatorRunning || !IsVisible || WindowState == WindowState.Minimized)
if (AppServices.Current.State.SimulatorRunning || !IsVisible || WindowState == WindowState.Minimized)
return;
_lookingAtSceneryFiles = true;
try
{
var services = AppServices.Current;
@@ -146,10 +180,6 @@ public partial class MainWindow : Window
{
Diagnostics.Log("Following the scenery files", ex);
}
finally
{
_lookingAtSceneryFiles = false;
}
}
/// <summary>
@@ -742,6 +772,8 @@ public partial class MainWindow : Window
FollowLastRun();
RestoreFromSimulator();
ReportIfCrashed(simulator, executable, started);
// What the simulator or its editor wrote while it ran comes in now.
_ = _sceneryLook.RunAsync();
}), TaskScheduler.Default);
}

View File

@@ -1,3 +1,5 @@
using System;
using System.Globalization;
using Eu07.BlackBox.Views;
namespace StarterNG.Views.Tapes;
@@ -15,7 +17,14 @@ internal sealed class StarterBlackBoxStrings : IBlackBoxStrings
get
{
string text = App.Loc.Opt("BlackBox" + key);
return text.Length > 0 ? text : _own[key];
if (text.Length > 0)
return text;
// The commands in a language of the old starter's key descriptions, as the keys tab names them; in Polish
// and English the window's own.
if (key.StartsWith(DefaultBlackBoxStrings.CommandPrefix, StringComparison.Ordinal) && App.Loc.CurrentLangCode is not ("pl" or "en")
&& App.Loc.Opt(key) is { Length: > 0 } described)
return char.ToUpper(described[0], CultureInfo.CurrentCulture) + described[1..];
return _own[key];
}
}
}

View File

@@ -901,8 +901,8 @@
<String key="Cmd.trainbrakecharging">train brake valve: overcharge the brake pipe</String>
<String key="Cmd.trainbrakerelease">train brake valve: running position</String>
<String key="Cmd.trainbrakefirstservice">train brake valve: first braking step</String>
<String key="Cmd.trainbrakeservice">train brake valve: full service</String>
<String key="Cmd.trainbrakefullservice">train brake valve: supplementary braking</String>
<String key="Cmd.trainbrakeservice">train brake valve: service braking</String>
<String key="Cmd.trainbrakefullservice">train brake valve: full service</String>
<String key="Cmd.trainbrakehandleoff">train brake valve: lap position</String>
<String key="Cmd.trainbrakeemergency">emergency braking</String>
<String key="Cmd.trainbrakebasepressureincrease">raise the brake pipe pressure level</String>
@@ -1012,7 +1012,7 @@
<String key="Cmd.interiorlightdimtoggle">toggle cab light dimming</String>
<String key="Cmd.compartmentlightstoggle">toggle the compartment lights</String>
<String key="Cmd.instrumentlighttoggle">toggle the instrument lights</String>
<String key="Cmd.dashboardlighttoggle">toggle the desk lights</String>
<String key="Cmd.dashboardlighttoggle">toggle the dashboard light</String>
<String key="Cmd.timetablelighttoggle">toggle the timetable light</String>
<String key="Cmd.generictoggle0">generic switch 0</String>
<String key="Cmd.generictoggle1">generic switch 1</String>