Skip to content

Commit

Permalink
Merge pull request #852 from cesarBLG/remove-adhesion-options
Browse files Browse the repository at this point in the history
Remove unneeded adhesion options
  • Loading branch information
cjakeman committed Jul 22, 2023
2 parents d9fc5d4 + 72b9655 commit 868d5ab
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 61 deletions.
7 changes: 0 additions & 7 deletions Source/Documentation/Manual/options.rst
Expand Up @@ -355,13 +355,6 @@ by MSTS, while the advanced one is based on a model more similar to reality.
For more information read the section on :ref:`Adhesion Models <physics-adhesion>` later in this
manual.

Adhesion moving average filter size
-----------------------------------

The computations related to adhesion are passed through a moving average
filter. Higher values cause smoother operation, but also less
responsiveness. 10 is the default filter size.

Break couplers
--------------

Expand Down
41 changes: 2 additions & 39 deletions Source/Menu/Options.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions Source/Menu/Options.cs
Expand Up @@ -178,9 +178,6 @@ public OptionsForm(UserSettings settings, UpdateManager updateManager, bool init

checkSimpleControlsPhysics.Checked = Settings.SimpleControlPhysics;
checkUseAdvancedAdhesion.Checked = Settings.UseAdvancedAdhesion;
labelAdhesionMovingAverageFilterSize.Enabled = checkUseAdvancedAdhesion.Checked;
numericAdhesionMovingAverageFilterSize.Enabled = checkUseAdvancedAdhesion.Checked;
numericAdhesionMovingAverageFilterSize.Value = Settings.AdhesionMovingAverageFilterSize;
checkBreakCouplers.Checked = Settings.BreakCouplers;
checkCurveSpeedDependent.Checked = Settings.CurveSpeedDependent;
checkBoilerPreheated.Checked = Settings.HotStart;
Expand Down Expand Up @@ -466,7 +463,6 @@ void buttonOK_Click(object sender, EventArgs e)
// Simulation tab
Settings.SimpleControlPhysics = checkSimpleControlsPhysics.Checked;
Settings.UseAdvancedAdhesion = checkUseAdvancedAdhesion.Checked;
Settings.AdhesionMovingAverageFilterSize = (int)numericAdhesionMovingAverageFilterSize.Value;
Settings.BreakCouplers = checkBreakCouplers.Checked;
Settings.CurveSpeedDependent = checkCurveSpeedDependent.Checked;
Settings.HotStart = checkBoilerPreheated.Checked;
Expand Down Expand Up @@ -589,8 +585,6 @@ private void trackAdhesionFactor_ValueChanged(object sender, EventArgs e)
private void SetAdhesionLevelValue()
{
int level = trackAdhesionFactor.Value - trackAdhesionFactorChange.Value;
// Adjust level to be proportional to weather
level -= 40;

if (level > 159)
AdhesionLevelValue.Text = catalog.GetString("Very easy");
Expand Down Expand Up @@ -779,12 +773,6 @@ private void checkDistantMountains_Click(object sender, EventArgs e)
numericDistantMountainsViewingDistance.Enabled = checkDistantMountains.Checked;
}

private void checkUseAdvancedAdhesion_Click(object sender, EventArgs e)
{
labelAdhesionMovingAverageFilterSize.Enabled = checkUseAdvancedAdhesion.Checked;
numericAdhesionMovingAverageFilterSize.Enabled = checkUseAdvancedAdhesion.Checked;
}

private void checkDataLogTrainSpeed_Click(object sender, EventArgs e)
{
checkListDataLogTSContents.Enabled = checkDataLogTrainSpeed.Checked;
Expand Down
2 changes: 0 additions & 2 deletions Source/ORTS.Settings/UserSettings.cs
Expand Up @@ -212,8 +212,6 @@ public enum DirectXFeature
public bool SimpleControlPhysics { get; set; }
[Default(true)]
public bool UseAdvancedAdhesion { get; set; }
[Default(10)]
public int AdhesionMovingAverageFilterSize { get; set; }
[Default(false)]
public bool BreakCouplers { get; set; }
[Default(false)]
Expand Down
Expand Up @@ -3120,7 +3120,7 @@ public virtual void UpdateFrictionCoefficient(float elapsedClockSeconds)
Train.SlipperySpotLengthM = 10 + 40 * (float)Simulator.Random.NextDouble();
Train.SlipperySpotDistanceM = Train.SlipperySpotLengthM + 2000 * (float)Simulator.Random.NextDouble();
}
if (Train.SlipperySpotDistanceM < Train.SlipperySpotLengthM)
if (Train.SlipperySpotDistanceM < Train.SlipperySpotLengthM && Simulator.Settings.AdhesionFactorChange > 0)
{
if (BaseFrictionCoefficientFactor > 0.6 && BaseFrictionCoefficientFactor < 0.8)
{
Expand Down

0 comments on commit 868d5ab

Please sign in to comment.