jmri.jmrix.lenz
Class XNetTurnout

java.lang.Object
  extended by jmri.implementation.AbstractNamedBean
      extended by jmri.implementation.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 _mClosed
           
protected  int _mThrown
           
protected static int COMMANDSENT
           
protected static int IDLE
           
protected  int InternalState
           
protected  int mNumber
           
protected static int OFFSENT
           
 
Fields inherited from class jmri.implementation.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
 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 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
protected  void sendOffMessage()
           
 void setCommandedState(int s)
          Public access to changing turnout state.
 void setInverted(boolean inverted)
          Set turnout inverted If true commands are reversed to layout
protected  void turnoutPushbuttonLockout(boolean _pushButtonLockout)
           
 
Methods inherited from class jmri.implementation.AbstractTurnout
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, setLocked, setNumberOutputBits, setReportLocked, setState, setTurnoutOperation, turnoutPushbuttonLockout
 
Methods inherited from class jmri.implementation.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

OFFSENT

protected static final int OFFSENT
See Also:
Constant Field Values

COMMANDSENT

protected static final int COMMANDSENT
See Also:
Constant Field Values

IDLE

protected static final int IDLE
See Also:
Constant Field Values

InternalState

protected int InternalState

_mThrown

protected int _mThrown

_mClosed

protected int _mClosed

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


setInverted

public void setInverted(boolean inverted)
Description copied from interface: Turnout
Set turnout inverted

If true commands are reversed to layout

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

canInvert

public boolean canInvert()
Description copied from class: AbstractTurnout
Determine if the turnouts can be inverted. If true inverted turnouts supported.

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

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.

sendOffMessage

protected void sendOffMessage()

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 - 2009 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: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads