Interface SignalMast
-
- All Superinterfaces:
java.lang.Comparable<NamedBean>
,NamedBean
,PropertyChangeProvider
,Signal
- All Known Implementing Classes:
AbstractSignalMast
,BiDiBSignalMast
,DccSignalMast
,LNCPSignalMast
,MatrixSignalMast
,MqttSignalMast
,OlcbSignalMast
,SignalHeadSignalMast
,TurnoutSignalMast
,VirtualSignalMast
public interface SignalMast extends Signal
Represent a signal mast. A signal mast is one or more signal heads that are treated as a single signal. (Imagine several heads attached to a single mast, though other implementations are possible)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
-
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
allowUnLit()
SignalAppearanceMap
getAppearanceMap()
java.lang.String
getAspect()
Get current aspect name.boolean
getHeld()
Get the held state of the signal mast.boolean
getLit()
Get if signal mast is lit or dark.java.lang.String
getMastType()
Get the specific mast type for this mast.SignalSystem
getSignalSystem()
java.util.Vector<java.lang.String>
getValidAspects()
Get an alphabetically sorted list of valid aspects that have not been disabled.boolean
isAspectDisabled(java.lang.String aspect)
boolean
isPermissiveSmlDisabled()
Determine if the permissive SML logic should be disabled.void
setAllowUnLit(boolean boo)
Sets whether the Signal Mast is allowed or configured to show an unlit aspect, or if it is always lit.void
setAspect(java.lang.String aspect)
Set aspect to a valid name in the current signal system definition.void
setHeld(boolean newHeld)
void
setLit(boolean newLit)
void
setMastType(java.lang.String type)
Set the specific mast type for this mast.void
setPermissiveSmlDisabled(boolean disabled)
-
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getBeanType, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getState, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setState, setUserName, toString, updateListenerRef, vetoableChange
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from interface jmri.Signal
isAtStop, isCleared, isShowingRestricting
-
-
-
-
Method Detail
-
setAspect
void setAspect(@Nonnull java.lang.String aspect)
Set aspect to a valid name in the current signal system definition.- Parameters:
aspect
- the new aspect shown- Throws:
java.lang.IllegalArgumentException
- if not a valid aspect name
-
getAspect
@CheckForNull java.lang.String 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
@Nonnull java.util.Vector<java.lang.String> getValidAspects()
Get an alphabetically sorted list of valid aspects that have not been disabled.- Returns:
- sorted list of valid aspects; may be empty
-
getSignalSystem
SignalSystem getSignalSystem()
-
getAppearanceMap
SignalAppearanceMap getAppearanceMap()
-
setMastType
void setMastType(@Nonnull java.lang.String type)
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
java.lang.String 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.
-
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.
-
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
void setPermissiveSmlDisabled(boolean disabled)
-
isAspectDisabled
boolean isAspectDisabled(java.lang.String aspect)
-
setAllowUnLit
void setAllowUnLit(boolean boo)
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()
-
-