Class OlcbThrottle

    • Field Detail

      • ot

        final org.openlcb.implementations.throttle.TractionThrottle ot
      • speedListener

        org.openlcb.implementations.VersionedValueListener<java.lang.Float> speedListener
      • fnListeners

        java.util.List<org.openlcb.implementations.VersionedValueListener<java.lang.Boolean>> fnListeners
    • Method Detail

      • guessDCCNodeID

        public static org.openlcb.NodeID guessDCCNodeID​(boolean isLong,
                                                        int dccAddress)
      • getLocoAddress

        public LocoAddress 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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • 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 functionNum,
                                boolean newState)
        Set Loco Function and send to Layout.
        Specified by:
        setFunction in interface Throttle
        Overrides:
        setFunction in class AbstractThrottle
        Parameters:
        functionNum - Function Number, 0-28
        newState - New Function State. True on, false off.