jmri
Interface SignalMastLogic

Show UML class diagram
All Known Implementing Classes:
DefaultSignalMastLogic

public interface SignalMastLogic


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.


Field Summary
static int STOREALL
          Constant representing that all the user entered details relating to a signal logic are stored.
static int STOREMASTSONLY
          Constant representing that only the basic signal mast logic details are stored.
static int STORENONE
          Constant representing that this signal mast logic is not stored with the panel file.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
           
 void addSensor(String sensorName, int state, SignalMast destination)
          Add an individual sensor and its state to the logic
 void allowAutoMaticSignalMastGeneration(boolean allow, SignalMast destination)
          Sets whether we should allow the system to automatically generate a list of signal masts that could cause a conflicting route.
 boolean allowAutoMaticSignalMastGeneration(SignalMast destination)
          Query if we are allowing the system to automatically generated a list of conflicting SignalMast that have a direct effect on our logic.
 void allowTurnoutLock(boolean lock, SignalMast destination)
          Sets whether we should lock all turnouts between the source and destination signal masts when the logic goes active, to prevent them from being changed.
 boolean areBlocksIncluded(ArrayList<Block> blks)
          Returns true if any of the blocks in the supplied list are included in any of the logics that set this signal.
 void disableLayoutEditorUse()
           
 void dispose()
           
 SignalMast getActiveDestination()
          return the active the active destination Signal Mast
 Section getAssociatedSection(SignalMast destination)
           
 ArrayList<Block> getAutoBlocks(SignalMast destination)
          returns all the blocks that have been detected as being in use for this logic, this includes blocks on level xings that are not directly in the path but do have an affect on the logic
 ArrayList<Block> getAutoBlocksBetweenMasts(SignalMast destination)
          returns only the blocks that have been detected as being directly between the source and destination mast.
 int getAutoBlockState(Block block, SignalMast destination)
           
 ArrayList<SignalMast> getAutoMasts(SignalMast destination)
           
 String getAutoSignalMastState(SignalMast mast, SignalMast destination)
           
 ArrayList<Turnout> getAutoTurnouts(SignalMast destination)
           
 int getAutoTurnoutState(Turnout turnout, SignalMast destination)
           
 ArrayList<Block> getBlocks(SignalMast destination)
           
 int getBlockState(Block block, SignalMast destination)
           
 String getComment(SignalMast dest)
           
 ArrayList<SignalMast> getDestinationList()
           
 LayoutBlock getFacingBlock()
          Get the block facing our source signal
 float getMaximumSpeed(SignalMast destination)
           
 ArrayList<NamedBeanHandle<Sensor>> getNamedSensors(SignalMast destination)
           
 ArrayList<NamedBeanHandle<Turnout>> getNamedTurnouts(SignalMast destination)
           
 int getNumPropertyChangeListeners()
           
 LayoutBlock getProtectingBlock(SignalMast destination)
          Get the block that the source signal is protecting on the path to the destination signal mast
 ArrayList<Sensor> getSensors(SignalMast destination)
           
 int getSensorState(Sensor sensor, SignalMast destination)
           
 ArrayList<SignalMast> getSignalMasts(SignalMast destination)
           
 String getSignalMastState(SignalMast mast, SignalMast destination)
           
 SignalMast getSourceMast()
           
 int getStoreState(SignalMast destination)
          returns where the signalmast logic should be stored, if so how much.
 ArrayList<Turnout> getTurnouts(SignalMast destination)
           
 int getTurnoutState(Turnout turnout, SignalMast destination)
           
 void initialise()
           
 void initialise(SignalMast destination)
          Initialise the signalmast after all the parameters have been set.
 boolean isActive(SignalMast dest)
          Query if the signalmast logic to the destination signal mast is active.
 boolean isBlockIncluded(Block block, SignalMast destination)
           
 boolean isDestinationValid(SignalMast dest)
           
 boolean isEnabled(SignalMast dest)
          Query if the signalmast logic to the destination signal mast is enabled or disabled.
 boolean isSensorIncluded(Sensor sensor, SignalMast destination)
           
 boolean isSignalMastIncluded(SignalMast signal, SignalMast destination)
           
 boolean isTurnoutIncluded(Turnout turnout, SignalMast destination)
           
 boolean isTurnoutLockAllowed(SignalMast destination)
          Query if we are allowing the system to lock turnouts when the logic goes active.
 void removeConflictingLogic(SignalMast sm, LevelXing lx)
           
 boolean removeDestination(SignalMast dest)
           
 void removePropertyChangeListener(PropertyChangeListener l)
           
 void removeSensor(String sensorName, SignalMast destination)
          Remove an individual sensor from the logic
 void replaceDestinationMast(SignalMast oldMast, SignalMast newMast)
          This will replace the existing destination SignalMast with a new signal mast instance.
 void replaceSourceMast(SignalMast oldMast, SignalMast newMast)
          This will replace the existing source SignalMast with a new signal mast instance.
 void setAssociatedSection(Section sec, SignalMast destination)
           
 void setAutoBlocks(LinkedHashMap<Block,Integer> blocks, SignalMast destination)
          Sets which blocks must be inactive for the signal not to be set at a stop aspect These blocks are not stored in the panel file.
 void setAutoMasts(Hashtable<SignalMast,String> masts, SignalMast destination)
          Sets which masts must be in a given state before our mast can be set.
 void setAutoTurnouts(Hashtable<Turnout,Integer> turnouts, SignalMast destination)
          Sets which blocks must be inactive for the signal not to be set at a stop aspect These Turnouts are not stored in the panel file.
 void setBlocks(Hashtable<Block,Integer> blocks, SignalMast destination)
          Sets which blocks must be inactive for the signal not to be set at a stop aspect
 void setComment(String comment, SignalMast dest)
           
 void setConflictingLogic(SignalMast sm, LevelXing lx)
           
 void setDestinationMast(SignalMast dest)
           
 void setDisabled(SignalMast dest)
          Sets the logic to the destination signal mast to be disabled.
 void setEnabled(SignalMast dest)
          Sets the logic to the destination signal mast to be enabled.
 void setFacingBlock(LayoutBlock facing)
           
 void setMasts(Hashtable<SignalMast,String> masts, SignalMast destination)
          Sets which masts must be in a given state before our mast can be set.
 void setSensors(Hashtable<NamedBeanHandle<Sensor>,Integer> sensors, SignalMast destination)
          Sets which sensors must be in a given state before our mast can be set.
 void setStore(int store, SignalMast destination)
          Use this to determine if the signalmast logic is stored in the panel file and if all the information is stored.
 void setTurnouts(Hashtable<NamedBeanHandle<Turnout>,Integer> turnouts, SignalMast destination)
          Sets the states that each turnout must be in for signal not to be set at a stop aspect
 void setupLayoutEditorDetails()
           
 LinkedHashMap<Block,Integer> setupLayoutEditorTurnoutDetails(List<LayoutBlock> blks, SignalMast destination)
          Set the auto turnouts based upon a given list of layout blocks for a specific destination mast
 void useLayoutEditor(boolean boo, SignalMast destination)
          Sets whether this logic should use the details stored in the layout editor to determine the which blocks, turnouts will make up the logic between the source and destination signal mast.
 boolean useLayoutEditor(SignalMast destination)
          Query if we are using the layout editor panels to build the signal mast logic, blocks, turnouts .
 boolean useLayoutEditorBlocks(SignalMast destination)
          Query if we are using the layout editor block information in the signal mast logic.
 void useLayoutEditorDetails(boolean turnouts, boolean blocks, SignalMast destination)
          Sets whether we should use the information from the layout editor for either blocks or turnouts.
 boolean useLayoutEditorTurnouts(SignalMast destination)
          Query if we are using the layout editor turnout information in the signal mast logic.
 

Field Detail

STOREALL

static final int STOREALL
Constant representing that all the user entered details relating to a signal logic are stored. Automatically generated details that have been entered via the setAutoBean are not stored.

See Also:
Constant Field Values

STOREMASTSONLY

static final int STOREMASTSONLY
Constant representing that only the basic signal mast logic details are stored. All details that determine the triggering of the logic are not stored.

See Also:
Constant Field Values

STORENONE

static final int STORENONE
Constant representing that this signal mast logic is not stored with the panel file. This is used where another piece of code uses handles the dynamic creation of signalmast logic

See Also:
Constant Field Values
Method Detail

allowAutoMaticSignalMastGeneration

boolean allowAutoMaticSignalMastGeneration(SignalMast destination)
Query if we are allowing the system to automatically generated a list of conflicting SignalMast that have a direct effect on our logic.

Parameters:
destination - Destination SignalMast.
Returns:
true if this is allowed.

allowAutoMaticSignalMastGeneration

void allowAutoMaticSignalMastGeneration(boolean allow,
                                        SignalMast destination)
Sets whether we should allow the system to automatically generate a list of signal masts that could cause a conflicting route.

Parameters:
destination - Destination SignalMast.
allow - set true if we are to allow automatic generation.

allowTurnoutLock

void allowTurnoutLock(boolean lock,
                      SignalMast destination)
Sets whether we should lock all turnouts between the source and destination signal masts when the logic goes active, to prevent them from being changed. This is dependant upon the hardware allowing for this.

Parameters:
destination - Destination SignalMast.
lock - set true if the system should lock the turnout.

areBlocksIncluded

boolean areBlocksIncluded(ArrayList<Block> blks)
Returns true if any of the blocks in the supplied list are included in any of the logics that set this signal.


replaceSourceMast

void replaceSourceMast(SignalMast oldMast,
                       SignalMast newMast)
This will replace the existing source SignalMast with a new signal mast instance. This is for use with such tools as the layout editor where a signalmast can at a certain location can be replaced with another, while the remainder of the configuration stays the same.


replaceDestinationMast

void replaceDestinationMast(SignalMast oldMast,
                            SignalMast newMast)
This will replace the existing destination SignalMast with a new signal mast instance. This is for use with such tools as the layout editor where a signalmast can at a certain location can be replaced with another, while the remainder of the configuration stays the same.


dispose

void dispose()

getAssociatedSection

Section getAssociatedSection(SignalMast destination)

setAssociatedSection

void setAssociatedSection(Section sec,
                          SignalMast destination)

getAutoBlockState

int getAutoBlockState(Block block,
                      SignalMast destination)

getAutoBlocks

ArrayList<Block> getAutoBlocks(SignalMast destination)
returns all the blocks that have been detected as being in use for this logic, this includes blocks on level xings that are not directly in the path but do have an affect on the logic


getAutoBlocksBetweenMasts

ArrayList<Block> getAutoBlocksBetweenMasts(SignalMast destination)
returns only the blocks that have been detected as being directly between the source and destination mast. The order of the block in the list, is the order that they are connected.


getAutoMasts

ArrayList<SignalMast> getAutoMasts(SignalMast destination)

getAutoSignalMastState

String getAutoSignalMastState(SignalMast mast,
                              SignalMast destination)

getAutoTurnoutState

int getAutoTurnoutState(Turnout turnout,
                        SignalMast destination)

getAutoTurnouts

ArrayList<Turnout> getAutoTurnouts(SignalMast destination)

getBlockState

int getBlockState(Block block,
                  SignalMast destination)

getBlocks

ArrayList<Block> getBlocks(SignalMast destination)

getComment

String getComment(SignalMast dest)

getDestinationList

ArrayList<SignalMast> getDestinationList()

getMaximumSpeed

float getMaximumSpeed(SignalMast destination)

getNumPropertyChangeListeners

int getNumPropertyChangeListeners()

getSensorState

int getSensorState(Sensor sensor,
                   SignalMast destination)

getSensors

ArrayList<Sensor> getSensors(SignalMast destination)

getNamedSensors

ArrayList<NamedBeanHandle<Sensor>> getNamedSensors(SignalMast destination)

getSignalMastState

String getSignalMastState(SignalMast mast,
                          SignalMast destination)

getSignalMasts

ArrayList<SignalMast> getSignalMasts(SignalMast destination)

getSourceMast

SignalMast getSourceMast()

getStoreState

int getStoreState(SignalMast destination)
returns where the signalmast logic should be stored, if so how much.


getTurnoutState

int getTurnoutState(Turnout turnout,
                    SignalMast destination)

getTurnouts

ArrayList<Turnout> getTurnouts(SignalMast destination)

getNamedTurnouts

ArrayList<NamedBeanHandle<Turnout>> getNamedTurnouts(SignalMast destination)

initialise

void initialise()

initialise

void initialise(SignalMast destination)
Initialise the signalmast after all the parameters have been set.


isActive

boolean isActive(SignalMast dest)
Query if the signalmast logic to the destination signal mast is active.


getActiveDestination

SignalMast getActiveDestination()
return the active the active destination Signal Mast


isBlockIncluded

boolean isBlockIncluded(Block block,
                        SignalMast destination)

isDestinationValid

boolean isDestinationValid(SignalMast dest)

isEnabled

boolean isEnabled(SignalMast dest)
Query if the signalmast logic to the destination signal mast is enabled or disabled.


isSensorIncluded

boolean isSensorIncluded(Sensor sensor,
                         SignalMast destination)

isSignalMastIncluded

boolean isSignalMastIncluded(SignalMast signal,
                             SignalMast destination)

isTurnoutIncluded

boolean isTurnoutIncluded(Turnout turnout,
                          SignalMast destination)

isTurnoutLockAllowed

boolean isTurnoutLockAllowed(SignalMast destination)
Query if we are allowing the system to lock turnouts when the logic goes active.

Parameters:
destination - Destination SignalMast.
Returns:
true if locking is allowed.

removeConflictingLogic

void removeConflictingLogic(SignalMast sm,
                            LevelXing lx)

removeDestination

boolean removeDestination(SignalMast dest)
Parameters:
dest - Destination SignalMast.
Returns:
true if there are no more destination signal masts

setAutoBlocks

void setAutoBlocks(LinkedHashMap<Block,Integer> blocks,
                   SignalMast destination)
Sets which blocks must be inactive for the signal not to be set at a stop aspect These blocks are not stored in the panel file.

Parameters:
blocks -

setAutoMasts

void setAutoMasts(Hashtable<SignalMast,String> masts,
                  SignalMast destination)
Sets which masts must be in a given state before our mast can be set. These masts are not stored in the panel file.

Parameters:
masts -

setAutoTurnouts

void setAutoTurnouts(Hashtable<Turnout,Integer> turnouts,
                     SignalMast destination)
Sets which blocks must be inactive for the signal not to be set at a stop aspect These Turnouts are not stored in the panel file.


setBlocks

void setBlocks(Hashtable<Block,Integer> blocks,
               SignalMast destination)
Sets which blocks must be inactive for the signal not to be set at a stop aspect

Parameters:
blocks -

setComment

void setComment(String comment,
                SignalMast dest)

setConflictingLogic

void setConflictingLogic(SignalMast sm,
                         LevelXing lx)

setDestinationMast

void setDestinationMast(SignalMast dest)

setDisabled

void setDisabled(SignalMast dest)
Sets the logic to the destination signal mast to be disabled.


setEnabled

void setEnabled(SignalMast dest)
Sets the logic to the destination signal mast to be enabled.


setFacingBlock

void setFacingBlock(LayoutBlock facing)

setMasts

void setMasts(Hashtable<SignalMast,String> masts,
              SignalMast destination)
Sets which masts must be in a given state before our mast can be set.

Parameters:
masts -

setSensors

void setSensors(Hashtable<NamedBeanHandle<Sensor>,Integer> sensors,
                SignalMast destination)
Sets which sensors must be in a given state before our mast can be set.

Parameters:
sensors -

addSensor

void addSensor(String sensorName,
               int state,
               SignalMast destination)
Add an individual sensor and its state to the logic


removeSensor

void removeSensor(String sensorName,
                  SignalMast destination)
Remove an individual sensor from the logic


setStore

void setStore(int store,
              SignalMast destination)
Use this to determine if the signalmast logic is stored in the panel file and if all the information is stored.

Parameters:
store -

setTurnouts

void setTurnouts(Hashtable<NamedBeanHandle<Turnout>,Integer> turnouts,
                 SignalMast destination)
Sets the states that each turnout must be in for signal not to be set at a stop aspect

Parameters:
turnouts -

setupLayoutEditorDetails

void setupLayoutEditorDetails()

useLayoutEditor

void useLayoutEditor(boolean boo,
                     SignalMast destination)
                     throws JmriException
Sets whether this logic should use the details stored in the layout editor to determine the which blocks, turnouts will make up the logic between the source and destination signal mast.

Parameters:
boo - Use the layout editor details to determine logic details.
destination - Destination SignalMast.
Throws:
JmriException

useLayoutEditor

boolean useLayoutEditor(SignalMast destination)
Query if we are using the layout editor panels to build the signal mast logic, blocks, turnouts .

Parameters:
destination - Destination SignalMast.
Returns:
true if we are using the layout editor to build the signal mast logic.

useLayoutEditorBlocks

boolean useLayoutEditorBlocks(SignalMast destination)
Query if we are using the layout editor block information in the signal mast logic.

Parameters:
destination - Destination SignalMast.
Returns:
true if we are using the block information from the layout editor.

useLayoutEditorDetails

void useLayoutEditorDetails(boolean turnouts,
                            boolean blocks,
                            SignalMast destination)
                            throws JmriException
Sets whether we should use the information from the layout editor for either blocks or turnouts.

Parameters:
destination - Destination SignalMast.
blocks - set false if not to use the block information gathered from the layouteditor
turnouts - set false if not to use the turnout information gathered from the layouteditor
Throws:
JmriException

useLayoutEditorTurnouts

boolean useLayoutEditorTurnouts(SignalMast destination)
Query if we are using the layout editor turnout information in the signal mast logic.

Parameters:
destination - Destination SignalMast.
Returns:
true if we are using the turnout information from the layout editor.

disableLayoutEditorUse

void disableLayoutEditorUse()

removePropertyChangeListener

void removePropertyChangeListener(PropertyChangeListener l)

addPropertyChangeListener

void addPropertyChangeListener(PropertyChangeListener l)

getFacingBlock

LayoutBlock getFacingBlock()
Get the block facing our source signal


getProtectingBlock

LayoutBlock getProtectingBlock(SignalMast destination)
Get the block that the source signal is protecting on the path to the destination signal mast


setupLayoutEditorTurnoutDetails

LinkedHashMap<Block,Integer> setupLayoutEditorTurnoutDetails(List<LayoutBlock> blks,
                                                             SignalMast destination)
Set the auto turnouts based upon a given list of layout blocks for a specific destination mast

Parameters:
blks - List of Layout Blockt.
destination - Destination SignalMast.
Returns:
A LinkedHashMap of the original blocks and the required state, plus any blocks found on double-overs that also need to be un-occupied


Copyright © 1997-2013 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads