Skip to content

Commit c1c417f

Browse files
committed
Fix for MSTS Gear Motor Bug
1 parent ad0cd0e commit c1c417f

File tree

1 file changed

+6
-12
lines changed
  • Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerTransmissions

1 file changed

+6
-12
lines changed

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -804,24 +804,18 @@ public void Initialize()
804804
{
805805
// If user has entered this value then assume that they have already put the maximum torque value in
806806
Gears[i].MaxTractiveForceN = GearBoxParams.GearBoxMaxTractiveForceForGearsN[i] / Locomotive.DieselEngines.Count;
807+
808+
// For purposes of calculating engine efficiency the tractive force at maximum gear speed needs to be used.
809+
Gears[i].TractiveForceatMaxSpeedN = (GearBoxParams.GearBoxMaxTractiveForceForGearsN[i] / (DieselEngine.DieselTorqueTab.MaxY() / DieselEngine.DieselTorqueTab[DieselEngine.MaxRPM])) / Locomotive.DieselEngines.Count;
807810
}
808811
else
809812
{
810813
// if they entered the TE at maximum gear speed, then increase the value accordingly
811814
Gears[i].MaxTractiveForceN = (GearBoxParams.GearBoxTractiveForceAtSpeedN[i] * DieselEngine.DieselTorqueTab.MaxY() / DieselEngine.DieselTorqueTab[DieselEngine.MaxRPM]) / Locomotive.DieselEngines.Count;
812-
// Trace.TraceInformation("MaxTractiveForce - CarID {0} MaxTE {1} ")
813-
}
814-
// For purposes of calculating engine efficiency the tractive force at maximum gear speed needs to be used.
815-
if (GearBoxParams.GearBoxTractiveForceAtSpeedN != null && GearBoxParams.GearBoxTractiveForceAtSpeedN[i] != 0)
816-
{
817-
// Assume that user has entered the TE at max speed already in the Eng
815+
816+
// For purposes of calculating engine efficiency the tractive force at maximum gear speed needs to be used.
818817
Gears[i].TractiveForceatMaxSpeedN = GearBoxParams.GearBoxTractiveForceAtSpeedN[i] / Locomotive.DieselEngines.Count;
819-
}
820-
else
821-
{
822-
// Assume that user entered max TE at maximum torque point
823-
Gears[i].TractiveForceatMaxSpeedN = (GearBoxParams.GearBoxMaxTractiveForceForGearsN[i] / (DieselEngine.DieselTorqueTab.MaxY() / DieselEngine.DieselTorqueTab[DieselEngine.MaxRPM])) / Locomotive.DieselEngines.Count;
824-
}
818+
}
825819

826820
Gears[i].OverspeedPercentage = GearBoxParams.GearBoxOverspeedPercentageForFailure;
827821
Gears[i].UpGearProportion = GearBoxParams.GearBoxUpGearProportion;

0 commit comments

Comments
 (0)