Skip to content

Commit 7772884

Browse files
committed
Add Max Dynamic Brake Force to Train Info tab.
Also max tractive effort variables.
1 parent c5711ad commit 7772884

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

Source/RunActivity/Viewer3D/Popups/HelpWindow.cs

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ owner.Viewer.Simulator.PlayerLocomotive is MSTSLocomotive &&
593593
}));
594594
Tabs.Add(new TabData(Tab.TrainInfo, Viewer.Catalog.GetString("Train Info"), (cl) =>
595595
{
596-
var labelWidth = cl.TextHeight * 11;
596+
var labelWidth = cl.TextHeight * 12;
597597
var scrollbox = cl.AddLayoutScrollboxVertical(cl.RemainingWidth);
598598
if (Owner.Viewer.PlayerTrain != null)
599599
{
@@ -1197,13 +1197,15 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
11971197
var lengthM = playerTrain.Length;
11981198
var maxSpeedMps = playerTrain.TrainMaxSpeedMpS;
11991199
float totPowerW = 0f;
1200-
string sectionTractiveForce = ""; // using " + " between DPU sets
1200+
string sectionMaxTractiveForce = ""; // using " + " between DPU sets
1201+
string sectionMaxDynamicBrakeForce = ""; // using " + " between DPU sets
12011202
float maxBrakeForceN = 0f;
12021203
float lowestCouplerStrengthN = 9.999e8f; // impossible high force
12031204
float lowestDerailForceN = 9.999e8f; // impossible high force
12041205

12051206
int engCount = 0; string countSeparator = ""; // when set, indicates that subsequent engines are in a separate block
1206-
float engForceN = 0f; string forceSeparator = ""; // when set, indicates that subsequent engines are in a separate block
1207+
float engMaxTractiveForceN = 0f; float engMaxDynBrakeForceN = 0f; string forceSeparator = ""; // when set, indicates that subsequent engines are in a separate block
1208+
12071209
float wagMassKg = 0f; string massSeparator = ""; // when set, indicates that subsequent engines are in a separate block
12081210
int numOperativeBrakes = 0;
12091211
bool isMetric = false; bool isUK = false; // isImperial* does not seem to be used in simulation
@@ -1229,7 +1231,8 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
12291231
engCount++;
12301232
numAxles += eng.LocoNumDrvAxles + eng.GetWagonNumAxles();
12311233
totPowerW += eng.MaxPowerW;
1232-
engForceN += eng.MaxForceN;
1234+
engMaxTractiveForceN += eng.MaxForceN;
1235+
engMaxDynBrakeForceN += eng.MaxDynamicBrakeForceN;
12331236

12341237
// hanlde transition from wagons to engines
12351238
if (wagMassKg > 0)
@@ -1249,8 +1252,9 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
12491252
{
12501253
numEngines += countSeparator + engCount.ToString();
12511254
engCount = 0; countSeparator = "+";
1252-
sectionTractiveForce += forceSeparator + FormatStrings.FormatForce(engForceN, isMetric);
1253-
engForceN = 0f; forceSeparator = " + ";
1255+
sectionMaxTractiveForce += forceSeparator + FormatStrings.FormatForce(engMaxTractiveForceN, isMetric);
1256+
sectionMaxDynamicBrakeForce += forceSeparator + FormatStrings.FormatForce(engMaxDynBrakeForceN, isMetric);
1257+
engMaxTractiveForceN = 0f; engMaxDynBrakeForceN = 0f; forceSeparator = " + ";
12541258
}
12551259
}
12561260

@@ -1262,15 +1266,16 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
12621266
if (couplerStrength < lowestCouplerStrengthN) { lowestCouplerStrengthN = couplerStrength; }
12631267
var derailForce = GetDerailForce(wag);
12641268
if (derailForce < lowestDerailForceN) { lowestDerailForceN = derailForce; }
1265-
if (wag.MaxBrakeForceN > 0) { numOperativeBrakes++; }
1269+
if (wag.MaxBrakeForceN > 0) { numOperativeBrakes++; } // simplistic: real world has cutout brakes, and no brakes on some articulated car-segments
12661270

12671271
carInfoList.Add(new CarInfo(wag.MassKG, isEng));
12681272
}
12691273
}
12701274

12711275
if (engCount > 0) { numEngines = numEngines + countSeparator + engCount.ToString(); }
12721276
if (String.IsNullOrEmpty(numEngines)) { numEngines = "0"; }
1273-
if (engForceN > 0) { sectionTractiveForce += forceSeparator + FormatStrings.FormatForce(engForceN, isMetric); }
1277+
if (engMaxTractiveForceN > 0) { sectionMaxTractiveForce += forceSeparator + FormatStrings.FormatForce(engMaxTractiveForceN, isMetric); }
1278+
if (engMaxDynBrakeForceN > 0) { sectionMaxDynamicBrakeForce += forceSeparator + FormatStrings.FormatForce(engMaxDynBrakeForceN, isMetric); }
12741279
if (wagMassKg > 0) { sectionMass += massSeparator + FormatStrings.FormatLargeMass(wagMassKg, isMetric, isUK); }
12751280

12761281
var line = scrollbox.AddLayoutHorizontalLineOfText();
@@ -1306,7 +1311,11 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
13061311

13071312
line = scrollbox.AddLayoutHorizontalLineOfText();
13081313
line.Add(new Label(labelWidth, line.RemainingHeight, Viewer.Catalog.GetString("Max Tractive Effort:"), LabelAlignment.Left));
1309-
line.Add(new Label(line.RemainingWidth, line.RemainingHeight, sectionTractiveForce, LabelAlignment.Left));
1314+
line.Add(new Label(line.RemainingWidth, line.RemainingHeight, sectionMaxTractiveForce, LabelAlignment.Left));
1315+
1316+
line = scrollbox.AddLayoutHorizontalLineOfText();
1317+
line.Add(new Label(labelWidth, line.RemainingHeight, Viewer.Catalog.GetString("Max Dynamic Brake Force:"), LabelAlignment.Left));
1318+
line.Add(new Label(line.RemainingWidth, line.RemainingHeight, sectionMaxDynamicBrakeForce, LabelAlignment.Left));
13101319

13111320
if (!isMetric)
13121321
{

0 commit comments

Comments
 (0)