Class SpeedStepScaleSpeedMatcher
java.lang.Object
jmri.jmrix.bachrus.speedmatcher.SpeedMatcher
jmri.jmrix.bachrus.speedmatcher.speedStepScale.SpeedStepScaleSpeedMatcher
- All Implemented Interfaces:
EventListener,ProgListener,ThrottleListener
- Direct Known Subclasses:
SpeedStepScaleESUTableSpeedMatcher,SpeedStepScaleSpeedTableSpeedMatcher
Abstract class defining the basic operations of a Speed Step Scale speed
matcher (sets up the complex speed table such that the speed step equals the
locomotive speed when using "128" speed step mode). All speed step scale
speed matcher implementations must extend this class.
-
Nested Class Summary
Nested 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
FieldsModifier and TypeFieldDescriptionprotected final JLabelprotected floatprotected floatprotected final Speed.Unitprotected final floatprotected final SpeedTableStepSpeedFields 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 abstract SpeedStepScaleSpeedMatcher at the core of any Speed Step Scale Speed Matcher -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetNextLowestSpeedTableStepForSpeed(float speed) Gets the next lowest speed table step for the given speedstatic floatgetSpeedForSpeedTableStep(int speedStep) Gets the 128 speed step mode speed for a speed table stepprotected intgetSpeedStepLinearValue(int speedStep) Gets the speed step value for a linear speed tableprotected floatgetSpeedStepScaleSpeedInKPH(int speedStep) Gets the speed in KPH for a given speed step for a speed step scale speed matcherprotected booleanvalidate()Validates the speed matcher's configurationMethods inherited from class jmri.jmrix.bachrus.speedmatcher.SpeedMatcher
cleanUpSpeedMatcher, getNextSpeedMatchValue, initializeAndStartSpeedMatcher, isSpeedMatcherIdle, notifyDecisionRequired, notifyFailedThrottleRequest, notifyThrottleFound, programmingOpReply, resetSpeedMatcher, setSpeedMatchError, setSpeedMatchStateTimerDuration, setThrottle, startSpeedMatcher, startSpeedMatchStateTimer, stopSpeedMatcher, stopSpeedMatchStateTimer, updateCurrentSpeed, writeForwardTrim, writeMomentumAccel, writeMomentumDecel, writeReverseTrim, writeSpeedTableStep, writeVHigh, writeVMid, writeVStart
-
Field Details
-
targetMaxSpeedStep
-
targetMaxSpeedKPH
-
speedUnit
-
actualMaxSpeedField
-
measuredMaxSpeedKPH
-
speedMatchMaxSpeedKPH
-
-
Constructor Details
-
SpeedStepScaleSpeedMatcher
Constructs the abstract SpeedStepScaleSpeedMatcher at the core of any Speed Step Scale Speed Matcher- Parameters:
config- SpeedStepScaleSpeedMatcherConfig
-
-
Method Details
-
validate
Validates the speed matcher's configuration- Specified by:
validatein classSpeedMatcher- Returns:
- true if the configuration is valid, false otherwise
-
getSpeedStepScaleSpeedInKPH
Gets the speed in KPH for a given speed step for a speed step scale speed matcher- Parameters:
speedStep- the int speed step to get the speed for- Returns:
- speed for the given speedStep in KPH
-
getSpeedStepLinearValue
Gets the speed step value for a linear speed table- Parameters:
speedStep- the inst speed step to get the value for- Returns:
- value for the speed step
-
getSpeedForSpeedTableStep
Gets the 128 speed step mode speed for a speed table step- Parameters:
speedStep- the int speed table step to get the 128 speed step mode speed for- Returns:
- the 128 speed step mode speed for the given speedStep
-
getNextLowestSpeedTableStepForSpeed
Gets the next lowest speed table step for the given speed- Parameters:
speed- float speed in the user facing unit- Returns:
- the next lowest int speed table step for the given speed
-