Class AbstractSignalMast

    • Constructor Detail

      • AbstractSignalMast

        public AbstractSignalMast​(java.lang.String systemName,
                                  java.lang.String userName)
    • Method Detail

      • 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 interface SignalMast
        Parameters:
        aspect - the new aspect shown
      • getAspect

        public java.lang.String getAspect()
        Description copied from interface: SignalMast
        Get current aspect name. Changes to this property can be listened to using the property Aspect.
        Specified by:
        getAspect in interface SignalMast
        Returns:
        the current aspect or null if not set
      • getSpeed

        public java.lang.String getSpeed()
      • getState

        public int getState()
        The state is the index of the current aspect in the list of possible aspects.
        Specified by:
        getState in interface NamedBean
        Returns:
        the state
      • setState

        public void setState​(int i)
        Description copied from interface: NamedBean
        Provide 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.

        Specified by:
        setState in interface NamedBean
        Parameters:
        i - the state
      • getLit

        public boolean getLit()
        Default behavior for "lit" property is to track value and return it.
        Specified by:
        getLit in interface Signal
        Specified by:
        getLit in interface SignalMast
        Returns:
        true if lit; false if dark
      • getHeld

        public boolean getHeld()
        "Held" property is just tracked and notified.
        Specified by:
        getHeld in interface Signal
        Specified by:
        getHeld in interface SignalMast
        Returns:
        true if held; false otherwise
      • setLit

        public void setLit​(boolean newLit)
        Set the lit property.

        This acts on all the SignalHeads included in this SignalMast

        Specified by:
        setLit in interface Signal
        Specified by:
        setLit in interface SignalMast
        Parameters:
        newLit - the new value of lit
      • setHeld

        public void setHeld​(boolean newHeld)
        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:
        setHeld in interface Signal
        Specified by:
        setHeld in interface SignalMast
        Parameters:
        newHeld - the new value of the help property
      • isAtStop

        public boolean isAtStop()
        Description copied from interface: Signal
        Determine 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.
        Specified by:
        isAtStop in interface Signal
        Returns:
        true if the signal is showing a stop indication; false otherwise
      • isShowingRestricting

        public boolean isShowingRestricting()
        Description copied from interface: Signal
        Determine 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:
        isShowingRestricting in interface Signal
        Returns:
        true if the signal is showing a restricting indication; false otherwise
      • isCleared

        public boolean isCleared()
        Description copied from interface: Signal
        Determine 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.
        Specified by:
        isCleared in interface Signal
        Returns:
        true if the signal is showing a clear indication; false otherwise
      • isPermissiveSmlDisabled

        public 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.
        Specified by:
        isPermissiveSmlDisabled in interface SignalMast
        Returns:
        true if permissive SML is disabled.
      • configureAspectTable

        protected void configureAspectTable​(java.lang.String signalSystemName,
                                            java.lang.String aspectMapName)
      • getValidAspects

        @Nonnull
        public java.util.Vector<java.lang.String> getValidAspects()
        Description copied from interface: SignalMast
        Get an alphabetically sorted list of valid aspects that have not been disabled.
        Specified by:
        getValidAspects in interface SignalMast
        Returns:
        sorted list of valid aspects; may be empty
      • getAllKnownAspects

        public java.util.Vector<java.lang.String> 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
      • setAllowUnLit

        public void setAllowUnLit​(boolean boo)
        Description copied from interface: SignalMast
        Sets whether the Signal Mast is allowed or configured to show an unlit aspect, or if it is always lit.
        Specified by:
        setAllowUnLit in interface SignalMast
        Parameters:
        boo - Set true to allow the UnLit to be used, set false it is not supported or allowed.
      • getBeanType

        public java.lang.String getBeanType()
        Description copied from interface: NamedBean
        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.
        Specified by:
        getBeanType in interface NamedBean
        Returns:
        a string of the bean type, eg Turnout, Sensor etc