Skip to content

Commit 562fe42

Browse files
committed
Further adjustments to derail
1 parent 06a5735 commit 562fe42

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

Source/Orts.Parsers.Msts/STFReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ public enum UNITS
813813
/// Valid Units: deg, rad
814814
/// <para>Scaled to Radians</para>
815815
/// </summary>
816-
Angle = 1 << 28, // "Temperature", note above TemperatureDifference, is different
816+
Angle = 1 << 28,
817817

818818
// "Any" is used where units cannot easily be specified, such as generic routines for interpolating continuous data from point values.
819819
// or interpreting locomotive cab attributes from the ORTSExtendedCVF experimental mechanism.

Source/Orts.Simulation/Simulation/RollingStocks/MSTSWagon.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -509,17 +509,12 @@ public virtual void LoadFromWagFile(string wagFilePath)
509509
// Set wheel flange parameters to default values.
510510
if (MaximumWheelFlangeAngleRad == 0)
511511
{
512-
MaximumWheelFlangeAngleRad = 1.09956f; // Default = 63.36 deg.
513-
}
514-
else
515-
{
516-
const float convertDegtoRad = 0.01745329252f;
517-
MaximumWheelFlangeAngleRad = convertDegtoRad * MaximumWheelFlangeAngleRad; // Assume that input has been in degrees - TO ADD - appropriate input parameters
512+
MaximumWheelFlangeAngleRad = 1.22173f; // Default = 70 deg - Pre 1990 AAR 1:20 wheel
518513
}
519514

520515
if (WheelFlangeLengthM == 0)
521516
{
522-
WheelFlangeLengthM = 0.026194f; // Height = 1.031in
517+
WheelFlangeLengthM = 0.0254f; // Height = 1.00in - Pre 1990 AAR 1:20 wheel
523518
}
524519

525520
// Initialise steam heat parameters

Source/Orts.Simulation/Simulation/RollingStocks/TrainCar.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,6 +1513,18 @@ public void UpdateTrainDerailmentRisk(float elapsedClockSeconds)
15131513
{
15141514
DerailElapsedTimeS = 0; // Reset timer if derail is not possible
15151515
}
1516+
1517+
if (AbsSpeedMpS < 0.01)
1518+
{
1519+
DerailExpected = false;
1520+
DerailPossible = false;
1521+
}
1522+
1523+
// if (CarID == "0 - 84" || CarID == "0 - 83" || CarID == "0 - 82" || CarID == "0 - 81" || CarID == "0 - 80" || CarID == "0 - 79")
1524+
// {
1525+
// Trace.TraceInformation("Nadal - {0}, Adhesion {1} Flange Angle {2}", NadalDerailmentCoefficient, wagonAdhesion, MaximumWheelFlangeAngleRad);
1526+
// Trace.TraceInformation("Derailment - CarID {0}, Nadal {1}, Derail {2} Possible {3} Expected {4} Derail Distance {5} ElapsedTime {6} DerailTime {7}", CarID, NadalDerailmentCoefficient, DerailmentCoefficient, DerailPossible, DerailExpected, DerailClimbDistanceM, DerailElapsedTimeS, derailTimeS);
1527+
// }
15161528
}
15171529
else
15181530
{

0 commit comments

Comments
 (0)