Interface SignalMast
- All Superinterfaces:
Comparable<NamedBean>,NamedBean,PropertyChangeProvider,Signal
- All Known Implementing Classes:
AbstractSignalMast,BiDiBSignalMast,DccSignalMast,LNCPSignalMast,MatrixSignalMast,MqttSignalMast,OlcbSignalMast,SignalHeadSignalMast,TurnoutSignalMast,VirtualSignalMast
A mast presents an Aspect, as that's a composite of the appearance(s) of the entire signal.
This class has three bound parameters:
- Aspect
- The specific aspect being shown.
Aspects are named by a user defined String name.
- Lit
- Whether the mast's lamps are lit or left dark. This differs from the DARK color defined for the appearance parameter, in that it's independent of that. Lit is intended to allow you to extinguish a signal mast for approach lighting, while still allowing its color to be set to a definite value for e.g. display on a panel or evaluation in higher level logic.
- Held
- Whether the mast's lamps should be forced to a specific aspect,
e.g. Stop, in higher-level logic.
For use in signaling systems, this is a convenient way of storing whether a higher-level of control (e.g. non-vital system or dispatcher) has "held" the signal at stop. It does not effect how this signal mast actually works; any appearance can be set and will be displayed even when "held" is set.
This file is part of JMRI.
JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
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 TypeFieldDescriptionstatic final StringConstant property for aspect.static final StringConstant property for aspect disabled.static final StringConstant for property aspect enabled.static final StringConstant property for permissive SML disabled.Fields 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_LIT -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet current aspect name.booleangetHeld()Get the held state of the signal mast.booleangetLit()Get if signal mast is lit or dark.Get the specific mast type for this mast.Get an alphabetically sorted list of valid aspects that have not been disabled.booleanisAspectDisabled(String aspect) booleanDetermine if the permissive SML logic should be disabled.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.voidsetHeld(boolean newHeld) voidsetLit(boolean newLit) voidsetMastType(String type) Set the specific mast type for this mast.voidsetPermissiveSmlDisabled(boolean disabled) Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getBeanType, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getState, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setState, setUserName, toString, updateListenerRef, vetoableChangeMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from interface jmri.Signal
isAtStop, isCleared, isShowingRestricting
-
Field Details
-
PROPERTY_ASPECT
Constant property for aspect.- See Also:
-
PROPERTY_PERMISSIVE_SML_DISABLED
Constant property for permissive SML disabled.- See Also:
-
PROPERTY_ASPECT_DISABLED
Constant property for aspect disabled.- See Also:
-
PROPERTY_ASPECT_ENABLED
Constant for property aspect enabled.- See Also:
-
-
Method Details
-
setAspect
Set aspect to a valid name in the current signal system definition.- Parameters:
aspect- the new aspect shown- Throws:
IllegalArgumentException- if not a valid aspect name
-
getAspect
Get current aspect name. Changes to this property can be listened to using the property Aspect.- Returns:
- the current aspect or null if not set
-
getValidAspects
Get an alphabetically sorted list of valid aspects that have not been disabled.- Returns:
- sorted list of valid aspects; may be empty
-
getSignalSystem
-
getAppearanceMap
-
setMastType
Set 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.- Parameters:
type- mast type.
-
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.- Returns:
- mast type.
-
getLit
boolean getLit()Get if signal mast is lit or dark. Changes to this property can be listened to using the property Lit. -
setLit
-
getHeld
boolean getHeld()Get the held state of the signal mast. It controls what mechanisms can control the mast's appearance. The actual semantics are defined by those external mechanisms. Changes to this property can be listened to using the property Held. -
setHeld
-
isPermissiveSmlDisabled
boolean 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.- Returns:
- true if permissive SML is disabled.
-
setPermissiveSmlDisabled
-
isAspectDisabled
-
setAllowUnLit
Sets whether the Signal Mast is allowed or configured to show an unlit aspect, or if it is always lit.- Parameters:
boo- Set true to allow the UnLit to be used, set false it is not supported or allowed.
-
allowUnLit
boolean allowUnLit()
-