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:
EventListener,ProgListener,ThrottleListener
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 ClassesModifier and TypeClassDescriptionprotected static enumNested classes/interfaces inherited from class jmri.jmrix.bachrus.speedmatcher.SpeedMatcher
SpeedMatcher.ProgrammerState, SpeedMatcher.SpeedMatcherCV, SpeedMatcher.SpeedTableStepNested 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, targetMaxSpeedStepFields inherited from class jmri.jmrix.bachrus.speedmatcher.SpeedMatcher
ALLOWED_SPEED_MATCH_ERROR, attempt, currentSpeedKPH, dccLocoAddress, INITIAL_MOMENTUM, opsModeProgrammer, powerManager, programmerState, REVERSE_TRIM_MAX, REVERSE_TRIM_MIN, speedMatchError, speedMatcherValueDelta, startStopButton, statusLabel, stepDuration, trimReverseSpeed, warmUpForwardSeconds, warmUpReverseSecondsFields inherited from interface jmri.ProgListener
CommError, ConfirmFailed, FailedTimeout, NoAck, NoLocoDetected, NotImplemented, OK, ProgrammerBusy, ProgrammingShort, SequenceError, UnknownError, UserAborted -
Constructor Summary
ConstructorsConstructorDescriptionConstructs the SpeedStepScaleSpeedTableSpeedMatcher from a SpeedStepScaleSpeedMatcherConfig -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCleans up the speed matcher when speed matching is stopped or is finishedprotected voidSets up the speed match state by resetting the speed matcher with a value delta of 10, clearing the step duration, setting the timer duration, and setting the next stateprotected voidinitNextSpeedMatcherState(SpeedStepScaleSpeedTableSpeedMatcher.SpeedMatcherState nextState, int speedMatchValueDelta) Sets up the speed match state by resetting the speed matcher with the given value delta, clearing the step duration, setting the timer duration, and setting the next statebooleanIndicates if the speed matcher is idle (not currently speed matching)voidCalled when a throttle is foundbooleanStarts the speed matching processvoidStops the speed matching processMethods inherited from class jmri.jmrix.bachrus.speedmatcher.speedStepScale.SpeedStepScaleSpeedMatcher
getNextLowestSpeedTableStepForSpeed, getSpeedForSpeedTableStep, getSpeedStepLinearValue, getSpeedStepScaleSpeedInKPH, validateMethods inherited from class jmri.jmrix.bachrus.speedmatcher.SpeedMatcher
getNextSpeedMatchValue, initializeAndStartSpeedMatcher, notifyDecisionRequired, notifyFailedThrottleRequest, programmingOpReply, resetSpeedMatcher, setSpeedMatchError, setSpeedMatchStateTimerDuration, setThrottle, startSpeedMatchStateTimer, stopSpeedMatchStateTimer, updateCurrentSpeed, writeForwardTrim, writeMomentumAccel, writeMomentumDecel, writeReverseTrim, writeSpeedTableStep, writeVHigh, writeVMid, writeVStart
-
Constructor Details
-
SpeedStepScaleSpeedTableSpeedMatcher
Constructs the SpeedStepScaleSpeedTableSpeedMatcher from a SpeedStepScaleSpeedMatcherConfig- Parameters:
config- SpeedStepScaleSpeedMatcherConfig
-
-
Method Details
-
startSpeedMatcher
Starts the speed matching process- Specified by:
startSpeedMatcherin classSpeedMatcher- Returns:
- true if speed matching started successfully, false otherwise
-
stopSpeedMatcher
Stops the speed matching process- Specified by:
stopSpeedMatcherin classSpeedMatcher
-
isSpeedMatcherIdle
Indicates if the speed matcher is idle (not currently speed matching)- Specified by:
isSpeedMatcherIdlein classSpeedMatcher- Returns:
- true if idle, false otherwise
-
cleanUpSpeedMatcher
Cleans up the speed matcher when speed matching is stopped or is finished- Overrides:
cleanUpSpeedMatcherin classSpeedMatcher
-
notifyThrottleFound
Called when a throttle is found- Specified by:
notifyThrottleFoundin interfaceThrottleListener- Overrides:
notifyThrottleFoundin classSpeedMatcher- Parameters:
t- the requested DccThrottle
-
initNextSpeedMatcherState
protected void initNextSpeedMatcherState(SpeedStepScaleSpeedTableSpeedMatcher.SpeedMatcherState nextState) Sets up the speed match state by resetting the speed matcher with a value delta of 10, clearing the step duration, setting the timer duration, and setting the next state- Parameters:
nextState- next SpeedMatcherState to set
-
initNextSpeedMatcherState
protected void initNextSpeedMatcherState(SpeedStepScaleSpeedTableSpeedMatcher.SpeedMatcherState nextState, int speedMatchValueDelta) Sets up the speed match state by resetting the speed matcher with the given value delta, clearing the step duration, setting the timer duration, and setting the next state- Parameters:
nextState- next SpeedMatcherState to setspeedMatchValueDelta- the value delta to use when resetting the speed matcher
-