Package jmri.implementation
Class DccSignalMast
- java.lang.Object
-
- jmri.implementation.AbstractNamedBean
-
- jmri.implementation.AbstractSignalMast
-
- jmri.implementation.DccSignalMast
-
- All Implemented Interfaces:
java.beans.VetoableChangeListener,java.lang.Comparable<NamedBean>,java.util.EventListener,PropertyChangeProvider,NamedBean,Signal,SignalMast
- Direct Known Subclasses:
LNCPSignalMast
public class DccSignalMast extends AbstractSignalMast
This class implements a SignalMast that uses Extended Accessory Decoder Control Packet Format and outputs that packet to the DCC System via the generic CommandStation interface.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.
System name specifies the creation information:
IF$dsm:basic:one-searchlight(123)
The name is a colon-separated series of terms:- IF$dsm - defines signal masts of this type
- basic - name of the signaling system
- one-searchlight - name of the particular aspect map
- (123) - DCC address for the decoder
Based upon
DccSignalHeadby Alex Shepherd
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.HashMap<java.lang.String,java.lang.Integer>appearanceToOutputprotected CommandStationcprotected intdccSignalDecoderAddressprotected intpacketSendCount(package private) intunLitId-
Fields inherited from class jmri.implementation.AbstractSignalMast
aspect, disabledAspects, disablePermissiveSignalMastLogic, map, mastType, speed, systemDefn
-
Fields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, register
-
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWN
-
Fields inherited from interface jmri.Signal
PROPERTY_HELD, PROPERTY_LIT
-
Fields inherited from interface jmri.SignalMast
PROPERTY_ASPECT, PROPERTY_ASPECT_DISABLED, PROPERTY_ASPECT_ENABLED, PROPERTY_PERMISSIVE_SML_DISABLED
-
-
Constructor Summary
Constructors Constructor Description DccSignalMast(java.lang.String sys)DccSignalMast(java.lang.String sys, java.lang.String user)DccSignalMast(java.lang.String sys, java.lang.String user, java.lang.String mastSubType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigureFromName(java.lang.String systemName)CommandStationgetCommandStation()intgetDccSignalMastAddress()intgetDccSignalMastPacketSendCount()Get the number of times the packet should be sent to the track.intgetOutputForAppearance(java.lang.String appearance)intgetUnlitId()static java.lang.StringisDCCAddressUsed(int addr)voidsetAspect(java.lang.String aspect)Set aspect to a valid name in the current signal system definition.voidsetDccSignalMastPacketSendCount(int count)Set Number of times the packet should be sent.voidsetLit(boolean newLit)Set the lit property.voidsetOutputForAppearance(java.lang.String appearance, int number)voidsetUnlitId(int i)booleanuseAddressOffSet()voiduseAddressOffSet(boolean boo)-
Methods inherited from class jmri.implementation.AbstractSignalMast
allowUnLit, configureAspectTable, configureSignalSystemDefinition, getAllKnownAspects, getAppearanceMap, getAspect, getBeanType, getDisabledAspects, getHeld, getLit, getMastType, getSignalSystem, getSpeed, getState, getUsageReport, getValidAspects, isAspectDisabled, isAtStop, isCleared, isPermissiveSmlDisabled, isShowingRestricting, setAllowUnLit, setAspectDisabled, setAspectEnabled, setHeld, setMastType, setPermissiveSmlDisabled, setState, vetoableChange
-
Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, describeState, 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, updateListenerRef
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getSystemName, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRef
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
appearanceToOutput
protected java.util.HashMap<java.lang.String,java.lang.Integer> appearanceToOutput
-
packetSendCount
protected int packetSendCount
-
unLitId
int unLitId
-
c
protected CommandStation c
-
dccSignalDecoderAddress
protected int dccSignalDecoderAddress
-
-
Constructor Detail
-
DccSignalMast
public DccSignalMast(java.lang.String sys, java.lang.String user)
-
DccSignalMast
public DccSignalMast(java.lang.String sys)
-
DccSignalMast
public DccSignalMast(java.lang.String sys, java.lang.String user, java.lang.String mastSubType)
-
-
Method Detail
-
configureFromName
protected void configureFromName(java.lang.String systemName)
-
setOutputForAppearance
public void setOutputForAppearance(java.lang.String appearance, int number)
-
getOutputForAppearance
public int getOutputForAppearance(java.lang.String appearance)
-
setAspect
public void setAspect(@Nonnull java.lang.String aspect)
Description copied from interface:SignalMastSet aspect to a valid name in the current signal system definition.- Specified by:
setAspectin interfaceSignalMast- Overrides:
setAspectin classAbstractSignalMast- Parameters:
aspect- the new aspect shown
-
useAddressOffSet
public void useAddressOffSet(boolean boo)
-
useAddressOffSet
public boolean useAddressOffSet()
-
setLit
public void setLit(boolean newLit)
Description copied from class:AbstractSignalMastSet the lit property.This acts on all the SignalHeads included in this SignalMast
- Specified by:
setLitin interfaceSignal- Specified by:
setLitin interfaceSignalMast- Overrides:
setLitin classAbstractSignalMast- Parameters:
newLit- the new value of lit
-
setUnlitId
public void setUnlitId(int i)
-
getUnlitId
public int getUnlitId()
-
getDccSignalMastAddress
public int getDccSignalMastAddress()
-
getCommandStation
public CommandStation getCommandStation()
-
isDCCAddressUsed
public static java.lang.String isDCCAddressUsed(int addr)
-
setDccSignalMastPacketSendCount
public void setDccSignalMastPacketSendCount(int count)
Set Number of times the packet should be sent.- Parameters:
count- - less than 1 is treated as 1.
-
getDccSignalMastPacketSendCount
public int getDccSignalMastPacketSendCount()
Get the number of times the packet should be sent to the track.- Returns:
- the count.
-
-