ATC Dimetronic: ATO braking calculations
This commit is contained in:
parent
b3c35ecf4e
commit
390e894a56
1 changed files with 8 additions and 0 deletions
|
@ -464,6 +464,7 @@ namespace OpenbveFcmbTrainPlugin
|
|||
if (train.PhysicalHandles.Reverser == 1 && TrackState > TrackStates.Unprotected)
|
||||
{
|
||||
DeviceState = DeviceStates.ATP;
|
||||
AtcControlState = AtcControlStates.Released;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -724,6 +725,13 @@ namespace OpenbveFcmbTrainPlugin
|
|||
requiredDeceleration = (train.State.Speed.MetersPerSecond - target.MetersPerSecond) / (distance - 8) * 10;
|
||||
}
|
||||
|
||||
// Calculate time needed to reach target speed
|
||||
double requiredDecelerationSeconds = 0;
|
||||
if (target.KilometersPerHour < limit.KilometersPerHour)
|
||||
{
|
||||
requiredDecelerationSeconds = (target.MetersPerSecond - limit.MetersPerSecond) / -AtoDeceleration;
|
||||
}
|
||||
|
||||
// Pitch multiplier, used to alter when state changes occur
|
||||
double pitchMulti = train.State.Pitch / 20;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue