jmri.implementation
Class MergSD2SignalHead

Show UML class diagram
java.lang.Object
  extended by jmri.implementation.AbstractNamedBean
      extended by jmri.implementation.AbstractSignalHead
          extended by jmri.implementation.DefaultSignalHead
              extended by jmri.implementation.MergSD2SignalHead
All Implemented Interfaces:
Serializable, NamedBean, SignalHead

public class MergSD2SignalHead
extends DefaultSignalHead

Implement SignalHead for the MERG Signal Driver 2.

The Signal Driver , runs off of the output of a steady State Accessory decoder. and can be configured to run 2, 3 or 4 Aspect signals. With 2 or 3 aspect signals being able to have a feather included. The driver is designed to be used with UK based signals The class assigns turnout positions for RED, YELLOW, GREEN and Double Yellow aspects. THE SD2 does not support flashing double yellow aspects on turnouts, an alternative method is required to do this, as per the MERG SD2 documentation. nb As there is no Double Yellow asigned within JMRI, we use the Lunar instead.

For more info on the signals, see http://www.merg.info.

See Also:
Serialized Form

Field Summary
(package private) static org.slf4j.Logger log
           
(package private)  int mAspects
           
(package private)  boolean mFeather
           
(package private)  boolean mHome
           
(package private)  NamedBeanHandle<Turnout> mInput1
           
(package private)  NamedBeanHandle<Turnout> mInput2
           
(package private)  NamedBeanHandle<Turnout> mInput3
           
 
Fields inherited from class jmri.implementation.DefaultSignalHead
delay, mFlashOn, timer
 
Fields inherited from class jmri.implementation.AbstractSignalHead
mAppearance, mHeld, mLit
 
Fields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, mUserName, parameters, pcs, register
 
Fields inherited from interface jmri.SignalHead
DARK, FLASHGREEN, FLASHLUNAR, FLASHRED, FLASHYELLOW, GREEN, HELD, LUNAR, RED, YELLOW
 
Fields inherited from interface jmri.NamedBean
INCONSISTENT, UNKNOWN
 
Constructor Summary
MergSD2SignalHead(String sys, int aspect, NamedBeanHandle<Turnout> t1, NamedBeanHandle<Turnout> t2, NamedBeanHandle<Turnout> t3, boolean feather, boolean home)
           
MergSD2SignalHead(String sys, String user, int aspect, NamedBeanHandle<Turnout> t1, NamedBeanHandle<Turnout> t2, NamedBeanHandle<Turnout> t3, boolean feather, boolean home)
           
 
Method Summary
 void dispose()
          Remove references to and from this object, so that it can eventually be garbage-collected.
 int getAspects()
          Return the number of aspects for a given signal.
 boolean getFeather()
           
 boolean getHome()
          Returns whether the signal is a home or a distant/Repeater signal default is true.
 NamedBeanHandle<Turnout> getInput1()
           
 NamedBeanHandle<Turnout> getInput2()
           
 NamedBeanHandle<Turnout> getInput3()
           
 String[] getValidStateNames()
           
 int[] getValidStates()
           
 void setAppearance(int newAppearance)
           
 void setAspects(int i)
          Sets the number of aspects on the signal, valid aspects 2,3,4
 void setFeather(boolean boo)
           
 void setHome(boolean boo)
          Set wheather the signal is a home or distance/repeater signal
 void setInput1(NamedBeanHandle<Turnout> t)
          Sets the first turnout used on the driver Relates to the section directly infront of the Signal (2, 3 & 4 aspect Signals)
 void setInput2(NamedBeanHandle<Turnout> t)
          Sets the second turnout used on the driver Relates to the section in front of the next Signal (3 and 4 aspect Signal)
 void setInput3(NamedBeanHandle<Turnout> t)
          Sets the third turnout used on the driver Relates to the section directly in front the third Signal (4 aspect Signal)
 void setLit(boolean newLit)
           
protected  void updateOutput()
          Type-specific routine to handle output to the layout hardware.
 
Methods inherited from class jmri.implementation.DefaultSignalHead
setHeld, 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, getSystemName, getUserName, removeProperty, 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, removeProperty, removePropertyChangeListener, setComment, setProperty, setUserName, updateListenerRef
 

Field Detail

mInput1

NamedBeanHandle<Turnout> mInput1

mInput2

NamedBeanHandle<Turnout> mInput2

mInput3

NamedBeanHandle<Turnout> mInput3

mAspects

int mAspects

mFeather

boolean mFeather

mHome

boolean mHome

log

static org.slf4j.Logger log
Constructor Detail

MergSD2SignalHead

public MergSD2SignalHead(String sys,
                         String user,
                         int aspect,
                         NamedBeanHandle<Turnout> t1,
                         NamedBeanHandle<Turnout> t2,
                         NamedBeanHandle<Turnout> t3,
                         boolean feather,
                         boolean home)

MergSD2SignalHead

public MergSD2SignalHead(String sys,
                         int aspect,
                         NamedBeanHandle<Turnout> t1,
                         NamedBeanHandle<Turnout> t2,
                         NamedBeanHandle<Turnout> t3,
                         boolean feather,
                         boolean home)
Method Detail

setAppearance

public void setAppearance(int newAppearance)
Specified by:
setAppearance in interface SignalHead
Overrides:
setAppearance in class DefaultSignalHead

setLit

public void setLit(boolean newLit)
Specified by:
setLit in interface SignalHead
Overrides:
setLit in class DefaultSignalHead

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

dispose

public void dispose()
Remove references to and from this object, so that it can eventually be garbage-collected.

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

getInput1

public NamedBeanHandle<Turnout> getInput1()

getInput2

public NamedBeanHandle<Turnout> getInput2()

getInput3

public NamedBeanHandle<Turnout> getInput3()

getAspects

public int getAspects()
Return the number of aspects for a given signal.


getFeather

public boolean getFeather()

getHome

public boolean getHome()
Returns whether the signal is a home or a distant/Repeater signal default is true.


setInput1

public void setInput1(NamedBeanHandle<Turnout> t)
Sets the first turnout used on the driver Relates to the section directly infront of the Signal (2, 3 & 4 aspect Signals)


setInput2

public void setInput2(NamedBeanHandle<Turnout> t)
Sets the second turnout used on the driver Relates to the section in front of the next Signal (3 and 4 aspect Signal)


setInput3

public void setInput3(NamedBeanHandle<Turnout> t)
Sets the third turnout used on the driver Relates to the section directly in front the third Signal (4 aspect Signal)


setAspects

public void setAspects(int i)
Sets the number of aspects on the signal, valid aspects 2,3,4


setFeather

public void setFeather(boolean boo)

setHome

public void setHome(boolean boo)
Set wheather the signal is a home or distance/repeater signal


getValidStates

public int[] getValidStates()
Specified by:
getValidStates in interface SignalHead
Overrides:
getValidStates in class DefaultSignalHead

getValidStateNames

public String[] getValidStateNames()
Specified by:
getValidStateNames in interface SignalHead
Overrides:
getValidStateNames in class DefaultSignalHead


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