Skip to content

Commit 0ec597e

Browse files
committed
Automatic merge of T1.6-rc3-30-gdf7bf1a26 and 12 pull requests
- Pull request #1104 at c039a26: Handle simple adhesion within the axle module - Pull request #1057 at 1c2bcb4: Switchable brake system - Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc) - Pull request #1091 at 2391bc0: Automatic speed control - Pull request #1110 at 387388e: Fix Activity Runner persists after loading exception - Pull request #1115 at 270f22f: Do not activate ETS switch if no suitable cars are attached - Pull request #1121 at 91d2d26: Manually Override Articulation - Pull request #1123 at dc286f5: Handle null control active locomotive - Pull request #1125 at 7a4f055: Lift #1096 into 1.6 release - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification - Pull request #1124 at 1d765f0: Built-in PBL2 brake controller
14 parents 2e7d9ba + df7bf1a + c039a26 + 1c2bcb4 + e10390b + 2391bc0 + 387388e + 270f22f + 91d2d26 + dc286f5 + 7a4f055 + 5845a1a + 689494b + 1d765f0 commit 0ec597e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ public enum ControllerPosition
5353
private Timer ResetTimer { get; set; }
5454

5555
// brake controller values
56-
private float FirstDepressureBar = 0.5f;
5756
private float BrakeReleasedDepressureBar = 0.2f;
5857
private float EpActivationThresholdBar = 0.15f;
5958

@@ -151,9 +150,9 @@ public override void UpdatePressure(ref float pressureBar, float elapsedClockSec
151150
return;
152151
}
153152

154-
if (!FirstDepression && CurrentPosition == ControllerPosition.Apply && pressureBar > Math.Max(MaxPressureBar() - FirstDepressureBar, 0))
153+
if (!FirstDepression && CurrentPosition == ControllerPosition.Apply && pressureBar > Math.Max(MaxPressureBar() - MinReductionBar(), 0))
155154
FirstDepression = true;
156-
else if (FirstDepression && pressureBar <= Math.Max(MaxPressureBar() - FirstDepressureBar, 0))
155+
else if (FirstDepression && pressureBar <= Math.Max(MaxPressureBar() - MinReductionBar(), 0))
157156
FirstDepression = false;
158157

159158
if (QuickReleaseButtonPressed())
@@ -179,7 +178,7 @@ public override void UpdatePressure(ref float pressureBar, float elapsedClockSec
179178
CurrentState = State.Apply;
180179
else if (
181180
CurrentPosition == ControllerPosition.Apply && pressureBar > MaxPressureBar() - FullServReductionBar()
182-
|| FirstDepression && CurrentPosition != ControllerPosition.Release && !QuickRelease && pressureBar > MaxPressureBar() - FirstDepressureBar
181+
|| FirstDepression && CurrentPosition != ControllerPosition.Release && !QuickRelease && pressureBar > MaxPressureBar() - MinReductionBar()
183182
)
184183
CurrentState = State.Apply;
185184
else if (OverchargeElimination && pressureBar > MaxPressureBar())
@@ -199,7 +198,6 @@ public override void UpdatePressure(ref float pressureBar, float elapsedClockSec
199198
else
200199
CurrentState = State.Hold;
201200

202-
float targetPressureBar = pressureBar;
203201
switch (CurrentState)
204202
{
205203
case State.Overcharge:
@@ -286,6 +284,9 @@ public override void UpdatePressure(ref float pressureBar, float elapsedClockSec
286284

287285
if (QuickRelease && pressureBar >= Math.Min(MaxPressureBar(), MainReservoirPressureBar()))
288286
QuickRelease = false;
287+
288+
if (OverchargeElimination && pressureBar <= MaxPressureBar())
289+
OverchargeElimination = false;
289290
}
290291

291292
public override void UpdateEngineBrakePressure(ref float pressureBar, float elapsedClockSeconds)

0 commit comments

Comments
 (0)