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

public abstract class BasicSpeedMatcher extends SpeedMatcher
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.
  • Field Details

  • Constructor Details

    • BasicSpeedMatcher

      Constructs the abstract BasicSpeedMatcher at the core of any Basic Speed Matcher
      Parameters:
      config - BasicSpeedMatcherConfig
  • Method Details

    • validate

      protected boolean validate()
      Validates the speed matcher's configuration
      Specified by:
      validate in class SpeedMatcher
      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 for
      minSpeed - 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