mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-11 16:57:11 +01:00
fix(blackbox): the driver's valve as its gauge shows, no clash of the traction's labels, fewer self-made events
- The pressure of the driver's valve is named as what its gauge shows (the equalizing reservoir, the FV4a's time reservoir), alike in both languages. - The traction's values are clipped to their columns, and the torque converter's label is shorter: it ran into the oil pressure's. - The doors in two columns, the radio's label shorter: the names were cut. - The compressor and the motor fans go on and off by themselves: no events for them. - The summary of HeadCodes.Right back above it.
This commit is contained in:
@@ -203,7 +203,7 @@ public sealed class DefaultBlackBoxStrings : IBlackBoxStrings
|
||||
["CabLightsWant"] = "{0}, should be {1}",
|
||||
["CabLightsNone"] = "no lamps",
|
||||
["CabBrakeSetting"] = "setting {0}",
|
||||
["CabEqualizing"] = "Equalizing reservoir",
|
||||
["CabDriverValve"] = "Driver's valve",
|
||||
["CabFeedPipe"] = "Main reservoir pipe",
|
||||
["CabConsistCylinder"] = "Cylinders, train max",
|
||||
["CabPower"] = "Power",
|
||||
@@ -214,7 +214,7 @@ public sealed class DefaultBlackBoxStrings : IBlackBoxStrings
|
||||
["CabEngine"] = "Engine",
|
||||
["CabNoDrive"] = "no drive of its own",
|
||||
["CabClutch"] = "Clutch",
|
||||
["CabConverterFill"] = "Torque converter",
|
||||
["CabConverterFill"] = "Converter",
|
||||
["CabIntegrated"] = "Driving handle",
|
||||
["CabGroupDoors"] = "Doors",
|
||||
["DevDoorPermitLeft"] = "Left doors permitted",
|
||||
@@ -474,7 +474,7 @@ public sealed class DefaultBlackBoxStrings : IBlackBoxStrings
|
||||
["CabLightsWant"] = "{0}, a ma być {1}",
|
||||
["CabLightsNone"] = "brak lamp",
|
||||
["CabBrakeSetting"] = "nastawa {0}",
|
||||
["CabEqualizing"] = "Zbiornik czasowy",
|
||||
["CabDriverValve"] = "Zawór maszynisty",
|
||||
["CabFeedPipe"] = "Przewód zasilający",
|
||||
["CabConsistCylinder"] = "Cylindry, skład max",
|
||||
["CabPower"] = "Moc",
|
||||
@@ -485,7 +485,7 @@ public sealed class DefaultBlackBoxStrings : IBlackBoxStrings
|
||||
["CabEngine"] = "Silnik",
|
||||
["CabNoDrive"] = "brak własnego napędu",
|
||||
["CabClutch"] = "Sprzęgło",
|
||||
["CabConverterFill"] = "Przekładnia hydr.",
|
||||
["CabConverterFill"] = "Przekładnia",
|
||||
["CabIntegrated"] = "Zadajnik",
|
||||
["CabGroupDoors"] = "Drzwi",
|
||||
["DevDoorPermitLeft"] = "Zezwolenie lewe",
|
||||
@@ -500,7 +500,7 @@ public sealed class DefaultBlackBoxStrings : IBlackBoxStrings
|
||||
["DevMotorBlowers"] = "Wentylatory silników",
|
||||
["DevEngineHot"] = "Przegrzanie silnika",
|
||||
["DevSpeedControl"] = "Tempomat",
|
||||
["DevRadioChannel"] = "Radiotelefon, kanał {0}",
|
||||
["DevRadioChannel"] = "Radio, kanał {0}",
|
||||
["DevHandBrake"] = "Hamulec ręczny",
|
||||
["DevHornTone"] = "Syrena ({0})",
|
||||
["HornLow"] = "niski",
|
||||
|
||||
@@ -20,7 +20,7 @@ public sealed class CabPanel : Control
|
||||
{
|
||||
private const double Pad = 14;
|
||||
private const double LampRow = 14;
|
||||
private const int DoorColumns = 3;
|
||||
private const int DoorColumns = 2;
|
||||
|
||||
private Recording? _recording;
|
||||
private double _time;
|
||||
@@ -34,7 +34,7 @@ public sealed class CabPanel : Control
|
||||
public CabPanel()
|
||||
{
|
||||
ClipToBounds = true;
|
||||
Height = 650;
|
||||
Height = 664;
|
||||
}
|
||||
|
||||
public IBlackBoxStrings Strings { get; set; } = new DefaultBlackBoxStrings();
|
||||
@@ -129,8 +129,8 @@ public sealed class CabPanel : Control
|
||||
double y = top + gauge;
|
||||
if (extra is { } x1)
|
||||
{
|
||||
// where the driver's brake valve takes the pipe
|
||||
Gauge(context, Strings["CabEqualizing"], x1.EqualizingReservoir, 6, null, $"{x1.EqualizingReservoir:0.00} bar", Palette.Target, Pad, y, width);
|
||||
// what the driver's brake valve shows: its equalizing reservoir, the FV4a's time reservoir
|
||||
Gauge(context, Strings["CabDriverValve"], x1.DriverValve, 6, null, $"{x1.DriverValve:0.00} bar", Palette.Target, Pad, y, width);
|
||||
y += gauge;
|
||||
}
|
||||
Gauge(context, Strings["CabCylinder"], s.BrakeCylinder, 6, null, $"{s.BrakeCylinder:0.0} bar", Palette.Brakes, Pad, y, width);
|
||||
@@ -211,7 +211,7 @@ public sealed class CabPanel : Control
|
||||
x += groupWidth;
|
||||
}
|
||||
|
||||
// The doors under them, across: open, permitted, the departure signal, the steps and the lock.
|
||||
// The doors under them, in two columns: open, permitted, the departure signal, the steps and the lock.
|
||||
top = Math.Max(bottom, top + 16 + 9 * LampRow) + 6;
|
||||
context.DrawText(MapView.Text(Strings["CabGroupDoors"], Palette.DimText, 10, FontWeight.SemiBold), new Point(Pad, top));
|
||||
var doors = Doors(s);
|
||||
@@ -232,8 +232,11 @@ public sealed class CabPanel : Control
|
||||
/// </summary>
|
||||
private void DrawDrive(DrawingContext context, CabSample s, double top, double third, CultureInfo culture)
|
||||
{
|
||||
void At(int column, int row, string label, string value, IBrush? brush = null) =>
|
||||
Value(context, label, value, Pad + column * third, top + row * 36, brush);
|
||||
void At(int column, int row, string label, string value, IBrush? brush = null)
|
||||
{
|
||||
using (context.PushClip(new Rect(Pad + column * third, top + row * 36, third - 4, 34)))
|
||||
Value(context, label, value, Pad + column * third, top + row * 36, brush);
|
||||
}
|
||||
|
||||
string voltage = _powered.Contains(s.Vehicle) ? $"{s.Voltage:0} V" : "—";
|
||||
if (s.Extra is not { } e)
|
||||
@@ -535,7 +538,7 @@ public sealed class CabPanel : Control
|
||||
return [("CabGroupPower", power.ToArray()), ("CabGroupDriving", driving.ToArray()), ("CabGroupSafety", safety.ToArray())];
|
||||
}
|
||||
|
||||
/// <summary>The doors of the vehicle the user is in, in rows of three: open, the lock, the permits, the steps, the departure signal.</summary>
|
||||
/// <summary>The doors of the vehicle the user is in, in rows of two: open, the lock, the permits, the steps, the departure signal.</summary>
|
||||
private (string Text, IBrush? Lit)[] Doors(CabSample s)
|
||||
{
|
||||
(string, IBrush?) On(string key, CabDevices device, IBrush colour) => (Strings[key], s.Has(device) ? colour : null);
|
||||
|
||||
@@ -267,12 +267,15 @@ public sealed class EventList : ListBox
|
||||
_ => "CameraFree"
|
||||
};
|
||||
|
||||
/// <summary>The switches the driver worked, as the cab tells them: what came on and went off.</summary>
|
||||
/// <summary>
|
||||
/// The switches the driver worked, as the cab tells them: what came on and went off. Not the compressor and the
|
||||
/// motor fans, which go on and off by themselves.
|
||||
/// </summary>
|
||||
private static readonly (CabDevices Device, string Key)[] Switched =
|
||||
[
|
||||
(CabDevices.MainBreaker, "DevMainBreaker"), (CabDevices.PantographFront, "DevPantographFront"),
|
||||
(CabDevices.PantographRear, "DevPantographRear"), (CabDevices.FuelPump, "DevFuelPump"), (CabDevices.OilPump, "DevOilPump"),
|
||||
(CabDevices.Converter, "DevConverter"), (CabDevices.Compressor, "DevCompressor"), (CabDevices.MotorBlowers, "DevMotorBlowers"),
|
||||
(CabDevices.Converter, "DevConverter"),
|
||||
(CabDevices.Heating, "DevHeating"), (CabDevices.Radio, "DevRadio"), (CabDevices.ShuntMode, "DevShuntMode"),
|
||||
(CabDevices.SpringBrake, "DevSpringBrake"), (CabDevices.BrakeReleaser, "DevBrakeReleaser"),
|
||||
(CabDevices.DoorPermitLeft, "DevDoorPermitLeft"), (CabDevices.DoorPermitRight, "DevDoorPermitRight"),
|
||||
|
||||
@@ -86,13 +86,13 @@ public static class HeadCodes
|
||||
_ => null
|
||||
};
|
||||
|
||||
/// <summary>Whether both ends showed what they were to; null when nothing tells it.</summary>
|
||||
/// <summary>
|
||||
/// An end with no lamp at all, a draisine's: the simulator still asks it for a signal it can't show, so it
|
||||
/// is not judged. A recording made before the lamps were written can't tell.
|
||||
/// </summary>
|
||||
public static bool NoLamps(Lights? equipped) => equipped == Lights.None;
|
||||
|
||||
/// <summary>Whether both ends showed what they were to; null when nothing tells it.</summary>
|
||||
public static bool? Right(CabSample sample) =>
|
||||
HeadRight(sample) is { } head && TailRight(sample) is { } tail ? head && tail : null;
|
||||
|
||||
|
||||
@@ -118,12 +118,12 @@ public enum EngineKind : byte
|
||||
|
||||
/// <summary>
|
||||
/// The rest of a look at the user's train, written from the same version as the doors' permits: what drives it,
|
||||
/// the brakes' setting and mode, the hand brake, the radio, the horn, the pressures of the equalizing reservoir
|
||||
/// and the main reservoir pipe, a diesel's oil, temperatures, clutch and torque converter, the cruise control,
|
||||
/// the brakes' setting and mode, the hand brake, the radio, the horn, the pressure the driver's brake valve shows
|
||||
/// (its equalizing reservoir, the FV4a's time reservoir) and that of the main reservoir pipe, a diesel's oil, temperatures, clutch and torque converter, the cruise control,
|
||||
/// the power and the integrated controller of a unit, the highest brake cylinder pressure of the train. The
|
||||
/// temperatures and the oil mean something for a diesel only.
|
||||
/// </summary>
|
||||
public readonly record struct CabExtra(EngineKind Engine, byte BrakeDelay, byte RadioChannel, float EqualizingReservoir,
|
||||
public readonly record struct CabExtra(EngineKind Engine, byte BrakeDelay, byte RadioChannel, float DriverValve,
|
||||
float FeedPipe, float OilPressure, float WaterTemperature, float OilTemperature,
|
||||
float EngineTemperature, float SpeedControlKmh, float EnginePower, sbyte HandBrake,
|
||||
byte BrakeMode, byte Horn, float IntegratedController, float Clutch, float ConverterFill,
|
||||
|
||||
Reference in New Issue
Block a user