Package jmri

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.

    The integer state (getState(), setState()) is the index of the current aspect in the list of all defined aspects.
    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.

    • 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
      • 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.
        Specified by:
        getLit in interface Signal
        Returns:
        true if lit; false if dark
      • 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.
        Specified by:
        getHeld in interface Signal
        Returns:
        true if held; false otherwise
      • 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.
      • 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.