Skip to content

Commit c04a41e

Browse files
committed
Automatic merge of T1.5.1-1044-g217ca3b745 and 24 pull requests
- Pull request #799 at dfc715e: Consolidated wind simulation - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at 8f695a4: Blueprint/train car operations UI window - Pull request #885 at e267870: feat: Add notifications to Menu - Pull request #891 at 9a1d6b2: Auto save - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #900 at c27f32d: DMI updates - Pull request #903 at 3e390b8: Downloading route content (Github, zip) - Pull request #922 at a3bc9e7: Autopilot for timetable mode - Pull request #946 at 91a03af: Advanced track sounds - Pull request #949 at da7663b: Oil Burning Locomotive - Pull request #952 at 8347095: Investigation - Pulsing graphics - Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes - Pull request #954 at 84c2f4b: Add Support for Multiple Track Profiles - Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value - Pull request #960 at c8e2a28: Fix draw state name in scripts - Pull request #962 at 46d0472: Fix pantographs on unpowered cars - Pull request #963 at 2d5a67d: Fix dynamic brake force indicator - Pull request #964 at b11c894: fix: Warning CA1417: Do not use the 'OutAttribute' for string parameter - Pull request #965 at 7554f02: style: Renormalize line endings - Pull request #966 at 6353e03: fix: Warning CS0618: 'string.Copy(string)' is obsolete - Pull request #967 at a799e20: Fix AI Lights After Reversing Points
26 parents 8bcab16 + 217ca3b + dfc715e + d00beb9 + f92de76 + 8f695a4 + e267870 + 9a1d6b2 + 1f5ba4c + 5866028 + c27f32d + 3e390b8 + a3bc9e7 + 91a03af + da7663b + 8347095 + a519452 + 84c2f4b + 2452cb0 + c8e2a28 + 46d0472 + 2d5a67d + b11c894 + 7554f02 + 6353e03 + a799e20 commit c04a41e

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2210,38 +2210,38 @@ public void UpdateWindComponents()
22102210
// These will be representative of the train whilst it is on a straight track, but each wagon will vary when going around a curve.
22112211
// Note both train and wind direction will be positive between 0 (north) and 180 (south) through east, and negative between 0 (north) and 180 (south) through west
22122212
// Wind and train direction to be converted to an angle between 0 and 360 deg.
2213-
// Calculate Wind speed and direction, and train direction
2214-
// Update the value of the Wind Speed and Direction for the train
2213+
// Calculate Wind speed and direction, and train direction
2214+
// Update the value of the Wind Speed and Direction for the train
22152215
PhysicsWindDirectionDeg = MathHelper.ToDegrees(Simulator.Weather.WindInstantaneousDirectionRad);
22162216
PhysicsWindSpeedMpS = Simulator.Weather.WindInstantaneousSpeedMpS;
22172217
var speedMpS = Math.Abs(SpeedMpS);
22182218

2219-
// If a westerly direction (ie -ve) convert to an angle between 0 and 360
2220-
if (PhysicsWindDirectionDeg < 0)
2221-
PhysicsWindDirectionDeg += 360;
2219+
// If a westerly direction (ie -ve) convert to an angle between 0 and 360
2220+
if (PhysicsWindDirectionDeg < 0)
2221+
PhysicsWindDirectionDeg += 360;
22222222

2223-
if (PhysicsTrainLocoDirectionDeg < 0)
2224-
PhysicsTrainLocoDirectionDeg += 360;
2223+
if (PhysicsTrainLocoDirectionDeg < 0)
2224+
PhysicsTrainLocoDirectionDeg += 360;
22252225

22262226
// Calculate angle between train and wind direction
2227-
if (PhysicsWindDirectionDeg > PhysicsTrainLocoDirectionDeg)
2228-
ResultantWindComponentDeg = PhysicsWindDirectionDeg - PhysicsTrainLocoDirectionDeg;
2229-
else if (PhysicsTrainLocoDirectionDeg > PhysicsWindDirectionDeg)
2230-
ResultantWindComponentDeg = PhysicsTrainLocoDirectionDeg - PhysicsWindDirectionDeg;
2231-
else
2232-
ResultantWindComponentDeg = 0.0f;
2227+
if (PhysicsWindDirectionDeg > PhysicsTrainLocoDirectionDeg)
2228+
ResultantWindComponentDeg = PhysicsWindDirectionDeg - PhysicsTrainLocoDirectionDeg;
2229+
else if (PhysicsTrainLocoDirectionDeg > PhysicsWindDirectionDeg)
2230+
ResultantWindComponentDeg = PhysicsTrainLocoDirectionDeg - PhysicsWindDirectionDeg;
2231+
else
2232+
ResultantWindComponentDeg = 0.0f;
22332233

2234-
// Correct wind direction if it is greater then 360 deg, then correct to a value less then 360
2235-
if (Math.Abs(ResultantWindComponentDeg) > 360)
2236-
ResultantWindComponentDeg = ResultantWindComponentDeg - 360.0f;
2234+
// Correct wind direction if it is greater then 360 deg, then correct to a value less then 360
2235+
if (Math.Abs(ResultantWindComponentDeg) > 360)
2236+
ResultantWindComponentDeg = ResultantWindComponentDeg - 360.0f;
22372237

2238-
// Wind angle should be kept between 0 and 180 the formulas do not cope with angles > 180. If angle > 180, denotes wind of "other" side of train
2239-
if (ResultantWindComponentDeg > 180)
2240-
ResultantWindComponentDeg = 360 - ResultantWindComponentDeg;
2238+
// Wind angle should be kept between 0 and 180 the formulas do not cope with angles > 180. If angle > 180, denotes wind of "other" side of train
2239+
if (ResultantWindComponentDeg > 180)
2240+
ResultantWindComponentDeg = 360 - ResultantWindComponentDeg;
22412241

22422242
var windAngleRad = MathHelper.ToRadians(ResultantWindComponentDeg);
22432243
WindResultantSpeedMpS = (float)Math.Sqrt(speedMpS * speedMpS + PhysicsWindSpeedMpS * PhysicsWindSpeedMpS + 2.0f * speedMpS * PhysicsWindSpeedMpS * (float)Math.Cos(windAngleRad));
2244-
}
2244+
}
22452245

22462246

22472247
//================================================================================================//

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ public override void Initialize()
765765
SupplyBrakeLineVolumeRatio = 3.1f;
766766
CylBrakeLineVolumeRatio = 1.24f;
767767
}
768-
768+
769769
// If user specified only one two stage speed, set the other to be equal
770770
if (TwoStageSpeedDownMpS == 0 && TwoStageSpeedUpMpS > 0)
771771
TwoStageSpeedDownMpS = TwoStageSpeedUpMpS;
@@ -779,7 +779,7 @@ public override void Initialize()
779779
// If relay valve ratio isn't used, assume it doesn't change
780780
if (TwoStageRelayValveRatio == 0)
781781
TwoStageRelayValveRatio = RelayValveRatio;
782-
782+
783783
RelayValveFitted |= (Car is MSTSLocomotive loco && (loco.DynamicBrakeAutoBailOff || loco.DynamicBrakePartialBailOff)) ||
784784
(Car as MSTSWagon).BrakeValve == MSTSWagon.BrakeValveType.DistributingValve || (Car as MSTSWagon).SupplyReservoirPresent ||
785785
TwoStageRelayValveRatio != RelayValveRatio || RelayValveInshotPSI != 0 || EngineRelayValveInshotPSI != 0;
@@ -1171,7 +1171,7 @@ public override void Update(float elapsedClockSeconds)
11711171
if (CylSource == CylinderSource.AuxRes)
11721172
AutoCylPressurePSI = CalculateBrakeCylinderPressure(ref AutoCylAirPSIM3, -elapsedClockSeconds * MaxReleaseRatePSIpS, 0);
11731173
else
1174-
AutoCylPressurePSI -= elapsedClockSeconds * MaxReleaseRatePSIpS;
1174+
AutoCylPressurePSI -= elapsedClockSeconds * MaxReleaseRatePSIpS;
11751175
if (AutoCylPressurePSI < 0)
11761176
{
11771177
AutoCylPressurePSI = 0;
@@ -1206,11 +1206,11 @@ public override void Update(float elapsedClockSeconds)
12061206
else
12071207
{
12081208
// Accelerated application: Air is vented from the brake pipe to speed up service applications
1209-
// Amount of air vented is proportional to pressure reduction from external sources
1209+
// Amount of air vented is proportional to pressure reduction from external sources
12101210
if (AcceleratedApplicationFactor > 0)
12111211
dpPipe = MathHelper.Clamp(-SmoothedBrakePipeChangePSIpS.SmoothedValue * AcceleratedApplicationFactor, 0, AcceleratedApplicationLimitPSIpS) * elapsedClockSeconds;
1212-
if (BrakeLine1PressurePSI - dpPipe < 0)
1213-
dpPipe = BrakeLine1PressurePSI;
1212+
if (BrakeLine1PressurePSI - dpPipe < 0)
1213+
dpPipe = BrakeLine1PressurePSI;
12141214

12151215
if (AutoCylPressurePSI < QuickServiceLimitPSI)
12161216
dp = elapsedClockSeconds * Math.Max(QuickServiceApplicationRatePSIpS, MaxApplicationRatePSIpS);
@@ -1243,7 +1243,7 @@ public override void Update(float elapsedClockSeconds)
12431243
}
12441244
else
12451245
{
1246-
AutoCylPressurePSI += dp;
1246+
AutoCylPressurePSI += dp;
12471247
AuxResPressurePSI -= dp / AuxCylVolumeRatio;
12481248
}
12491249
BrakeLine1PressurePSI -= dpPipe;
@@ -1269,7 +1269,7 @@ public override void Update(float elapsedClockSeconds)
12691269
if (CylSource == CylinderSource.AuxRes)
12701270
AutoCylPressurePSI = CalculateBrakeCylinderPressure(ref AutoCylAirPSIM3, -dp, AuxResPressurePSI);
12711271
else
1272-
AutoCylPressurePSI -= dp;
1272+
AutoCylPressurePSI -= dp;
12731273
AuxResPressurePSI += dp / AuxCylVolumeRatio;
12741274

12751275
dp = elapsedClockSeconds * MaxAuxilaryChargingRatePSIpS;
@@ -1392,7 +1392,7 @@ public override void Update(float elapsedClockSeconds)
13921392
if (CylSource == CylinderSource.AuxRes) // Aux res is directly connected to brake cylinder, no relay valve
13931393
AutoCylPressurePSI = CalculateBrakeCylinderPressure(ref AutoCylAirPSIM3, -dp, threshold);
13941394
else
1395-
AutoCylPressurePSI -= dp;
1395+
AutoCylPressurePSI -= dp;
13961396
}
13971397
// Special cases for equipment which bypasses triple valve
13981398
else if ((TwoStageLowSpeedActive && AutoCylPressurePSI > TwoStageLowPressurePSI) ||
@@ -1465,7 +1465,7 @@ public override void Update(float elapsedClockSeconds)
14651465
QuickServiceBulbPressurePSI -= dp * volumeRatio;
14661466
}
14671467
}
1468-
1468+
14691469
// Manage emergency res charging
14701470
if ((Car as MSTSWagon).EmergencyReservoirPresent)
14711471
{
@@ -1744,7 +1744,7 @@ public override void Update(float elapsedClockSeconds)
17441744
dp = demandedPressurePSI - CylPressurePSI;
17451745
if (MaxCylPressurePSI < CylPressurePSI + dp)
17461746
dp = MaxCylPressurePSI - CylPressurePSI;
1747-
1747+
17481748
float volumeRatio;
17491749
switch (CylSource)
17501750
{
@@ -1755,13 +1755,13 @@ public override void Update(float elapsedClockSeconds)
17551755
SupplyResPressurePSI -= dp * volumeRatio;
17561756
break;
17571757
case CylinderSource.MainRes:
1758-
if (loco != null)
1759-
{
1758+
if (loco != null)
1759+
{
17601760
volumeRatio = TotalCylVolumeM3 / loco.MainResVolumeM3;
17611761
if (loco.MainResPressurePSI - (dp * volumeRatio) < CylPressurePSI + dp)
1762-
dp = (loco.MainResPressurePSI - CylPressurePSI) / (1 + volumeRatio);
1763-
loco.MainResPressurePSI -= dp * volumeRatio;
1764-
}
1762+
dp = (loco.MainResPressurePSI - CylPressurePSI) / (1 + volumeRatio);
1763+
loco.MainResPressurePSI -= dp * volumeRatio;
1764+
}
17651765
break;
17661766
case CylinderSource.MainResPipe:
17671767
volumeRatio = TotalCylVolumeM3 / BrakePipeVolumeM3;
@@ -2081,7 +2081,7 @@ protected static void PropagateBrakeLinePressures(float elapsedClockSeconds, Tra
20812081
else
20822082
loco.MainResPressurePSI -= PressureDiffEqualToPipePSI * locoAirSystem.BrakePipeVolumeM3 / loco.MainResVolumeM3;
20832083

2084-
// Instantaneous flow rate from MR to BP
2084+
// Instantaneous flow rate from MR to BP
20852085
tempBrakePipeFlow = (PressureDiffEqualToPipePSI * locoAirSystem.BrakePipeVolumeM3) / (OneAtmospherePSI * trainPipeTimeVariationS);
20862086
}
20872087
// reduce pressure in loco brake line if brake pipe pressure is above equalising pressure - apply brakes

0 commit comments

Comments
 (0)