jmri.implementation
Class SE8cSignalHead

java.lang.Object
  extended by jmri.implementation.AbstractNamedBean
      extended by jmri.implementation.AbstractSignalHead
          extended by jmri.implementation.DefaultSignalHead
              extended by jmri.implementation.SE8cSignalHead
All Implemented Interfaces:
Serializable, NamedBean, SignalHead

public class SE8cSignalHead
extends DefaultSignalHead

Extend jmri.SignalHead for signals implemented by an SE8c

This implementation writes out to the physical signal when it's commanded to change appearance, and updates its internal state when it hears commands from other places.

To get a complete set of aspects, we assume that the SE8C board has been configured such that the 4th aspect is "dark". We then do flashing aspects by commanding the lit appearance to change.

We can't assume any form of numbering for Turnouts to address the digits, so we take two turnout names as arguments. As a convenience, we manage the user names if they're not already set.

The algorithms in this class are a collaborative effort of Digitrax, Inc and Bob Jacobsen.

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

Field Summary
 
Fields inherited from class jmri.implementation.DefaultSignalHead
mFlashOn
 
Fields inherited from class jmri.implementation.AbstractSignalHead
mAppearance, mHeld, mLit
 
Fields inherited from class jmri.implementation.AbstractNamedBean
mSystemName, mUserName
 
Fields inherited from interface jmri.SignalHead
DARK, FLASHGREEN, FLASHLUNAR, FLASHRED, FLASHYELLOW, GREEN, LUNAR, RED, YELLOW
 
Fields inherited from interface jmri.NamedBean
INCONSISTENT, UNKNOWN
 
Constructor Summary
SE8cSignalHead(int pNumber)
          Compatibility ctor
SE8cSignalHead(int pNumber, String userName)
          Compatibility ctor
SE8cSignalHead(NamedBeanHandle<Turnout> lowTO, NamedBeanHandle<Turnout> highTO)
          Primary ctor without user name
SE8cSignalHead(NamedBeanHandle<Turnout> lowTO, NamedBeanHandle<Turnout> highTO, String userName)
          Primary ctor
SE8cSignalHead(String sname, NamedBeanHandle<Turnout> lowTO, NamedBeanHandle<Turnout> highTO)
          Ctor for specifying system name
SE8cSignalHead(String sname, NamedBeanHandle<Turnout> lowTO, NamedBeanHandle<Turnout> highTO, String userName)
          Ctor for specifying system name
 
Method Summary
 void dispose()
          Deactivate this object, so that it releases as many resources as possible and no longer effects others.
 NamedBeanHandle<Turnout> getHigh()
           
 NamedBeanHandle<Turnout> getLow()
           
 String getSystemName()
          Get a system-specific name.
protected  void updateOutput()
          Type-specific routine to handle output to the layout hardware.
 
Methods inherited from class jmri.implementation.DefaultSignalHead
getValidStateNames, getValidStates, setAppearance, setHeld, setLit, startFlash, stopFlash
 
Methods inherited from class jmri.implementation.AbstractSignalHead
getAppearance, getAppearanceName, getAppearanceName, getDefaultStateName, getDefaultValidStateNames, getDefaultValidStates, getHeld, getLit, getState, setState
 
Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getComment, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyKeys, 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, getUserName, removePropertyChangeListener, setComment, setProperty, setUserName, updateListenerRef
 

Constructor Detail

SE8cSignalHead

public SE8cSignalHead(NamedBeanHandle<Turnout> lowTO,
                      NamedBeanHandle<Turnout> highTO,
                      String userName)
Primary ctor

Parameters:
lowTO - Lower-numbered Turnout reference
highTO - higher-numbered Turnout reference

SE8cSignalHead

public SE8cSignalHead(NamedBeanHandle<Turnout> lowTO,
                      NamedBeanHandle<Turnout> highTO)
Primary ctor without user name

Parameters:
lowTO - Lower-numbered Turnout reference
highTO - higher-numbered Turnout reference

SE8cSignalHead

public SE8cSignalHead(String sname,
                      NamedBeanHandle<Turnout> lowTO,
                      NamedBeanHandle<Turnout> highTO,
                      String userName)
Ctor for specifying system name

Parameters:
lowTO - Lower-numbered Turnout reference
highTO - higher-numbered Turnout reference

SE8cSignalHead

public SE8cSignalHead(String sname,
                      NamedBeanHandle<Turnout> lowTO,
                      NamedBeanHandle<Turnout> highTO)
Ctor for specifying system name

Parameters:
lowTO - Lower-numbered Turnout reference
highTO - higher-numbered Turnout reference

SE8cSignalHead

public SE8cSignalHead(int pNumber,
                      String userName)
Compatibility ctor

Parameters:
pNumber - number (address) of low turnout

SE8cSignalHead

public SE8cSignalHead(int pNumber)
Compatibility ctor

Parameters:
pNumber - number (address) of low turnout
Method Detail

getSystemName

public String getSystemName()
Description copied from interface: NamedBean
Get a system-specific name. This encodes the hardware addressing information.

Specified by:
getSystemName in interface NamedBean
Overrides:
getSystemName in class AbstractNamedBean

updateOutput

protected void updateOutput()
Description copied from class: DefaultSignalHead
Type-specific routine to handle output to the layout hardware. Does not notify listeners of changes; that's done elsewhere. Should use the following variables to determine what to send:

Specified by:
updateOutput in class DefaultSignalHead

getLow

public NamedBeanHandle<Turnout> getLow()

getHigh

public NamedBeanHandle<Turnout> getHigh()

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 AbstractNamedBean


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