Skip to content

Commit 51d3b26

Browse files
committed
Automatic merge of T1.5.1-799-gb02a6e5d3 and 14 pull requests
- Pull request #570 at 3539862: Experimental glTF 2.0 support with PBR lighting - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at a055bca: Blueprint/train car operations UI window - Pull request #885 at 8f94333: feat: Add notifications to Menu - Pull request #886 at 6c0785b: Scene viewer extension to TrackViewer - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #897 at 42f1dd9: feat: Improved system information collection - Pull request #899 at b48ac9f: Duplex steam engines - Booster Engine addition - Pull request #903 at 6c9da3f: Downloading route content (Github, zip) - Pull request #907 at 9b0b04f: Bug fix for https://bugs.launchpad.net/or/+bug/2047300 Dynamic tracks disappear after long tunnel - Pull request #908 at 4b4afe3: feat: supports switching adhesion precisions - Pull request #911 at 6834af0: docs: Add refactoring as a special type of PR
16 parents 0fb4ef1 + b02a6e5 + 3539862 + d00beb9 + f92de76 + a055bca + 8f94333 + 6c0785b + 1f5ba4c + 5866028 + 42f1dd9 + b48ac9f + 6c9da3f + 9b0b04f + 4b4afe3 + 6834af0 commit 51d3b26

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2299,6 +2299,7 @@ public override void Update(float elapsedClockSeconds)
22992299
CylinderCocksPressureAtmPSI = 0;
23002300
CabSteamChestPressurePSI = 0;
23012301
CabSteamBoosterPressurePSI = 0;
2302+
SteamDrvWheelWeightLbs = 0;
23022303

23032304
for (int i = 0; i < SteamEngines.Count; i++)
23042305
{
@@ -2549,6 +2550,8 @@ public override void Update(float elapsedClockSeconds)
25492550

25502551
UpdateSteamTractiveForce(elapsedClockSeconds, tractiveforcethrottle, 0, 0, i);
25512552

2553+
SteamDrvWheelWeightLbs += Kg.ToLb(SteamEngines[i].AttachedAxle.WheelWeightKg / SteamEngines[i].AttachedAxle.NumAxles); // Calculate the weight per axle (used in MSTSLocomotive for friction calculatons)
2554+
25522555
}
25532556

25542557
UpdateTractiveForce(elapsedClockSeconds, ThrottlePercent / 100f, AbsSpeedMpS, AbsWheelSpeedMpS);
@@ -6358,10 +6361,8 @@ public override void AdvancedAdhesion(float elapsedClockSeconds)
63586361
float WheelMomentInertia = (linkedEngine.AttachedAxle.WheelWeightKg * linkedEngine.AttachedAxle.WheelRadiusM * linkedEngine.AttachedAxle.WheelRadiusM) / 2.0f;
63596362
float AxleMomentInertia = (linkedEngine.AttachedAxle.WheelWeightKg * AxleRadiusM * AxleRadiusM) / 2.0f;
63606363
float TotalWheelMomentofInertia = WheelMomentInertia + AxleMomentInertia; // Total MoI for generic wheelset
6361-
6362-
SteamDrvWheelWeightLbs = Kg.ToLb(linkedEngine.AttachedAxle.WheelWeightKg / linkedEngine.AttachedAxle.NumAxles); // Calculate the weight per axle (used in MSTSLocomotive for friction calculatons)
6363-
6364-
// The moment of inertia needs to be increased by the number of wheel sets
6364+
6365+
// The moment of inertia needs to be increased by the number of wheels in each set
63656366
TotalWheelMomentofInertia *= linkedEngine.AttachedAxle.NumAxles;
63666367

63676368
// the inertia of the coupling rods can also be added
@@ -6379,7 +6380,6 @@ public override void AdvancedAdhesion(float elapsedClockSeconds)
63796380
axle.DampingNs = axle.AxleWeightN / 200;
63806381
// Calculate internal resistance - IR = 3.8 * diameter of cylinder^2 * stroke * dia of drivers (all in inches) - This should reduce wheel force
63816382
axle.FrictionN = N.FromLbf(3.8f * Me.ToIn(linkedEngine.CylindersDiameterM) * Me.ToIn(linkedEngine.CylindersDiameterM) * Me.ToIn(linkedEngine.CylindersStrokeM) / (Me.ToIn(linkedEngine.AttachedAxle.WheelRadiusM * 2.0f)));
6382-
63836383
}
63846384

63856385
axle.BrakeRetardForceN = BrakeRetardForceN / LocomotiveAxles.Count;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2295,7 +2295,6 @@ private void UpdateDriveWheelWeight(int index, float masskg, int numberofengine
22952295
var LocoIdentification = Train.Cars[index] as MSTSSteamLocomotive;
22962296
if (LocoIdentification != null)
22972297
{
2298-
22992298
for (int i = 0; i < LocoIdentification.SteamEngines.Count; i++)
23002299
{
23012300
LocoIdentification.SteamEngines[i].AttachedAxle.WheelWeightKg = (MassKG / InitialMassKG) * LocoIdentification.SteamEngines[i].AttachedAxle.InitialDrvWheelWeightKg;

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerTransmissions/Axle.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,19 @@ public void Initialize()
241241
if (axle.DampingNs <= 0) axle.DampingNs = locomotive.MassKG / 1000.0f / AxleList.Count;
242242
if (axle.FrictionN <= 0) axle.FrictionN = locomotive.MassKG / 1000.0f / AxleList.Count;
243243
if (axle.NumberWheelAxles <= 0) axle.NumberWheelAxles = 1;
244+
245+
// set the wheel slip threshold times for different types of locomotives
246+
// Because of the irregular force around the wheel for a steam engine during a revolution, "response" time for warnings needs to be lower
247+
if (locomotive.EngineType == TrainCar.EngineTypes.Steam)
248+
{
249+
axle.WheelSlipThresholdTimeS = 0.01f;
250+
axle.WheelSlipWarningThresholdTimeS = 0.005f;
251+
}
252+
else
253+
{
254+
axle.WheelSlipThresholdTimeS = 1;
255+
axle.WheelSlipWarningThresholdTimeS = 1;
256+
}
244257
}
245258
axle.Initialize();
246259
}
@@ -675,6 +688,7 @@ public float TransmissionEfficiency
675688
/// </summary>
676689
public bool IsWheelSlip { get; private set; }
677690
float WheelSlipTimeS;
691+
public float WheelSlipThresholdTimeS = 1;
678692

679693
/// <summary>
680694
/// Wheelslip threshold value used to indicate maximal effective slip
@@ -736,6 +750,7 @@ public void ComputeWheelSlipThresholdMpS()
736750
/// </summary>
737751
public bool IsWheelSlipWarning { get; private set; }
738752
float WheelSlipWarningTimeS;
753+
public float WheelSlipWarningThresholdTimeS = 1;
739754

740755
/// <summary>
741756
/// Read only slip speed value in metric meters per second
@@ -1178,7 +1193,7 @@ public virtual void Update(float elapsedSeconds)
11781193
if (Math.Abs(SlipSpeedMpS) > WheelSlipThresholdMpS)
11791194
{
11801195
// Wait some time before indicating wheelslip to avoid false triggers
1181-
if (WheelSlipTimeS > 1)
1196+
if (WheelSlipTimeS > WheelSlipThresholdTimeS)
11821197
{
11831198
IsWheelSlip = IsWheelSlipWarning = true;
11841199
}
@@ -1187,7 +1202,7 @@ public virtual void Update(float elapsedSeconds)
11871202
else if (Math.Abs(SlipSpeedPercent) > SlipWarningTresholdPercent)
11881203
{
11891204
// Wait some time before indicating wheelslip to avoid false triggers
1190-
if (WheelSlipWarningTimeS > 1) IsWheelSlipWarning = true;
1205+
if (WheelSlipWarningTimeS > WheelSlipWarningThresholdTimeS) IsWheelSlipWarning = true;
11911206
IsWheelSlip = false;
11921207
WheelSlipWarningTimeS += elapsedSeconds;
11931208
}

0 commit comments

Comments
 (0)