Skip to content

Commit fdebb96

Browse files
committed
Automatic merge of T1.5.1-776-g362e836a2 and 14 pull requests
- Pull request #570 at 3539862: Experimental glTF 2.0 support with PBR lighting - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at a055bca: Blueprint/train car operations UI window - Pull request #885 at d9ce84b: feat: Add notifications to Menu - Pull request #886 at 6c0785b: Scene viewer extension to TrackViewer - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #893 at bf8876b: Signal errors - Pull request #894 at 5ff1e73: Correct Decrease Colour - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #897 at 0a9d939: feat: Improved system information collection - Pull request #899 at e5db0a2: Duplex steam engines - Booster Engine addition - Pull request #903 at a0d2991: first phase downloading from Github - Pull request #904 at 71beb33: fix: adds downgrade to low precision
16 parents 95fe32b + 362e836 + 3539862 + d00beb9 + f92de76 + a055bca + d9ce84b + 6c0785b + 1f5ba4c + bf8876b + 5ff1e73 + 5866028 + 0a9d939 + e5db0a2 + a0d2991 + 71beb33 commit fdebb96

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerTransmissions/Axle.cs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ public float InertiaKgm2
436436
/// <summary>
437437
/// switch between Polach and Pacha adhesion calculation
438438
/// </summary>
439-
bool UsePolachAdhesion = false;
439+
public static bool UsePolachAdhesion = false; // "static" so it's shared by all axles of the Player's loco
440440

441441
/// <summary>
442442
/// Pre-calculation of slip characteristics at 0 slip speed
@@ -1152,22 +1152,25 @@ enum AdhesionPrecisionLevel
11521152
// into HelpWindow.PrepareFrame() temporarily.
11531153
public static bool IsPrecisionHigh(float elapsedSeconds)
11541154
{
1155-
// Switches between Polach (high precision) adhesion model and Pacha (low precision) adhesion model depending upon the PC performance
1156-
switch (PrecisionLevel)
1155+
if (elapsedSeconds > 0) // Ignore period with elapsedSeconds == 0 until user starts game.
11571156
{
1158-
case AdhesionPrecisionLevel.High:
1159-
if (elapsedSeconds > UpperLimitS)
1160-
{
1161-
var screenFrameRate = 1 / elapsedSeconds;
1157+
// Switches between Polach (high precision) adhesion model and Pacha (low precision) adhesion model depending upon the PC performance
1158+
switch (PrecisionLevel)
1159+
{
1160+
case AdhesionPrecisionLevel.High:
1161+
if (elapsedSeconds > UpperLimitS)
11621162
{
1163-
Trace.TraceInformation($"Advanced adhesion model switched to low precision permanently after low frame rate {screenFrameRate:F1} below limit {1 / UpperLimitS:F0}");
1164-
PrecisionLevel = AdhesionPrecisionLevel.Low;
1163+
var screenFrameRate = 1 / elapsedSeconds;
1164+
{
1165+
Trace.TraceInformation($"Advanced adhesion model switched to low precision permanently after low frame rate {screenFrameRate:F1} below limit {1 / UpperLimitS:F0}");
1166+
PrecisionLevel = AdhesionPrecisionLevel.Low;
1167+
}
11651168
}
1166-
}
1167-
break;
1169+
break;
11681170

1169-
case AdhesionPrecisionLevel.Low:
1170-
break;
1171+
case AdhesionPrecisionLevel.Low:
1172+
break;
1173+
}
11711174
}
11721175
return (PrecisionLevel == AdhesionPrecisionLevel.High);
11731176
}

Source/RunActivity/Viewer3D/Popups/HUDWindow.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
using Orts.Simulation.RollingStocks.SubSystems.Brakes;
2828
using Orts.Simulation.RollingStocks.SubSystems.Brakes.MSTS;
2929
using Orts.Simulation.RollingStocks.SubSystems.PowerSupplies;
30+
using Orts.Simulation.RollingStocks.SubSystems.PowerTransmissions;
3031
using Orts.Viewer3D.Processes;
3132
using ORTS.Common;
3233
using ORTS.Scripting.Api;
@@ -1078,7 +1079,9 @@ void TextPageForceInfo(TableData table)
10781079
{
10791080
if (mstsLocomotive.AdvancedAdhesionModel)
10801081
{
1081-
TableAddLine(table, Viewer.Catalog.GetString("(Advanced adhesion model)"));
1082+
var text = Viewer.Catalog.GetString("(Advanced adhesion model)");
1083+
if (Axle.UsePolachAdhesion == false) text += "???";
1084+
TableAddLine(table, text);
10821085
int row0 = table.CurrentRow;
10831086
TableSetCell(table, table.CurrentRow++, table.CurrentLabelColumn, Viewer.Catalog.GetString("Wheel slip (Thres)"));
10841087
TableSetCell(table, table.CurrentRow++, table.CurrentLabelColumn, Viewer.Catalog.GetString("Conditions"));

Source/RunActivity/Viewer3D/Popups/HelpWindow.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,6 +1216,8 @@ public TabData(Tab tab, string tabLabel, Action<ControlLayout> layout)
12161216

12171217
public override void PrepareFrame(ElapsedTime elapsedTime, bool updateFull)
12181218
{
1219+
// Uncomment this statement to reduce framerate during play for testing
1220+
//System.Threading.Thread.Sleep(40); // Press F1 to force framerate below 25 fps
12191221

12201222
base.PrepareFrame(elapsedTime, updateFull);
12211223

0 commit comments

Comments
 (0)