Class LnPr2ThrottleManager

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

LocoNet implementation of a ThrottleManager for the PR2.

Does direct "push" writes to the extended slot in the PR2.

The PR2 only allows a single locomotive address to be active, because it implements a single-slot command station.

See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • singleUse

      protected boolean singleUse()
      PR2 allows only one throttle

      Does this DCC system allow a Throttle (e.g. an address) to be used by only one user at a time?

      Overrides:
      singleUse in class AbstractThrottleManager
      Returns:
      true or false
    • requestThrottleSetup

      public void requestThrottleSetup(LocoAddress address, boolean control)
      Get a new Throttle object. This immediately invokes the callback with the a new throttle object.
      Specified by:
      requestThrottleSetup in class AbstractThrottleManager
      Parameters:
      address - address
      control - false - read only.
    • hasDispatchFunction

      public boolean hasDispatchFunction()
      PR2 does not have a Dispatch function
      Specified by:
      hasDispatchFunction in interface ThrottleManager
      Overrides:
      hasDispatchFunction in class AbstractThrottleManager
      Returns:
      true if dispatch is possible; false otherwise
    • canBeLongAddress

      public boolean canBeLongAddress(int address)
      Address 128 and above is a long address
      Parameters:
      address - address number to test
      Returns:
      true if address can be long; false otherwise
    • canBeShortAddress

      public boolean canBeShortAddress(int address)
      Address 127 and below is a short address
      Parameters:
      address - address number to test
      Returns:
      true if address can be short; false otherwise
    • addressTypeUnique

      public boolean addressTypeUnique()
      Are there any ambiguous addresses (short vs long) on this system?
      Returns:
      true if ambiguous addresses are not allowed; false otherwise
    • isLongAddress

      static boolean isLongAddress(int num)
    • getActiveAddress

      Make the active address available to the power manager, which needs it to turn on and off "neutral mode" in the locomotive
      Returns:
      a DccLocoAddress