Skip to content

Commit 99ca163

Browse files
committed
Automatic merge of T1.5.1-1695-gade019506 and 17 pull requests
- Pull request #570 at f11a428: glTF 2.0 support with PBR lighting - Pull request #900 at 4629736: DMI in 3D cab + two more dials - Pull request #1030 at d3ae4a2: Refactor settings, in prep for settings exporter - Pull request #1045 at cc4d53c: Bugfix: Empty Start Time for Explore, and other issues loading from Menu Selection and Content Routes - Pull request #1052 at 5bbc476: Content Manager: Add axle count, and lowest derail force - Pull request #1062 at b96d6fa: Train Forces popup Window. - Pull request #1064 at 9b3415e: Add Train Info tab to Help window (F1) - Pull request #1066 at 62c89c1: Log derailment, using TraceInformation. - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #1000 at d8d9709: Locomotive operation from control car - Pull request #1029 at 92c74ef: Superelevation Follow Up Fixes - Pull request #1057 at 50c3789: Switchable brake system - Pull request #1069 at 3f153f0: Mouse wheel control only with Alt – Followup for #1051 - Pull request #1070 at f818e40: Fix a NullReferenceException in TCS scripts - Pull request #1055 at 5c78967: Route Based TTrack Sounds - Pull request #896 at f1681df: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #1049 at 4dd8c4f: Re-organise document storage and access
19 parents 9b481d8 + ade0195 + f11a428 + 4629736 + d3ae4a2 + cc4d53c + 5bbc476 + b96d6fa + 9b3415e + 62c89c1 + 1f5ba4c + d8d9709 + 92c74ef + 50c3789 + 3f153f0 + f818e40 + 5c78967 + f1681df + 4dd8c4f commit 99ca163

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed
107 Bytes
Loading

Source/RunActivity/Viewer3D/Popups/TrainForcesWindow.cs

+14-3
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,14 @@ private void UpdateWheelForceImage(TrainCar car, int carPosition)
414414
private void UpdateBrakeForceImage(TrainCar car, int carPosition)
415415
{
416416
var idx = 0; // neutral
417-
var absForceN = car.BrakeForceN;
417+
bool isDynamicBrakes = false;
418+
419+
var absForceN = Math.Abs(car.BrakeForceN); // using Math.Abs() for safety and consistency
420+
if (car.WagonType == TrainCar.WagonTypes.Engine && Math.Abs(car.DynamicBrakeForceN) > absForceN)
421+
{
422+
absForceN = Math.Abs(car.DynamicBrakeForceN);
423+
isDynamicBrakes = true;
424+
}
418425

419426
if (absForceN > 1000f && BrakeForceScaleN > 1000f) // exclude improbabl values
420427
{
@@ -425,8 +432,12 @@ private void UpdateBrakeForceImage(TrainCar car, int carPosition)
425432
if (idx < 0) { idx = 0; } else if (idx > 9) { idx = 9; }
426433
}
427434

428-
if (car.WagonType == TrainCar.WagonTypes.Engine) { BrakeForceBarGraph[carPosition].Source = new Rectangle(1 + idx * BarWidth, BarHight * 2, BarWidth, HalfBarHight); }
429-
else { BrakeForceBarGraph[carPosition].Source = new Rectangle(1 + idx * BarWidth, BarHight * 2 + HalfBarHight, BarWidth, HalfBarHight); }
435+
if (car.WagonType == TrainCar.WagonTypes.Engine)
436+
{
437+
if (isDynamicBrakes) { BrakeForceBarGraph[carPosition].Source = new Rectangle(1 + idx * BarWidth, BarHight * 2, BarWidth, HalfBarHight); }
438+
else { BrakeForceBarGraph[carPosition].Source = new Rectangle(1 + idx * BarWidth, BarHight * 2 + HalfBarHight, BarWidth, HalfBarHight); }
439+
}
440+
else { BrakeForceBarGraph[carPosition].Source = new Rectangle(1 + idx * BarWidth, BarHight * 2 + HalfBarHight * 2, BarWidth, HalfBarHight); }
430441
}
431442
}
432443
}

0 commit comments

Comments
 (0)