Class SerialThrottle

    • Field Detail

      • REPEAT_TIME

        static final int REPEAT_TIME
        This code block is necessary to support the send repeats of the repeatFunctionSendWhileOn(value, func); code above. This code block "Sends Again" if FkKey is still pressed/on, and repeats per the interval set in static final int REPEAT_TIME.
        See Also:
        Constant Field Values
    • Method Detail

      • 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
      • 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.
      • 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
      • sendFnToLayout

        protected void sendFnToLayout​(int value,
                                      int func)
        Send these messages to the layout and repeat while button is pressed/on.
        Parameters:
        value - Content of message to be sent in three bytes
        func - The number of the function being addressed