From 2d5a67d4cdd9e0a9f4b923f40287150a72fadaa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Benito=20Lamata?= Date: Sat, 6 Jul 2024 23:18:32 +0200 Subject: [PATCH] Fix dynamic brake force indicator --- .../RollingStocks/MSTSLocomotive.cs | 23 +++---------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs b/Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs index 224a04f55..e432895b2 100644 --- a/Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs +++ b/Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs @@ -5456,37 +5456,20 @@ public virtual float GetDataOf(CabViewControl cvc) var direction = 0; // Forwards if (cvc is CVCGauge && ((CVCGauge)cvc).Orientation == 0) direction = ((CVCGauge)cvc).Direction; - data = 0.0f; data = DynamicBrakeForceN; - if (data > 0 && SpeedMpS > 0 || data < 0 && SpeedMpS < 0) - { - data = 0; - break; - } - data = Math.Abs(data); switch (cvc.Units) { case CABViewControlUnits.AMPS: - if (MaxCurrentA == 0) - MaxCurrentA = (float)cvc.MaxValue; if (DynamicBrakeMaxCurrentA == 0) - DynamicBrakeMaxCurrentA = (float)cvc.MinValue; - if (ThrottlePercent > 0) - { - data = 0; - } - if (DynamicBrakePercent > 0) - { - data = (DynamicBrakeForceN / MaxDynamicBrakeForceN) * DynamicBrakeMaxCurrentA; - } - data = Math.Abs(data); + DynamicBrakeMaxCurrentA = (float)cvc.MaxValue; + data = data / MaxDynamicBrakeForceN * DynamicBrakeMaxCurrentA; break; case CABViewControlUnits.NEWTONS: break; case CABViewControlUnits.KILO_NEWTONS: - data = data / 1000.0f; + data /= 1000.0f; break; case CABViewControlUnits.KILO_LBS: