Class ThrottleManager

java.lang.Object
jmri.jmrix.AbstractThrottleManager
jmri.jmrix.direct.ThrottleManager
All Implemented Interfaces:
ThrottleManager

Direct DCC implementation of a ThrottleManager.

When the traffic manager doesn't have anything else to do, it comes here to get a command to send.

This is a partial implementation, which can only handle one Throttle at a time. It also is missing logic to alternate sending speed and function commands; right now it only sends the first group of function packets.

  • Field Details

  • Constructor Details

  • Method Details

    • requestThrottleSetup

      public void requestThrottleSetup(LocoAddress address, boolean control)
      Create throttle data structures. Abstract member to actually do the work of configuring a new throttle, usually via interaction with the DCC system.
      Specified by:
      requestThrottleSetup in class AbstractThrottleManager
      Parameters:
      address - address
      control - false - read only.
    • addressTypeUnique

      public boolean addressTypeUnique()
      Description copied from interface: ThrottleManager
      Test if ambiguous addresses (short vs long) are not allowed on this system. Also indicates support for multi-protocol decoders.
      Returns:
      true if ambiguous addresses are not allowed; false otherwise
    • canBeShortAddress

      public boolean canBeShortAddress(int a)
      Description copied from interface: ThrottleManager
      Test if a specific number is a valid short address on this system.
      Parameters:
      a - address number to test
      Returns:
      true if address can be short; false otherwise
    • canBeLongAddress

      public boolean canBeLongAddress(int a)
      Description copied from interface: ThrottleManager
      Test if a specific number is a valid long address on this system.
      Parameters:
      a - address number to test
      Returns:
      true if address can be long; false otherwise
    • disposeThrottle

      Invoked when a throttle is released, this updates the local data structures.
      Specified by:
      disposeThrottle in interface ThrottleManager
      Overrides:
      disposeThrottle in class AbstractThrottleManager
      Parameters:
      t - Throttle being released
      l - Throttle Listener releasing the throttle
      Returns:
      true if the throttle has been disposed of.