Skip to content

Commit 0fb4ef1

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 ff2e73d: 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 02f4945 + b02a6e5 + 3539862 + d00beb9 + f92de76 + a055bca + 8f94333 + 6c0785b + 1f5ba4c + 5866028 + 42f1dd9 + ff2e73d + 6c9da3f + 9b0b04f + 4b4afe3 + 6834af0 commit 0fb4ef1

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7936,7 +7936,7 @@ public override string GetDebugStatus()
79367936
Simulator.Catalog.GetString("Slip"),
79377937
SteamEngines[i].AttachedAxle.IsWheelSlip ? Simulator.Catalog.GetString("Yes") : Simulator.Catalog.GetString("No"),
79387938
Simulator.Catalog.GetString("WheelM"),
7939-
FormatStrings.FormatMass(Kg.FromLb(SteamDrvWheelWeightLbs), IsMetric),
7939+
FormatStrings.FormatMass(SteamEngines[i].AttachedAxle.WheelWeightKg, IsMetric),
79407940
Simulator.Catalog.GetString("FoA"),
79417941
SteamEngines[i].CalculatedFactorOfAdhesion);
79427942
}

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
using Orts.Simulation.RollingStocks.SubSystems.Controllers;
4545
using Orts.Simulation.RollingStocks.SubSystems.PowerSupplies;
4646
using Orts.Simulation.RollingStocks.SubSystems.PowerTransmissions;
47+
using Orts.Simulation.Simulation.RollingStocks.SubSystems.PowerSupplies;
4748
using ORTS.Common;
4849
using ORTS.Scripting.Api;
4950
using System;
@@ -2192,6 +2193,11 @@ private void UpdateLocomotiveLoadPhysics()
21922193
MassKG = MathHelper.Clamp(MassKG, LoadEmptyMassKg, LoadFullMassKg); // Clamp Mass to between the empty and full wagon values
21932194
// Adjust drive wheel weight
21942195
SteamLocomotiveIdentification.DrvWheelWeightKg = (MassKG / InitialMassKG) * SteamLocomotiveIdentification.InitialDrvWheelWeightKg;
2196+
2197+
// update drive wheel weight for each multiple steam engine
2198+
UpdateDriveWheelWeight(LocoIndex, MassKG, SteamLocomotiveIdentification.SteamEngines.Count);
2199+
2200+
21952201
}
21962202
else // locomotive must be a tender type locomotive
21972203
// This is a tender locomotive. A tender locomotive does not have any fuel onboard.
@@ -2202,6 +2208,10 @@ private void UpdateLocomotiveLoadPhysics()
22022208
MassKG = MathHelper.Clamp(MassKG, LoadEmptyMassKg, MassUpperLimit); // Clamp Mass to between the empty and full wagon values
22032209
// Adjust drive wheel weight
22042210
SteamLocomotiveIdentification.DrvWheelWeightKg = (MassKG / InitialMassKG) * SteamLocomotiveIdentification.InitialDrvWheelWeightKg;
2211+
2212+
// update drive wheel weight for each multiple steam engine
2213+
UpdateDriveWheelWeight(LocoIndex, MassKG, SteamLocomotiveIdentification.SteamEngines.Count);
2214+
22052215
}
22062216

22072217
// Update wagon physics parameters sensitive to wagon mass change
@@ -2280,6 +2290,19 @@ private void UpdateLocomotiveLoadPhysics()
22802290
}
22812291
}
22822292

2293+
private void UpdateDriveWheelWeight(int index, float masskg, int numberofengines)
2294+
{
2295+
var LocoIdentification = Train.Cars[index] as MSTSSteamLocomotive;
2296+
if (LocoIdentification != null)
2297+
{
2298+
2299+
for (int i = 0; i < LocoIdentification.SteamEngines.Count; i++)
2300+
{
2301+
LocoIdentification.SteamEngines[i].AttachedAxle.WheelWeightKg = (MassKG / InitialMassKG) * LocoIdentification.SteamEngines[i].AttachedAxle.InitialDrvWheelWeightKg;
2302+
}
2303+
}
2304+
}
2305+
22832306
private void UpdateTrainBaseResistance()
22842307
{
22852308
IsBelowMergeSpeed = AbsSpeedMpS < MergeSpeedMpS;

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,11 @@ public float TransmissionEfficiency
583583
/// </summary>
584584
public float WheelWeightKg;
585585

586+
/// <summary>
587+
/// Initial Wheel mass parameter in kilograms, is the reference against which the dynamic wheel weight is calculated.
588+
/// </summary>
589+
public float InitialDrvWheelWeightKg;
590+
586591
/// <summary>
587592
/// Flange angle wheels connected to axle
588593
/// </summary>

0 commit comments

Comments
 (0)