@@ -1194,10 +1194,12 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
1194
1194
int numCars = 0 ;
1195
1195
int numAxles = 0 ;
1196
1196
var totMassKg = playerTrain . MassKg ;
1197
+ float trailingMassKg = 0f ;
1197
1198
string sectionMass = "" ; // using " + " between wagon sets
1198
1199
var lengthM = playerTrain . Length ;
1199
1200
var maxSpeedMps = playerTrain . TrainMaxSpeedMpS ;
1200
1201
float totPowerW = 0f ;
1202
+ float totMaxTractiveEffortN = 0f ;
1201
1203
float totMaxContTractiveEffortN = 0f ;
1202
1204
string sectionMaxContTractiveForce = "" ; // using " + " between DPU sets
1203
1205
float totMaxDynamicBrakeForceN = 0f ;
@@ -1209,8 +1211,8 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
1209
1211
int engCount = 0 ; string countSeparator = "" ; // when set, indicates that subsequent engines are in a separate block
1210
1212
float engMaxContTractiveForceN = 0f ; float engMaxDynBrakeForceN = 0f ; string forceSeparator = "" ; // when set, indicates that subsequent engines are in a separate block
1211
1213
1212
- float wagMassKg = 0f ; string massSeparator = "" ; // when set, indicates that subsequent engines are in a separate block
1213
- float trailingMassKg = 0f ; int numOperativeBrakes = 0 ;
1214
+ float wagSectionMassKg = 0f ; string massSeparator = "" ; // when set, indicates that subsequent engines are in a separate block
1215
+ int numOperativeBrakes = 0 ;
1214
1216
bool isMetric = false ; bool isUK = false ; // isImperial* does not seem to be used in simulation
1215
1217
1216
1218
if ( TrainInfoSpriteSheet == null ) { TrainInfoSpriteSheet = SharedTextureManager . Get ( Owner . Viewer . RenderProcess . GraphicsDevice , Path . Combine ( Owner . Viewer . ContentPath , "TrainInfoSprites.png" ) ) ; }
@@ -1234,23 +1236,24 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
1234
1236
engCount ++ ;
1235
1237
numAxles += eng . LocoNumDrvAxles + eng . GetWagonNumAxles ( ) ;
1236
1238
totPowerW += eng . MaxPowerW ;
1239
+ totMaxTractiveEffortN += eng . MaxForceN ;
1237
1240
totMaxContTractiveEffortN += eng . MaxContinuousForceN > 0 ? eng . MaxContinuousForceN : eng . MaxForceN ;
1238
1241
engMaxContTractiveForceN += eng . MaxContinuousForceN > 0 ? eng . MaxContinuousForceN : eng . MaxForceN ;
1239
1242
totMaxDynamicBrakeForceN += eng . MaxDynamicBrakeForceN ;
1240
1243
engMaxDynBrakeForceN += eng . MaxDynamicBrakeForceN ;
1241
1244
1242
1245
// hanlde transition from wagons to engines
1243
- if ( wagMassKg > 0 )
1246
+ if ( wagSectionMassKg > 0 )
1244
1247
{
1245
- sectionMass += massSeparator + FormatStrings . FormatLargeMass ( wagMassKg , isMetric , isUK ) ;
1246
- wagMassKg = 0f ; massSeparator = " + " ;
1248
+ sectionMass += massSeparator + FormatStrings . FormatLargeMass ( wagSectionMassKg , isMetric , isUK ) ;
1249
+ wagSectionMassKg = 0f ; massSeparator = " + " ;
1247
1250
}
1248
1251
}
1249
1252
else if ( wag != null )
1250
1253
{
1251
1254
numCars ++ ;
1252
1255
numAxles += wag . GetWagonNumAxles ( ) ;
1253
- wagMassKg += wag . MassKG ;
1256
+ wagSectionMassKg += wag . MassKG ;
1254
1257
trailingMassKg += wag . MassKG ;
1255
1258
if ( wag . MaxBrakeForceN > 0 && car . BrakeSystem != null && ! ( car . BrakeSystem is SingleTransferPipe ) && ! ( car . BrakeSystem is ManualBraking ) ) { numOperativeBrakes ++ ; }
1256
1259
@@ -1282,7 +1285,7 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
1282
1285
if ( String . IsNullOrEmpty ( numEngines ) ) { numEngines = "0" ; }
1283
1286
if ( engMaxContTractiveForceN > 0 ) { sectionMaxContTractiveForce += forceSeparator + FormatStrings . FormatForce ( engMaxContTractiveForceN , isMetric ) ; }
1284
1287
if ( engMaxDynBrakeForceN > 0 ) { sectionMaxDynamicBrakeForce += forceSeparator + FormatStrings . FormatForce ( engMaxDynBrakeForceN , isMetric ) ; }
1285
- if ( wagMassKg > 0 ) { sectionMass += massSeparator + FormatStrings . FormatLargeMass ( wagMassKg , isMetric , isUK ) ; }
1288
+ if ( wagSectionMassKg > 0 ) { sectionMass += massSeparator + FormatStrings . FormatLargeMass ( wagSectionMassKg , isMetric , isUK ) ; }
1286
1289
1287
1290
var line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
1288
1291
line . Add ( new Label ( labelWidth , line . RemainingHeight , Viewer . Catalog . GetString ( "Number of Engines:" ) , LabelAlignment . Left ) ) ;
@@ -1312,9 +1315,13 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
1312
1315
scrollbox . AddHorizontalSeparator ( ) ;
1313
1316
1314
1317
line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
1315
- line . Add ( new Label ( labelWidth , line . RemainingHeight , Viewer . Catalog . GetString ( "Total Power:" ) , LabelAlignment . Left ) ) ;
1318
+ line . Add ( new Label ( labelWidth , line . RemainingHeight , Viewer . Catalog . GetString ( "Max Power:" ) , LabelAlignment . Left ) ) ;
1316
1319
line . Add ( new Label ( line . RemainingWidth , line . RemainingHeight , FormatStrings . FormatPower ( totPowerW , isMetric , false , false ) , LabelAlignment . Left ) ) ;
1317
1320
1321
+ line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
1322
+ line . Add ( new Label ( labelWidth , line . RemainingHeight , Viewer . Catalog . GetString ( "Max Tractive Effort:" ) , LabelAlignment . Left ) ) ;
1323
+ line . Add ( new Label ( line . RemainingWidth , line . RemainingHeight , FormatStrings . FormatForce ( totMaxTractiveEffortN , isMetric ) , LabelAlignment . Left ) ) ;
1324
+
1318
1325
line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
1319
1326
line . Add ( new Label ( labelWidth , line . RemainingHeight , Viewer . Catalog . GetString ( "Max Continuous Tractive Effort:" ) , LabelAlignment . Left ) ) ;
1320
1327
line . Add ( new Label ( line . RemainingWidth , line . RemainingHeight , sectionMaxContTractiveForce , LabelAlignment . Left ) ) ;
@@ -1325,7 +1332,7 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
1325
1332
1326
1333
if ( ! isMetric )
1327
1334
{
1328
- float hpt = totMassKg > 0f ? W . ToHp ( totPowerW ) / Kg . ToTUS ( totMassKg ) : 0f ;
1335
+ float hpt = trailingMassKg > 0f ? W . ToHp ( totPowerW ) / Kg . ToTUS ( trailingMassKg ) : 0f ;
1329
1336
line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
1330
1337
line . Add ( new Label ( labelWidth , line . RemainingHeight , Viewer . Catalog . GetString ( "Horespower per Ton:" ) , LabelAlignment . Left ) ) ;
1331
1338
line . Add ( new Label ( line . RemainingWidth , line . RemainingHeight , string . Format ( "{0:0.0}" , hpt ) , LabelAlignment . Left ) ) ;
@@ -1342,13 +1349,13 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
1342
1349
// and should really be defined in the path file.
1343
1350
1344
1351
// tons per equivalent powered axle (TPA or TpEPA)
1345
- float tpepa = totMaxContTractiveEffortN > 0 ? Kg . ToTUS ( totMassKg ) / ( N . ToLbf ( totMaxContTractiveEffortN ) / 10000f ) : 0 ;
1352
+ float tpepa = totMaxContTractiveEffortN > 0 ? Kg . ToTUS ( trailingMassKg ) / ( N . ToLbf ( totMaxContTractiveEffortN ) / 10000f ) : 0 ;
1346
1353
line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
1347
1354
line . Add ( new Label ( labelWidth , line . RemainingHeight , Viewer . Catalog . GetString ( "Tons per EPA:" ) , LabelAlignment . Left ) ) ;
1348
1355
line . Add ( new Label ( line . RemainingWidth , line . RemainingHeight , string . Format ( "{0:0}" , tpepa ) , LabelAlignment . Left ) ) ;
1349
1356
1350
1357
// tons per equivalent dynamic brake axle (TpEDBA)
1351
- float tpedba = totMaxDynamicBrakeForceN > 0 ? Kg . ToTUS ( totMassKg ) / ( N . ToLbf ( totMaxDynamicBrakeForceN ) / 10000f ) : 0 ;
1358
+ float tpedba = totMaxDynamicBrakeForceN > 0 ? Kg . ToTUS ( trailingMassKg ) / ( N . ToLbf ( totMaxDynamicBrakeForceN ) / 10000f ) : 0 ;
1352
1359
line = scrollbox . AddLayoutHorizontalLineOfText ( ) ;
1353
1360
line . Add ( new Label ( labelWidth , line . RemainingHeight , Viewer . Catalog . GetString ( "Tons per EDBA:" ) , LabelAlignment . Left ) ) ;
1354
1361
line . Add ( new Label ( line . RemainingWidth , line . RemainingHeight , string . Format ( "{0:0}" , tpedba ) , LabelAlignment . Left ) ) ;
0 commit comments