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
DccSignalHead
by 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>
appearanceToOutput
protected CommandStation
c
protected int
dccSignalDecoderAddress
protected int
packetSendCount
(package private) int
unLitId
-
Fields inherited from class jmri.implementation.AbstractSignalMast
allowUnLit, 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_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
-
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 void
configureFromName(java.lang.String systemName)
CommandStation
getCommandStation()
int
getDccSignalMastAddress()
int
getDccSignalMastPacketSendCount()
Get the number of times the packet should be sent to the track.int
getOutputForAppearance(java.lang.String appearance)
int
getUnlitId()
static java.lang.String
isDCCAddressUsed(int addr)
void
setAspect(java.lang.String aspect)
Set aspect to a valid name in the current signal system definition.void
setDccSignalMastPacketSendCount(int count)
Set Number of times the packet should be sent.void
setLit(boolean newLit)
Set the lit property.void
setOutputForAppearance(java.lang.String appearance, int number)
void
setUnlitId(int i)
boolean
useAddressOffSet()
void
useAddressOffSet(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:SignalMast
Set aspect to a valid name in the current signal system definition.- Specified by:
setAspect
in interfaceSignalMast
- Overrides:
setAspect
in 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:AbstractSignalMast
Set the lit property.This acts on all the SignalHeads included in this SignalMast
- Specified by:
setLit
in interfaceSignal
- Specified by:
setLit
in interfaceSignalMast
- Overrides:
setLit
in 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.
-
-