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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a listener for consist eventsvoid
dispose()
A method for cleaning up the cab signalvoid
forwardCabSignalToLayout()
Forward the current cab signal value to the layout.Block
getBlock()
Get the Block position of the locomotive associated with the cab signal.java.util.List<Block>
getBlockList()
Get Block List for the CabSignal.LocoAddress
getCabSignalAddress()
Get the LocoAddress associated with the consistBlock
getNextBlock()
Get the Next Block the locomotive is expected to enter.SignalMast
getNextMast()
Get the Next Signal Mast the locomotive is expected to pass.boolean
isCabSignalActive()
void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a listener for cab signal eventsvoid
setBlock()
Set the Block of the locomotive by searching the block list.void
setBlock(Block position)
Set the Block of the locomotivevoid
setCabSignalActive(boolean active)
void
setMasterCabSigPauseActive(boolean active)
-
-
-
Method Detail
-
dispose
void dispose()
A method for cleaning up the cab signal
-
getCabSignalAddress
LocoAddress getCabSignalAddress()
Get the LocoAddress associated with the consist- Returns:
- the cab signal address
-
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<Block> getBlockList()
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
-
forwardCabSignalToLayout
void forwardCabSignalToLayout()
Forward the current cab signal value to the layout.
-
isCabSignalActive
boolean isCabSignalActive()
-
setCabSignalActive
void setCabSignalActive(boolean active)
-
setMasterCabSigPauseActive
void setMasterCabSigPauseActive(boolean active)
-
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
-
-