Package jmri.jmrix.bidib
Class BiDiBOutputMessageHandler
- java.lang.Object
-
- org.bidib.jbidibc.core.DefaultMessageListener
-
- jmri.jmrix.bidib.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
-
Constructor Summary
Constructors Constructor Description BiDiBOutputMessageHandler(BiDiBNamedBeanInterface nb, java.lang.String type, BiDiBTrafficController tc)
-
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 stateorg.bidib.jbidibc.messages.LcConfigX
getConfigX()
Get the port configuration if output is a BiDiB portorg.bidib.jbidibc.messages.enums.LcOutputType
getLcType()
Get the port output type if output is a BiDiB portvoid
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 ConfigXvoid
newOutputState(int state)
Notify output statevoid
outputWait(int time)
Notify output will change latervoid
sendOutput(int portstat)
Send output request to traffic controller Send new port value or aspect valuevoid
sendQuery()
Send output query request to traffic controllervoid
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
-
-
-
-
Field Detail
-
tc
protected BiDiBTrafficController tc
-
type
protected java.lang.String type
-
portConfigx
protected org.bidib.jbidibc.messages.LcConfigX portConfigx
-
lcType
protected org.bidib.jbidibc.messages.enums.LcOutputType lcType
-
requestFactory
protected org.bidib.jbidibc.messages.message.BidibRequestFactory requestFactory
-
portConfigLock
final java.lang.Object portConfigLock
-
-
Constructor Detail
-
BiDiBOutputMessageHandler
BiDiBOutputMessageHandler(BiDiBNamedBeanInterface nb, java.lang.String type, BiDiBTrafficController tc)
-
-
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)
-
sendQueryConfig
public void sendQueryConfig()
-
waitQueryConfig
public void waitQueryConfig()
-
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
- inputlcType
- 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 interfaceorg.bidib.jbidibc.core.MessageListener
- Overrides:
accessoryState
in classorg.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 interfaceorg.bidib.jbidibc.core.MessageListener
- Overrides:
csAccessoryAcknowledge
in classorg.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 interfaceorg.bidib.jbidibc.core.MessageListener
- Overrides:
csAccessoryManual
in classorg.bidib.jbidibc.core.DefaultMessageListener
-
lcStat
public void lcStat(byte[] address, int messageNum, org.bidib.jbidibc.messages.BidibPort bidibPort, int portStatus)
- Specified by:
lcStat
in interfaceorg.bidib.jbidibc.core.MessageListener
- Overrides:
lcStat
in classorg.bidib.jbidibc.core.DefaultMessageListener
-
lcWait
public void lcWait(byte[] address, int messageNum, org.bidib.jbidibc.messages.BidibPort bidibPort, int time)
- Specified by:
lcWait
in interfaceorg.bidib.jbidibc.core.MessageListener
- Overrides:
lcWait
in classorg.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 interfaceorg.bidib.jbidibc.core.MessageListener
- Overrides:
lcNa
in classorg.bidib.jbidibc.core.DefaultMessageListener
-
lcConfig
public void lcConfig(byte[] address, int messageNum, org.bidib.jbidibc.messages.LcConfig lcConfig)
- Specified by:
lcConfig
in interfaceorg.bidib.jbidibc.core.MessageListener
- Overrides:
lcConfig
in classorg.bidib.jbidibc.core.DefaultMessageListener
-
lcConfigX
public void lcConfigX(byte[] address, int messageNum, org.bidib.jbidibc.messages.LcConfigX lcConfigX)
- Specified by:
lcConfigX
in interfaceorg.bidib.jbidibc.core.MessageListener
- Overrides:
lcConfigX
in classorg.bidib.jbidibc.core.DefaultMessageListener
-
-