Skip to content

Commit fb28a11

Browse files
committed
Automatic merge of T1.6-rc2-41-gacd714487 and 8 pull requests
- Pull request #1072 at 076a8d3: Content Creation Shortcuts & Advanced Wagon Shape Interactions - Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc) - Pull request #1091 at b81c6fc: Automatic speed control - Pull request #1107 at f5eb3dc: Fix DPMode when last remote is moved to front. - Pull request #1108 at cd5c185: Fix Horn, Bell, and MU light conditions on AI trains - Pull request #1109 at 0190043: Fix Erroneous Detection of Departure Before Passenger Boarding Completed - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification
10 parents f304c7e + acd7144 + 076a8d3 + e10390b + b81c6fc + f5eb3dc + cd5c185 + 0190043 + 5845a1a + 689494b commit fb28a11

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

Source/Documentation/Manual/cruisecontrol.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ A list of the available .eng file CC parameters follows here below.
137137
"UseThrottleAsForceSelector", "if ControllerCruiseControlLogic is set to None, throttle when in Auto mode will change the maximum CC Force", "Boolean", "FALSE"
138138
"ControllerCruiseControlLogic", "Can have values 'None', 'SpeedOnly', 'Full'", "Enum", "Full"
139139
"HasProportionalSpeedSelector", "Speed selector is performed by a lever ranging from 0 to max speed", "Boolean", "FALSE"
140-
"SpeedSelectorIsDiscrete", "Speed selected can have only values multiple of NominalSpeedStep", "Boolean", "FALSE"
140+
"SpeedSelectorIsDiscrete", "Speed selected can have only values multiple of NominalSpeedStep", "Boolean", "TRUE"
141141
"ModeSwitchAllowedWithThrottleNotAtZero", "Switch from manual to auto and vice-versa can occur also when throttle lever is not at 0", "Boolean", "FALSE"
142142
"DisableManualSwitchToAutoWhenSetSpeedNotAtTop", "Manual Switch to Cruise Control Auto Mode can't occur when speed is not set at maximum value and at the same moment train speed is not 0", "Boolean", "FALSE"
143143
"UseTrainBrakeAndDynBrake", "CC uses train brake and dyn brake together", "Boolean", "FALSE"

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/CruiseControl.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,7 @@ public enum SpeedSelectorMode { Parking, Neutral, On, Start }
170170
public bool BrakeCommandHasPriorityOverASCBraking = false;
171171
public bool HasIndependentThrottleDynamicBrakeLever = false;
172172
public bool HasProportionalSpeedSelector = false;
173-
public bool SpeedSelectorIsDiscrete = false;
174-
private bool speedSelectorIsDiscreteSet = false;
173+
public bool SpeedSelectorIsDiscrete = true;
175174
public bool DoComputeNumberOfAxles = false;
176175
public bool DisableManualSwitchToAutoWhenSetSpeedNotAtTop = false;
177176
public bool EnableSelectedSpeedSelectionWhenManualModeSet = false;
@@ -302,7 +301,6 @@ public CruiseControl(CruiseControl other, MSTSLocomotive locomotive)
302301
DisableManualSwitchToAutoWhenSetSpeedNotAtTop = other.DisableManualSwitchToAutoWhenSetSpeedNotAtTop;
303302
EnableSelectedSpeedSelectionWhenManualModeSet = other.EnableSelectedSpeedSelectionWhenManualModeSet;
304303
SpeedSelectorIsDiscrete = other.SpeedSelectorIsDiscrete;
305-
speedSelectorIsDiscreteSet = other.SpeedSelectorIsDiscrete;
306304
DoComputeNumberOfAxles = other.DoComputeNumberOfAxles;
307305
UseTrainBrakeAndDynBrake = other.UseTrainBrakeAndDynBrake;
308306
UseDynBrake = other.UseDynBrake;
@@ -394,7 +392,7 @@ public void Parse(STFReader stf)
394392
case "ascspeedtakespriorityoverspeedselector": ASCSpeedTakesPriorityOverSpeedSelector = stf.ReadBoolBlock(false); break;
395393
case "hasindependentthrottledynamicbrakelever": HasIndependentThrottleDynamicBrakeLever = stf.ReadBoolBlock(false); break;
396394
case "hasproportionalspeedselector": HasProportionalSpeedSelector = stf.ReadBoolBlock(false); break;
397-
case "speedselectorisdiscrete": speedSelectorIsDiscreteSet = true; SpeedSelectorIsDiscrete = stf.ReadBoolBlock(false); break;
395+
case "speedselectorisdiscrete": SpeedSelectorIsDiscrete = stf.ReadBoolBlock(false); break;
398396
case "usetrainbrakeanddynbrake": UseTrainBrakeAndDynBrake = stf.ReadBoolBlock(false); break;
399397
case "usedynbrake": UseDynBrake = stf.ReadBoolBlock(false); break;
400398
case "speeddeltatoenabletrainbrake": SpeedDeltaToEnableTrainBrake = stf.ReadFloatBlock(STFReader.UNITS.Speed, 5f); break;
@@ -509,13 +507,6 @@ public void Initialize()
509507

510508
if (StartInAutoMode) SpeedRegMode = SpeedRegulatorMode.Auto;
511509

512-
if (!speedSelectorIsDiscreteSet)
513-
{
514-
var mpc = Locomotive.MultiPositionControllers.Where(x => x.controllerBinding == ControllerBinding.SelectedSpeed).FirstOrDefault();
515-
SpeedSelectorIsDiscrete = mpc == null;
516-
}
517-
if (SpeedSelectorIsDiscrete && SpeedRegulatorNominalSpeedStepMpS <= 0) SpeedRegulatorNominalSpeedStepMpS = MpS.FromMpS(1.0f, !SpeedIsMph);
518-
519510
if (UseThrottleAsForceSelector)
520511
{
521512
MaxForceSelectorController = Locomotive.ThrottleController;

0 commit comments

Comments
 (0)