|
||||||||||
| 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.
| Field Summary | |
|---|---|
protected PropertyChangeListener |
propertyDestinationMastListener
|
protected PropertyChangeListener |
propertySourceMastListener
|
| 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 |
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 |
dispose()
|
protected void |
firePropertyChange(String p,
Object old,
Object n)
|
ArrayList<Block> |
getAutoBlocks(SignalMast destination)
|
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()
|
float |
getMaximumSpeed(SignalMast destination)
|
ArrayList<NamedBeanHandle<Sensor>> |
getNamedSensors(SignalMast destination)
|
ArrayList<NamedBeanHandle<Turnout>> |
getNamedTurnouts(SignalMast destination)
|
int |
getNumPropertyChangeListeners()
|
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 |
setAutoBlocks(Hashtable<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 |
setProtectingBlock(LayoutBlock protecting)
|
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()
|
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 |
|---|
protected PropertyChangeListener propertyDestinationMastListener
protected PropertyChangeListener propertySourceMastListener
| Constructor Detail |
|---|
public DefaultSignalMastLogic(SignalMast source)
source - - The signalmast we are configuring| Method Detail |
|---|
public void setFacingBlock(LayoutBlock facing)
setFacingBlock in interface SignalMastLogicpublic void setProtectingBlock(LayoutBlock protecting)
setProtectingBlock in interface SignalMastLogicpublic SignalMast getSourceMast()
getSourceMast 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 boolean removeDestination(SignalMast dest)
removeDestination in interface SignalMastLogicdest - Destination SignalMast.
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 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(Hashtable<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 ArrayList<Block> getBlocks(SignalMast destination)
getBlocks in interface SignalMastLogicpublic ArrayList<Block> getAutoBlocks(SignalMast destination)
getAutoBlocks 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 SignalMastLogicpublic 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 SignalMastLogic
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 | |||||||||