Skip to content

Commit

Permalink
Automatic merge of T1.5.1-797-gabb8eb9a4 and 13 pull requests
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
openrails-bot committed Jan 14, 2024
15 parents 0642684 + abb8eb9 + 3539862 + d00beb9 + f92de76 + a055bca + 8f94333 + 6c0785b + 1f5ba4c + 5866028 + 0a9d939 + 28436ab + 9b0b04f + 4b4afe3 + c3a572a commit 7a8df6f
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1976,7 +1976,7 @@ public override void Initialize()

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

MaxIndicatedHorsePowerHP += SteamEngines[i].MaxIndicatedHorsePowerHP;
}


// Check to see if MaxIHP is in fact limited by the boiler
if (MaxIndicatedHorsePowerHP > MaxBoilerOutputHP)
{
MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
// MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler - No need to limit IHP, naturally limited by steam production?????
ISBoilerLimited = true;
}
else
Expand Down Expand Up @@ -6098,6 +6096,14 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float loc
MotiveForceN += SteamEngines[i].TractiveForceN;
}

// Temporary code to compare TE and IHP

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);

SteamEngines[i].CompareIndicatedHorsePower = (N.ToLbf(SteamEngines[i].TractiveForceN) * pS.TopH(Me.ToMi(absSpeedMpS))) / 375.0f;



// Set Max Power equal to max IHP
MaxPowerW += W.FromHp(SteamEngines[i].MaxIndicatedHorsePowerHP);

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

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

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

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

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

}

Expand Down Expand Up @@ -7775,7 +7781,9 @@ public override string GetDebugStatus()
Simulator.Catalog.GetString("Drawbar"),
FormatStrings.FormatPower(W.FromHp(DrawbarHorsePowerHP), IsMetric, false, false),
Simulator.Catalog.GetString("BlrLmt"),
ISBoilerLimited ? Simulator.Catalog.GetString("Yes") : Simulator.Catalog.GetString("No"));
ISBoilerLimited ? Simulator.Catalog.GetString("Yes") : Simulator.Catalog.GetString("No")

);

if (SteamEngines.Count > 1)
{
Expand All @@ -7788,10 +7796,27 @@ public override string GetDebugStatus()
Simulator.Catalog.GetString("TheorTE"),
FormatStrings.FormatForce(N.FromLbf(SteamEngines[i].MaxTractiveEffortLbf), IsMetric),
Simulator.Catalog.GetString("TE"),
FormatStrings.FormatForce(SteamEngines[i].TractiveForceN, IsMetric));
FormatStrings.FormatForce(SteamEngines[i].TractiveForceN, IsMetric)

);

}
}

for (int i = 0; i < SteamEngines.Count; i++)
{
status.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\n",
Simulator.Catalog.GetString("ForceCom:"),
Simulator.Catalog.GetString("Eng#:"),
i + 1,
Simulator.Catalog.GetString("CompTE"),
FormatStrings.FormatForce(SteamEngines[i].CompareTractiveForceN, IsMetric),
Simulator.Catalog.GetString("CompIHP"),
FormatStrings.FormatPower(W.FromHp(SteamEngines[i].CompareIndicatedHorsePower), IsMetric, false, false)
);
}


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",
Simulator.Catalog.GetString("ForceTot:"),
Simulator.Catalog.GetString("TheorTE"),
Expand Down Expand Up @@ -7850,7 +7875,7 @@ public override string GetDebugStatus()
Simulator.Catalog.GetString("Slip"),
SteamEngines[i].AttachedAxle.IsWheelSlip ? Simulator.Catalog.GetString("Yes") : Simulator.Catalog.GetString("No"),
Simulator.Catalog.GetString("WheelM"),
FormatStrings.FormatMass(SteamEngines[i].AttachedAxle.WheelWeightKg, IsMetric),
FormatStrings.FormatMass(Kg.FromLb(SteamDrvWheelWeightLbs), IsMetric),
Simulator.Catalog.GetString("FoA"),
SteamEngines[i].CalculatedFactorOfAdhesion);
}
Expand Down Expand Up @@ -8127,7 +8152,7 @@ public void SteamStartGearBoxIncrease()
// Check to see if MaxIHP is in fact limited by the boiler
if (MaxIndicatedHorsePowerHP > MaxBoilerOutputHP)
{
MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
// MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
ISBoilerLimited = true;
}
else
Expand Down Expand Up @@ -8168,7 +8193,7 @@ public void SteamStartGearBoxIncrease()
// Check to see if MaxIHP is in fact limited by the boiler
if (MaxIndicatedHorsePowerHP > MaxBoilerOutputHP)
{
MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
// MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
ISBoilerLimited = true;
}
else
Expand Down Expand Up @@ -8231,7 +8256,7 @@ public void SteamStartGearBoxDecrease()
// Check to see if MaxIHP is in fact limited by the boiler
if (MaxIndicatedHorsePowerHP > MaxBoilerOutputHP)
{
MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
// MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
ISBoilerLimited = true;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,16 @@ public enum AuxiliarySteamEngineTypes
/// </summary>
public float AverageTractiveForceN;

/// <summary>
/// Steam Engine average tractive force
/// </summary>
public float CompareTractiveForceN;

/// <summary>
/// Steam Engine average tractive force
/// </summary>
public float CompareIndicatedHorsePower;

/// <summary>
/// Steam Engine maximum indicated horsepower
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ public float TransmissionEfficiency
public float BogieRigidWheelBaseM;

/// <summary>
/// Axles in group of wheels
/// Number of drive axles in group of wheels
/// </summary>
public float NumAxles;

Expand Down

0 comments on commit 7a8df6f

Please sign in to comment.