Skip to content

Commit e11b601

Browse files
committed
Automatic merge of T1.5.1-1188-gd2c2ab5d66 and 14 pull requests
- 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 #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #952 at 8347095: Investigation - Pulsing graphics - Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes - Pull request #954 at 53e9cc6: 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 #978 at 91f3ee8: fix: adds MilepostUnitsMiles to Manual - Pull request #900 at c27f32d: DMI updates - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
16 parents b40465c + d2c2ab5 + 2452cb0 + e90a2aa + d00beb9 + 1f5ba4c + 8347095 + a519452 + 53e9cc6 + 46d0472 + 6fa5eed + c35be87 + 5faea6f + 91f3ee8 + c27f32d + f92de76 commit e11b601

File tree

25 files changed

+580
-921
lines changed

25 files changed

+580
-921
lines changed

Source/Menu/Options.Designer.cs

Lines changed: 2 additions & 73 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/Menu/Options.cs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,6 @@ public OptionsForm(UserSettings settings, UpdateManager updateManager, bool init
165165
comboPressureUnit.Text = Settings.PressureUnit;
166166
comboOtherUnits.Text = settings.Units;
167167
checkEnableTCSScripts.Checked = !Settings.DisableTCSScripts; // Inverted as "Enable scripts" is better UI than "Disable scripts"
168-
checkAutoSaveActive.Checked = Settings.AutoSaveActive;
169-
ButtonAutoSave15.Checked = checkAutoSaveActive.Checked & Settings.AutoSaveInterval == 15;
170-
ButtonAutoSave30.Checked = checkAutoSaveActive.Checked & Settings.AutoSaveInterval == 30;
171-
ButtonAutoSave60.Checked = checkAutoSaveActive.Checked & Settings.AutoSaveInterval == 60;
172168

173169
// Audio tab
174170
numericSoundVolumePercent.Value = Settings.SoundVolumePercent;
@@ -460,8 +456,6 @@ void buttonOK_Click(object sender, EventArgs e)
460456
Settings.PressureUnit = comboPressureUnit.SelectedValue.ToString();
461457
Settings.Units = comboOtherUnits.SelectedValue.ToString();
462458
Settings.DisableTCSScripts = !checkEnableTCSScripts.Checked; // Inverted as "Enable scripts" is better UI than "Disable scripts"
463-
Settings.AutoSaveActive = checkAutoSaveActive.Checked;
464-
Settings.AutoSaveInterval = ButtonAutoSave15.Checked ? 15 : ButtonAutoSave30.Checked ? 30 : 60;
465459

466460
// Audio tab
467461
Settings.SoundVolumePercent = (int)numericSoundVolumePercent.Value;
@@ -813,50 +807,6 @@ private void checkPerformanceTuner_Click(object sender, EventArgs e)
813807
labelPerformanceTunerTarget.Enabled = checkPerformanceTuner.Checked;
814808
}
815809

816-
private void checkAutoSave_checkchanged(object sender, EventArgs e)
817-
{
818-
if (checkAutoSaveActive.Checked)
819-
{
820-
ButtonAutoSave15.Enabled = true;
821-
ButtonAutoSave15.Checked = Settings.AutoSaveInterval == 15;
822-
ButtonAutoSave30.Enabled = true;
823-
ButtonAutoSave30.Checked = Settings.AutoSaveInterval == 30;
824-
ButtonAutoSave60.Enabled = true;
825-
ButtonAutoSave60.Checked = Settings.AutoSaveInterval == 60;
826-
}
827-
else
828-
{
829-
ButtonAutoSave15.Checked = false;
830-
ButtonAutoSave15.Enabled = false;
831-
ButtonAutoSave30.Checked = false;
832-
ButtonAutoSave30.Enabled = false;
833-
ButtonAutoSave60.Checked = false;
834-
ButtonAutoSave60.Enabled = false;
835-
}
836-
}
837-
838-
private void buttonAutoSaveInterval_checkchanged(object sender, EventArgs e)
839-
{
840-
if (ButtonAutoSave15.Checked)
841-
{
842-
Settings.AutoSaveInterval = 15;
843-
ButtonAutoSave30.Checked = false;
844-
ButtonAutoSave60.Checked = false;
845-
}
846-
else if (ButtonAutoSave30.Checked)
847-
{
848-
Settings.AutoSaveInterval = 30;
849-
ButtonAutoSave15.Checked = false;
850-
ButtonAutoSave60.Checked = false;
851-
}
852-
else if (ButtonAutoSave60.Checked)
853-
{
854-
Settings.AutoSaveInterval = 60;
855-
ButtonAutoSave15.Checked = false;
856-
ButtonAutoSave30.Checked = false;
857-
}
858-
}
859-
860810
#region Help for Options
861811
// The icons all share the same code which assumes they are named according to a simple scheme as follows:
862812
// 1. To add a new Help Icon, copy an existing one and paste it onto the tab.

Source/ORTS.Common/Conversions.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,6 @@ public static class FormatStrings
576576
public static string kN = Catalog.GetString("kN");
577577
public static string lbf = Catalog.GetString("lbf");
578578
public static string klbf = Catalog.GetString("klbf");
579-
public static string deg = Catalog.GetString("°");
580579

581580
/// <summary>
582581
/// Formatted unlocalized speed string, used in reports and logs.
@@ -846,11 +845,6 @@ public static string FormatAirFlow(float flowM3pS, bool isMetric)
846845
return String.Format(CultureInfo.CurrentCulture, "{0:F0} {1}", flow, isMetric ? lps : cfm);
847846
}
848847

849-
public static string FormatAngleDeg(float angleDeg)
850-
{
851-
return String.Format(CultureInfo.CurrentCulture, "{0:F0} {1}", angleDeg, deg);
852-
}
853-
854848
/// <summary>
855849
/// Converts duration in floating-point seconds to whole hours, minutes and seconds (rounded down).
856850
/// </summary>

Source/ORTS.Settings/UserSettings.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,6 @@ public enum DirectXFeature
168168
public String Units { get; set; }
169169
[Default(false)]
170170
public bool DisableTCSScripts { get; set; }
171-
[Default(false)]
172-
public bool AutoSaveActive { get; set; }
173-
[Default (15)]
174-
public int AutoSaveInterval { get; set; }
175171

176172
// Audio settings:
177173
[Default(100)]
@@ -316,6 +312,12 @@ public enum DirectXFeature
316312
public bool AdhesionProportionalToWeather { get; set; }
317313
[Default(false)]
318314
public bool NoForcedRedAtStationStops { get; set; }
315+
[Default(100)]
316+
public int PrecipitationBoxHeight { get; set; }
317+
[Default(500)]
318+
public int PrecipitationBoxWidth { get; set; }
319+
[Default(500)]
320+
public int PrecipitationBoxLength { get; set; }
319321
[Default(false)]
320322
public bool CorrectQuestionableBrakingParams { get; set; }
321323
[Default(false)]

Source/Orts.Simulation/Simulation/AIs/AITrain.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ public void AIUpdate(float elapsedClockSeconds, double clockTime, bool preUpdate
710710

711711
if (Cars[0] is MSTSLocomotive leadingLoco)
712712
{
713-
var isRainingOrSnowing = Simulator.Weather.PrecipitationIntensityPPSPM2 > 0;
713+
var isRainingOrSnowing = Simulator.Weather.PricipitationIntensityPPSPM2 > 0;
714714
if (leadingLoco.Wiper && !isRainingOrSnowing)
715715
leadingLoco.SignalEvent(Event.WiperOff);
716716
else if (!leadingLoco.Wiper && isRainingOrSnowing)

Source/Orts.Simulation/Simulation/Physics/Train.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2205,14 +2205,14 @@ public virtual void physicsUpdate(float elapsedClockSeconds)
22052205
public void UpdateWindComponents()
22062206
{
22072207
// Gets wind direction and speed, and determines HUD display values for the train as a whole.
2208-
// These will be representative of the train whilst it is on a straight track, but each wagon will vary when going around a curve.
2208+
//These will be representative of the train whilst it is on a straight track, but each wagon will vary when going around a curve.
22092209
// Note both train and wind direction will be positive between 0 (north) and 180 (south) through east, and negative between 0 (north) and 180 (south) through west
22102210
// Wind and train direction to be converted to an angle between 0 and 360 deg.
22112211
// Calculate Wind speed and direction, and train direction
22122212
// Update the value of the Wind Speed and Direction for the train
2213-
PhysicsWindDirectionDeg = MathHelper.ToDegrees(Simulator.Weather.WindInstantaneousDirectionRad);
2214-
PhysicsWindSpeedMpS = Simulator.Weather.WindInstantaneousSpeedMpS;
2215-
var speedMpS = Math.Abs(SpeedMpS);
2213+
PhysicsWindDirectionDeg = MathHelper.ToDegrees(Simulator.Weather.WindDirection);
2214+
PhysicsWindSpeedMpS = Simulator.Weather.WindSpeed;
2215+
float TrainSpeedMpS = Math.Abs(SpeedMpS);
22162216

22172217
// If a westerly direction (ie -ve) convert to an angle between 0 and 360
22182218
if (PhysicsWindDirectionDeg < 0)
@@ -2221,7 +2221,7 @@ public void UpdateWindComponents()
22212221
if (PhysicsTrainLocoDirectionDeg < 0)
22222222
PhysicsTrainLocoDirectionDeg += 360;
22232223

2224-
// Calculate angle between train and wind direction
2224+
// calculate angle between train and eind direction
22252225
if (PhysicsWindDirectionDeg > PhysicsTrainLocoDirectionDeg)
22262226
ResultantWindComponentDeg = PhysicsWindDirectionDeg - PhysicsTrainLocoDirectionDeg;
22272227
else if (PhysicsTrainLocoDirectionDeg > PhysicsWindDirectionDeg)
@@ -2237,8 +2237,9 @@ public void UpdateWindComponents()
22372237
if (ResultantWindComponentDeg > 180)
22382238
ResultantWindComponentDeg = 360 - ResultantWindComponentDeg;
22392239

2240-
var windAngleRad = MathHelper.ToRadians(ResultantWindComponentDeg);
2241-
WindResultantSpeedMpS = (float)Math.Sqrt(speedMpS * speedMpS + PhysicsWindSpeedMpS * PhysicsWindSpeedMpS + 2.0f * speedMpS * PhysicsWindSpeedMpS * (float)Math.Cos(windAngleRad));
2240+
float WindAngleRad = MathHelper.ToRadians(ResultantWindComponentDeg);
2241+
2242+
WindResultantSpeedMpS = (float)Math.Sqrt(TrainSpeedMpS * TrainSpeedMpS + PhysicsWindSpeedMpS * PhysicsWindSpeedMpS + 2.0f * TrainSpeedMpS * PhysicsWindSpeedMpS * (float)Math.Cos(WindAngleRad));
22422243
}
22432244

22442245

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3263,7 +3263,7 @@ public virtual void UpdateFrictionCoefficient(float elapsedClockSeconds)
32633263
{
32643264
var fogBaseFrictionCoefficientFactor = 1.0f;
32653265
var pricBaseFrictionCoefficientFactor = 1.0f;
3266-
float pric = Simulator.Weather.PrecipitationIntensityPPSPM2 * 1000;
3266+
float pric = Simulator.Weather.PricipitationIntensityPPSPM2 * 1000;
32673267
// precipitation will calculate a base coefficient value between 60% (light rain) and 90% (heavy rain) - this will be a factor that is used to adjust the base value
32683268
// assume linear value between upper and lower precipitation values. Limits are set in the weather module, ie Rain = 0.01ppm (10) and Snow = 0.005ppm (5)
32693269
float precGrad = (0.2f - 0) / (10f - 5f);
@@ -3279,7 +3279,7 @@ public virtual void UpdateFrictionCoefficient(float elapsedClockSeconds)
32793279
}
32803280

32813281
// Adjust adhesion for impact of fog - default = 20000m = 20km
3282-
float fog = Simulator.Weather.VisibilityM;
3282+
float fog = Simulator.Weather.FogDistance;
32833283
if (fog < 20000) // as fog thickens then decrease adhesion
32843284
{
32853285
fogBaseFrictionCoefficientFactor = Math.Min((fog * 2.75e-4f + 0.6f), 1.0f); // If fog is less then 2km then it will impact friction, decrease adhesion to 60% (same as light rain transition)

0 commit comments

Comments
 (0)