Skip to content

Commit f7e31c1

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 b554363: 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 a0a37ac: Duplex steam engines - Booster Engine addition - Pull request #903 at 0d6d045: 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 cfd99f5 + b02a6e5 + 3539862 + d00beb9 + f92de76 + b554363 + 8f94333 + 6c0785b + 1f5ba4c + 5866028 + 42f1dd9 + a0a37ac + 0d6d045 + 9b0b04f + 4b4afe3 + 6834af0 commit f7e31c1

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2039,10 +2039,11 @@ public override void Initialize()
20392039
}
20402040

20412041
// Calculate factor of adhesion for display purposes
2042-
// Per Engine
2042+
// Per Engine, and set Initial drivewheelweight
20432043
for (int i = 0; i < SteamEngines.Count; i++)
20442044
{
20452045
SteamEngines[i].CalculatedFactorOfAdhesion = Kg.ToLb(SteamEngines[i].AttachedAxle.WheelWeightKg) / SteamEngines[i].MaxTractiveEffortLbf;
2046+
SteamEngines[i].AttachedAxle.InitialDrvWheelWeightKg = SteamEngines[i].AttachedAxle.WheelWeightKg;
20462047
}
20472048

20482049
// Calculate "critical" power of locomotive to determine limit of max IHP
@@ -6338,13 +6339,15 @@ public override void AdvancedAdhesion(float elapsedClockSeconds)
63386339
// geared locomotive or booster locomotive
63396340
{
63406341
// Moment of Inertia (Wheel and axle) = (Mass x Radius^2) / 2.0
6342+
float wheelMassKG = Kg.FromLb(6000.0f);
6343+
float AxleMassKG = Kg.FromLb(1000.0f);
63416344
float AxleRadiusM = Me.FromIn(8.0f / 2.0f);
6342-
float WheelMomentInertia = (linkedEngine.AttachedAxle.WheelWeightKg * linkedEngine.AttachedAxle.WheelRadiusM * linkedEngine.AttachedAxle.WheelRadiusM) / 2.0f;
6343-
float AxleMomentInertia = (linkedEngine.AttachedAxle.WheelWeightKg * AxleRadiusM * AxleRadiusM) / 2.0f;
6345+
float WheelMomentInertia = (wheelMassKG * linkedEngine.AttachedAxle.WheelRadiusM * linkedEngine.AttachedAxle.WheelRadiusM) / 2.0f;
6346+
float AxleMomentInertia = (AxleMassKG * AxleRadiusM * AxleRadiusM) / 2.0f;
63446347
float TotalWheelMomentofInertia = WheelMomentInertia + AxleMomentInertia; // Total MoI for generic wheelset
63456348
float TotalMomentInertia = TotalWheelMomentofInertia;
63466349
axle.InertiaKgm2 = TotalMomentInertia;
6347-
axle.DampingNs = linkedEngine.AttachedAxle.AxleWeightN / 200;
6350+
63486351
// Calculate internal resistance - IR = 3.8 * diameter of cylinder^2 * stroke * dia of drivers (all in inches) - This should reduce wheel force
63496352
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)));
63506353
}
@@ -6357,10 +6360,11 @@ public override void AdvancedAdhesion(float elapsedClockSeconds)
63576360
// Generic wheel assumptions are - 80 inch drive wheels ( 2.032 metre), a pair of drive wheels weighs approx 6,000lbs, axle weighs 1,000 lbs, and has a diameter of 8 inches.
63586361
// Moment of Inertia (Wheel and axle) = (Mass x Radius^2) / 2.0
63596362

6360-
float AxleWeighKG = Kg.FromLb(1000.0f);
6363+
float wheelMassKG = Kg.FromLb(6000.0f);
6364+
float AxleMassKG = Kg.FromLb(1000.0f);
63616365
float AxleRadiusM = Me.FromIn(8.0f / 2.0f);
6362-
float WheelMomentInertia = (linkedEngine.AttachedAxle.WheelWeightKg * linkedEngine.AttachedAxle.WheelRadiusM * linkedEngine.AttachedAxle.WheelRadiusM) / 2.0f;
6363-
float AxleMomentInertia = (linkedEngine.AttachedAxle.WheelWeightKg * AxleRadiusM * AxleRadiusM) / 2.0f;
6366+
float WheelMomentInertia = (wheelMassKG * linkedEngine.AttachedAxle.WheelRadiusM * linkedEngine.AttachedAxle.WheelRadiusM) / 2.0f;
6367+
float AxleMomentInertia = (AxleMassKG * AxleRadiusM * AxleRadiusM) / 2.0f;
63646368
float TotalWheelMomentofInertia = WheelMomentInertia + AxleMomentInertia; // Total MoI for generic wheelset
63656369

63666370
// The moment of inertia needs to be increased by the number of wheels in each set
@@ -6378,6 +6382,7 @@ public override void AdvancedAdhesion(float elapsedClockSeconds)
63786382

63796383
float TotalMomentInertia = TotalWheelMomentofInertia + RodMomentInertia;
63806384
axle.InertiaKgm2 = TotalMomentInertia;
6385+
63816386
axle.DampingNs = axle.AxleWeightN / 200;
63826387
// Calculate internal resistance - IR = 3.8 * diameter of cylinder^2 * stroke * dia of drivers (all in inches) - This should reduce wheel force
63836388
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)));

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2197,7 +2197,6 @@ private void UpdateLocomotiveLoadPhysics()
21972197
// update drive wheel weight for each multiple steam engine
21982198
UpdateDriveWheelWeight(LocoIndex, MassKG, SteamLocomotiveIdentification.SteamEngines.Count);
21992199

2200-
22012200
}
22022201
else // locomotive must be a tender type locomotive
22032202
// This is a tender locomotive. A tender locomotive does not have any fuel onboard.
@@ -2298,7 +2297,7 @@ private void UpdateDriveWheelWeight(int index, float masskg, int numberofengine
22982297
for (int i = 0; i < LocoIdentification.SteamEngines.Count; i++)
22992298
{
23002299
LocoIdentification.SteamEngines[i].AttachedAxle.WheelWeightKg = (MassKG / InitialMassKG) * LocoIdentification.SteamEngines[i].AttachedAxle.InitialDrvWheelWeightKg;
2301-
}
2300+
}
23022301
}
23032302
}
23042303

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ public void Initialize()
246246
// Because of the irregular force around the wheel for a steam engine during a revolution, "response" time for warnings needs to be lower
247247
if (locomotive.EngineType == TrainCar.EngineTypes.Steam)
248248
{
249-
axle.WheelSlipThresholdTimeS = 0.01f;
250-
axle.WheelSlipWarningThresholdTimeS = 0.005f;
249+
axle.WheelSlipThresholdTimeS = 0.1f;
250+
axle.WheelSlipWarningThresholdTimeS = 0.05f;
251251
}
252252
else
253253
{
@@ -501,6 +501,7 @@ public float InertiaKgm2
501501
{
502502
if (value <= 0.0)
503503
throw new NotSupportedException("Inertia must be greater than zero");
504+
504505
inertiaKgm2 = value;
505506
switch (DriveType)
506507
{

0 commit comments

Comments
 (0)