jmri.jmrix.tchtech.serial
Class SerialTurnout

java.lang.Object
  extended by jmri.AbstractNamedBean
      extended by jmri.AbstractTurnout
          extended by jmri.jmrix.tchtech.serial.SerialTurnout
All Implemented Interfaces:
PropertyChangeListener, Serializable, EventListener, NamedBean, Turnout

public class SerialTurnout
extends AbstractTurnout

SerialTurnout.java This object doesn't listen to the TCH Technology 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. Turnouts may be controlled by one or two output bits. If a turnout is controlled by two output bits, the output bits must be on the same node, the address must point to the first output bit, and the second output bit must follow the output bit in the address. Valid states for the two bits controlling the two-bit turnout are: ON OFF, and OFF ON for the two bits. Description: extend jmri.AbstractTurnout for TCH Technology serial layouts

Author:
Bob Jacobsen Copyright (C) 2003
See Also:
Serialized Form

Field Summary
protected  Timer mPulseClosedTimer
           
protected  Timer mPulseThrownTimer
           
protected  boolean mPulseTimerOn
           
protected  int tBit
           
protected  SerialNode tNode
           
 
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
SerialTurnout(String systemName, String userName)
          Create a Turnout object, with both system and user names.
 
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 by sending a turnout command
protected  void sendMessage(boolean closed)
           
protected  void turnoutPushbuttonLockout(boolean _pushButtonLockout)
           
 
Methods inherited from class jmri.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, setCommandedState, 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

tBit

protected int tBit

tNode

protected SerialNode tNode

mPulseClosedTimer

protected Timer mPulseClosedTimer

mPulseThrownTimer

protected Timer mPulseThrownTimer

mPulseTimerOn

protected boolean mPulseTimerOn
Constructor Detail

SerialTurnout

public SerialTurnout(String systemName,
                     String userName)
Create a Turnout object, with both system and user names.

'systemName' was previously validated in SerialTurnoutManager

Method Detail

forwardCommandChangeToLayout

protected void forwardCommandChangeToLayout(int s)
Handle a request to change state by sending a turnout command

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

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

turnoutPushbuttonLockout

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

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

sendMessage

protected void sendMessage(boolean closed)


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