Package jmri.implementation
Class DccSignalHead
java.lang.Object
jmri.implementation.AbstractNamedBean
jmri.implementation.AbstractSignalHead
jmri.implementation.DccSignalHead
- All Implemented Interfaces:
VetoableChangeListener,Comparable<NamedBean>,EventListener,PropertyChangeProvider,NamedBean,Signal,SignalHead
This class implements a SignalHead that maps the various appearances values to
aspect values in the Extended Accessory Decoder Control Packet Format
and outputs that packet to the DCC System via the generic CommandStation
interface
The mapping is as follows:
0 = RED
1 = YELLOW
2 = GREEN
3 = LUNAR
4 = FLASHRED
5 = FLASHYELLOW
6 = FLASHGREEN
7 = FLASHLUNAR
8 = DARK
The FLASH appearances are expected to be implemented in the decoder.
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException -
Field Summary
FieldsFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGet the number of times the packet should be sent to the track.static intintgetOutputForAppearance(int appearance) booleanCheck if a given turnout is used on this head.voidsetAppearance(int newAppearance) Set the Signal Head Appearance.voidsetDccSignalHeadPacketSendCount(int count) Set Number of times the packet should be sent to the track.voidsetHeld(boolean newHeld) Set the held parameter.voidsetLit(boolean newLit) voidsetOutputForAppearance(int appearance, int number) protected voidbooleanvoiduseAddressOffSet(boolean boo) Methods inherited from class jmri.implementation.AbstractSignalHead
describeState, getAppearance, getAppearanceKey, getAppearanceKey, getAppearanceName, getAppearanceName, getBeanType, getDefaultStateName, getDefaultValidStateNames, getDefaultValidStates, getHeld, getLit, getState, getValidStateKeys, getValidStateNames, getValidStates, isAtStop, isCleared, isShowingRestricting, setState, vetoableChangeMethods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, dispose, 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, dispose, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRefMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
appearanceToOutput
-
-
Constructor Details
-
DccSignalHead
-
DccSignalHead
-
-
Method Details
-
setAppearance
Description copied from interface:SignalHeadSet the Signal Head Appearance.- Parameters:
newAppearance- integer representing a valid Appearance for this head
-
setLit
Description copied from interface:SignalHead -
setHeld
Set the held parameter.Note that this does not directly affect the output on the layout; the held parameter is a local variable which affects the aspect only via higher-level logic.
-
updateOutput
-
useAddressOffSet
-
useAddressOffSet
-
getOutputForAppearance
-
setOutputForAppearance
-
getDefaultNumberForAppearance
-
setDccSignalHeadPacketSendCount
Set Number of times the packet should be sent to the track.- Parameters:
count- - less than 1 is treated as 1
-
getDccSignalHeadPacketSendCount
Get the number of times the packet should be sent to the track.- Returns:
- the count
-
isTurnoutUsed
Description copied from class:AbstractSignalHeadCheck if a given turnout is used on this head.- Specified by:
isTurnoutUsedin classAbstractSignalHead- Parameters:
t- Turnout object to check- Returns:
- true if turnout is configured as output or driver of head
-