|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.implementation.DefaultSignalMastLogic
public class DefaultSignalMastLogic
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.
| Nested Class Summary | |
|---|---|
(package private) class |
DefaultSignalMastLogic.DestinationMast
|
| Field Summary | |
|---|---|
(package private) SignalMast |
destination
|
(package private) Hashtable<SignalMast,DefaultSignalMastLogic.DestinationMast> |
destList
|
(package private) boolean |
disposing
|
(package private) LayoutEditor |
editor
|
(package private) LayoutBlock |
facingBlock
|
(package private) boolean |
inWait
|
(package private) static org.slf4j.Logger |
log
|
(package private) PropertyChangeSupport |
pcs
|
protected PropertyChangeListener |
propertyDestinationMastListener
|
protected PropertyChangeListener |
propertySourceMastListener
|
(package private) SignalMast |
source
|
(package private) String |
stopAspect
|
(package private) Thread |
thr
|
(package private) boolean |
useAutoGenBlock
|
(package private) boolean |
useAutoGenTurnouts
|
| Fields inherited from interface jmri.SignalMastLogic |
|---|
STOREALL, STOREMASTSONLY, STORENONE |
| Constructor Summary | |
|---|---|
DefaultSignalMastLogic(SignalMast source)
Initialise the signal mast logic |
|
| 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. |
(package private) boolean |
checkStates()
|
void |
disableLayoutEditorUse()
|
void |
dispose()
|
protected void |
firePropertyChange(String p,
Object old,
Object n)
|
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 dest)
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)
|
(package private) void |
setMastAppearance()
Evaluates the destination signal mast appearance and sets ours accordingly |
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. |
(package private) void |
setSignalAppearance()
|
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()
|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
SignalMast source
SignalMast destination
String stopAspect
Hashtable<SignalMast,DefaultSignalMastLogic.DestinationMast> destList
LayoutEditor editor
boolean useAutoGenBlock
boolean useAutoGenTurnouts
LayoutBlock facingBlock
boolean disposing
volatile boolean inWait
Thread thr
protected PropertyChangeListener propertyDestinationMastListener
protected PropertyChangeListener propertySourceMastListener
PropertyChangeSupport pcs
static org.slf4j.Logger log
| Constructor Detail |
|---|
public DefaultSignalMastLogic(SignalMast source)
source - - The signalmast we are configuring| Method Detail |
|---|
public void setFacingBlock(LayoutBlock facing)
setFacingBlock in interface SignalMastLogicpublic LayoutBlock getFacingBlock()
SignalMastLogic
getFacingBlock in interface SignalMastLogicpublic LayoutBlock getProtectingBlock(SignalMast dest)
SignalMastLogic
getProtectingBlock in interface SignalMastLogicpublic SignalMast getSourceMast()
getSourceMast in interface SignalMastLogic
public void replaceSourceMast(SignalMast oldMast,
SignalMast newMast)
SignalMastLogic
replaceSourceMast in interface SignalMastLogic
public void replaceDestinationMast(SignalMast oldMast,
SignalMast newMast)
SignalMastLogic
replaceDestinationMast in interface SignalMastLogicpublic void setDestinationMast(SignalMast dest)
setDestinationMast in interface SignalMastLogicpublic boolean isDestinationValid(SignalMast dest)
isDestinationValid in interface SignalMastLogicpublic ArrayList<SignalMast> getDestinationList()
getDestinationList in interface SignalMastLogicpublic String getComment(SignalMast dest)
getComment in interface SignalMastLogic
public void setComment(String comment,
SignalMast dest)
setComment in interface SignalMastLogic
public void setStore(int store,
SignalMast destination)
setStore in interface SignalMastLogicstore - public int getStoreState(SignalMast destination)
getStoreState in interface SignalMastLogicpublic void setEnabled(SignalMast dest)
setEnabled in interface SignalMastLogicpublic void setDisabled(SignalMast dest)
setDisabled in interface SignalMastLogicpublic boolean isEnabled(SignalMast dest)
isEnabled in interface SignalMastLogicpublic boolean isActive(SignalMast dest)
isActive in interface SignalMastLogicpublic SignalMast getActiveDestination()
SignalMastLogic
getActiveDestination in interface SignalMastLogicpublic boolean removeDestination(SignalMast dest)
removeDestination in interface SignalMastLogicdest - Destination SignalMast.
public void disableLayoutEditorUse()
disableLayoutEditorUse in interface SignalMastLogic
public void useLayoutEditor(boolean boo,
SignalMast destination)
throws JmriException
useLayoutEditor in interface SignalMastLogicboo - Use the layout editor details to determine logic details.destination - Destination SignalMast.
JmriExceptionpublic boolean useLayoutEditor(SignalMast destination)
useLayoutEditor in interface SignalMastLogicdestination - Destination SignalMast.
public void useLayoutEditorDetails(boolean turnouts,
boolean blocks,
SignalMast destination)
throws JmriException
useLayoutEditorDetails in interface SignalMastLogicdestination - Destination SignalMast.blocks - set false if not to use the block information gathered from the layouteditorturnouts - set false if not to use the turnout information gathered from the layouteditor
JmriExceptionpublic boolean useLayoutEditorTurnouts(SignalMast destination)
useLayoutEditorTurnouts in interface SignalMastLogicdestination - Destination SignalMast.
public boolean useLayoutEditorBlocks(SignalMast destination)
useLayoutEditorBlocks in interface SignalMastLogicdestination - Destination SignalMast.
public Section getAssociatedSection(SignalMast destination)
getAssociatedSection in interface SignalMastLogic
public void setAssociatedSection(Section sec,
SignalMast destination)
setAssociatedSection in interface SignalMastLogicpublic boolean allowAutoMaticSignalMastGeneration(SignalMast destination)
allowAutoMaticSignalMastGeneration in interface SignalMastLogicdestination - Destination SignalMast.
public void allowAutoMaticSignalMastGeneration(boolean allow,
SignalMast destination)
allowAutoMaticSignalMastGeneration in interface SignalMastLogicdestination - Destination SignalMast.allow - set true if we are to allow automatic generation.
public void allowTurnoutLock(boolean lock,
SignalMast destination)
allowTurnoutLock in interface SignalMastLogicdestination - Destination SignalMast.lock - set true if the system should lock the turnout.public boolean isTurnoutLockAllowed(SignalMast destination)
isTurnoutLockAllowed in interface SignalMastLogicdestination - Destination SignalMast.
public void setTurnouts(Hashtable<NamedBeanHandle<Turnout>,Integer> turnouts,
SignalMast destination)
setTurnouts in interface SignalMastLogicturnouts -
public void setAutoTurnouts(Hashtable<Turnout,Integer> turnouts,
SignalMast destination)
setAutoTurnouts in interface SignalMastLogic
public void setBlocks(Hashtable<Block,Integer> blocks,
SignalMast destination)
setBlocks in interface SignalMastLogicblocks -
public void setAutoBlocks(LinkedHashMap<Block,Integer> blocks,
SignalMast destination)
setAutoBlocks in interface SignalMastLogicblocks -
public void setMasts(Hashtable<SignalMast,String> masts,
SignalMast destination)
setMasts in interface SignalMastLogicmasts -
public void setAutoMasts(Hashtable<SignalMast,String> masts,
SignalMast destination)
setAutoMasts in interface SignalMastLogicmasts -
public void setSensors(Hashtable<NamedBeanHandle<Sensor>,Integer> sensors,
SignalMast destination)
setSensors in interface SignalMastLogicsensors -
public void addSensor(String sensorName,
int state,
SignalMast destination)
SignalMastLogic
addSensor in interface SignalMastLogic
public void removeSensor(String sensorName,
SignalMast destination)
SignalMastLogic
removeSensor in interface SignalMastLogicpublic ArrayList<Block> getBlocks(SignalMast destination)
getBlocks in interface SignalMastLogicpublic ArrayList<Block> getAutoBlocks(SignalMast destination)
SignalMastLogic
getAutoBlocks in interface SignalMastLogicpublic ArrayList<Block> getAutoBlocksBetweenMasts(SignalMast destination)
SignalMastLogic
getAutoBlocksBetweenMasts in interface SignalMastLogicpublic ArrayList<Turnout> getTurnouts(SignalMast destination)
getTurnouts in interface SignalMastLogicpublic ArrayList<NamedBeanHandle<Turnout>> getNamedTurnouts(SignalMast destination)
getNamedTurnouts in interface SignalMastLogicpublic ArrayList<Turnout> getAutoTurnouts(SignalMast destination)
getAutoTurnouts in interface SignalMastLogicpublic ArrayList<Sensor> getSensors(SignalMast destination)
getSensors in interface SignalMastLogicpublic ArrayList<NamedBeanHandle<Sensor>> getNamedSensors(SignalMast destination)
getNamedSensors in interface SignalMastLogicpublic ArrayList<SignalMast> getSignalMasts(SignalMast destination)
getSignalMasts in interface SignalMastLogicpublic ArrayList<SignalMast> getAutoMasts(SignalMast destination)
getAutoMasts in interface SignalMastLogicpublic void initialise()
initialise in interface SignalMastLogicpublic void initialise(SignalMast destination)
initialise in interface SignalMastLogicpublic void setupLayoutEditorDetails()
setupLayoutEditorDetails in interface SignalMastLogicboolean checkStates()
public boolean areBlocksIncluded(ArrayList<Block> blks)
areBlocksIncluded in interface SignalMastLogic
public int getBlockState(Block block,
SignalMast destination)
getBlockState in interface SignalMastLogic
public boolean isBlockIncluded(Block block,
SignalMast destination)
isBlockIncluded in interface SignalMastLogic
public boolean isTurnoutIncluded(Turnout turnout,
SignalMast destination)
isTurnoutIncluded in interface SignalMastLogic
public boolean isSensorIncluded(Sensor sensor,
SignalMast destination)
isSensorIncluded in interface SignalMastLogic
public boolean isSignalMastIncluded(SignalMast signal,
SignalMast destination)
isSignalMastIncluded in interface SignalMastLogic
public int getAutoBlockState(Block block,
SignalMast destination)
getAutoBlockState in interface SignalMastLogic
public int getSensorState(Sensor sensor,
SignalMast destination)
getSensorState in interface SignalMastLogic
public int getTurnoutState(Turnout turnout,
SignalMast destination)
getTurnoutState in interface SignalMastLogic
public int getAutoTurnoutState(Turnout turnout,
SignalMast destination)
getAutoTurnoutState in interface SignalMastLogic
public String getSignalMastState(SignalMast mast,
SignalMast destination)
getSignalMastState in interface SignalMastLogic
public String getAutoSignalMastState(SignalMast mast,
SignalMast destination)
getAutoSignalMastState in interface SignalMastLogicpublic float getMaximumSpeed(SignalMast destination)
getMaximumSpeed in interface SignalMastLogicvoid setSignalAppearance()
void setMastAppearance()
public void setConflictingLogic(SignalMast sm,
LevelXing lx)
setConflictingLogic in interface SignalMastLogic
public void removeConflictingLogic(SignalMast sm,
LevelXing lx)
removeConflictingLogic in interface SignalMastLogicpublic void addPropertyChangeListener(PropertyChangeListener l)
addPropertyChangeListener in interface SignalMastLogicpublic void removePropertyChangeListener(PropertyChangeListener l)
removePropertyChangeListener in interface SignalMastLogicpublic int getNumPropertyChangeListeners()
getNumPropertyChangeListeners in interface SignalMastLogic
protected void firePropertyChange(String p,
Object old,
Object n)
public void dispose()
dispose in interface SignalMastLogic
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||