Skip to content

Commit 382ea6d

Browse files
committed
Add TpEPA and TpEDBA, when units are imperial.
TpEPA = Tons per Equivalent Powered Axles. TpEDBA = Tons per Equivalent Dynamic Brake Axles. These metrics are more accurate than HP per Ton, as they are based on tractive effort. The calculations are based on Union Pacific practices. UP uses a standard axle of 10'000 lbf tractive effort or dynamic brake force. For example a GP40-2 is 5.0 EPA, an SD40-2 is 7.1 EPA. Both have the same HP (and thus result in the same HP-per-Ton).
1 parent 6e1bdff commit 382ea6d

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

Source/Contrib/ContentManager/ContentInfo.cs

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,13 @@ public static string GetText(Content content)
195195
details.AppendFormat("Power:\t{1}{0}", Environment.NewLine, FormatStrings.FormatPower(data.MaxPowerW, IsMetric, IsImperialBHP, IsImperialBTUpS));
196196
details.AppendFormat("MaxTE:\t{1}{0}", Environment.NewLine, FormatStrings.FormatForce(data.MaxTractiveForceN, IsMetric));
197197
details.AppendFormat("MaxDynBrk:\t{1}{0}", Environment.NewLine, FormatStrings.FormatForce(data.MaxDynamicBrakeForceN, IsMetric));
198-
if (!IsMetric && !IsUK) { details.AppendFormat("HPT:\t{1}{0}", Environment.NewLine, FormatHPT(data.MaxPowerW, data.MassKG)); }
199-
if (!IsMetric && !IsUK) { details.AppendFormat("TpOB:\t{1}{0}", Environment.NewLine, FormatTPOB(data.MassKG, data.NumOperativeBrakes)); }
198+
if (!IsMetric && !IsUK)
199+
{
200+
details.AppendFormat("HPT:\t{1}{0}", Environment.NewLine, FormatHPT(data.MaxPowerW, data.MassKG));
201+
details.AppendFormat("TpOB:\t{1}{0}", Environment.NewLine, FormatTPOB(data.MassKG, data.NumOperativeBrakes));
202+
details.AppendFormat("TpEPA:\t{1}{0}", Environment.NewLine, FormatTonsPerEPA(data.MassKG, data.MaxTractiveForceN));
203+
details.AppendFormat("TpEDBA:\t{1}{0}", Environment.NewLine, FormatTonsPerEDBA(data.MassKG, data.MaxDynamicBrakeForceN));
204+
}
200205
details.AppendFormat("MinCouplerStrength:\t{1}{0}", Environment.NewLine, FormatStrings.FormatForce(data.MinCouplerStrengthN, IsMetric));
201206
details.AppendFormat("MinDerailForce:\t{1}{0}", Environment.NewLine, FormatStrings.FormatForce(data.MinDerailForceN, IsMetric));
202207
details.AppendLine();
@@ -273,9 +278,6 @@ static string FormatMassBar(float massKg)
273278
/// <summary>
274279
/// Calculate and format horsepower per ton for consist, rounded to one decimal.
275280
/// </summary>
276-
/// <param name="consistPowerW"></param>
277-
/// <param name="consistMassKG"></param>
278-
/// <returns>horsepower-per-ton formated to one decimal.</returns>
279281
//TODO: implement UK and metric version
280282
static string FormatHPT(float consistPowerW, float consistMassKG)
281283
{
@@ -286,14 +288,33 @@ static string FormatHPT(float consistPowerW, float consistMassKG)
286288
/// <summary>
287289
/// Calculate and format tons per operative brake for consist, rounded to an integer.
288290
/// </summary>
289-
/// <param name="consistMassKG"></param>
290-
/// <param name="consistNumOpBrakes"></param>
291-
/// <returns>tons-per-operative-brake formated to an integer.</returns>
292291
//TODO: implement UK and metric version
293292
static string FormatTPOB(float consistMassKG, float consistNumOpBrakes)
294293
{
295294
var tpob = consistNumOpBrakes > 0 ? Kg.ToTUS(consistMassKG) / consistNumOpBrakes : 0;
296295
return string.Format("{0:0}", tpob);
297296
}
297+
298+
/// <summary>
299+
/// Calculate and format tons per equivalent powered axle, rounded to an integer.
300+
/// Based on UP convention, of 10k lbf counting as one axle.
301+
/// Strictly, EPA should be defined in the eng file. May be done in future.
302+
/// </summary>
303+
static string FormatTonsPerEPA(float consistMassKG, float consistMaxTractiveEffortN)
304+
{
305+
var tpepa = consistMaxTractiveEffortN > 0 ? Kg.ToTUS(consistMassKG) / (N.ToLbf(consistMaxTractiveEffortN) / 10000f) : 0;
306+
return string.Format("{0:0}", tpepa);
307+
}
308+
309+
/// <summary>
310+
/// Calculate and format tons per equivalent dynamic brake axle, rounded to an integer.
311+
/// Based on UP convention, of 10k lbf counting as one axle.
312+
/// Strictly, EDBA should be defined in the eng file. May be done in future.
313+
/// </summary>
314+
static string FormatTonsPerEDBA(float consistMassKG, float consistMaxDynamicBrakeForceN)
315+
{
316+
var tpedba = consistMaxDynamicBrakeForceN > 0 ? Kg.ToTUS(consistMassKG) / (N.ToLbf(consistMaxDynamicBrakeForceN) / 10000f) : 0;
317+
return string.Format("{0:0}", tpedba);
318+
}
298319
}
299320
}

0 commit comments

Comments
 (0)