Skip to content

Commit 50c3789

Browse files
committed
Fix the brake equipment type, added some documentation.
1 parent 389c2d2 commit 50c3789

File tree

4 files changed

+81
-5
lines changed

4 files changed

+81
-5
lines changed

Source/Documentation/Manual/physics.rst

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2678,6 +2678,46 @@ For EP brakes, two variants are available:
26782678
actuating the cylinders. This system is sometimes called "UIC EP brake". It is typically the system
26792679
used in high speed trains.
26802680

2681+
Defining Multiple Brake Systems
2682+
-------------------------------
2683+
2684+
It is possible to define multiple systems within ``OrtsBrakeMode`` sections::
2685+
2686+
ORTSBrakeMode (
2687+
ORTSBrakeModeName ( AG )
2688+
BrakeSystemType( Air_single_pipe )
2689+
Comment ( All brake parameters are available in such a section )
2690+
)
2691+
ORTSBrakeMode (
2692+
ORTSBrakeModeName ( VB )
2693+
BrakeSystemType( Vacuum_single_pipe )
2694+
Comment ( All brake parameters are available in such a section )
2695+
)
2696+
2697+
These sections can be used to either define dual vacuum/air rolling stock, or
2698+
can be used to define the brake modes of the UIC stock in the following form::
2699+
2700+
BrakeSystemType( Air_twin_pipe )
2701+
ORTSBrakeMode (
2702+
ORTSBrakeModeName ( G )
2703+
ORTSBrakeMass ( 67t )
2704+
Comment ( All brake parameters are available in such a section )
2705+
)
2706+
ORTSBrakeMode (
2707+
ORTSBrakeModeName ( P )
2708+
ORTSBrakeMass ( 83t )
2709+
BrakeSystemType( Vacuum_single_pipe )
2710+
Comment ( All brake parameters are available in such a section )
2711+
)
2712+
2713+
Available brake mode names to be used are: GG, G, PP, P, RR, R, R_MG, AG, AP, AU, VB, VP, VU.
2714+
With the ``ORTSBrakeModeNames`` keyword the used brake modes can be filtered,
2715+
for being able to define them in an include file, and using only the needed
2716+
ones. It can be used e.g. in the following form::
2717+
2718+
ORTSBrakeModeNames ( "P, R" )
2719+
2720+
26812721
.. _physics-brake-controller:
26822722

26832723
Train Brake Controller Positions
@@ -3087,6 +3127,13 @@ using the ORTSBrakeShoeFriction parameter, 1D (ie, speed only, see above section
30873127

30883128
``ORTSNumberCarBrakeShoes`` - to facilitate the operation of the default 2D curves above it is necessary to configure the number of brake shoes for each car.
30893129

3130+
``ORTSBrakeMass`` - Railways part of the UIC organisation instead of NBR
3131+
provide brake masses, measured in tonnes, which is a virtual value to define
3132+
the brake efficiency. Openrails uses this value as an alternative to setting
3133+
the max brake shoe force directly, and recalculates this to that force using
3134+
approximating formulas to the published UIC brake curves. This parameter is
3135+
ignored if the ``ORTSMaxBrakeShoeForce`` also set.
3136+
30903137
Whilst OR will attempt to set some defaults if parameters are left out, the most realistic operation will be achieved by using all the relevant parameters.
30913138

30923139
The following two legacy arrangements can be used as an alternative to the above method,
@@ -3095,6 +3142,26 @@ The following two legacy arrangements can be used as an alternative to the above
30953142

30963143
- Legacy #2 - where MaxBrakeForce and ORTSBrakeShoeFriction have been set, legacy operation will remain unchanged.
30973144

3145+
Load Compensation
3146+
-----------------
3147+
3148+
Load compensation stages can be defined in the following way::
3149+
3150+
OrtsLoadStage (
3151+
OrtsBrakeMass ( 28t )
3152+
Comment ( All brake parameters are available in such a section )
3153+
)
3154+
OrtsLoadStage (
3155+
OrtsBrakeMass ( 37t )
3156+
OrtsLoadStageMinMass ( 34t )
3157+
Comment ( All brake parameters are available in such a section )
3158+
)
3159+
3160+
The ``OrtsLoadStageMinMass`` parameter defines the minimum car mass (together
3161+
with the load) where the stage can be activated without risking the brake lock.
3162+
For the lowest stage this keyword should be omitted. In OpenRails the switching
3163+
between stages is automatic.
3164+
30983165

30993166
Train Brake Pipe Losses
31003167
-----------------------
@@ -3597,10 +3664,11 @@ The retainers of a car will only be available if either the General Option
35973664
:ref:`Retainer valve on all cars <options-retainers>` is checked, or the car's
35983665
.wag file contains a retainer valve declaration. To declare a retainer the line
35993666
``BrakeEquipmentType ( )`` in the .wag file must include either the item
3600-
``Retainer_4_Position`` or the item ``Retainer_3_Position``. A 4 position
3667+
``Retainer_4_Position``, ``Retainer_3_Position`` or ``UIC_mountain``. A 4 position
36013668
retainer includes four states: exhaust, low pressure (10 psi), high pressure
36023669
(20 psi), and slow direct (gradual drop to zero). A 3 position retainer does
3603-
not include the low pressure position. The use and display of the retainers is
3670+
not include the low pressure position. The UIC plain-mountain switch has only
3671+
2 positions. The use and display of the retainers is
36043672
described in :ref:`Extended HUD for Brake Information <physics-hud-brake>`.
36053673

36063674
The setting of the retained pressure and the number of retainers is

Source/Orts.Simulation/Simulation/RollingStocks/MSTSWagon.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,7 @@ public virtual void Parse(string lowercasetoken, STFReader stf)
13831383
case "wagon(ortsbrakemode":
13841384
var newSystem = BrakeSystem.CreateNewLike(BrakeSystem, this)?.InitializeDefault(); // Start with the same BrakeSystemType() as the base
13851385
BrakeModes? brakeModeName = null;
1386+
List<string> brakeEquipment = null;
13861387

13871388
stf.VerifyStartOfBlock();
13881389
while (!stf.EndOfBlock())
@@ -1419,6 +1420,12 @@ public virtual void Parse(string lowercasetoken, STFReader stf)
14191420
else
14201421
BrakeSystems.Add(key, newSystem);
14211422
}
1423+
if (brakeEquipment != null)
1424+
(newSystem as MSTSBrakeSystem)?.SetBrakeEquipment(brakeEquipment);
1425+
break;
1426+
case "wagon(ortsbrakemode(brakeequipmenttype":
1427+
brakeEquipment = stf.ReadStringBlock("").ToLower().Replace(" ", "").Split(',').ToList();
1428+
(newSystem as MSTSBrakeSystem)?.SetBrakeEquipment(brakeEquipment);
14221429
break;
14231430
case "wagon(ortsbrakemode(ortsloadstage":
14241431
var stage = BrakeSystem.CreateNewLike(newSystem, this).InitializeDefault();

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/AirSinglePipe.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ public override string[] GetDebugStatus(Dictionary<BrakeSystemComponent, Pressur
402402
TwoPipes ? FormatStrings.FormatPressure(BrakeLine2PressurePSI, PressureUnit.PSI, units[BrakeSystemComponent.MainPipe], true) : string.Empty,
403403
BrakeValve == BrakeValveType.Distributor ? FormatStrings.FormatPressure(ControlResPressurePSI, PressureUnit.PSI, units[BrakeSystemComponent.AuxiliaryReservoir], true) : string.Empty,
404404
SupplyReservoirPresent ? FormatStrings.FormatPressure(SupplyResPressurePSI, PressureUnit.PSI, units[BrakeSystemComponent.SupplyReservoir], true) : string.Empty,
405-
RetainerPositions == 0 ? string.Empty : RetainerDebugState,
405+
RetainerPositions <= 0 ? string.Empty : RetainerDebugState,
406406
Simulator.Catalog.GetString(GetStringAttribute.GetPrettyName(TripleValveState)),
407407
string.Empty, // Spacer because the state above needs 2 columns.
408408
HandBrakePresent ? string.Format("{0:F0}%", HandbrakePercent) : string.Empty,
@@ -482,7 +482,7 @@ public override void SetBrakeEquipment(List<string> equipment)
482482
if (equipment.Contains("retainer_4_position")) RetainerPositions = 4;
483483
else if (equipment.Contains("retainer_3_position")) RetainerPositions = 3;
484484
else if (equipment.Contains("uic_mountain")) RetainerPositions = 2;
485-
else RetainerPositions = 0;
485+
else RetainerPositions = -1;
486486
SupplyReservoirPresent = equipment.Contains("supply_reservoir");
487487
EmergencySolenoidValve = equipment.Contains("emergency_solenoid_valve");
488488
}
@@ -2515,6 +2515,7 @@ public override void SetRetainer(RetainerSetting setting)
25152515
{
25162516
switch (RetainerPositions)
25172517
{
2518+
case -1:
25182519
case 0:
25192520
case 1: setting = RetainerSetting.Exhaust; break;
25202521
case 2: if (setting == RetainerSetting.LowPressure || setting == RetainerSetting.HighPressure) setting = RetainerSetting.SlowDirect; break;

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/SMEBrakeSystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public override string[] GetDebugStatus(Dictionary<BrakeSystemComponent, Pressur
8686
EmergencyReservoirPresent ? FormatStrings.FormatPressure(EmergResPressurePSI, PressureUnit.PSI, units[BrakeSystemComponent.EmergencyReservoir], true) : string.Empty,
8787
TwoPipes ? FormatStrings.FormatPressure(CylPressurePSI, PressureUnit.PSI, units[BrakeSystemComponent.MainPipe], true) : string.Empty,
8888
BrakeValve == BrakeValveType.Distributor ? FormatStrings.FormatPressure(ControlResPressurePSI, PressureUnit.PSI, units[BrakeSystemComponent.AuxiliaryReservoir], true) : string.Empty,
89-
RetainerPositions == 0 ? string.Empty : RetainerDebugState,
89+
RetainerPositions <= 0 ? string.Empty : RetainerDebugState,
9090
Simulator.Catalog.GetString(GetStringAttribute.GetPrettyName(TripleValveState)),
9191
string.Empty, // Spacer because the state above needs 2 columns.
9292
string.Empty,

0 commit comments

Comments
 (0)