Class SpeedStepScaleSpeedMatcher
- java.lang.Object
- 
- jmri.jmrix.bachrus.speedmatcher.SpeedMatcher
- 
- jmri.jmrix.bachrus.speedmatcher.speedStepScale.SpeedStepScaleSpeedMatcher
 
 
- 
- All Implemented Interfaces:
- java.util.EventListener,- ProgListener,- ThrottleListener
 - Direct Known Subclasses:
- SpeedStepScaleESUTableSpeedMatcher,- SpeedStepScaleSpeedTableSpeedMatcher
 
 public abstract class SpeedStepScaleSpeedMatcher extends SpeedMatcher 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.SpeedMatcherSpeedMatcher.ProgrammerState, SpeedMatcher.SpeedMatcherCV, SpeedMatcher.SpeedTableStep
 - 
Nested classes/interfaces inherited from interface jmri.ThrottleListenerThrottleListener.DecisionType
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected javax.swing.JLabelactualMaxSpeedFieldprotected floatmeasuredMaxSpeedKPHprotected floatspeedMatchMaxSpeedKPHprotected Speed.UnitspeedUnitprotected floattargetMaxSpeedKPHprotected SpeedTableStepSpeedtargetMaxSpeedStep- 
Fields inherited from class jmri.jmrix.bachrus.speedmatcher.SpeedMatcherALLOWED_SPEED_MATCH_ERROR, attempt, currentSpeedKPH, dccLocoAddress, INITIAL_MOMENTUM, opsModeProgrammer, powerManager, programmerState, REVERSE_TRIM_MAX, REVERSE_TRIM_MIN, speedMatchError, speedMatcherValueDelta, startStopButton, statusLabel, stepDuration, trimReverseSpeed, warmUpForwardSeconds, warmUpReverseSeconds
 - 
Fields inherited from interface jmri.ProgListenerCommError, ConfirmFailed, FailedTimeout, NoAck, NoLocoDetected, NotImplemented, OK, ProgrammerBusy, ProgrammingShort, SequenceError, UnknownError, UserAborted
 
- 
 - 
Constructor SummaryConstructors Constructor Description SpeedStepScaleSpeedMatcher(SpeedStepScaleSpeedMatcherConfig config)Constructs the abstract SpeedStepScaleSpeedMatcher at the core of any Speed Step Scale Speed Matcher
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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 configuration- 
Methods inherited from class jmri.jmrix.bachrus.speedmatcher.SpeedMatchercleanUpSpeedMatcher, 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 Detail- 
targetMaxSpeedStepprotected final SpeedTableStepSpeed targetMaxSpeedStep 
 - 
targetMaxSpeedKPHprotected final float targetMaxSpeedKPH 
 - 
speedUnitprotected final Speed.Unit speedUnit 
 - 
actualMaxSpeedFieldprotected final javax.swing.JLabel actualMaxSpeedField 
 - 
measuredMaxSpeedKPHprotected float measuredMaxSpeedKPH 
 - 
speedMatchMaxSpeedKPHprotected float speedMatchMaxSpeedKPH 
 
- 
 - 
Constructor Detail- 
SpeedStepScaleSpeedMatcherpublic SpeedStepScaleSpeedMatcher(SpeedStepScaleSpeedMatcherConfig config) Constructs the abstract SpeedStepScaleSpeedMatcher at the core of any Speed Step Scale Speed Matcher- Parameters:
- config- SpeedStepScaleSpeedMatcherConfig
 
 
- 
 - 
Method Detail- 
validateprotected boolean validate() Validates the speed matcher's configuration- Specified by:
- validatein class- SpeedMatcher
- Returns:
- true if the configuration is valid, false otherwise
 
 - 
getSpeedStepScaleSpeedInKPHprotected float getSpeedStepScaleSpeedInKPH(int speedStep) 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
 
 - 
getSpeedStepLinearValueprotected int getSpeedStepLinearValue(int speedStep) 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
 
 - 
getSpeedForSpeedTableSteppublic static float getSpeedForSpeedTableStep(int speedStep) 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
 
 - 
getNextLowestSpeedTableStepForSpeedpublic static int getNextLowestSpeedTableStepForSpeed(float speed) 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
 
 
- 
 
-