Class DCCppLight

    • Constructor Detail

      • DCCppLight

        public DCCppLight​(DCCppTrafficController tc,
                          DCCppLightManager lm,
                          java.lang.String systemName)
        Create a Light object, with only system name.

        'systemName' was previously validated in DCCppLightManager

        Parameters:
        tc - the traffic controller for the connection
        lm - the managing LightManager for this Light
        systemName - the system name for this Light
      • DCCppLight

        public DCCppLight​(DCCppTrafficController tc,
                          DCCppLightManager lm,
                          java.lang.String systemName,
                          java.lang.String userName)
        Create a Light object, with both system and user names.

        'systemName' was previously validated in DCCppLightManager

        Parameters:
        tc - the traffic controller for the connection
        lm - the managing LightManager for this Light
        systemName - the system name for this Light
        userName - the user name for this Light
    • Method Detail

      • setState

        public void setState​(int newState)
        Set the current state of this Light. This routine requests the hardware to change.
        Specified by:
        setState in interface Light
        Specified by:
        setState in interface NamedBean
        Overrides:
        setState in class AbstractLight
        Parameters:
        newState - new state
      • message

        public void message​(DCCppReply l)
        Member function that will be invoked by a DCCppInterface implementation to forward a DCC++ message from the layout. Handle an incoming message from the DCC++ Base Station.

        NOTE: We aren't registered as a listener, so this is only triggered when we send out a message

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

        public void message​(DCCppMessage l)
        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. Listen for messages to the DCC++ Base Station.
        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.