Package jmri.jmrit.dispatcher
Class AutoActiveTrain.AutoEngineer
- java.lang.Object
-
- jmri.jmrit.dispatcher.AutoActiveTrain.AutoEngineer
-
- Enclosing class:
- AutoActiveTrain
class AutoActiveTrain.AutoEngineer extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.LinkedList<jmri.jmrit.dispatcher.AutoActiveTrain.AutoEngineer.SpeedSetting>
stepQueue
-
Constructor Summary
Constructors Constructor Description AutoEngineer(DccThrottle throttle, RosterEntry rosterEntry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abort()
Flag from user to end run.boolean
getIsForward()
float
getTargetSpeed()
boolean
isAtSpeed()
Check if train is moving at its current requested speed.boolean
isStopped()
Check if train is moving or stopped.protected void
setFunction(int cmdNum, boolean isSet)
void
setHalt(boolean halt)
Flag from user's control.void
setIsForward(boolean isForward)
(package private) void
setNextStep()
void
setRamping(int ramping, int fullRampTime, int minThrottleInterval, int rampRate)
void
setSpeedImmediate(float speed)
Set the train speed directly, bypassing ramping.void
setSpeedLimits(float minReliableOperatingSpeed, float maxSpeed, float speedFactor)
Set the limits and adjustment factore for train speed.void
setTargetSpeed(float speed)
void
setTargetSpeed(float distance, float speed)
void
slowToStop(boolean on)
void
stopAllTimers()
-
-
-
Field Detail
-
stepQueue
java.util.LinkedList<jmri.jmrit.dispatcher.AutoActiveTrain.AutoEngineer.SpeedSetting> stepQueue
-
-
Constructor Detail
-
AutoEngineer
AutoEngineer(DccThrottle throttle, RosterEntry rosterEntry)
-
-
Method Detail
-
setRamping
public void setRamping(int ramping, int fullRampTime, int minThrottleInterval, int rampRate)
-
setIsForward
public void setIsForward(boolean isForward)
-
getIsForward
public boolean getIsForward()
-
setTargetSpeed
public void setTargetSpeed(float speed)
-
getTargetSpeed
public float getTargetSpeed()
-
setHalt
public void setHalt(boolean halt)
Flag from user's control.- Parameters:
halt
- true to immediately stop the train; false otherwise
-
setSpeedLimits
public void setSpeedLimits(float minReliableOperatingSpeed, float maxSpeed, float speedFactor)
Set the limits and adjustment factore for train speed. Active train will calculate the required setting and it will be adjusted if not 0.0f required setting * speed Factor then test for less than max and greater than min.- Parameters:
minReliableOperatingSpeed
- lowest throttle % train will reliably move.maxSpeed
- max throttle % for train.speedFactor
- multiplier
-
setTargetSpeed
public void setTargetSpeed(float distance, float speed)
-
slowToStop
public void slowToStop(boolean on)
-
stopAllTimers
public void stopAllTimers()
-
setNextStep
void setNextStep()
-
setSpeedImmediate
public void setSpeedImmediate(float speed)
Set the train speed directly, bypassing ramping.- Parameters:
speed
- 0.0 (stop) to 1.0 (full)
-
isStopped
public boolean isStopped()
Check if train is moving or stopped.- Returns:
- true if stopped; false otherwise
-
isAtSpeed
public boolean isAtSpeed()
Check if train is moving at its current requested speed.- Returns:
- true if at requested speed; false otherwise
-
abort
public void abort()
Flag from user to end run.
-
setFunction
protected void setFunction(int cmdNum, boolean isSet)
-
-