jmri.jmrix.lenz
Class XNetTurnout

java.lang.Object
  extended by jmri.AbstractNamedBean
      extended by jmri.AbstractTurnout
          extended by jmri.jmrix.lenz.XNetTurnout
All Implemented Interfaces:
PropertyChangeListener, Serializable, EventListener, AbstractMRListener, XNetListener, NamedBean, Turnout
Direct Known Subclasses:
EliteXNetTurnout

public class XNetTurnout
extends AbstractTurnout
implements XNetListener

See Also:
Serialized Form

Field Summary
protected  int mNumber
           
 
Fields inherited from class jmri.AbstractTurnout
_activeFeedbackType, _cabLockout, _decoderName, _enableCabLockout, _enablePushButtonLockout, _inverted, _pushButtonLockout, _reportLocked, _validDecoderNames, _validFeedbackModes, _validFeedbackNames, _validFeedbackTypes, inhibitOperation, myOperator, myTurnoutOperation
 
Fields inherited from interface jmri.Turnout
CABLOCKOUT, CLOSED, DIRECT, EXACT, INDIRECT, LOCKED, MONITORING, ONESENSOR, PUSHBUTTONLOCKOUT, SIGNAL, THROWN, TWOSENSOR, UNLOCKED
 
Fields inherited from interface jmri.NamedBean
INCONSISTENT, UNKNOWN
 
Constructor Summary
XNetTurnout(int pNumber)
           
 
Method Summary
 void dispose()
          Deactivate this object, so that it releases as many resources as possible and no longer effects others.
protected  void forwardCommandChangeToLayout(int s)
          Handle a request to change state, typically by sending a message to the layout in some child class.
 int getNumber()
           
 void message(XNetMessage l)
          Member function that will be invoked by a XNetInterface implementation to forward a XNet message sent to the layout.
 void message(XNetReply l)
          Member function that will be invoked by a XNetInterface implementation to forward a XNet message from the layout.
 void requestUpdateFromLayout()
          request an update on status by sending an XPressNet message
 void setCommandedState(int s)
          Public access to changing turnout state.
protected  void turnoutPushbuttonLockout(boolean _pushButtonLockout)
           
 
Methods inherited from class jmri.AbstractTurnout
canInvert, canLock, enableLockOperation, forwardCommandChangeToLayout, getCommandedState, getControlType, getCurrentOperator, getDecoderName, getFeedbackMode, getFeedbackModeForOperation, getFeedbackModeName, getFirstSensor, getInhibitOperation, getInverted, getKnownState, getLocked, getNumberOutputBits, getReportLocked, getSecondSensor, getState, getTurnoutOperation, getTurnoutOperator, getValidDecoderNames, getValidFeedbackNames, getValidFeedbackTypes, isConsistentState, newCommandedState, newKnownState, operationPropertyChange, propertyChange, provideFirstFeedbackSensor, provideSecondFeedbackSensor, sensorPropertyChange, setControlType, setDecoderName, setFeedbackMode, setFeedbackMode, setInhibitOperation, setInitialKnownStateFromFeedback, setInverted, setLocked, setNumberOutputBits, setReportLocked, setState, setTurnoutOperation, turnoutPushbuttonLockout
 
Methods inherited from class jmri.AbstractNamedBean
addPropertyChangeListener, firePropertyChange, getComment, getNumPropertyChangeListeners, getSystemName, getUserName, removePropertyChangeListener, setComment, setUserName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, getComment, getNumPropertyChangeListeners, getSystemName, getUserName, removePropertyChangeListener, setComment, setUserName
 

Field Detail

mNumber

protected int mNumber
Constructor Detail

XNetTurnout

public XNetTurnout(int pNumber)
Method Detail

getNumber

public int getNumber()

setCommandedState

public void setCommandedState(int s)
Description copied from class: AbstractTurnout
Public access to changing turnout state. Sets the commanded state and, if appropriate starts a TurnoutOperator to do its thing. If there is no TurnoutOperator (not required or nothing suitable) then just tell the layout and hope for the best.

Specified by:
setCommandedState in interface Turnout
Overrides:
setCommandedState in class AbstractTurnout

forwardCommandChangeToLayout

protected void forwardCommandChangeToLayout(int s)
Description copied from class: AbstractTurnout
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.

Specified by:
forwardCommandChangeToLayout in class AbstractTurnout
Parameters:
s - new state value

turnoutPushbuttonLockout

protected void turnoutPushbuttonLockout(boolean _pushButtonLockout)
Specified by:
turnoutPushbuttonLockout in class AbstractTurnout

requestUpdateFromLayout

public void requestUpdateFromLayout()
request an update on status by sending an XPressNet message


message

public void message(XNetReply l)
Description copied from interface: XNetListener
Member function that will be invoked by a XNetInterface implementation to forward a XNet message from the layout.

Specified by:
message in interface XNetListener
Parameters:
l - The received XNet message. Note that this same object may be presented to multiple users. It should not be modified here.

message

public void message(XNetMessage l)
Description copied from interface: XNetListener
Member function that will be invoked by a XNetInterface implementation to forward a XNet message sent to the layout. Normally, this function will do nothing.

Specified by:
message in interface XNetListener
Parameters:
l - The received XNet message. Note that this same object may be presented to multiple users. It should not be modified here.

dispose

public void dispose()
Description copied from interface: NamedBean
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 interface NamedBean
Overrides:
dispose in class AbstractTurnout


Copyright © 1997 - 2008 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: SourceForge_Logo