Class SpeedStepScaleSpeedTableSpeedMatcher
- java.lang.Object
-
- jmri.jmrix.bachrus.speedmatcher.SpeedMatcher
-
- jmri.jmrix.bachrus.speedmatcher.speedStepScale.SpeedStepScaleSpeedMatcher
-
- jmri.jmrix.bachrus.speedmatcher.speedStepScale.SpeedStepScaleSpeedTableSpeedMatcher
-
- All Implemented Interfaces:
java.util.EventListener
,ProgListener
,ThrottleListener
public class SpeedStepScaleSpeedTableSpeedMatcher extends SpeedStepScaleSpeedMatcher
This is a speed step scale speed matcher which will speed match a locomotive such that its speed in mph/kph will be equal to its speed step in 128 speed step mode. This uses the complex speed table, and the locomotive's speed will plateau at either its actual top speed or the set max speed, whichever is lower.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
SpeedStepScaleSpeedTableSpeedMatcher.SpeedMatcherState
-
Nested classes/interfaces inherited from class jmri.jmrix.bachrus.speedmatcher.SpeedMatcher
SpeedMatcher.ProgrammerState, SpeedMatcher.SpeedMatcherCV, SpeedMatcher.SpeedTableStep
-
Nested classes/interfaces inherited from interface jmri.ThrottleListener
ThrottleListener.DecisionType
-
-
Field Summary
-
Fields inherited from class jmri.jmrix.bachrus.speedmatcher.speedStepScale.SpeedStepScaleSpeedMatcher
actualMaxSpeedField, measuredMaxSpeedKPH, speedMatchMaxSpeedKPH, speedUnit, targetMaxSpeedKPH, targetMaxSpeedStep
-
Fields inherited from class jmri.jmrix.bachrus.speedmatcher.SpeedMatcher
ALLOWED_SPEED_MATCH_ERROR, currentSpeedKPH, dccLocoAddress, INITIAL_MOMENTUM, Kd, Ki, Kp, lastSpeedMatchError, opsModeProgrammer, powerManager, programmerState, REVERSE_TRIM_MAX, REVERSE_TRIM_MIN, speedMatchDerivative, speedMatchError, speedMatchIntegral, startStopButton, statusLabel, stepDuration, Td, Ti, trimReverseSpeed, warmUpForwardSeconds, warmUpReverseSeconds
-
Fields inherited from interface jmri.ProgListener
CommError, ConfirmFailed, FailedTimeout, NoAck, NoLocoDetected, NotImplemented, OK, ProgrammerBusy, ProgrammingShort, SequenceError, UnknownError, UserAborted
-
-
Constructor Summary
Constructors Constructor Description SpeedStepScaleSpeedTableSpeedMatcher(SpeedStepScaleSpeedMatcherConfig config)
Constructs the SpeedStepScaleSpeedTableSpeedMatcher from a SpeedStepScaleSpeedMatcherConfig
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cleanUpSpeedMatcher()
Cleans up the speed matcher when speed matching is stopped or is finishedprotected void
initNextSpeedMatcherState(SpeedStepScaleSpeedTableSpeedMatcher.SpeedMatcherState nextState)
Sets up the speed match state by clearing the speed match error, clearing the step duration, setting the timer duration, and setting the next stateboolean
isSpeedMatcherIdle()
Indicates if the speed matcher is idle (not currently speed matching)void
notifyThrottleFound(DccThrottle t)
Called when a throttle is foundboolean
startSpeedMatcher()
Starts the speed matching processvoid
stopSpeedMatcher()
Stops the speed matching process-
Methods inherited from class jmri.jmrix.bachrus.speedmatcher.speedStepScale.SpeedStepScaleSpeedMatcher
getNextLowestSpeedTableStepForSpeed, getSpeedForSpeedTableStep, getSpeedStepLinearValue, getSpeedStepScaleSpeedInKPH, validate
-
Methods inherited from class jmri.jmrix.bachrus.speedmatcher.SpeedMatcher
getNextSpeedMatchValue, initializeAndStartSpeedMatcher, notifyDecisionRequired, notifyFailedThrottleRequest, programmingOpReply, resetSpeedMatchError, setSpeedMatchError, setSpeedMatchStateTimerDuration, setThrottle, startSpeedMatchStateTimer, stopSpeedMatchStateTimer, updateCurrentSpeed, writeForwardTrim, writeMomentumAccel, writeMomentumDecel, writeReverseTrim, writeSpeedTableStep, writeVHigh, writeVMid, writeVStart
-
-
-
-
Constructor Detail
-
SpeedStepScaleSpeedTableSpeedMatcher
public SpeedStepScaleSpeedTableSpeedMatcher(SpeedStepScaleSpeedMatcherConfig config)
Constructs the SpeedStepScaleSpeedTableSpeedMatcher from a SpeedStepScaleSpeedMatcherConfig- Parameters:
config
- SpeedStepScaleSpeedMatcherConfig
-
-
Method Detail
-
startSpeedMatcher
public boolean startSpeedMatcher()
Starts the speed matching process- Specified by:
startSpeedMatcher
in classSpeedMatcher
- Returns:
- true if speed matching started successfully, false otherwise
-
stopSpeedMatcher
public void stopSpeedMatcher()
Stops the speed matching process- Specified by:
stopSpeedMatcher
in classSpeedMatcher
-
isSpeedMatcherIdle
public boolean isSpeedMatcherIdle()
Indicates if the speed matcher is idle (not currently speed matching)- Specified by:
isSpeedMatcherIdle
in classSpeedMatcher
- Returns:
- true if idle, false otherwise
-
cleanUpSpeedMatcher
protected void cleanUpSpeedMatcher()
Cleans up the speed matcher when speed matching is stopped or is finished- Overrides:
cleanUpSpeedMatcher
in classSpeedMatcher
-
notifyThrottleFound
public void notifyThrottleFound(DccThrottle t)
Called when a throttle is found- Specified by:
notifyThrottleFound
in interfaceThrottleListener
- Overrides:
notifyThrottleFound
in classSpeedMatcher
- Parameters:
t
- the requested DccThrottle
-
initNextSpeedMatcherState
protected void initNextSpeedMatcherState(SpeedStepScaleSpeedTableSpeedMatcher.SpeedMatcherState nextState)
Sets up the speed match state by clearing the speed match error, clearing the step duration, setting the timer duration, and setting the next state- Parameters:
nextState
- next SpeedMatcherState to set
-
-