Class DCCppThrottleManager

    • Method Detail

      • requestThrottleSetup

        public void requestThrottleSetup​(LocoAddress address,
                                         boolean control)
        Request a new throttle object be created for the address, and let the throttle listeners know about it. 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.
      • singleUse

        protected boolean singleUse()
        DCC++ based systems can have multiple throttles for the same device

        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
      • canBeLongAddress

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

        public boolean canBeShortAddress​(int address)
        Address between 1 and 127 is a short address
        Specified by:
        canBeShortAddress in interface ThrottleManager
        Parameters:
        address - address number to test
        Returns:
        true if address can be short; false otherwise
      • isLongAddress

        protected static boolean isLongAddress​(int num)
        Local method for deciding short/long address. (is it?)
        Parameters:
        num - the address number to check.
        Returns:
        true if number greater than or equals 128.
      • message

        public void message​(DCCppReply r)
        Description copied from interface: DCCppListener
        Member function that will be invoked by a DCCppInterface implementation to forward a DCC++ message from the layout.
        Specified by:
        message in interface DCCppListener
        Parameters:
        r - The received DCC++ message. Note that this same object may be presented to multiple users. It should not be modified here.
      • message

        public void message​(DCCppMessage l)
        Description copied from interface: DCCppListener
        Member function that will be invoked by a DCCppInterface implementation to forward a DCC++ message sent to the layout. Normally, this function will do nothing.
        Specified by:
        message in interface DCCppListener
        Parameters:
        l - The received DCC++ message. Note that this same object may be presented to multiple users. It should not be modified here.
      • notifyTimeout

        public void notifyTimeout​(DCCppMessage msg)
        Description copied from interface: DCCppListener
        Member function invoked by an DCCppInterface implementation to notify a sender that an outgoing message timed out and was dropped from the queue.
        Specified by:
        notifyTimeout in interface DCCppListener
        Parameters:
        msg - the message that timed out.