Skip to content

Commit 2759c59

Browse files
committed
Enhancements for EP brakes
1 parent e5b8414 commit 2759c59

File tree

17 files changed

+237
-161
lines changed

17 files changed

+237
-161
lines changed

Source/Documentation/Manual/physics.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3246,10 +3246,12 @@ MaxAuxilaryChargingRate and EmergencyResChargingRate.
32463246
single: ORTSBrakeEmergencyTimeFactor
32473247
single: ORTSBrakePipeTimeFactor
32483248
single: ORTSEPBrakeControlsBrakePipe
3249+
single: ORTSEPBrakeInhibitsTripleValve
32493250
single: ORTSCompressorIsMuControlled
32503251
single: Supply_Reservoir
32513252
single: ORTSSupplyResCapacity
32523253
single: ORTSSupplyResChargingRate
3254+
single: Emergency_Solenoid_Valve
32533255

32543256
- ``Wagon(BrakePipeVolume`` -- Volume of car's brake pipe in cubic feet
32553257
(default .5).
@@ -3322,6 +3324,8 @@ MaxAuxilaryChargingRate and EmergencyResChargingRate.
33223324
by the brake system.
33233325
- ``Wagon(ORTSEPBrakeControlsBrakePipe`` -- Set to 1 for UIC EP brake: brake pipe
33243326
pressure is electrically controlled at every fitted car.
3327+
- ``Wagon(ORTSEPBrakeInhibitsTripleValve`` -- Set to 1 if the car is fitted with a
3328+
selector valve that ignores brake pipe pressure when EP brakes are operational.
33253329
- ``Wagon(ORTSBrakeRelayValveRatio`` -- Determines the proportionality constant
33263330
between pressure as demanded by the triple valve and brake cylinder pressure.
33273331
This is achieved via a relay valve which sets BC pressure proportionally.
@@ -3400,7 +3404,7 @@ MaxAuxilaryChargingRate and EmergencyResChargingRate.
34003404
- ``Wagon(ORTSInitialApplicationThreshold`` -- The pressure difference between
34013405
the brake pipe and auxiliary reservoir at which the triple valve will
34023406
change from release to apply (default 1 psi).
3403-
- ``BrakeEquipmentType(Supply_Reservoir`` -- Adds a supply reservoir to the
3407+
- ``Wagon(BrakeEquipmentType(Supply_Reservoir`` -- Adds a supply reservoir to the
34043408
loco or wagon, which will constantly charge to the brake pipe pressure
34053409
or MR pipe (if equipped) pressure. If a supply reservoir is equipped,
34063410
supply res air will be used to pressurize the brake cylinders thru the relay
@@ -3437,6 +3441,10 @@ MaxAuxilaryChargingRate and EmergencyResChargingRate.
34373441
Pipe for twin pipe braking systems (default = Main Reservoir Pressure).
34383442
- ``Engine(ORTSCompressorIsMuControlled`` -- Set to 1 if compressors from
34393443
all locomotives are synchronized.
3444+
- ``Wagon(BrakeEquipmentType(Emergency_Solenoid_Valve`` -- Adds an
3445+
electrically controlled valve that quickly applies maximum
3446+
brake cylinder pressure during an emergency braking. Only available if the
3447+
brake cylinder pressure is controlled using a relay valve.
34403448

34413449
.. _physics-retainers:
34423450

Source/Orts.Simulation/Simulation/Physics/Train.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4042,7 +4042,7 @@ public virtual void InitializeBrakes()
40424042
if (Simulator.Settings.VerboseConfigurationMessages && LeadLocomotiveIndex >= 0) // Check incompatibilities between brake control valves
40434043
{
40444044
MSTSLocomotive lead = (MSTSLocomotive)Cars[LeadLocomotiveIndex];
4045-
if (Cars.Any(x => (x as MSTSWagon).BrakeValve != lead.BrakeValve))
4045+
if (lead.BrakeSystem is AirSinglePipe leadBrakes && Cars.Any(x => x.BrakeSystem is AirSinglePipe carBrakes && leadBrakes.BrakeValve != carBrakes.BrakeValve))
40464046
{
40474047
Trace.TraceInformation("Cars along the train have incompatible brake control valves");
40484048
}
@@ -4071,13 +4071,13 @@ public void UnconditionalInitializeBrakes()
40714071
car.MSTSBrakeSystem = new VacuumSinglePipe(car);
40724072
else if (lead.BrakeSystem is AirTwinPipe)
40734073
car.MSTSBrakeSystem = new AirTwinPipe(car);
4074-
else if (lead.BrakeSystem is AirSinglePipe)
4074+
else if (lead.BrakeSystem is AirSinglePipe leadAir)
40754075
{
40764076
car.MSTSBrakeSystem = new AirSinglePipe(car);
40774077
// if emergency reservoir has been set on lead locomotive then also set on trailing cars
4078-
if (lead.EmergencyReservoirPresent)
4078+
if (leadAir.EmergencyReservoirPresent)
40794079
{
4080-
car.EmergencyReservoirPresent = lead.EmergencyReservoirPresent;
4080+
(car.BrakeSystem as AirSinglePipe).EmergencyReservoirPresent = leadAir.EmergencyReservoirPresent;
40814081
}
40824082
}
40834083
else if (lead.BrakeSystem is EPBrakeSystem)

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

Lines changed: 4 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -236,51 +236,13 @@ public enum WindowState
236236
public float BearingHotBoxSmokeDurationS;
237237
public float BearingHotBoxSmokeVelocityMpS = 15.0f;
238238
public Color BearingHotBoxSmokeSteadyColor = Color.Gray;
239-
240-
/// <summary>
241-
/// True if vehicle is equipped with an additional emergency brake reservoir
242-
/// </summary>
243-
public bool EmergencyReservoirPresent;
244-
public enum BrakeValveType
245-
{
246-
None,
247-
TripleValve, // Plain triple valve
248-
Distributor, // Triple valve with graduated release
249-
DistributingValve, // Triple valve + driver brake valve control. Only for locomotives
250-
}
251-
/// <summary>
252-
/// Type of brake valve in the car
253-
/// </summary>
254-
public BrakeValveType BrakeValve;
255-
/// <summary>
256-
/// True if equipped with handbrake. (Not common for older steam locomotives.)
257-
/// </summary>
258-
public bool HandBrakePresent;
259-
/// <summary>
260-
/// Number of available retainer positions. (Used on freight cars, mostly.) Might be 0, 3 or 4.
261-
/// </summary>
262-
public int RetainerPositions;
263-
264-
/// <summary>
265-
/// Indicates whether a brake is present or not when Manual Braking is selected.
266-
/// </summary>
267-
public bool ManualBrakePresent;
239+
List<string> BrakeEquipment;
268240

269241
/// <summary>
270242
/// Indicates whether a non auto (straight) brake is present or not when braking is selected.
271243
/// </summary>
272244
public bool NonAutoBrakePresent;
273245

274-
/// <summary>
275-
/// Indicates whether an auxiliary reservoir is present on the wagon or not.
276-
/// </summary>
277-
public bool AuxiliaryReservoirPresent;
278-
279-
/// <summary>
280-
/// Indicates whether an additional supply reservoir is present on the wagon or not.
281-
/// </summary>
282-
public bool SupplyReservoirPresent;
283-
284246
/// <summary>
285247
/// Active locomotive for a control trailer
286248
/// </summary>
@@ -1372,30 +1334,11 @@ public virtual void Parse(string lowercasetoken, STFReader stf)
13721334
case "wagon(brakesystemtype":
13731335
CarBrakeSystemType = stf.ReadStringBlock(null).ToLower();
13741336
BrakeSystem = MSTSBrakeSystem.Create(CarBrakeSystemType, this);
1337+
MSTSBrakeSystem?.SetBrakeEquipment(BrakeEquipment);
13751338
break;
13761339
case "wagon(brakeequipmenttype":
1377-
foreach (var equipment in stf.ReadStringBlock("").ToLower().Replace(" ", "").Split(','))
1378-
{
1379-
switch (equipment)
1380-
{
1381-
case "triple_valve": BrakeValve = BrakeValveType.TripleValve; break;
1382-
case "distributor":
1383-
case "graduated_release_triple_valve": BrakeValve = BrakeValveType.Distributor; break;
1384-
case "distributing_valve": BrakeValve = BrakeValveType.DistributingValve; break;
1385-
case "emergency_brake_reservoir": EmergencyReservoirPresent = true; break;
1386-
case "handbrake": HandBrakePresent = true; break;
1387-
case "auxilary_reservoir": // MSTS legacy parameter - use is discouraged
1388-
case "auxiliary_reservoir":
1389-
AuxiliaryReservoirPresent = true;
1390-
break;
1391-
case "manual_brake": ManualBrakePresent = true; break;
1392-
case "retainer_3_position": RetainerPositions = 3; break;
1393-
case "retainer_4_position": RetainerPositions = 4; break;
1394-
case "supply_reservoir":
1395-
SupplyReservoirPresent = true;
1396-
break;
1397-
}
1398-
}
1340+
BrakeEquipment = stf.ReadStringBlock("").ToLower().Replace(" ", "").Split(',').ToList();
1341+
MSTSBrakeSystem?.SetBrakeEquipment(BrakeEquipment);
13991342
break;
14001343
case "wagon(coupling":
14011344
Couplers.Add(new MSTSCoupling()); // Adds a new coupler every time "Coupler" parameters found in WAG and INC file
@@ -1741,13 +1684,6 @@ public virtual void Copy(MSTSWagon copy)
17411684
IsGreaseFrictionBearing = copy.IsGreaseFrictionBearing;
17421685
CarBrakeSystemType = copy.CarBrakeSystemType;
17431686
BrakeSystem = MSTSBrakeSystem.Create(CarBrakeSystemType, this);
1744-
EmergencyReservoirPresent = copy.EmergencyReservoirPresent;
1745-
BrakeValve = copy.BrakeValve;
1746-
HandBrakePresent = copy.HandBrakePresent;
1747-
ManualBrakePresent = copy.ManualBrakePresent;
1748-
AuxiliaryReservoirPresent = copy.AuxiliaryReservoirPresent;
1749-
SupplyReservoirPresent = copy.SupplyReservoirPresent;
1750-
RetainerPositions = copy.RetainerPositions;
17511687
InteriorShapeFileName = copy.InteriorShapeFileName;
17521688
InteriorSoundFileName = copy.InteriorSoundFileName;
17531689
Cab3DShapeFileName = copy.Cab3DShapeFileName;

0 commit comments

Comments
 (0)