Skip to content

Commit

Permalink
Automatic merge of T1.5.1-664-gd39447273 and 6 pull requests
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
openrails-bot committed Oct 1, 2023
8 parents 38caa56 + d394472 + d00beb9 + 776d6df + e90cf2b + 43bf33e + f92de76 + 0b44e34 commit cd59350
Show file tree
Hide file tree
Showing 8 changed files with 304 additions and 136 deletions.
Expand Up @@ -1467,7 +1467,7 @@ public override void Initialize()
// Ensure Drive Axles is set with a default value if user doesn't supply an OR value in ENG file
if (LocoNumDrvAxles == 0)
{
if (MSTSLocoNumDrvWheels != 0 && MSTSLocoNumDrvWheels < 6)
if (MSTSLocoNumDrvWheels != 0 && MSTSLocoNumDrvWheels < 7)
{
LocoNumDrvAxles = (int) MSTSLocoNumDrvWheels;
}
Expand Down Expand Up @@ -2755,6 +2755,9 @@ public virtual void AdvancedAdhesion(float elapsedClockSeconds)
axle.BrakeRetardForceN = BrakeRetardForceN/LocomotiveAxles.Count;
axle.TrainSpeedMpS = SpeedMpS; //Set the train speed of the axle mod
axle.WheelRadiusM = DriverWheelRadiusM;
axle.WheelDistanceGaugeM = TrackGaugeM;
axle.CurrentCurveRadiusM = CurrentCurveRadiusM;
axle.BogieRigidWheelBaseM = RigidWheelBaseM;
}
LocomotiveAxles.Update(elapsedClockSeconds);
MotiveForceN = LocomotiveAxles.CompensatedForceN;
Expand All @@ -2768,10 +2771,10 @@ public virtual void AdvancedAdhesion(float elapsedClockSeconds)
// This enables steam locomotives to have different speeds for driven and non-driven wheels.
if (EngineType == EngineTypes.Steam && SteamEngineType != MSTSSteamLocomotive.SteamEngineTypes.Geared)
{
WheelSpeedSlipMpS = LocomotiveAxles[0].AxleSpeedMpS;
WheelSpeedSlipMpS = (float)LocomotiveAxles[0].AxleSpeedMpS;
WheelSpeedMpS = SpeedMpS;
}
else WheelSpeedMpS = LocomotiveAxles[0].AxleSpeedMpS;
else WheelSpeedMpS = (float)LocomotiveAxles[0].AxleSpeedMpS;

}

Expand Down
Expand Up @@ -5062,7 +5062,7 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float t,
// Crank Angle - converts the above range to 0 - 180 - 0 - this is the principle reference used so that it lines up with reference
// tables used to buold this function
// Normalised Crank Angle - converts the above to a 0 - 360 range, this is used for triggering special steam effects, etc.
float axlePostionRad = LocomotiveAxles[0].AxlePositionRad;
float axlePostionRad = (float)LocomotiveAxles[0].AxlePositionRad;
float crankAngleRad = (float)(axlePostionRad + WheelCrankAngleDiffRad[i]);

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

if (normalisedCrankAngleRad < 0)
{
Expand Down

0 comments on commit cd59350

Please sign in to comment.