Skip to content

Commit 60d7a3f

Browse files
committed
Adding support for air piped systems and EOTs
1 parent 96e2cb1 commit 60d7a3f

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ public override void Update(float elapsedClockSeconds)
162162
float brakeShoeFriction = Car.GetBrakeShoeFrictionFactor();
163163
Car.HuDBrakeShoeFriction = Car.GetBrakeShoeFrictionCoefficientHuD();
164164

165+
// Update anglecock opening. Anglecocks set to gradually open over 30 seconds, but close instantly.
166+
// Gradual opening prevents undesired emergency applications
167+
UpdateAngleCockState(AngleCockAOpen, ref AngleCockAOpenAmount, ref AngleCockAOpenTime);
168+
UpdateAngleCockState(AngleCockBOpen, ref AngleCockBOpenAmount, ref AngleCockBOpenTime);
169+
165170
Car.BrakeRetardForceN = ( Car.MaxHandbrakeForceN * HandbrakePercent / 100) * brakeShoeFriction; // calculates value of force applied to wheel, independent of wheel skid
166171
if (Car.BrakeSkid) // Test to see if wheels are skiding to excessive brake force
167172
{

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/EOT.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,15 @@ public override void Update(float elapsedClockSeconds)
123123
if (Train.Simulator.PlayerLocomotive.Train == Train && EOTState == EOTstate.ArmedTwoWay &&
124124
(EOTEmergencyBrakingOn ||
125125
(Train.Simulator.PlayerLocomotive as MSTSLocomotive).TrainBrakeController.GetStatus().ToLower().StartsWith("emergency")))
126-
Train.Cars.Last().BrakeSystem.AngleCockBOpen = true;
126+
{
127+
// Simulate EOT opening brake pipe to atmosphere by instantly opening rear anglecock
128+
this.BrakeSystem.AngleCockBOpen = true;
129+
this.BrakeSystem.AngleCockBOpenAmount = 1;
130+
}
127131
else
128-
Train.Cars.Last().BrakeSystem.AngleCockBOpen = false;
132+
{
133+
this.BrakeSystem.AngleCockBOpen = false;
134+
}
129135
base.Update(elapsedClockSeconds);
130136
}
131137

@@ -277,4 +283,4 @@ public void EmergencyBrake (bool toState)
277283
}
278284

279285
}
280-
}
286+
}

0 commit comments

Comments
 (0)