Package jmri.jmrix.roco.z21
Class Z21XNetTurnout
- java.lang.Object
-
- jmri.implementation.AbstractNamedBean
-
- jmri.implementation.AbstractTurnout
-
- jmri.jmrix.lenz.XNetTurnout
-
- jmri.jmrix.roco.z21.Z21XNetTurnout
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.lang.Comparable<NamedBean>
,java.util.EventListener
,PropertyChangeProvider
,DigitalIO
,AbstractMRListener
,XNetListener
,NamedBean
,Turnout
,VariableControlSpanBean
public class Z21XNetTurnout extends XNetTurnout
Extend jmri.jmrix.lenz.XNetTurnout for Roco Z21/z21 systems.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrix.lenz.XNetTurnout
XNetTurnout.RequestMessage
-
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.jmrix.lenz.XNetTurnout
_mClosed, _mThrown, _prefix, COMMANDSENT, IDLE, internalState, lastMsg, mNumber, OFFSENT, QUEUEDMESSAGE, requestList, STATUSREQUESTSENT, tc
-
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 Constructor Description Z21XNetTurnout(java.lang.String prefix, int pNumber, XNetTrafficController controller)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
forwardCommandChangeToLayout(int s)
Handle a request to change state, typically by sending a message to the layout in some child class.protected XNetMessage
getOffMessage(boolean state)
(package private) void
initMessageZ21(XNetReply l)
initmessage is a package proteceted class which allows the Manger to send a feedback message at initialization without changing the state of the turnout with respect to whether or not a feedback request was sent.void
message(XNetReply l)
Handle an incoming message from the XpressNet.void
notifyTimeout(XNetMessage msg)
Handle a timeout notification.void
requestUpdateFromLayout()
Request an update on status by sending an XpressNet message.protected void
sendOffMessage()
Send an "Off" message to the decoder for this output.protected void
sendOffMessage(int state)
-
Methods inherited from class jmri.jmrix.lenz.XNetTurnout
canInvert, dispose, getNumber, getOffMessage, message, queueMessage, sendQueuedMessage, setCommandedState, setInverted, turnoutPushbuttonLockout
-
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, setCommandedStateAtInterval, setControlType, setDecoderName, setDivergingSpeed, setFeedbackMode, setFeedbackMode, setFollowingCommandedState, setInhibitOperation, setInitialKnownStateFromFeedback, 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.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, 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
-
Z21XNetTurnout
public Z21XNetTurnout(java.lang.String prefix, int pNumber, XNetTrafficController controller)
-
-
Method Detail
-
forwardCommandChangeToLayout
protected void forwardCommandChangeToLayout(int s)
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 an XpressNet command. Sends an XpressNet command.- Overrides:
forwardCommandChangeToLayout
in classXNetTurnout
- Parameters:
s
- new state value
-
requestUpdateFromLayout
public void requestUpdateFromLayout()
Request an update on status by sending an XpressNet message.- Specified by:
requestUpdateFromLayout
in interfaceDigitalIO
- Overrides:
requestUpdateFromLayout
in classXNetTurnout
-
notifyTimeout
public void notifyTimeout(XNetMessage msg)
Description copied from class:XNetTurnout
Handle a timeout notification.- Specified by:
notifyTimeout
in interfaceXNetListener
- Overrides:
notifyTimeout
in classXNetTurnout
- Parameters:
msg
- message which has timed out.
-
initMessageZ21
void initMessageZ21(XNetReply l)
initmessage is a package proteceted class which allows the Manger to send a feedback message at initialization without changing the state of the turnout with respect to whether or not a feedback request was sent. This is used only when the turnout is created by on layout feedback.- Parameters:
l
- Init message
-
message
public void message(XNetReply l)
Description copied from class:XNetTurnout
Handle an incoming message from the XpressNet.- Specified by:
message
in interfaceXNetListener
- Overrides:
message
in classXNetTurnout
- Parameters:
l
- The received XNet message. Note that this same object may be presented to multiple users. It should not be modified here.
-
sendOffMessage
protected void sendOffMessage()
Description copied from class:XNetTurnout
Send an "Off" message to the decoder for this output.- Overrides:
sendOffMessage
in classXNetTurnout
-
sendOffMessage
protected void sendOffMessage(int state)
-
getOffMessage
protected XNetMessage getOffMessage(boolean state)
-
-