Skip to content

Commit

Permalink
Automatic merge of T1.5-rc1-80-gf4212d3c4 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 #692 at 20de7da: Italian translation for OR 1.5
- 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: Extended door functionality
- Pull request #712 at 68cd8ab: Search for NORMAL signals if no argument is provided
- Pull request #713 at 966a61c: https://blueprints.launchpad.net/or/+spec/cruise-control 
- Pull request #715 at 447143b: Bug fix for //bugs.launchpad.net/or/+bug/1990930 Default snow terrtex not appearing
- Pull request #722 at fb9079e: Fix Windows Forms deprecations in ActivityEditor
- Pull request #726 at b6cc020: Correctly initialize triple valve for EP trains
  • Loading branch information
openrails-bot committed Oct 8, 2022
14 parents 68a3e40 + f4212d3 + 824f96f + 704731a + 918fdb1 + c1c417f + 20de7da + 6baf43d + 265d33d + 68cd8ab + 966a61c + 447143b + fb9079e + b6cc020 commit 360e004
Showing 1 changed file with 19 additions and 29 deletions.
Expand Up @@ -259,11 +259,19 @@ public float TransmissionEfficiency
public float TrainSpeedMpS;

/// <summary>
/// Wheel slip indicator
/// Read only wheel slip indicator
/// - is true when absolute value of SlipSpeedMpS is greater than WheelSlipThresholdMpS, otherwise is false
/// </summary>
public bool IsWheelSlip { get; private set; }
float WheelSlipTimeS;
public bool IsWheelSlip
{
get
{
if (Math.Abs(SlipSpeedMpS) > WheelSlipThresholdMpS)
return true;
else
return false;
}
}

/// <summary>
/// Read only wheelslip threshold value used to indicate maximal effective slip
Expand All @@ -282,13 +290,18 @@ public float WheelSlipThresholdMpS
}

/// <summary>
/// Wheelslip warning indication
/// Read only wheelslip warning indication
/// - is true when SlipSpeedMpS is greater than zero and
/// SlipSpeedPercent is greater than SlipWarningThresholdPercent in both directions,
/// otherwise is false
/// </summary>
public bool IsWheelSlipWarning { get; private set; }
float WheelSlipWarningTimeS;
public bool IsWheelSlipWarning
{
get
{
return Math.Abs(SlipSpeedPercent) > SlipWarningTresholdPercent;
}
}

/// <summary>
/// Read only slip speed value in metric meters per second
Expand Down Expand Up @@ -540,29 +553,6 @@ public virtual void Update(float timeSpan)
CompensatedAxleForceN = AxleForceN + Math.Sign(TrainSpeedMpS) * BrakeRetardForceN;
if (AxleForceN == 0) CompensatedAxleForceN = 0;

if (Math.Abs(SlipSpeedMpS) > WheelSlipThresholdMpS)
{
// Wait some time before indicating wheelslip to avoid false triggers
if (WheelSlipTimeS > 0.1f)
{
IsWheelSlip = IsWheelSlipWarning = true;
}
WheelSlipTimeS += timeSpan;
}
else if (Math.Abs(SlipSpeedPercent) > SlipWarningTresholdPercent)
{
// Wait some time before indicating wheelslip to avoid false triggers
if (WheelSlipWarningTimeS > 0.1f) IsWheelSlipWarning = true;
IsWheelSlip = false;
WheelSlipWarningTimeS += timeSpan;
}
else
{
IsWheelSlipWarning = false;
IsWheelSlip = false;
WheelSlipWarningTimeS = WheelSlipTimeS = 0;
}

if (timeSpan > 0.0f)
{
slipDerivationMpSS = (SlipSpeedMpS - previousSlipSpeedMpS) / timeSpan;
Expand Down

0 comments on commit 360e004

Please sign in to comment.