Skip to content

Commit c9144d9

Browse files
committed
Automatic merge of T1.5.1-1092-g6436d559f9 and 20 pull requests
- Pull request #891 at 9a1d6b2: Auto save - Pull request #903 at 4a4b032: Downloading route content (Github, zip) - Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value - Pull request #972 at e90a2aa: On Map window color changed switch or signal is not changed - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #882 at 8f695a4: Blueprint/train car operations UI window - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #922 at a3bc9e7: Autopilot for timetable mode - Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes - Pull request #954 at 3caecc7: Multiple Track Profiles & Superelevation Improvements - Pull request #962 at 46d0472: Fix pantographs on unpowered cars - Pull request #970 at 6fa5eed: feat: Remove unnecessary Windows.Forms usage - Pull request #973 at c35be87: fix: Using singular target framework to allow for different platforms across different projects - Pull request #974 at 5faea6f: Bug fix for https://bugs.launchpad.net/or/+bug/2076034 Doors remain open in AI trains - Pull request #977 at a30c659: adds cache for SD files - Pull request #978 at 91f3ee8: fix: adds MilepostUnitsMiles to Manual - Pull request #900 at c27f32d: DMI updates - Pull request #799 at dfc715e: Consolidated wind simulation - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #952 at 8347095: Investigation - Pulsing graphics
22 parents 1b0a451 + 6436d55 + 9a1d6b2 + 4a4b032 + 2452cb0 + e90a2aa + d00beb9 + 8f695a4 + 1f5ba4c + a3bc9e7 + a519452 + 3caecc7 + 46d0472 + 6fa5eed + c35be87 + 5faea6f + a30c659 + 91f3ee8 + c27f32d + dfc715e + f92de76 + 8347095 commit c9144d9

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

Source/ORTS.Common/Conversions.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,13 @@ public static string FormatVeryShortDistanceDisplay(float distanceM, bool isMetr
683683
return String.Format(CultureInfo.CurrentCulture, "{0:N3} {1}", Me.ToFt(distanceM), ft);
684684
}
685685

686+
public static string FormatMillimeterDistanceDisplay(float distanceM, bool isMetric)
687+
{
688+
if (isMetric)
689+
return String.Format(CultureInfo.CurrentCulture, "{0:N0} {1}", distanceM * 1000.0f, mm);
690+
return String.Format(CultureInfo.CurrentCulture, "{0:N1} {1}", Me.ToIn(distanceM), "in");
691+
}
692+
686693
/// <summary>
687694
/// format localized mass string, as displayed in in-game windows.
688695
/// </summary>

Source/Orts.Formats.Msts/RouteFile.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public Tr_RouteFile(STFReader stf)
106106
// values for superelevation
107107
new STFReader.TokenProcessor("ortstracksuperelevation", ()=>{ SuperElevationHgtpRadiusM = new Interpolator(stf); }),
108108
// New superelevation standard, will overwrite ORTSTrackSuperElevation
109-
new STFReader.TokenProcessor("ortssuperelevation", ()=>{ SuperElevationHgtpRadiusM = null; SuperElevation.Add(new SuperElevationStandard(stf)); }),
109+
new STFReader.TokenProcessor("ortssuperelevation", ()=>{ SuperElevation.Add(new SuperElevationStandard(stf)); }),
110110
// images
111111
new STFReader.TokenProcessor("graphic", ()=>{ Thumbnail = stf.ReadStringBlock(null); }),
112112
new STFReader.TokenProcessor("loadingscreen", ()=>{ LoadingScreen = stf.ReadStringBlock(null); }),
@@ -132,6 +132,7 @@ public Tr_RouteFile(STFReader stf)
132132
if (RouteStart == null) throw new STFException(stf, "Missing RouteStart");
133133
if (ForestClearDistance == 0 && RemoveForestTreesFromRoads) Trace.TraceWarning("You must define also ORTSUserPreferenceForestClearDistance to avoid trees on roads");
134134
if (SuperElevation.Count <= 0) SuperElevation.Add(new SuperElevationStandard());
135+
else SuperElevationHgtpRadiusM = null; // Disable legacy superelevation system if newer system is defined
135136
}
136137

137138
public string RouteID; // ie JAPAN1 - used for TRK file and route folder name

Source/Orts.Simulation/Simulation/RollingStocks/TrainCar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ public Direction Direction
636636
protected float TrackGaugeM = 1.435f; // Track gauge - read in MSTSWagon
637637
protected Vector3 InitialCentreOfGravityM = new Vector3(0, 1.8f, 0); // get centre of gravity - read in MSTSWagon
638638
protected Vector3 CentreOfGravityM = new Vector3(0, 1.8f, 0); // get centre of gravity after adjusted for freight animation
639-
protected float SuperelevationM; // Super elevation on the curve
639+
public float SuperelevationM; // Super elevation on the curve
640640
protected float MaxUnbalancedSuperElevationM; // Maximum comfortable cant deficiency, read from MSTS Wagon File
641641
public float SuperElevationAngleRad;
642642
protected bool IsMaxSafeCurveSpeed = false; // Has equal loading speed around the curve been exceeded, ie are all the wheesl still on the track?

Source/RunActivity/Viewer3D/Popups/HUDWindow.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,12 +1233,13 @@ void TextPageForceInfo(TableData table)
12331233
Viewer.Catalog.GetString("Mass"),
12341234
Viewer.Catalog.GetString("Gradient"),
12351235
Viewer.Catalog.GetString("Curve"),
1236+
Viewer.Catalog.GetString("SuperElev"),
12361237
Viewer.Catalog.GetString("Brk Frict."),
12371238
Viewer.Catalog.GetString("Brk Slide"),
12381239
Viewer.Catalog.GetString("Bear Temp"),
12391240
Viewer.Catalog.GetString(" "),
1240-
Viewer.Catalog.GetString("DerailCoeff")
1241-
1241+
Viewer.Catalog.GetString("DerailCoeff"),
1242+
Viewer.Catalog.GetString(" ")
12421243
);
12431244
TableAddLine(table);
12441245

@@ -1262,11 +1263,13 @@ void TextPageForceInfo(TableData table)
12621263
TableSetCell(table, 12, "{0}", FormatStrings.FormatLargeMass(car.MassKG, car.IsMetric, car.IsUK));
12631264
TableSetCell(table, 13, "{0:F2}%", -car.CurrentElevationPercent);
12641265
TableSetCell(table, 14, "{0}", FormatStrings.FormatDistance(car.CurrentCurveRadiusM, car.IsMetric));
1265-
TableSetCell(table, 15, "{0:F0}%", car.HuDBrakeShoeFriction * 100.0f);
1266-
TableSetCell(table, 16, car.HUDBrakeSkid ? Viewer.Catalog.GetString("Yes") : Viewer.Catalog.GetString("No"));
1267-
TableSetCell(table, 17, "{0} {1}", FormatStrings.FormatTemperature(car.WheelBearingTemperatureDegC, car.IsMetric, false), car.DisplayWheelBearingTemperatureStatus);
1268-
TableSetCell(table, 18, car.Flipped ? Viewer.Catalog.GetString("Flipped") : "");
1269-
TableSetCell(table, 19, "{0:F2}{1}", car.DerailmentCoefficient, car.DerailExpected ? "!!!" : car.DerailPossible ? "???" : "");
1266+
TableSetCell(table, 15, "{0}", FormatStrings.FormatMillimeterDistanceDisplay(car.SuperelevationM, car.IsMetric));
1267+
TableSetCell(table, 16, "{0:F0}%", car.HuDBrakeShoeFriction * 100.0f);
1268+
TableSetCell(table, 17, car.HUDBrakeSkid ? Viewer.Catalog.GetString("Yes") : Viewer.Catalog.GetString("No"));
1269+
TableSetCell(table, 18, "{0} {1}", FormatStrings.FormatTemperature(car.WheelBearingTemperatureDegC, car.IsMetric, false), car.DisplayWheelBearingTemperatureStatus);
1270+
TableSetCell(table, 19, " ");
1271+
TableSetCell(table, 20, "{0:F2}{1}", car.DerailmentCoefficient, car.DerailExpected ? "!!!" : car.DerailPossible ? "???" : "");
1272+
TableSetCell(table, 21, car.Flipped ? Viewer.Catalog.GetString("Flipped") : "");
12701273
TableAddLine(table);
12711274

12721275
}

0 commit comments

Comments
 (0)