Package jmri.implementation
Class AbstractSignalMast
java.lang.Object
jmri.implementation.AbstractNamedBean
jmri.implementation.AbstractSignalMast
- All Implemented Interfaces:
VetoableChangeListener,Comparable<NamedBean>,EventListener,PropertyChangeProvider,NamedBean,Signal,SignalMast
- Direct Known Subclasses:
BiDiBSignalMast,DccSignalMast,MatrixSignalMast,MqttSignalMast,OlcbSignalMast,SignalHeadSignalMast,TurnoutSignalMast,VirtualSignalMast
public abstract class AbstractSignalMast
extends AbstractNamedBean
implements SignalMast, VetoableChangeListener
Abstract class providing the basic logic of the SignalMast interface.
-
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 TypeFieldDescriptionprotected String(package private) booleanprotected DefaultSignalAppearanceMap(package private) Stringprotected String(package private) SignalSystemFields 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.SignalMast
PROPERTY_ASPECT, PROPERTY_ASPECT_DISABLED, PROPERTY_ASPECT_ENABLED, PROPERTY_PERMISSIVE_SML_DISABLED -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSignalMast(String systemName) AbstractSignalMast(String systemName, String userName) -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected voidconfigureAspectTable(String signalSystemName, String aspectMapName) protected voidGet a list of all the known aspects for this mast, including those that have been disabled.Get current aspect name.For instances in the code where we are dealing with just a bean and a message needs to be passed to the user or in a log.booleangetHeld()"Held" property is just tracked and notified.booleangetLit()Default behavior for "lit" property is to track value and return it.Get the specific mast type for this mast.getSpeed()intgetState()The state is the index of the current aspect in the list of possible aspects.getUsageReport(NamedBean bean) Get a list of references for the specified bean.Get an alphabetically sorted list of valid aspects that have not been disabled.booleanisAspectDisabled(String aspect) booleanisAtStop()Determine whether this signal shows an aspect or appearance that forbid travel past it.booleanDetermine whether this signal shows an aspect or appearance that allows travel past it, e.g. it's "been cleared".booleanDetermine if the permissive SML logic should be disabled.booleanDetermine whether this signal shows an aspect or appearance that allows travel past it only at restricted speed.voidsetAllowUnLit(boolean boo) Sets whether the Signal Mast is allowed or configured to show an unlit aspect, or if it is always lit.voidSet aspect to a valid name in the current signal system definition.voidsetAspectDisabled(String aspect) voidsetAspectEnabled(String aspect) voidsetHeld(boolean newHeld) Set the held property of the signal mast.voidsetLit(boolean newLit) Set the lit property.voidsetMastType(String type) Set the specific mast type for this mast.voidsetPermissiveSmlDisabled(boolean disabled) voidsetState(int i) Provide generic access to internal state.voidMethods 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, updateListenerRefMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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, updateListenerRefMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
aspect
-
speed
-
map
-
systemDefn
-
disablePermissiveSignalMastLogic
boolean disablePermissiveSignalMastLogic -
disabledAspects
-
mastType
-
-
Constructor Details
-
AbstractSignalMast
-
AbstractSignalMast
-
-
Method Details
-
setAspect
Description copied from interface:SignalMastSet aspect to a valid name in the current signal system definition.- Specified by:
setAspectin interfaceSignalMast- Parameters:
aspect- the new aspect shown
-
getAspect
Description copied from interface:SignalMastGet current aspect name. Changes to this property can be listened to using the property Aspect.- Specified by:
getAspectin interfaceSignalMast- Returns:
- the current aspect or null if not set
-
getSpeed
-
getState
The state is the index of the current aspect in the list of possible aspects. -
setState
Description copied from interface:NamedBeanProvide generic access to internal state.This generally shouldn't be used by Java code; use the class-specific form instead (e.g. setCommandedState in Turnout). This is provided to make scripts access easier to read.
-
getLit
Default behavior for "lit" property is to track value and return it.- Specified by:
getLitin interfaceSignal- Specified by:
getLitin interfaceSignalMast- Returns:
- true if lit; false if dark
-
getHeld
"Held" property is just tracked and notified.- Specified by:
getHeldin interfaceSignal- Specified by:
getHeldin interfaceSignalMast- Returns:
- true if held; false otherwise
-
setLit
Set the lit property.This acts on all the SignalHeads included in this SignalMast
- Specified by:
setLitin interfaceSignal- Specified by:
setLitin interfaceSignalMast- Parameters:
newLit- the new value of lit
-
setHeld
Set the held property of the signal mast.Note that this does not directly effect the output on the layout; the held property is a local variable which effects the aspect only via higher-level logic.
- Specified by:
setHeldin interfaceSignal- Specified by:
setHeldin interfaceSignalMast- Parameters:
newHeld- the new value of the help property
-
isAtStop
Description copied from interface:SignalDetermine whether this signal shows an aspect or appearance that forbid travel past it. This might be a red appearance, or a Stop aspect. Stop-and-Proceed or Restricting would return false here. -
isShowingRestricting
Description copied from interface:SignalDetermine whether this signal shows an aspect or appearance that allows travel past it only at restricted speed. This might be a flashing red appearance, or a Restricting aspect.- Specified by:
isShowingRestrictingin interfaceSignal- Returns:
- true if the signal is showing a restricting indication; false otherwise
-
isCleared
Description copied from interface:SignalDetermine whether this signal shows an aspect or appearance that allows travel past it, e.g. it's "been cleared". This might be a yellow or green appearance, or an Approach or Clear aspect. -
setPermissiveSmlDisabled
- Specified by:
setPermissiveSmlDisabledin interfaceSignalMast
-
isPermissiveSmlDisabled
Determine if the permissive SML logic should be disabled. The default will be false which means that automatic permissive processing is allowed. Prototypical CTC designs frequently require an additional action, such as Call-On, to enable permissive aspects.- Specified by:
isPermissiveSmlDisabledin interfaceSignalMast- Returns:
- true if permissive SML is disabled.
-
configureSignalSystemDefinition
-
configureAspectTable
-
getSignalSystem
- Specified by:
getSignalSystemin interfaceSignalMast
-
getAppearanceMap
- Specified by:
getAppearanceMapin interfaceSignalMast
-
getValidAspects
Description copied from interface:SignalMastGet an alphabetically sorted list of valid aspects that have not been disabled.- Specified by:
getValidAspectsin interfaceSignalMast- Returns:
- sorted list of valid aspects; may be empty
-
getMastType
Get the specific mast type for this mast. This is the type that appears in the SystemName and filename, i.e. "SL-3-high" for the AAR-1946/appearance-SL-3-high.xml definition.- Specified by:
getMastTypein interfaceSignalMast- Returns:
- mast type.
-
setMastType
Description copied from interface:SignalMastSet the specific mast type for this mast. This is the type that appears in the SystemName and filename, i.e. "SL-3-high" for the AAR-1946/appearance-SL-3-high.xml definition.- Specified by:
setMastTypein interfaceSignalMast- Parameters:
type- mast type.
-
getAllKnownAspects
Get a list of all the known aspects for this mast, including those that have been disabled.- Returns:
- list of known aspects; may be empty
-
setAspectDisabled
-
setAspectEnabled
-
getDisabledAspects
-
isAspectDisabled
- Specified by:
isAspectDisabledin interfaceSignalMast
-
setAllowUnLit
Description copied from interface:SignalMastSets whether the Signal Mast is allowed or configured to show an unlit aspect, or if it is always lit.- Specified by:
setAllowUnLitin interfaceSignalMast- Parameters:
boo- Set true to allow the UnLit to be used, set false it is not supported or allowed.
-
allowUnLit
- Specified by:
allowUnLitin interfaceSignalMast
-
vetoableChange
Description copied from class:AbstractNamedBean- Specified by:
vetoableChangein interfaceNamedBean- Specified by:
vetoableChangein interfaceVetoableChangeListener- Overrides:
vetoableChangein classAbstractNamedBean- Throws:
PropertyVetoException
-
getBeanType
Description copied from interface:NamedBeanFor instances in the code where we are dealing with just a bean and a message needs to be passed to the user or in a log.- Specified by:
getBeanTypein interfaceNamedBean- Returns:
- a string of the bean type, eg Turnout, Sensor etc
-
getUsageReport
Description copied from interface:NamedBeanGet a list of references for the specified bean.- Specified by:
getUsageReportin interfaceNamedBean- Parameters:
bean- The bean to be checked.- Returns:
- a list of NamedBeanUsageReports or an empty ArrayList.
-