@@ -1192,12 +1192,14 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
11921192 string numEngines = "" ; // using "+" between DPU sets
11931193 int numCars = 0 ;
11941194 int numAxles = 0 ;
1195- var massKg = playerTrain . MassKg ;
1195+ var totMassKg = playerTrain . MassKg ;
11961196 string sectionMass = "" ; // using " + " between wagon sets
11971197 var lengthM = playerTrain . Length ;
11981198 var maxSpeedMps = playerTrain . TrainMaxSpeedMpS ;
11991199 float totPowerW = 0f ;
1200+ float totMaxTractiveEffortN = 0f ;
12001201 string sectionMaxTractiveForce = "" ; // using " + " between DPU sets
1202+ float totMaxDynamicBrakeForceN = 0f ;
12011203 string sectionMaxDynamicBrakeForce = "" ; // using " + " between DPU sets
12021204 float maxBrakeForceN = 0f ;
12031205 float lowestCouplerStrengthN = 9.999e8f ; // impossible high force
@@ -1231,7 +1233,9 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
12311233 engCount ++ ;
12321234 numAxles += eng . LocoNumDrvAxles + eng . GetWagonNumAxles ( ) ;
12331235 totPowerW += eng . MaxPowerW ;
1236+ totMaxTractiveEffortN += eng . MaxForceN ;
12341237 engMaxTractiveForceN += eng . MaxForceN ;
1238+ totMaxDynamicBrakeForceN += eng . MaxDynamicBrakeForceN ;
12351239 engMaxDynBrakeForceN += eng . MaxDynamicBrakeForceN ;
12361240
12371241 // hanlde transition from wagons to engines
@@ -1292,7 +1296,7 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
12921296
12931297 line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
12941298 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 + ")" ;
12961300 line . Add ( new Label ( line . RemainingWidth , line . RemainingHeight , massValue , LabelAlignment . Left ) ) ;
12971301
12981302 line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
@@ -1319,17 +1323,37 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
13191323
13201324 if ( ! isMetric )
13211325 {
1322- float hpt = massKg > 0f ? W . ToHp ( totPowerW ) / Kg . ToTUS ( massKg ) : 0f ;
1326+ float hpt = totMassKg > 0f ? W . ToHp ( totPowerW ) / Kg . ToTUS ( totMassKg ) : 0f ;
13231327 line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
13241328 line . Add ( new Label ( labelWidth , line . RemainingHeight , Viewer . Catalog . GetString ( "Horespower per Ton:" ) , LabelAlignment . Left ) ) ;
13251329 line . Add ( new Label ( line . RemainingWidth , line . RemainingHeight , string . Format ( "{0:0.0}" , hpt ) , LabelAlignment . Left ) ) ;
13261330
1327- float tpob = numOperativeBrakes > 0 ? Kg . ToTUS ( massKg ) / numOperativeBrakes : 0 ;
1331+ float tpob = numOperativeBrakes > 0 ? Kg . ToTUS ( totMassKg ) / numOperativeBrakes : 0 ;
13281332 line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
13291333 line . Add ( new Label ( labelWidth , line . RemainingHeight , Viewer . Catalog . GetString ( "Tons per Operative Brake:" ) , LabelAlignment . Left ) ) ;
13301334 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 ) ) ;
13311353 }
13321354
1355+ scrollbox . AddHorizontalSeparator ( ) ;
1356+
13331357 line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
13341358 line . Add ( new Label ( labelWidth , line . RemainingHeight , Viewer . Catalog . GetString ( "Lowest Coupler Strength:" ) , LabelAlignment . Left ) ) ;
13351359 line . Add ( new Label ( line . RemainingWidth , line . RemainingHeight , FormatStrings . FormatForce ( lowestCouplerStrengthN , isMetric ) , LabelAlignment . Left ) ) ;
0 commit comments