Package jmri

Interface CabSignal

  • All Known Implementing Classes:
    CbusCabSignal, DefaultCabSignal, LnCabSignal

    public interface CabSignal
    Interface for a Cab Signal Object, describing the state of the track ahead relative to a locomotive with a given address. This is effectively a mobile signal mast.
    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

      • dispose

        void dispose()
        A method for cleaning up the cab signal
      • setBlock

        void setBlock()
        Set the Block of the locomotive by searching the block list.
      • setBlock

        void setBlock​(Block position)
        Set the Block of the locomotive
        Parameters:
        position - is a Block the locomotive is in.
      • getBlock

        Block getBlock()
        Get the Block position of the locomotive associated with the cab signal.
        Returns:
        The current Block position
      • getNextBlock

        Block getNextBlock()
        Get the Next Block the locomotive is expected to enter. This value is calculated from the current block and direction of travel.
        Returns:
        The next Block position
      • getBlockList

        @Nonnull
        java.util.List<BlockgetBlockList()
        Get Block List for the CabSignal. List of Blocks up to the end of Path or a Signal Mast displaying a Stop condition, whichever comes first.

        The first Block in the list ( if any ), is the current Block.

        This list does NOT guarantee that the Blocks will be unoccupied, a SignalMast may be displaying a call-on aspect.

        Returns:
        list of Blocks that the loco address is expected to traverse.
      • getNextMast

        SignalMast getNextMast()
        Get the Next Signal Mast the locomotive is expected to pass. This value may be calculated from the current block and direction of travel.
        Returns:
        The next SignalMast position
      • addPropertyChangeListener

        void addPropertyChangeListener​(java.beans.PropertyChangeListener listener)
        Add a listener for consist events
        Parameters:
        listener - is a PropertyChangeListener object
      • removePropertyChangeListener

        void removePropertyChangeListener​(java.beans.PropertyChangeListener listener)
        Remove a listener for cab signal events
        Parameters:
        listener - is a PropertyChangeListener object