Class BiDiBOutputMessageHandler

  • All Implemented Interfaces:
    org.bidib.jbidibc.core.MessageListener

    public class BiDiBOutputMessageHandler
    extends org.bidib.jbidibc.core.DefaultMessageListener
    This class handles output to: - BiDiB Accessories - DCC Accessories via command station - BiDiB LC Ports Output value is sent to the type according to the address type. Incoming messages a are catched by the BiDiB Message listener, then some common processing takes place and the new value is sent back to the listener of this class instance.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.bidib.jbidibc.messages.enums.LcOutputType lcType  
      (package private) java.lang.Object portConfigLock  
      protected org.bidib.jbidibc.messages.LcConfigX portConfigx  
      protected org.bidib.jbidibc.messages.message.BidibRequestFactory requestFactory  
      protected BiDiBTrafficController tc  
      protected java.lang.String type  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accessoryState​(byte[] address, int messageNum, org.bidib.jbidibc.messages.AccessoryState accessoryState, org.bidib.jbidibc.messages.AccessoryStateOptions accessoryStateOptions)  
      void csAccessoryAcknowledge​(byte[] address, int messageNum, int decoderAddress, org.bidib.jbidibc.messages.enums.AccessoryAcknowledge acknowledge)  
      void csAccessoryManual​(byte[] address, int messageNum, org.bidib.jbidibc.messages.AddressData decoderAddress, org.bidib.jbidibc.messages.enums.ActivateCoilEnum activate, int aspect)  
      void errorState​(int err)
      Notify error state
      org.bidib.jbidibc.messages.LcConfigX getConfigX()
      Get the port configuration if output is a BiDiB port
      org.bidib.jbidibc.messages.enums.LcOutputType getLcType()
      Get the port output type if output is a BiDiB port
      void lcConfig​(byte[] address, int messageNum, org.bidib.jbidibc.messages.LcConfig lcConfig)  
      void lcConfigX​(byte[] address, int messageNum, org.bidib.jbidibc.messages.LcConfigX lcConfigX)  
      void lcNa​(byte[] address, int messageNum, org.bidib.jbidibc.messages.BidibPort bidibPort, java.lang.Integer errorCode)  
      void lcStat​(byte[] address, int messageNum, org.bidib.jbidibc.messages.BidibPort bidibPort, int portStatus)  
      void lcWait​(byte[] address, int messageNum, org.bidib.jbidibc.messages.BidibPort bidibPort, int time)  
      void newLcConfigX​(org.bidib.jbidibc.messages.LcConfigX lcConfigX, org.bidib.jbidibc.messages.enums.LcOutputType lcType)
      Notify LC port ConfigX
      void newOutputState​(int state)
      Notify output state
      void outputWait​(int time)
      Notify output will change later
      void sendOutput​(int portstat)
      Send output request to traffic controller Send new port value or aspect value
      void sendQuery()
      Send output query request to traffic controller
      void sendQueryConfig()  
      void waitQueryConfig()  
      • Methods inherited from class org.bidib.jbidibc.core.DefaultMessageListener

        accessoryParameter, address, boosterDiag, boosterState, confidence, csDccAdvAckn, csDccAdvTid, csDriveAcknowledge, csDriveManual, csDriveState, csPomAcknowledge, csProgState, csRcPlusBindAnswer, csRcPlusFindAnswer, csRcPlusPingAcknState, csRcPlusTid, csState, dynState, error, feature, featureCount, featureNotAvailable, feedbackAccessory, feedbackCv, feedbackDccAInfoFirmwareId, feedbackDccAInfoFullName, feedbackDccAInfoProductName, feedbackDccAInfoShortGui, feedbackDccAInfoShortInfo, feedbackDccAInfoShortName, feedbackDccALogonAssignAck, feedbackDccALogonCollision, feedbackDccALogonNewDid, feedbackRcPlusBindAccepted, feedbackRcPlusFindCollision, feedbackRcPlusPingCollision, feedbackRcPlusPongNew, feedbackRcPlusPongOkay, feedbackXPom, feedbackXPom, firmwareUpdateStat, identify, internalError, lcKey, lcMacro, lcMacroParameter, lcMacroState, localBidibUp, localLogoff, localPong, nodeLost, nodeNew, nodeString, nodeTab, nodeTabCount, occupancyMultiple, pong, position, speed, stall, sysMagic, sysProtocolVersion, sysSoftwareVersion, sysUniqueId, vendor, vendorAck
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.bidib.jbidibc.core.MessageListener

        occupation
    • Method Detail

      • getConfigX

        public org.bidib.jbidibc.messages.LcConfigX getConfigX()
        Get the port configuration if output is a BiDiB port
        Returns:
        port ConfigX or null if not a BiDiB port
      • getLcType

        public org.bidib.jbidibc.messages.enums.LcOutputType getLcType()
        Get the port output type if output is a BiDiB port
        Returns:
        port output type or null if not a BiDiB port
      • sendOutput

        public void sendOutput​(int portstat)
        Send output request to traffic controller Send new port value or aspect value
        Parameters:
        portstat - BiDiB output value (see protocol description for valid values)
      • sendQuery

        public void sendQuery()
        Send output query request to traffic controller
      • newOutputState

        public void newOutputState​(int state)
        Notify output state
        Parameters:
        state - desired state from NamedBean list
      • errorState

        public void errorState​(int err)
        Notify error state
        Parameters:
        err - - BiDiB error number
      • outputWait

        public void outputWait​(int time)
        Notify output will change later
        Parameters:
        time - in msec
      • newLcConfigX

        public void newLcConfigX​(org.bidib.jbidibc.messages.LcConfigX lcConfigX,
                                 org.bidib.jbidibc.messages.enums.LcOutputType lcType)
        Notify LC port ConfigX
        Parameters:
        lcConfigX - input
        lcType - input
      • accessoryState

        public void accessoryState​(byte[] address,
                                   int messageNum,
                                   org.bidib.jbidibc.messages.AccessoryState accessoryState,
                                   org.bidib.jbidibc.messages.AccessoryStateOptions accessoryStateOptions)
        Specified by:
        accessoryState in interface org.bidib.jbidibc.core.MessageListener
        Overrides:
        accessoryState in class org.bidib.jbidibc.core.DefaultMessageListener
      • csAccessoryAcknowledge

        public void csAccessoryAcknowledge​(byte[] address,
                                           int messageNum,
                                           int decoderAddress,
                                           org.bidib.jbidibc.messages.enums.AccessoryAcknowledge acknowledge)
        Specified by:
        csAccessoryAcknowledge in interface org.bidib.jbidibc.core.MessageListener
        Overrides:
        csAccessoryAcknowledge in class org.bidib.jbidibc.core.DefaultMessageListener
      • csAccessoryManual

        public void csAccessoryManual​(byte[] address,
                                      int messageNum,
                                      org.bidib.jbidibc.messages.AddressData decoderAddress,
                                      org.bidib.jbidibc.messages.enums.ActivateCoilEnum activate,
                                      int aspect)
        Specified by:
        csAccessoryManual in interface org.bidib.jbidibc.core.MessageListener
        Overrides:
        csAccessoryManual in class org.bidib.jbidibc.core.DefaultMessageListener
      • lcStat

        public void lcStat​(byte[] address,
                           int messageNum,
                           org.bidib.jbidibc.messages.BidibPort bidibPort,
                           int portStatus)
        Specified by:
        lcStat in interface org.bidib.jbidibc.core.MessageListener
        Overrides:
        lcStat in class org.bidib.jbidibc.core.DefaultMessageListener
      • lcWait

        public void lcWait​(byte[] address,
                           int messageNum,
                           org.bidib.jbidibc.messages.BidibPort bidibPort,
                           int time)
        Specified by:
        lcWait in interface org.bidib.jbidibc.core.MessageListener
        Overrides:
        lcWait in class org.bidib.jbidibc.core.DefaultMessageListener
      • lcNa

        public void lcNa​(byte[] address,
                         int messageNum,
                         org.bidib.jbidibc.messages.BidibPort bidibPort,
                         java.lang.Integer errorCode)
        Specified by:
        lcNa in interface org.bidib.jbidibc.core.MessageListener
        Overrides:
        lcNa in class org.bidib.jbidibc.core.DefaultMessageListener
      • lcConfig

        public void lcConfig​(byte[] address,
                             int messageNum,
                             org.bidib.jbidibc.messages.LcConfig lcConfig)
        Specified by:
        lcConfig in interface org.bidib.jbidibc.core.MessageListener
        Overrides:
        lcConfig in class org.bidib.jbidibc.core.DefaultMessageListener
      • lcConfigX

        public void lcConfigX​(byte[] address,
                              int messageNum,
                              org.bidib.jbidibc.messages.LcConfigX lcConfigX)
        Specified by:
        lcConfigX in interface org.bidib.jbidibc.core.MessageListener
        Overrides:
        lcConfigX in class org.bidib.jbidibc.core.DefaultMessageListener