Skip to content

Commit 22312be

Browse files
committed
Fixing minor style issues, and adding support for both spellings of 'liter'
1 parent 7931a52 commit 22312be

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Source/Orts.Formats.Msts/CabViewFile.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,8 @@ public enum CABViewControlUnits
334334
YARDS,
335335

336336
CUBIC_FT_MIN,
337-
LITRES_S
337+
LITRES_S,
338+
LITERS_S
338339
}
339340

340341
public enum DiscreteStates

Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5425,6 +5425,7 @@ public virtual float GetDataOf(CabViewControl cvc)
54255425
break;
54265426

54275427
case CABViewControlUnits.LITRES_S:
5428+
case CABViewControlUnits.LITERS_S:
54285429
data = this.FilteredBrakePipeFlowM3pS * 1000.0f;
54295430
break;
54305431

@@ -5558,7 +5559,6 @@ public virtual float GetDataOf(CabViewControl cvc)
55585559

55595560
}
55605561
}
5561-
55625562
}
55635563
else
55645564
{

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Controllers/MSTSBrakeController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ static void IncreasePressure(ref float pressureBar, float targetBar, float rateB
415415
{
416416
float dp = rateBarpS * elapsedSeconds;
417417
if (targetBar - pressureBar < 0.5f) // Slow down increase when nearing target to simulate chokes in brake valve
418-
dp *= Math.Min((targetBar - pressureBar) / 0.5f + 0.1f, 1.0f);
418+
dp *= Math.Min(((targetBar - pressureBar) / 0.5f) + 0.1f, 1.0f);
419419
pressureBar += dp;
420420
if (pressureBar > targetBar)
421421
pressureBar = targetBar;
@@ -428,7 +428,7 @@ static void DecreasePressure(ref float pressureBar, float targetBar, float rateB
428428
{
429429
float dp = rateBarpS * elapsedSeconds;
430430
if (pressureBar - targetBar < 0.5f) // Slow down decrease when nearing target to simulate chokes in brake valve
431-
dp *= Math.Min((pressureBar - targetBar) / 0.5f + 0.1f, 1.0f);
431+
dp *= Math.Min(((pressureBar - targetBar) / 0.5f) + 0.1f, 1.0f);
432432
pressureBar -= dp;
433433
if (pressureBar < targetBar)
434434
pressureBar = targetBar;

0 commit comments

Comments
 (0)