Class XpaThrottle

All Implemented Interfaces:
PropertyChangeFirer, PropertyChangeProvider, DccThrottle, Throttle

public class XpaThrottle extends AbstractThrottle
An XPA+Modem implementation of the Throttle for XpressNet Systems
  • Constructor Details

  • Method Details

    • setSpeedSetting

      public void setSpeedSetting(float speed)
      Set the speed and direction.

      This intentionally skips the emergency stop value of 1.

      Specified by:
      setSpeedSetting in interface Throttle
      Overrides:
      setSpeedSetting in class AbstractThrottle
      Parameters:
      speed - Number from 0 to 1; less than zero is emergency stop
    • setIsForward

      public void setIsForward(boolean forward)
      Implementing functions should override this function, but should either make a call to super.setIsForward() to notify the listeners, or should notify the listeners themselves.
      Specified by:
      setIsForward in interface Throttle
      Overrides:
      setIsForward in class AbstractThrottle
      Parameters:
      forward - true if forward; false otherwise
    • setFunction

      public void setFunction(int func, boolean value)
      Set Loco Function and send to Layout.
      Specified by:
      setFunction in interface Throttle
      Overrides:
      setFunction in class AbstractThrottle
      Parameters:
      func - Function Number, 0-28
      value - New Function State. True on, false off.
    • sendFunctionGroup1

      public void sendFunctionGroup1()
      Send the message to set the state of functions F0, F1, F2, F3, F4.

      This is used in the setFn implementations provided in this class, but a real implementation needs to be provided.

      Overrides:
      sendFunctionGroup1 in class AbstractThrottle
    • sendFunctionGroup2

      public void sendFunctionGroup2()
      Send the message to set the state of functions F5, F6, F7, F8.

      This is used in the setFn implementations provided in this class, but a real implementation needs to be provided.

      Overrides:
      sendFunctionGroup2 in class AbstractThrottle
    • sendFunctionGroup3

      public void sendFunctionGroup3()
      Send the message to set the state of functions F9, F10, F11, F12.

      This is used in the setFn implementations provided in this class, but a real implementation needs to be provided.

      Overrides:
      sendFunctionGroup3 in class AbstractThrottle
    • getLocoAddress

      Locomotive address. The exact format is defined by the specific implementation, as subclasses of LocoAddress will contain different information.

      This is an unbound property.

      Returns:
      The locomotive address
    • throttleDispose

      public void throttleDispose()
      Dispose when finished with this Throttle. May be used in tests for cleanup. Throttles normally call AbstractThrottle.finishRecord() here.
      Specified by:
      throttleDispose in class AbstractThrottle