Class BasicSpeedMatcher
java.lang.Object
jmri.jmrix.bachrus.speedmatcher.SpeedMatcher
jmri.jmrix.bachrus.speedmatcher.basic.BasicSpeedMatcher
- All Implemented Interfaces:
EventListener,ProgListener,ThrottleListener
- Direct Known Subclasses:
BasicESUTableSpeedMatcher,BasicSimpleCVSpeedMatcher,BasicSpeedTableSpeedMatcher
Abstract class defining the basic operations of a Basic speed matcher (sets a
minimum speed at speed step 1, a maximum at speed step 28, and some number of
points in between). All basic 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 floatprotected floatFields 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 BasicSpeedMatcher at the core of any Basic Speed Matcher -
Method Summary
Modifier and TypeMethodDescriptionprotected floatgetSpeedForSpeedStep(SpeedMatcher.SpeedTableStep speedStep, float minSpeed, float maxSpeed) Gets the desired speed for a given speed stepprotected 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
-
targetStartSpeedKPH
-
targetTopSpeedKPH
-
-
Constructor Details
-
BasicSpeedMatcher
Constructs the abstract BasicSpeedMatcher at the core of any Basic Speed Matcher- Parameters:
config- BasicSpeedMatcherConfig
-
-
Method Details
-
validate
Validates the speed matcher's configuration- Specified by:
validatein classSpeedMatcher- Returns:
- true if the configuration is valid, false otherwise
-
getSpeedForSpeedStep
protected float getSpeedForSpeedStep(SpeedMatcher.SpeedTableStep speedStep, float minSpeed, float maxSpeed) Gets the desired speed for a given speed step- Parameters:
speedStep- the SpeedTableStep to get the speed forminSpeed- minimum speed in KPH (at speed step 1)maxSpeed- maximum speed in KPH (at speed step 28)- Returns:
- the speed for the given speed step in KPH
-