Class MergSD2SignalHead
- All Implemented Interfaces:
VetoableChangeListener,Comparable<NamedBean>,EventListener,PropertyChangeProvider,NamedBean,Signal,SignalHead
The Signal Driver, runs off of the output of a steady State Accessory decoder. Can be configured to run 2, 3 or 4 Aspect signals. With 2 or 3 aspect signals it may 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, so an alternative method is required to do this, as per the MERG SD2 documentation.
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException -
Field Summary
FieldsModifier and TypeFieldDescription(package private) int(package private) boolean(package private) boolean(package private) NamedBeanHandle<Turnout>(package private) NamedBeanHandle<Turnout>(package private) NamedBeanHandle<Turnout>Fields inherited from class jmri.implementation.DefaultSignalHead
delay, masterDelay, mFlashOn, timerFields inherited from class jmri.implementation.AbstractSignalHead
mAppearance, mHeld, mLitFields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, registerFields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWNFields inherited from interface jmri.Signal
PROPERTY_HELD, PROPERTY_LITFields inherited from interface jmri.SignalHead
DARK, FLASHGREEN, FLASHLUNAR, FLASHRED, FLASHYELLOW, GREEN, HELD, LUNAR, PROPERTY_APPEARANCE, RED, YELLOW -
Constructor Summary
ConstructorsConstructorDescriptionMergSD2SignalHead(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
Modifier and TypeMethodDescriptionvoiddispose()Remove references to and from this object, so that it can eventually be garbage-collected.intReturn the number of aspects for this signal.booleanbooleangetHome()Return whether this signal is a home or a distant/Repeater signal.String[]Get an array of non-localized appearance keys valid for the mast type.String[]Get an array of localized appearance descriptions valid for the mast type.int[]Get an array of appearance indexes valid for the mast type.booleanCheck if a given turnout is used on this head.voidsetAppearance(int newAppearance) Set the Signal Head Appearance.voidsetAspects(int i) Set the number of aspects on the signal.voidsetFeather(boolean boo) voidsetHome(boolean boo) Set whether the signal is a home or distance/repeater signal.voidSet the first turnout used on the driver.voidSet the second turnout used on the driver.voidSet the third turnout used on the driver.voidsetLit(boolean newLit) protected voidType-specific routine to handle output to the layout hardware.Methods inherited from class jmri.implementation.DefaultSignalHead
appearanceSetsFlashTimer, getUsageReport, setHeld, startFlash, stopFlashMethods inherited from class jmri.implementation.AbstractSignalHead
describeState, getAppearance, getAppearanceKey, getAppearanceKey, getAppearanceName, getAppearanceName, getBeanType, getDefaultStateName, getDefaultValidStateNames, getDefaultValidStates, getHeld, getLit, getState, isAtStop, isCleared, isShowingRestricting, setState, vetoableChangeMethods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, equals, firePropertyChange, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, hashCode, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setComment, setProperty, setUserName, toString, toStringSuffix, updateListenerRefMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getSystemName, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRefMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
Constructor Details
-
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 Details
-
setAppearance
Set the Signal Head Appearance. Modified from DefaultSignalHead. Removed option for software flashing.- Specified by:
setAppearancein interfaceSignalHead- Overrides:
setAppearancein classDefaultSignalHead- Parameters:
newAppearance- integer representing a valid Appearance for this head
-
setLit
Description copied from interface:SignalHead- Specified by:
setLitin interfaceSignal- Specified by:
setLitin interfaceSignalHead- Overrides:
setLitin classDefaultSignalHead
-
updateOutput
Description copied from class:DefaultSignalHeadType-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:
- mAppearance
- mLit
- mFlashOn
- Specified by:
updateOutputin classDefaultSignalHead
-
dispose
Remove references to and from this object, so that it can eventually be garbage-collected.- Specified by:
disposein interfaceNamedBean- Overrides:
disposein classAbstractNamedBean
-
getInput1
-
getInput2
-
getInput3
-
getAspects
Return the number of aspects for this signal.- Returns:
- the number of aspects
-
getFeather
-
getHome
Return whether this signal is a home or a distant/Repeater signal.- Returns:
- true if signal is set up as Home signal (default); false if Distant
-
setInput1
Set the first turnout used on the driver. Relates to the section directly in front of the Signal (2, 3 & 4 aspect Signals).- Parameters:
t- turnout (named bean handel) to use as input 1
-
setInput2
Set the second turnout used on the driver. Relates to the section in front of the next Signal (3 and 4 aspect Signal).- Parameters:
t- turnout (named bean handel) to use as input 2
-
setInput3
Set the third turnout used on the driver. Relates to the section directly in front the third Signal (4 aspect Signal).- Parameters:
t- turnout (named bean handel) to use as input 3
-
setAspects
Set the number of aspects on the signal.- Parameters:
i- the number of aspects on mast; valid values: 2, 3, 4
-
setFeather
-
setHome
Set whether the signal is a home or distance/repeater signal.- Parameters:
boo- true if configuring as a Home signal, false for a Distant
-
getValidStates
Get an array of appearance indexes valid for the mast type.- Specified by:
getValidStatesin interfaceSignalHead- Overrides:
getValidStatesin classDefaultSignalHead- Returns:
- array of appearance state values available on this mast type
-
getValidStateKeys
Get an array of non-localized appearance keys valid for the mast type. For GUI application consider using (capitalized)SignalHead.getValidStateNames()- Specified by:
getValidStateKeysin interfaceSignalHead- Overrides:
getValidStateKeysin classDefaultSignalHead- Returns:
- array of translated appearance names available on this mast type
-
getValidStateNames
Get an array of localized appearance descriptions valid for the mast type. For persistance and comparison consider usingSignalHead.getValidStateKeys()- Specified by:
getValidStateNamesin interfaceSignalHead- Overrides:
getValidStateNamesin classDefaultSignalHead- Returns:
- array of translated appearance names
-
isTurnoutUsed
Description copied from class:AbstractSignalHeadCheck if a given turnout is used on this head.- Overrides:
isTurnoutUsedin classDefaultSignalHead- Parameters:
t- Turnout object to check- Returns:
- true if turnout is configured as output or driver of head
-