Compare commits

..

No commits in common. "da761976b4f69d6911264d65dd11d0560b37490e" and "6bd560d93a2f1c83a3d4cd9cfc1fec4c25d77ed6" have entirely different histories.

3 changed files with 4 additions and 34 deletions

View file

@ -52,10 +52,6 @@ namespace OpenbveFcmbTrainPlugin
/// <summary>The maximum speed in YARD mode, in km/h.</summary>
private readonly double YardMaximumSpeed;
/// <summary>Whether ATO is available or not on the train.</summary>
private readonly bool AtoAvailable;
/// <summary>Represents an ATC speed code.</summary>
private class SpeedCode
{
@ -94,11 +90,9 @@ namespace OpenbveFcmbTrainPlugin
/// <summary>Creates an instance of the Bombardier ATC device.</summary>
/// <param name="yardMaxSpeed">The maximum speed in YARD mode, in km/h.</param>
/// <param name="atoAvailable">Whether ATO is available or not.</param>
internal AtcDimetronic(double yardMaxSpeed, bool atoAvailable)
internal AtcDimetronic(double yardMaxSpeed)
{
YardMaximumSpeed = yardMaxSpeed;
AtoAvailable = atoAvailable;
}
/// <summary>Is called when the device state should be updated.</summary>
@ -227,13 +221,9 @@ namespace OpenbveFcmbTrainPlugin
// YARD (M+25) mode selection button
if (!OpenbveFcmbTrainPlugin.KeysPressed[(int)key])
{
// Allow change anytime the train is stopped or from ATP mode below YARD speed limit
if ((DeviceState >= DeviceStates.NoMode && stopped) || (DeviceState == DeviceStates.ATP && train.State.Speed.KilometersPerHour < YardMaximumSpeed))
if (DeviceState == DeviceStates.NoMode && stopped)
{
if (train.PhysicalHandles.Reverser == 1 || train.PhysicalHandles.Reverser == -1)
{
DeviceState = DeviceStates.YARD;
}
DeviceState = DeviceStates.YARD;
}
}
break;
@ -241,28 +231,12 @@ namespace OpenbveFcmbTrainPlugin
// ATP (M+ATP) mode selection button
if (!OpenbveFcmbTrainPlugin.KeysPressed[(int)key])
{
// Allow change anytime the train is stopped or from ATO mode when running
if ((DeviceState >= DeviceStates.NoMode && DeviceState <= DeviceStates.ATO && stopped) || DeviceState == DeviceStates.ATO)
{
if (train.PhysicalHandles.Reverser == 1 && TrackState > TrackStates.Unprotected)
{
DeviceState = DeviceStates.ATP;
}
}
}
break;
case VirtualKeys.K:
// ATO mode selection button
if (!OpenbveFcmbTrainPlugin.KeysPressed[(int)key])
{
// Allow change when the train is stopped in ATP mode
if (DeviceState == DeviceStates.ATP && stopped && AtoAvailable)
{
if (train.PhysicalHandles.Reverser == 1 && TrackState > TrackStates.Unprotected)
{
DeviceState = DeviceStates.ATO;
}
}
}
break;
case VirtualKeys.L:

View file

@ -30,7 +30,6 @@ namespace OpenbveFcmbTrainPlugin
internal int AtcBombardierBlinkTime = 500;
internal int AtcDimetronicYardSpeedLimit = 25;
internal bool AtcDimetronicAtoAvailable;
}
/// <summary>Represents the plugin settings.</summary>
@ -203,9 +202,6 @@ namespace OpenbveFcmbTrainPlugin
}
}
break;
case "atoavailable":
PluginSettings.AtcDimetronicAtoAvailable = string.Compare(Value, "false", StringComparison.OrdinalIgnoreCase) != 0;
break;
}
break;
}

View file

@ -98,7 +98,7 @@ namespace OpenbveFcmbTrainPlugin
}
if (settings.AtcDimetronicDeviceEnabled)
{
Devices.Add(new AtcDimetronic(settings.AtcDimetronicYardSpeedLimit, settings.AtcDimetronicAtoAvailable));
Devices.Add(new AtcDimetronic(settings.AtcDimetronicYardSpeedLimit));
}
}