Skip to content

Commit

Permalink
Automatic merge of T1.5-rc1-61-g82a9ca1ff and 12 pull requests
Browse files Browse the repository at this point in the history
- Pull request #570 at 824f96f: Experimental glTF 2.0 support with PBR lighting
- Pull request #630 at 704731a: Sky Color Fix (Addresses Trello Roadmap Card #367 for More accurate sunrise and sunset)
- Pull request #652 at 918fdb1: Add button functions to Raildriver
- Pull request #677 at c1c417f: Correct double heading bug
- Pull request #688 at e44897d: adds Help Icons to Video tab
- Pull request #692 at 20de7da: Italian translation for OR 1.5
- Pull request #693 at 453ac3d: French locales
- Pull request #699 at 6baf43d: Bug fix for https://bugs.launchpad.net/or/+bug/1987453. Web: HUD/Force Information, some labels not visible.
- Pull request #706 at 265d33d: TCS Extensions
- Pull request #711 at 85ce248: Bug fix for https://bugs.launchpad.net/or/+bug/1989426 Out of bounds crash in Precipitation.cs
- Pull request #712 at 68cd8ab: Search for NORMAL signals if no argument is provided
- Pull request #713 at dd69c72: https://blueprints.launchpad.net/or/+spec/cruise-control
  • Loading branch information
openrails-bot committed Sep 24, 2022
14 parents 678a896 + 82a9ca1 + 824f96f + 704731a + 918fdb1 + c1c417f + e44897d + 20de7da + 453ac3d + 6baf43d + 265d33d + 85ce248 + 68cd8ab + dd69c72 commit 75de69f
Showing 1 changed file with 28 additions and 16 deletions.
44 changes: 28 additions & 16 deletions Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs
Expand Up @@ -1970,7 +1970,11 @@ public override void Update(float elapsedClockSeconds)

// Cruise Control
CruiseControl?.Update(elapsedClockSeconds);
if (CruiseControl != null && CruiseControl.OverrideForceCalculation) CruiseControl.UpdateMotiveForce(elapsedClockSeconds, AbsWheelSpeedMpS);
if (CruiseControl != null && CruiseControl.OverrideForceCalculation)
{
CruiseControl.UpdateMotiveForce(elapsedClockSeconds, AbsWheelSpeedMpS);
SetAbsTractionSpeedMpS();
}
else UpdateTractiveForce(elapsedClockSeconds, t, AbsSpeedMpS, AbsWheelSpeedMpS);

if (MultiPositionControllers != null)
Expand Down Expand Up @@ -2356,6 +2360,28 @@ protected virtual void UpdateControllers(float elapsedClockSeconds)
#endif
}

/// <summary>
/// This function derives AbsTractionSpeedMpS.
/// </summary>
public void SetAbsTractionSpeedMpS()
{
if (TractionMotorType == TractionMotorTypes.AC)
{
AbsTractionSpeedMpS = AbsSpeedMpS;
}
else
{
if (WheelSlip && AdvancedAdhesionModel)
{
AbsTractionSpeedMpS = AbsWheelSpeedMpS;
}
else
{
AbsTractionSpeedMpS = AbsSpeedMpS;
}
}
}

/// <summary>
/// This function updates periodically the locomotive's motive force.
/// </summary>
Expand All @@ -2376,21 +2402,7 @@ protected virtual void UpdateTractiveForce(float elapsedClockSeconds, float t, f
// More modern locomotive have a more sophisticated system that eliminates slip in the majority (if not all circumstances).
// Simple adhesion control does not have any slip control feature built into it.
// TODO - a full review of slip/no slip control.
if (TractionMotorType == TractionMotorTypes.AC)
{
AbsTractionSpeedMpS = AbsSpeedMpS;
}
else
{
if (WheelSlip && AdvancedAdhesionModel)
{
AbsTractionSpeedMpS = AbsWheelSpeedMpS;
}
else
{
AbsTractionSpeedMpS = AbsSpeedMpS;
}
}
SetAbsTractionSpeedMpS();

if (TractiveForceCurves == null)
{
Expand Down

0 comments on commit 75de69f

Please sign in to comment.