Skip to content

Commit 372a5dc

Browse files
committed
Automatic merge of T1.6-rc2-41-gacd714487 and 10 pull requests
- Pull request #1104 at f15bb6b: Handle simple adhesion within the axle module - Pull request #1057 at 1c2bcb4: Switchable brake system - Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc) - Pull request #1091 at 2391bc0: Automatic speed control - Pull request #1110 at 387388e: Fix Activity Runner persists after loading exception - Pull request #1115 at 270f22f: Do not activate ETS switch if no suitable cars are attached - Pull request #1116 at 721d118: Fix Potential Hang in AnimatedPart.SetFrameWrap - Pull request #1118 at f1e0f35: Fix DPMode when last remote is moved to front. (r1.6) - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification
12 parents bf4e3ff + acd7144 + f15bb6b + 1c2bcb4 + e10390b + 2391bc0 + 387388e + 270f22f + 721d118 + f1e0f35 + 5845a1a + 689494b commit 372a5dc

File tree

3 files changed

+29
-38
lines changed

3 files changed

+29
-38
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2580,13 +2580,13 @@ public virtual float GetAvailableTractionForceN(float t)
25802580
{
25812581
powerW = Math.Min(powerW, MaxPowerW * t * t * (1 - PowerReduction));
25822582

2583-
if (AbsTractionSpeedMpS > MaxSpeedMpS)
2583+
if (AbsTractionSpeedMpS > MaxSpeedMpS - 0.05f)
25842584
{
2585-
forceN = 0;
2585+
forceN = 20 * (MaxSpeedMpS - AbsTractionSpeedMpS) * MaxForceN * (1 - PowerReduction);
25862586
}
2587-
else if (AbsTractionSpeedMpS > MaxSpeedMpS - 0.05f)
2587+
else if (AbsTractionSpeedMpS > MaxSpeedMpS)
25882588
{
2589-
forceN = 20 * (MaxSpeedMpS - AbsTractionSpeedMpS) * MaxForceN * (1 - PowerReduction);
2589+
forceN = 0;
25902590
}
25912591
else
25922592
{

Source/RunActivity/Viewer3D/Popups/TrainDrivingWindow.cs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ void AddSeparator() => AddLabel(new ListLabel
771771
{
772772
FirstCol = Viewer.Catalog.GetString(locomotive is MSTSSteamLocomotive ? "Regulator" : "Throttle"),
773773
LastCol = $"{Round(locomotive.ThrottlePercent)}%" +
774-
(locomotive is MSTSDieselLocomotive && train.DPMode == 1 ? $" | {Round(train.DPThrottlePercent)}%" : ""),
774+
(locomotive is MSTSDieselLocomotive && train.DPMode == 1 ? $"({Round(train.DPThrottlePercent)}%)" : ""),
775775
KeyPressed = throttleKey,
776776
SymbolCol = ""//throttleKey,
777777
});
@@ -1048,28 +1048,24 @@ void AddSeparator() => AddLabel(new ListLabel
10481048

10491049
if (dynamicBrakeStatus != null && locomotive.IsLeadLocomotive())
10501050
{
1051-
var dynBrakeString = "";
1052-
var dynBrakeColor = "";
1053-
1054-
if (locomotive.DynamicBrakePercent < 0)
1055-
dynBrakeString = Viewer.Catalog.GetString("Off");
1056-
else if (!locomotive.DynamicBrake)
1051+
if (locomotive.DynamicBrakePercent >= 0)
10571052
{
1058-
dynBrakeString = Viewer.Catalog.GetString("Setup");
1059-
dynBrakeColor = ColorCode[Color.Cyan];
1053+
AddLabel(new ListLabel
1054+
{
1055+
FirstCol = Viewer.Catalog.GetString("Dynamic brake"),
1056+
LastCol = locomotive.DynamicBrake ? dynamicBrakeStatus : Viewer.Catalog.GetString("Setup") + ColorCode[Color.Cyan] +
1057+
(locomotive is MSTSDieselLocomotive && train.DPMode == -1 ? string.Format("({0:F0}%)", train.DPDynamicBrakePercent) : string.Empty),
1058+
});
10601059
}
10611060
else
1062-
dynBrakeString = dynamicBrakeStatus;
1063-
1064-
if (locomotive is MSTSDieselLocomotive && train.DPMode == -1)
1065-
dynBrakeString += string.Format(" | {0:F0}%", train.DPDynamicBrakePercent);
1066-
1061+
{
10671062
AddLabel(new ListLabel
10681063
{
10691064
FirstCol = Viewer.Catalog.GetString("Dynamic brake"),
1070-
LastCol = dynBrakeString + dynBrakeColor,
1065+
LastCol = Viewer.Catalog.GetString("Off") + (locomotive is MSTSDieselLocomotive && train.DPMode == -1 ? string.Format("({0:F0}%)", train.DPDynamicBrakePercent) : string.Empty),
10711066
});
10721067
}
1068+
}
10731069

10741070
AddSeparator();
10751071

Source/RunActivity/Viewer3D/WebServices/TrainDrivingDisplay.cs

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,7 @@ void AddSeparator() => AddLabel(new ListLabel
314314
AddLabel(new ListLabel
315315
{
316316
FirstCol = Viewer.Catalog.GetString(locomotive is MSTSSteamLocomotive ? "Regulator" : "Throttle"),
317-
LastCol = $"{Round(locomotive.ThrottlePercent)}%" +
318-
(locomotive is MSTSDieselLocomotive && train.DPMode == 1 ? $" | {Round(train.DPThrottlePercent)}%" : ""),
317+
LastCol = $"{Round(locomotive.ThrottlePercent)}%",
319318
KeyPressed = throttleKey,
320319
SymbolCol = throttleKey,
321320
});
@@ -590,27 +589,23 @@ void AddSeparator() => AddLabel(new ListLabel
590589

591590
if (dynamicBrakeStatus != null && locomotive.IsLeadLocomotive())
592591
{
593-
var dynBrakeString = "";
594-
var dynBrakeColor = "";
595-
596-
if (locomotive.DynamicBrakePercent < 0)
597-
dynBrakeString = Viewer.Catalog.GetString("Off");
598-
else if (!locomotive.DynamicBrake)
592+
if (locomotive.DynamicBrakePercent >= 0)
599593
{
600-
dynBrakeString = Viewer.Catalog.GetString("Setup");
601-
dynBrakeColor = ColorCode[Color.Cyan];
594+
AddLabel(new ListLabel
595+
{
596+
FirstCol = Viewer.Catalog.GetString("Dynamic brake"),
597+
LastCol = locomotive.DynamicBrake ? dynamicBrakeStatus : Viewer.Catalog.GetString("Setup") + ColorCode[Color.Cyan] +
598+
(locomotive is MSTSDieselLocomotive && train.DPMode == -1 ? string.Format("({0:F0}%)", train.DPDynamicBrakePercent) : string.Empty),
599+
});
602600
}
603601
else
604-
dynBrakeString = dynamicBrakeStatus;
605-
606-
if (locomotive is MSTSDieselLocomotive && train.DPMode == -1)
607-
dynBrakeString += string.Format(" | {0:F0}%", train.DPDynamicBrakePercent);
608-
609-
AddLabel(new ListLabel
610602
{
611-
FirstCol = Viewer.Catalog.GetString("Dynamic brake"),
612-
LastCol = dynBrakeString + dynBrakeColor,
613-
});
603+
AddLabel(new ListLabel
604+
{
605+
FirstCol = Viewer.Catalog.GetString("Dynamic brake"),
606+
LastCol = Viewer.Catalog.GetString("Off") + (locomotive is MSTSDieselLocomotive && train.DPMode == -1 ? string.Format("({0:F0}%)", train.DPDynamicBrakePercent) : string.Empty),
607+
});
608+
}
614609
}
615610

616611
AddSeparator();

0 commit comments

Comments
 (0)