@@ -1192,12 +1192,14 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
1192
1192
string numEngines = "" ; // using "+" between DPU sets
1193
1193
int numCars = 0 ;
1194
1194
int numAxles = 0 ;
1195
- var massKg = playerTrain . MassKg ;
1195
+ var totMassKg = playerTrain . MassKg ;
1196
1196
string sectionMass = "" ; // using " + " between wagon sets
1197
1197
var lengthM = playerTrain . Length ;
1198
1198
var maxSpeedMps = playerTrain . TrainMaxSpeedMpS ;
1199
1199
float totPowerW = 0f ;
1200
+ float totMaxTractiveEffortN = 0f ;
1200
1201
string sectionMaxTractiveForce = "" ; // using " + " between DPU sets
1202
+ float totMaxDynamicBrakeForceN = 0f ;
1201
1203
string sectionMaxDynamicBrakeForce = "" ; // using " + " between DPU sets
1202
1204
float maxBrakeForceN = 0f ;
1203
1205
float lowestCouplerStrengthN = 9.999e8f ; // impossible high force
@@ -1231,7 +1233,9 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
1231
1233
engCount ++ ;
1232
1234
numAxles += eng . LocoNumDrvAxles + eng . GetWagonNumAxles ( ) ;
1233
1235
totPowerW += eng . MaxPowerW ;
1236
+ totMaxTractiveEffortN += eng . MaxForceN ;
1234
1237
engMaxTractiveForceN += eng . MaxForceN ;
1238
+ totMaxDynamicBrakeForceN += eng . MaxDynamicBrakeForceN ;
1235
1239
engMaxDynBrakeForceN += eng . MaxDynamicBrakeForceN ;
1236
1240
1237
1241
// hanlde transition from wagons to engines
@@ -1292,7 +1296,7 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
1292
1296
1293
1297
line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
1294
1298
line . Add ( new Label ( labelWidth , line . RemainingHeight , Viewer . Catalog . GetString ( "Total Weight:" ) , LabelAlignment . Left ) ) ;
1295
- string massValue = FormatStrings . FormatLargeMass ( massKg , isMetric , isUK ) + " (" + sectionMass + ")" ;
1299
+ string massValue = FormatStrings . FormatLargeMass ( totMassKg , isMetric , isUK ) + " (" + sectionMass + ")" ;
1296
1300
line . Add ( new Label ( line . RemainingWidth , line . RemainingHeight , massValue , LabelAlignment . Left ) ) ;
1297
1301
1298
1302
line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
@@ -1319,17 +1323,37 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
1319
1323
1320
1324
if ( ! isMetric )
1321
1325
{
1322
- float hpt = massKg > 0f ? W . ToHp ( totPowerW ) / Kg . ToTUS ( massKg ) : 0f ;
1326
+ float hpt = totMassKg > 0f ? W . ToHp ( totPowerW ) / Kg . ToTUS ( totMassKg ) : 0f ;
1323
1327
line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
1324
1328
line . Add ( new Label ( labelWidth , line . RemainingHeight , Viewer . Catalog . GetString ( "Horespower per Ton:" ) , LabelAlignment . Left ) ) ;
1325
1329
line . Add ( new Label ( line . RemainingWidth , line . RemainingHeight , string . Format ( "{0:0.0}" , hpt ) , LabelAlignment . Left ) ) ;
1326
1330
1327
- float tpob = numOperativeBrakes > 0 ? Kg . ToTUS ( massKg ) / numOperativeBrakes : 0 ;
1331
+ float tpob = numOperativeBrakes > 0 ? Kg . ToTUS ( totMassKg ) / numOperativeBrakes : 0 ;
1328
1332
line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
1329
1333
line . Add ( new Label ( labelWidth , line . RemainingHeight , Viewer . Catalog . GetString ( "Tons per Operative Brake:" ) , LabelAlignment . Left ) ) ;
1330
1334
line . Add ( new Label ( line . RemainingWidth , line . RemainingHeight , string . Format ( "{0:0}" , tpob ) , LabelAlignment . Left ) ) ;
1335
+
1336
+ // The next two metrics are based on UP's equivalent powered axles and equivalent dynamic brake axles. These are based on
1337
+ // tractive effort, and thus provide a more accurate metric than horsepower per ton. UP uses 10k lbf for a standard axle.
1338
+ // TODO: EPA and EDBA should really be defined in the eng file, and not calculated here.
1339
+ // TODO: It would be great to also show the minimum TpEPA and TpEDBA for the current train-path. But that is hard to calculate,
1340
+ // and should really be defined in the path file.
1341
+
1342
+ // tons per equivalent powered axle (TPA or TpEPA)
1343
+ float tpepa = totMaxTractiveEffortN > 0 ? Kg . ToTUS ( totMassKg ) / ( N . ToLbf ( totMaxTractiveEffortN ) / 10000f ) : 0 ;
1344
+ line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
1345
+ line . Add ( new Label ( labelWidth , line . RemainingHeight , Viewer . Catalog . GetString ( "Tons per EPA:" ) , LabelAlignment . Left ) ) ;
1346
+ line . Add ( new Label ( line . RemainingWidth , line . RemainingHeight , string . Format ( "{0:0}" , tpepa ) , LabelAlignment . Left ) ) ;
1347
+
1348
+ // tons per equivalent dynamic brake axle (TpEDBA)
1349
+ float tpedba = totMaxDynamicBrakeForceN > 0 ? Kg . ToTUS ( totMassKg ) / ( N . ToLbf ( totMaxDynamicBrakeForceN ) / 10000f ) : 0 ;
1350
+ line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
1351
+ line . Add ( new Label ( labelWidth , line . RemainingHeight , Viewer . Catalog . GetString ( "Tons per EDBA:" ) , LabelAlignment . Left ) ) ;
1352
+ line . Add ( new Label ( line . RemainingWidth , line . RemainingHeight , string . Format ( "{0:0}" , tpedba ) , LabelAlignment . Left ) ) ;
1331
1353
}
1332
1354
1355
+ scrollbox . AddHorizontalSeparator ( ) ;
1356
+
1333
1357
line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
1334
1358
line . Add ( new Label ( labelWidth , line . RemainingHeight , Viewer . Catalog . GetString ( "Lowest Coupler Strength:" ) , LabelAlignment . Left ) ) ;
1335
1359
line . Add ( new Label ( line . RemainingWidth , line . RemainingHeight , FormatStrings . FormatForce ( lowestCouplerStrengthN , isMetric ) , LabelAlignment . Left ) ) ;
0 commit comments