jmri.jmrix.ecos
Class EcosTurnout

java.lang.Object
  extended by jmri.implementation.AbstractNamedBean
      extended by jmri.implementation.AbstractTurnout
          extended by jmri.jmrix.ecos.EcosTurnout
All Implemented Interfaces:
PropertyChangeListener, Serializable, EventListener, AbstractMRListener, EcosListener, NamedBean, Turnout

public class EcosTurnout
extends AbstractTurnout
implements EcosListener

Implement a Turnout via Ecos communications.

This object doesn't listen to the Ecos communications. This is because it should be the only object that is sending messages for this turnout; more than one Turnout object pointing to a single device is not allowed.

Author:
Bob Jacobsen Copyright (C) 2001, Daniel Boudreau (C) 2007
See Also:
Serialized Form

Field Summary
static int DOUBLESLIP
           
static int THREEWAY
           
 
Fields inherited from class jmri.implementation.AbstractTurnout
_activeFeedbackType, _cabLockout, _decoderName, _enableCabLockout, _enablePushButtonLockout, _inverted, _pushButtonLockout, _reportLocked, _validDecoderNames, _validFeedbackModes, _validFeedbackNames, _validFeedbackTypes, binaryOutput, inhibitOperation, myOperator, myTurnoutOperation
 
Fields inherited from class jmri.implementation.AbstractNamedBean
mSystemName, mUserName
 
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
EcosTurnout(int number, String prefix, EcosTrafficController etc, EcosTurnoutManager etm)
          Ecos turnouts use the NMRA number (0-2044) as their numerical identification in the system name.
 
Method Summary
 boolean canInvert()
          ECOS turnouts can be inverted
protected  void forwardCommandChangeToLayout(int s)
          Handle a request to change state, typically by sending a message to the layout in some child class.
 int getExtended()
           
 int getNumber()
           
 int getObject()
           
 String getSlaveAddress()
           
 void message(EcosMessage m)
           
 void reply(EcosReply m)
           
protected  void sendMessage(boolean closed)
          Tell the layout to go to new state.
 void turnoutPushbuttonLockout(boolean b)
           
 
Methods inherited from class jmri.implementation.AbstractTurnout
canLock, dispose, enableLockOperation, forwardCommandChangeToLayout, getCommandedState, getControlType, getCurrentOperator, getDecoderName, getDivergingLimit, getDivergingSpeed, getFeedbackMode, getFeedbackModeForOperation, getFeedbackModeName, getFirstNamedSensor, getFirstSensor, getInhibitOperation, getInverted, getKnownState, getLocked, getNumberOutputBits, getReportLocked, getSecondNamedSensor, getSecondSensor, getState, getStraightLimit, getStraightSpeed, getTurnoutOperation, getTurnoutOperator, getValidDecoderNames, getValidFeedbackNames, getValidFeedbackTypes, isConsistentState, newCommandedState, newKnownState, operationPropertyChange, propertyChange, provideFirstFeedbackNamedSensor, provideFirstFeedbackSensor, provideSecondFeedbackNamedSensor, provideSecondFeedbackSensor, sensorPropertyChange, setBinaryOutput, setCommandedState, setControlType, setDecoderName, setDivergingSpeed, setFeedbackMode, setFeedbackMode, setInhibitOperation, setInitialKnownStateFromFeedback, setInverted, setLocked, setNumberOutputBits, setReportLocked, setState, setStraightSpeed, setTurnoutOperation, turnoutPushbuttonLockout
 
Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getComment, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyKeys, getSystemName, getUserName, removePropertyChangeListener, setComment, setProperty, setUserName, updateListenerRef
 
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, addPropertyChangeListener, getComment, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyKeys, getSystemName, getUserName, removePropertyChangeListener, setComment, setProperty, setUserName, updateListenerRef
 

Field Detail

THREEWAY

public static final int THREEWAY
See Also:
Constant Field Values

DOUBLESLIP

public static final int DOUBLESLIP
See Also:
Constant Field Values
Constructor Detail

EcosTurnout

public EcosTurnout(int number,
                   String prefix,
                   EcosTrafficController etc,
                   EcosTurnoutManager etm)
Ecos turnouts use the NMRA number (0-2044) as their numerical identification in the system name.

Parameters:
number - DCC address of the turnout
Method Detail

getNumber

public int getNumber()

getObject

public int getObject()

getExtended

public int getExtended()

getSlaveAddress

public String getSlaveAddress()

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

public void turnoutPushbuttonLockout(boolean b)
Specified by:
turnoutPushbuttonLockout in class AbstractTurnout

canInvert

public boolean canInvert()
ECOS turnouts can be inverted

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

sendMessage

protected void sendMessage(boolean closed)
Tell the layout to go to new state.

Parameters:
closed - State of the turnout to be sent to the command station

reply

public void reply(EcosReply m)
Specified by:
reply in interface EcosListener

message

public void message(EcosMessage m)
Specified by:
message in interface EcosListener


Copyright © 1997 - 2011 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