@@ -188,14 +188,24 @@ public static string GetText(Content content)
188188 details . AppendFormat ( "Name:\t {1}{0}" , Environment . NewLine , data . Name ) ;
189189 details . AppendFormat ( "NumEngines:\t {1}{0}" , Environment . NewLine , data . NumEngines ) ;
190190 details . AppendFormat ( "NumCars:\t {1}{0}" , Environment . NewLine , data . NumCars ) ;
191- details . AppendFormat ( "MaxSpeed:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatSpeedLimit ( data . MaxSpeedMps , IsMetric ) ) ;
192- details . AppendFormat ( "Weight:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatLargeMass ( data . MassKG , IsMetric , IsUK ) ) ;
191+ details . AppendFormat ( "Axles:\t {1}{0}" , Environment . NewLine , data . NumAxles ) ;
192+ details . AppendFormat ( "Weight:\t {1} (trailing: {2}){0}" , Environment . NewLine , FormatStrings . FormatLargeMass ( data . MassKG , IsMetric , IsUK ) ,
193+ FormatStrings . FormatLargeMass ( data . TrailingMassKG , IsMetric , IsUK ) ) ;
193194 details . AppendFormat ( "Length:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatShortDistanceDisplay ( data . LengthM , IsMetric ) ) ;
194- details . AppendFormat ( "Power :\t {1}{0}" , Environment . NewLine , FormatStrings . FormatPower ( data . MaxPowerW , IsMetric , IsImperialBHP , IsImperialBTUpS ) ) ;
195+ details . AppendFormat ( "MaxPower :\t {1}{0}" , Environment . NewLine , FormatStrings . FormatPower ( data . MaxPowerW , IsMetric , IsImperialBHP , IsImperialBTUpS ) ) ;
195196 details . AppendFormat ( "MaxTE:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatForce ( data . MaxTractiveForceN , IsMetric ) ) ;
197+ details . AppendFormat ( "MaxContTE:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatForce ( data . MaxContinuousTractiveForceN , IsMetric ) ) ;
198+ details . AppendFormat ( "MaxDynBrk:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatForce ( data . MaxDynamicBrakeForceN , IsMetric ) ) ;
199+ if ( ! IsMetric && ! IsUK )
200+ {
201+ details . AppendFormat ( "HPT:\t {1}{0}" , Environment . NewLine , FormatHPT ( data . MaxPowerW , data . TrailingMassKG ) ) ;
202+ details . AppendFormat ( "TpOB:\t {1}{0}" , Environment . NewLine , FormatTPOB ( data . TrailingMassKG , data . NumOperativeBrakes ) ) ;
203+ details . AppendFormat ( "TpEPA:\t {1}{0}" , Environment . NewLine , FormatTonsPerEPA ( data . TrailingMassKG , data . MaxContinuousTractiveForceN ) ) ;
204+ details . AppendFormat ( "TpEDBA:\t {1}{0}" , Environment . NewLine , FormatTonsPerEDBA ( data . TrailingMassKG , data . MaxDynamicBrakeForceN ) ) ;
205+ }
206+ details . AppendFormat ( "MaxSpeed:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatSpeedLimit ( data . MaxSpeedMps , IsMetric ) ) ;
196207 details . AppendFormat ( "MinCouplerStrength:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatForce ( data . MinCouplerStrengthN , IsMetric ) ) ;
197- if ( ! IsMetric && ! IsUK ) { details . AppendFormat ( "HPT:\t {1}{0}" , Environment . NewLine , FormatHPT ( data . MaxPowerW , data . MassKG ) ) ; }
198- if ( ! IsMetric && ! IsUK ) { details . AppendFormat ( "TPOB:\t {1}{0}" , Environment . NewLine , FormatTPOB ( data . MassKG , data . NumOperativeBrakes ) ) ; }
208+ details . AppendFormat ( "MinDerailForce:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatForce ( data . MinDerailForceN , IsMetric ) ) ;
199209 details . AppendLine ( ) ;
200210 details . AppendFormat ( "Car ID:\t Direction:\t Weight:\t Name:\t {0}" , Environment . NewLine ) ;
201211 foreach ( var car in data . Cars )
@@ -208,16 +218,24 @@ public static string GetText(Content content)
208218 details . AppendFormat ( "Type:\t {1}{0}" , Environment . NewLine , data . Type ) ;
209219 details . AppendFormat ( "SubType:\t {1}{0}" , Environment . NewLine , data . SubType ) ;
210220 details . AppendFormat ( "Name:\t {1}{0}" , Environment . NewLine , data . Name ) ;
211- details . AppendFormat ( "Weight:\t {1} ({2}){0}" , Environment . NewLine , FormatStrings . FormatMass ( data . MassKG , IsMetric ) , FormatStrings . FormatLargeMass ( data . MassKG , IsMetric , IsUK ) ) ;
221+ details . AppendFormat ( "Weight:\t {1} ({2}){0}" , Environment . NewLine , FormatStrings . FormatMass ( data . MassKG , IsMetric ) , FormatStrings . FormatLargeMass ( data . MassKG , IsMetric , IsUK ) ) ;
212222 details . AppendFormat ( "Length:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatShortDistanceDisplay ( data . LengthM , IsMetric ) ) ;
213- if ( data . Type = = CarType . Engine )
223+ if ( data . Type ! = CarType . Engine )
214224 {
215- details . AppendFormat ( "MaxPowerW:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatPower ( data . MaxPowerW , IsMetric , IsImperialBHP , IsImperialBTUpS ) ) ;
216- details . AppendFormat ( "MaxForce:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatForce ( data . MaxForceN , IsMetric ) ) ;
217- details . AppendFormat ( "MaxSpeed:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatSpeedLimit ( data . MaxSpeedMps , IsMetric ) ) ;
225+ details . AppendFormat ( "Axles:\t {1}{0}" , Environment . NewLine , data . NumAllAxles ) ;
218226 }
219- details . AppendFormat ( "MaxBrakeF:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatForce ( data . MaxBarkeForceN , IsMetric ) ) ;
227+ else
228+ {
229+ details . AppendFormat ( "Axles:\t {1}+{2}{0}" , Environment . NewLine , data . NumDriveAxles , data . NumAllAxles - data . NumDriveAxles ) ;
230+ details . AppendFormat ( "MaxPower:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatPower ( data . MaxPowerW , IsMetric , IsImperialBHP , IsImperialBTUpS ) ) ;
231+ details . AppendFormat ( "MaxTE:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatForce ( data . MaxForceN , IsMetric ) ) ;
232+ details . AppendFormat ( "MaxContTE:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatForce ( data . MaxContinuousForceN , IsMetric ) ) ;
233+ details . AppendFormat ( "MaxDynBrk:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatForce ( data . MaxDynamicBrakeForceN , IsMetric ) ) ;
234+ }
235+ details . AppendFormat ( "MaxBrakeF:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatForce ( data . MaxBrakeForceN , IsMetric ) ) ;
236+ if ( data . MaxSpeedMps > 0f ) { details . AppendFormat ( "MaxSpeed:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatSpeedLimit ( data . MaxSpeedMps , IsMetric ) ) ; }
220237 details . AppendFormat ( "MinCouplerStrength:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatForce ( data . MinCouplerStrengthN , IsMetric ) ) ;
238+ details . AppendFormat ( "MinDerailForce:\t {1}{0}" , Environment . NewLine , FormatStrings . FormatForce ( data . MinDerailForceN , IsMetric ) ) ;
221239 details . AppendLine ( ) ;
222240 details . AppendFormat ( "Description:\t {0}{0}{1}{0}{0}" , Environment . NewLine , data . Description ) ;
223241 }
@@ -264,9 +282,6 @@ static string FormatMassBar(float massKg)
264282 /// <summary>
265283 /// Calculate and format horsepower per ton for consist, rounded to one decimal.
266284 /// </summary>
267- /// <param name="consistPowerW"></param>
268- /// <param name="consistMassKG"></param>
269- /// <returns>horsepower-per-ton formated to one decimal.</returns>
270285 //TODO: implement UK and metric version
271286 static string FormatHPT ( float consistPowerW , float consistMassKG )
272287 {
@@ -277,14 +292,33 @@ static string FormatHPT(float consistPowerW, float consistMassKG)
277292 /// <summary>
278293 /// Calculate and format tons per operative brake for consist, rounded to an integer.
279294 /// </summary>
280- /// <param name="consistMassKG"></param>
281- /// <param name="consistNumOpBrakes"></param>
282- /// <returns>tons-per-operative-brake formated to an integer.</returns>
283295 //TODO: implement UK and metric version
284296 static string FormatTPOB ( float consistMassKG , float consistNumOpBrakes )
285297 {
286298 var tpob = consistNumOpBrakes > 0 ? Kg . ToTUS ( consistMassKG ) / consistNumOpBrakes : 0 ;
287299 return string . Format ( "{0:0}" , tpob ) ;
288300 }
301+
302+ /// <summary>
303+ /// Calculate and format tons per equivalent powered axle, rounded to an integer.
304+ /// Based on UP convention, of 10k lbf counting as one axle.
305+ /// Strictly, EPA should be defined in the eng file. May be done in future.
306+ /// </summary>
307+ static string FormatTonsPerEPA ( float consistMassKG , float consistMaxTractiveEffortN )
308+ {
309+ var tpepa = consistMaxTractiveEffortN > 0 ? Kg . ToTUS ( consistMassKG ) / ( N . ToLbf ( consistMaxTractiveEffortN ) / 10000f ) : 0 ;
310+ return string . Format ( "{0:0}" , tpepa ) ;
311+ }
312+
313+ /// <summary>
314+ /// Calculate and format tons per equivalent dynamic brake axle, rounded to an integer.
315+ /// Based on UP convention, of 10k lbf counting as one axle.
316+ /// Strictly, EDBA should be defined in the eng file. May be done in future.
317+ /// </summary>
318+ static string FormatTonsPerEDBA ( float consistMassKG , float consistMaxDynamicBrakeForceN )
319+ {
320+ var tpedba = consistMaxDynamicBrakeForceN > 0 ? Kg . ToTUS ( consistMassKG ) / ( N . ToLbf ( consistMaxDynamicBrakeForceN ) / 10000f ) : 0 ;
321+ return string . Format ( "{0:0}" , tpedba ) ;
322+ }
289323 }
290324}
0 commit comments