Skip to content

Commit 7a8df6f

Browse files
committed
Automatic merge of T1.5.1-797-gabb8eb9a4 and 13 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 0a9d939: feat: Improved system information collection - Pull request #899 at 28436ab: Duplex steam engines - Booster Engine addition - 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 #909 at c3a572a: Correct Control Car crash bug
15 parents 0642684 + abb8eb9 + 3539862 + d00beb9 + f92de76 + a055bca + 8f94333 + 6c0785b + 1f5ba4c + 5866028 + 0a9d939 + 28436ab + 9b0b04f + 4b4afe3 + c3a572a commit 7a8df6f

File tree

3 files changed

+52
-17
lines changed

3 files changed

+52
-17
lines changed

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

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,7 +1976,7 @@ public override void Initialize()
19761976

19771977
for (int i = 0; i < SteamEngines.Count; i++)
19781978
{
1979-
if (SteamEngines[i].MaxIndicatedHorsePowerHP == 0 && SteamEngines.Count == 0 && MaxIndicatedHorsePowerHP != 0)
1979+
if (SteamEngines[i].MaxIndicatedHorsePowerHP == 0 && SteamEngines.Count == 1 && MaxIndicatedHorsePowerHP != 0)
19801980
// if MaxIHP is not set in ENG file, then set a default
19811981
{
19821982
SteamEngines[i].MaxIndicatedHorsePowerHP = MaxIndicatedHorsePowerHP;
@@ -1985,16 +1985,14 @@ public override void Initialize()
19851985
{
19861986
// Max IHP = (Max TE x Speed) / 375.0, use a factor of 0.85 to calculate max TE
19871987
SteamEngines[i].MaxIndicatedHorsePowerHP = MaxSpeedFactor * (SteamEngines[i].MaxTractiveEffortLbf * MaxLocoSpeedMpH) / 375.0f; // To be checked what MaxTractive Effort is for the purposes of this formula.
1988+
MaxIndicatedHorsePowerHP += SteamEngines[i].MaxIndicatedHorsePowerHP;
19881989
}
1989-
1990-
MaxIndicatedHorsePowerHP += SteamEngines[i].MaxIndicatedHorsePowerHP;
19911990
}
19921991

1993-
19941992
// Check to see if MaxIHP is in fact limited by the boiler
19951993
if (MaxIndicatedHorsePowerHP > MaxBoilerOutputHP)
19961994
{
1997-
MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
1995+
// MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler - No need to limit IHP, naturally limited by steam production?????
19981996
ISBoilerLimited = true;
19991997
}
20001998
else
@@ -6098,6 +6096,14 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float loc
60986096
MotiveForceN += SteamEngines[i].TractiveForceN;
60996097
}
61006098

6099+
// Temporary code to compare TE and IHP
6100+
6101+
SteamEngines[i].CompareTractiveForceN = N.FromLbf((SteamEngines[i].NumberCylinders / 2.0f) * (Me.ToIn(SteamEngines[i].CylindersDiameterM) * Me.ToIn(SteamEngines[i].CylindersDiameterM) * Me.ToIn(SteamEngines[i].CylindersStrokeM) / (2.0f * Me.ToIn(SteamEngines[i].AttachedAxle.WheelRadiusM))) * (SteamEngines[i].MeanEffectivePressurePSI * CylinderEfficiencyRate) * MotiveForceGearRatio);
6102+
6103+
SteamEngines[i].CompareIndicatedHorsePower = (N.ToLbf(SteamEngines[i].TractiveForceN) * pS.TopH(Me.ToMi(absSpeedMpS))) / 375.0f;
6104+
6105+
6106+
61016107
// Set Max Power equal to max IHP
61026108
MaxPowerW += W.FromHp(SteamEngines[i].MaxIndicatedHorsePowerHP);
61036109

@@ -6293,9 +6299,9 @@ public override void AdvancedAdhesion(float elapsedClockSeconds)
62936299
float TotalWheelMomentofInertia = WheelMomentInertia + AxleMomentInertia; // Total MoI for generic wheelset
62946300
float TotalMomentInertia = TotalWheelMomentofInertia;
62956301
axle.InertiaKgm2 = TotalMomentInertia;
6296-
axle.DampingNs = axle.AxleWeightN / 200;
6302+
axle.DampingNs = linkedEngine.AttachedAxle.AxleWeightN / 200;
62976303
// Calculate internal resistance - IR = 3.8 * diameter of cylinder^2 * stroke * dia of drivers (all in inches) - This should reduce wheel force
6298-
axle.FrictionN = N.FromLbf(3.8f * Me.ToIn(linkedEngine.CylindersDiameterM) * Me.ToIn(linkedEngine.CylindersDiameterM) * Me.ToIn(linkedEngine.CylindersStrokeM) / (Me.ToIn(axle.WheelRadiusM * 2.0f)));
6304+
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)));
62996305
}
63006306

63016307
else // normal locomotive
@@ -6312,10 +6318,10 @@ public override void AdvancedAdhesion(float elapsedClockSeconds)
63126318
float AxleMomentInertia = (linkedEngine.AttachedAxle.WheelWeightKg * AxleRadiusM * AxleRadiusM) / 2.0f;
63136319
float TotalWheelMomentofInertia = WheelMomentInertia + AxleMomentInertia; // Total MoI for generic wheelset
63146320

6315-
SteamDrvWheelWeightLbs = Kg.ToLb(DrvWheelWeightKg / axle.NumberWheelAxles); // Calculate the weight per axle (used in MSTSLocomotive for friction calculatons)
6321+
SteamDrvWheelWeightLbs = Kg.ToLb(linkedEngine.AttachedAxle.WheelWeightKg / linkedEngine.AttachedAxle.NumAxles); // Calculate the weight per axle (used in MSTSLocomotive for friction calculatons)
63166322

63176323
// The moment of inertia needs to be increased by the number of wheel sets
6318-
TotalWheelMomentofInertia *= axle.NumberWheelAxles;
6324+
TotalWheelMomentofInertia *= linkedEngine.AttachedAxle.NumAxles;
63196325

63206326
// the inertia of the coupling rods can also be added
63216327
// Assume rods weigh approx 1500 lbs
@@ -6331,7 +6337,7 @@ public override void AdvancedAdhesion(float elapsedClockSeconds)
63316337
axle.InertiaKgm2 = TotalMomentInertia;
63326338
axle.DampingNs = axle.AxleWeightN / 200;
63336339
// Calculate internal resistance - IR = 3.8 * diameter of cylinder^2 * stroke * dia of drivers (all in inches) - This should reduce wheel force
6334-
axle.FrictionN = N.FromLbf(3.8f * Me.ToIn(linkedEngine.CylindersDiameterM) * Me.ToIn(linkedEngine.CylindersDiameterM) * Me.ToIn(linkedEngine.CylindersStrokeM) / (Me.ToIn(axle.WheelRadiusM * 2.0f)));
6340+
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)));
63356341

63366342
}
63376343

@@ -7775,7 +7781,9 @@ public override string GetDebugStatus()
77757781
Simulator.Catalog.GetString("Drawbar"),
77767782
FormatStrings.FormatPower(W.FromHp(DrawbarHorsePowerHP), IsMetric, false, false),
77777783
Simulator.Catalog.GetString("BlrLmt"),
7778-
ISBoilerLimited ? Simulator.Catalog.GetString("Yes") : Simulator.Catalog.GetString("No"));
7784+
ISBoilerLimited ? Simulator.Catalog.GetString("Yes") : Simulator.Catalog.GetString("No")
7785+
7786+
);
77797787

77807788
if (SteamEngines.Count > 1)
77817789
{
@@ -7788,10 +7796,27 @@ public override string GetDebugStatus()
77887796
Simulator.Catalog.GetString("TheorTE"),
77897797
FormatStrings.FormatForce(N.FromLbf(SteamEngines[i].MaxTractiveEffortLbf), IsMetric),
77907798
Simulator.Catalog.GetString("TE"),
7791-
FormatStrings.FormatForce(SteamEngines[i].TractiveForceN, IsMetric));
7799+
FormatStrings.FormatForce(SteamEngines[i].TractiveForceN, IsMetric)
7800+
7801+
);
7802+
77927803
}
77937804
}
77947805

7806+
for (int i = 0; i < SteamEngines.Count; i++)
7807+
{
7808+
status.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\n",
7809+
Simulator.Catalog.GetString("ForceCom:"),
7810+
Simulator.Catalog.GetString("Eng#:"),
7811+
i + 1,
7812+
Simulator.Catalog.GetString("CompTE"),
7813+
FormatStrings.FormatForce(SteamEngines[i].CompareTractiveForceN, IsMetric),
7814+
Simulator.Catalog.GetString("CompIHP"),
7815+
FormatStrings.FormatPower(W.FromHp(SteamEngines[i].CompareIndicatedHorsePower), IsMetric, false, false)
7816+
);
7817+
}
7818+
7819+
77957820
status.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\t{10}\t{11}\t{12}\n",
77967821
Simulator.Catalog.GetString("ForceTot:"),
77977822
Simulator.Catalog.GetString("TheorTE"),
@@ -7850,7 +7875,7 @@ public override string GetDebugStatus()
78507875
Simulator.Catalog.GetString("Slip"),
78517876
SteamEngines[i].AttachedAxle.IsWheelSlip ? Simulator.Catalog.GetString("Yes") : Simulator.Catalog.GetString("No"),
78527877
Simulator.Catalog.GetString("WheelM"),
7853-
FormatStrings.FormatMass(SteamEngines[i].AttachedAxle.WheelWeightKg, IsMetric),
7878+
FormatStrings.FormatMass(Kg.FromLb(SteamDrvWheelWeightLbs), IsMetric),
78547879
Simulator.Catalog.GetString("FoA"),
78557880
SteamEngines[i].CalculatedFactorOfAdhesion);
78567881
}
@@ -8127,7 +8152,7 @@ public void SteamStartGearBoxIncrease()
81278152
// Check to see if MaxIHP is in fact limited by the boiler
81288153
if (MaxIndicatedHorsePowerHP > MaxBoilerOutputHP)
81298154
{
8130-
MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
8155+
// MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
81318156
ISBoilerLimited = true;
81328157
}
81338158
else
@@ -8168,7 +8193,7 @@ public void SteamStartGearBoxIncrease()
81688193
// Check to see if MaxIHP is in fact limited by the boiler
81698194
if (MaxIndicatedHorsePowerHP > MaxBoilerOutputHP)
81708195
{
8171-
MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
8196+
// MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
81728197
ISBoilerLimited = true;
81738198
}
81748199
else
@@ -8231,7 +8256,7 @@ public void SteamStartGearBoxDecrease()
82318256
// Check to see if MaxIHP is in fact limited by the boiler
82328257
if (MaxIndicatedHorsePowerHP > MaxBoilerOutputHP)
82338258
{
8234-
MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
8259+
// MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
82358260
ISBoilerLimited = true;
82368261
}
82378262
else

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerSupplies/SteamEngine.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,16 @@ public enum AuxiliarySteamEngineTypes
356356
/// </summary>
357357
public float AverageTractiveForceN;
358358

359+
/// <summary>
360+
/// Steam Engine average tractive force
361+
/// </summary>
362+
public float CompareTractiveForceN;
363+
364+
/// <summary>
365+
/// Steam Engine average tractive force
366+
/// </summary>
367+
public float CompareIndicatedHorsePower;
368+
359369
/// <summary>
360370
/// Steam Engine maximum indicated horsepower
361371
/// </summary>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ public float TransmissionEfficiency
604604
public float BogieRigidWheelBaseM;
605605

606606
/// <summary>
607-
/// Axles in group of wheels
607+
/// Number of drive axles in group of wheels
608608
/// </summary>
609609
public float NumAxles;
610610

0 commit comments

Comments
 (0)