Package jmri.jmrix.can.cbus
Class CbusTurnout
- java.lang.Object
-
- jmri.implementation.AbstractNamedBean
-
- jmri.implementation.AbstractTurnout
-
- jmri.jmrix.can.cbus.CbusTurnout
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.lang.Comparable<NamedBean>
,java.util.EventListener
,PropertyChangeProvider
,DigitalIO
,AbstractMRListener
,CanListener
,CbusEventInterface
,NamedBean
,Turnout
,VariableControlSpanBean
public class CbusTurnout extends AbstractTurnout implements CanListener, CbusEventInterface
Turnout for CBUS connections.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
-
-
Field Summary
-
Fields inherited from class jmri.implementation.AbstractTurnout
_activeFeedbackType, _cabLockout, _decoderName, _enableCabLockout, _enablePushButtonLockout, _inverted, _pushButtonLockout, _reportLocked, _validDecoderNames, _validFeedbackModes, _validFeedbackNames, _validFeedbackTypes, binaryOutput, DELAYED_FEEDBACK_INTERVAL, inhibitOperation, myOperator, myTurnoutOperation, r, thr
-
Fields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, register
-
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
Fields inherited from interface jmri.Turnout
CABLOCKOUT, CLOSED, DELAYED, DIRECT, EXACT, INDIRECT, LNALTERNATE, LOCKED, MONITORING, ONESENSOR, PUSHBUTTONLOCKOUT, SIGNAL, THROWN, TWOSENSOR, UNLOCKED
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CbusTurnout(java.lang.String prefix, java.lang.String address, TrafficController tc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canInvert()
Determine if the turnouts can be inverted.void
dispose()
Deactivate this object, so that it releases as many resources as possible and no longer effects others.protected void
forwardCommandChangeToLayout(int newState)
Handle a request to change state, typically by sending a message to the layout in some child class.CanMessage
getAddrClosed()
Package method returning CanMessage for the Closed Turnout AddressCanMessage
getAddrThrown()
Package method returning CanMessage for the Thrown Turnout Address.CanMessage
getBeanOffMessage()
Get event for primary Bean Off Action.CanMessage
getBeanOnMessage()
Get event for primary Bean On Action.void
message(CanMessage f)
Called when an outgoing message is sent to the CAN Network.void
reply(CanReply origf)
Called when an incoming CanFrame is received from the CAN Network.void
requestUpdateFromLayout()
Request an update on status by sending CBUS request message to thrown address.protected void
turnoutPushbuttonLockout(boolean locked)
-
Methods inherited from class jmri.implementation.AbstractTurnout
canLock, describeState, enableLockOperation, forwardCommandChangeToLayout, getBeanType, getCommandedState, getControlType, getCurrentOperator, getDecoderName, getDivergingLimit, getDivergingSpeed, getFeedbackMode, getFeedbackModeForOperation, getFeedbackModeName, getFirstNamedSensor, getFirstSensor, getInhibitOperation, getInverted, getKnownState, getLeadingTurnout, getLocked, getNumberControlBits, getPossibleLockModes, getReportLocked, getSecondNamedSensor, getSecondSensor, getState, getStraightLimit, getStraightSpeed, getTurnoutOperation, getTurnoutOperator, getUsageReport, getValidDecoderNames, getValidFeedbackModes, getValidFeedbackNames, getValidFeedbackTypes, isCanFollow, isConsistentState, isFollowingCommandedState, leadingTurnoutPropertyChange, newCommandedState, newKnownState, operationPropertyChange, propertyChange, provideFirstFeedbackNamedSensor, provideFirstFeedbackSensor, provideSecondFeedbackNamedSensor, provideSecondFeedbackSensor, sensorPropertyChange, setBinaryOutput, setCommandedState, setCommandedStateAtInterval, setControlType, setDecoderName, setDivergingSpeed, setFeedbackMode, setFeedbackMode, setFollowingCommandedState, setInhibitOperation, setInitialKnownStateFromFeedback, setInverted, setLeadingTurnout, setLeadingTurnout, setLocked, setNumberControlBits, setReportLocked, setState, setStraightSpeed, setTurnoutOperation, stateChangeCheck, statesOk, turnoutPushbuttonLockout, vetoableChange
-
Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, equals, firePropertyChange, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, hashCode, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setComment, setProperty, setUserName, toString, toStringSuffix, updateListenerRef
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jmri.jmrix.can.CanListener
addTc, addTc, removeTc, removeTc
-
Methods inherited from interface jmri.jmrix.can.cbus.CbusEventInterface
checkEvent
-
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRef
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from interface jmri.Turnout
provideFeedbackSensor
-
-
-
-
Constructor Detail
-
CbusTurnout
protected CbusTurnout(java.lang.String prefix, java.lang.String address, TrafficController tc)
-
-
Method Detail
-
requestUpdateFromLayout
public void requestUpdateFromLayout()
Request an update on status by sending CBUS request message to thrown address.- Specified by:
requestUpdateFromLayout
in interfaceDigitalIO
- Overrides:
requestUpdateFromLayout
in classAbstractTurnout
-
forwardCommandChangeToLayout
protected void forwardCommandChangeToLayout(int newState)
Handle a request to change state, typically by sending a message to the layout in some child class. Public version (used by TurnoutOperator) sends the current commanded state without changing it. Implementing classes will typically check the value of s and send a system specific sendMessage command. Sends a CBUS event.- Specified by:
forwardCommandChangeToLayout
in classAbstractTurnout
- Parameters:
newState
- new state value
-
getAddrThrown
public CanMessage getAddrThrown()
Package method returning CanMessage for the Thrown Turnout Address.- Returns:
- CanMessage with the Thrown Address
-
getAddrClosed
public CanMessage getAddrClosed()
Package method returning CanMessage for the Closed Turnout Address- Returns:
- CanReply with the Closed Address
-
message
public void message(CanMessage f)
Called when an outgoing message is sent to the CAN Network.- Specified by:
message
in interfaceCanListener
- Parameters:
f
- the CanMessage being sent.- See Also:
CanListener.message(jmri.jmrix.can.CanMessage)
-
reply
public void reply(CanReply origf)
Called when an incoming CanFrame is received from the CAN Network.- Specified by:
reply
in interfaceCanListener
- Parameters:
origf
- the CanReply being received.- See Also:
CanListener.reply(jmri.jmrix.can.CanReply)
-
turnoutPushbuttonLockout
protected void turnoutPushbuttonLockout(boolean locked)
- Specified by:
turnoutPushbuttonLockout
in classAbstractTurnout
-
canInvert
public boolean canInvert()
Determine if the turnouts can be inverted. If true, inverted turnouts are supported.- Specified by:
canInvert
in interfaceTurnout
- Overrides:
canInvert
in classAbstractTurnout
- Returns:
- invert supported
-
getBeanOnMessage
public CanMessage getBeanOnMessage()
Get event for primary Bean On Action. e.g. without inversion, Light On.- Specified by:
getBeanOnMessage
in interfaceCbusEventInterface
- Returns:
- Event for the Action, may be null
-
getBeanOffMessage
public CanMessage getBeanOffMessage()
Get event for primary Bean Off Action. e.g. without Inversion Light Off.- Specified by:
getBeanOffMessage
in interfaceCbusEventInterface
- Returns:
- Event for the Action, may be null
-
dispose
public void dispose()
Deactivate this object, so that it releases as many resources as possible and no longer effects others.For example, if this object has listeners, after a call to this method it should no longer notify those listeners. Any native or system-wide resources it maintains should be released, including threads, files, etc.
It is an error to invoke any other methods on this object once dispose() has been called. Note, however, that there is no guarantee about behavior in that case.
Afterwards, references to this object may still exist elsewhere, preventing its garbage collection. But it's formally dead, and shouldn't be keeping any other objects alive. Therefore, this method should null out any references to other objects that this NamedBean contained.
- Specified by:
dispose
in interfaceNamedBean
- Overrides:
dispose
in classAbstractTurnout
-
-