Skip to content

Commit cd59350

Browse files
committed
Automatic merge of T1.5.1-664-gd39447273 and 6 pull requests
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #865 at 776d6df: Dispatcher window improvements - Pull request #874 at e90cf2b: Dynamic brake controller refactoring - Pull request #875 at 43bf33e: Bug fix for https://bugs.launchpad.net/or/+bug/2036346 Player train switching doesn't work with 3D cabs - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #878 at 0b44e34: Implement Polach Adhesion
8 parents 38caa56 + d394472 + d00beb9 + 776d6df + e90cf2b + 43bf33e + f92de76 + 0b44e34 commit cd59350

File tree

8 files changed

+304
-136
lines changed

8 files changed

+304
-136
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,7 @@ public override void Initialize()
14671467
// Ensure Drive Axles is set with a default value if user doesn't supply an OR value in ENG file
14681468
if (LocoNumDrvAxles == 0)
14691469
{
1470-
if (MSTSLocoNumDrvWheels != 0 && MSTSLocoNumDrvWheels < 6)
1470+
if (MSTSLocoNumDrvWheels != 0 && MSTSLocoNumDrvWheels < 7)
14711471
{
14721472
LocoNumDrvAxles = (int) MSTSLocoNumDrvWheels;
14731473
}
@@ -2755,6 +2755,9 @@ public virtual void AdvancedAdhesion(float elapsedClockSeconds)
27552755
axle.BrakeRetardForceN = BrakeRetardForceN/LocomotiveAxles.Count;
27562756
axle.TrainSpeedMpS = SpeedMpS; //Set the train speed of the axle mod
27572757
axle.WheelRadiusM = DriverWheelRadiusM;
2758+
axle.WheelDistanceGaugeM = TrackGaugeM;
2759+
axle.CurrentCurveRadiusM = CurrentCurveRadiusM;
2760+
axle.BogieRigidWheelBaseM = RigidWheelBaseM;
27582761
}
27592762
LocomotiveAxles.Update(elapsedClockSeconds);
27602763
MotiveForceN = LocomotiveAxles.CompensatedForceN;
@@ -2768,10 +2771,10 @@ public virtual void AdvancedAdhesion(float elapsedClockSeconds)
27682771
// This enables steam locomotives to have different speeds for driven and non-driven wheels.
27692772
if (EngineType == EngineTypes.Steam && SteamEngineType != MSTSSteamLocomotive.SteamEngineTypes.Geared)
27702773
{
2771-
WheelSpeedSlipMpS = LocomotiveAxles[0].AxleSpeedMpS;
2774+
WheelSpeedSlipMpS = (float)LocomotiveAxles[0].AxleSpeedMpS;
27722775
WheelSpeedMpS = SpeedMpS;
27732776
}
2774-
else WheelSpeedMpS = LocomotiveAxles[0].AxleSpeedMpS;
2777+
else WheelSpeedMpS = (float)LocomotiveAxles[0].AxleSpeedMpS;
27752778

27762779
}
27772780

Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5062,7 +5062,7 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float t,
50625062
// Crank Angle - converts the above range to 0 - 180 - 0 - this is the principle reference used so that it lines up with reference
50635063
// tables used to buold this function
50645064
// Normalised Crank Angle - converts the above to a 0 - 360 range, this is used for triggering special steam effects, etc.
5065-
float axlePostionRad = LocomotiveAxles[0].AxlePositionRad;
5065+
float axlePostionRad = (float)LocomotiveAxles[0].AxlePositionRad;
50665066
float crankAngleRad = (float)(axlePostionRad + WheelCrankAngleDiffRad[i]);
50675067

50685068
crankAngleRad = (float)(MathHelper.WrapAngle(crankAngleRad)); // Ensures that crank angle is in the range 0 - 180 - 0
@@ -5316,7 +5316,7 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float t,
53165316
/// </summary>
53175317
private float NormalisedCrankAngle(int cylinderNumber)
53185318
{
5319-
float normalisedCrankAngleRad = (float)MathHelper.WrapAngle(LocomotiveAxles[0].AxlePositionRad + WheelCrankAngleDiffRad[cylinderNumber]);
5319+
float normalisedCrankAngleRad = (float)MathHelper.WrapAngle((float)LocomotiveAxles[0].AxlePositionRad + WheelCrankAngleDiffRad[cylinderNumber]);
53205320

53215321
if (normalisedCrankAngleRad < 0)
53225322
{

0 commit comments

Comments
 (0)