Package jmri
Interface SignalMastLogic
-
- All Superinterfaces:
java.lang.Comparable<NamedBean>
,NamedBean
,PropertyChangeProvider
- All Known Implementing Classes:
DefaultSignalMastLogic
public interface SignalMastLogic extends NamedBean
Generic interface for Signal Mast Logic. Signal Mast Logic allows to build up a set of criteria for a Signal Mast as to what Aspect it should be displaying for a specific route through to a destination Signal Mast. * @see jmri.implementation.DefaultSignalMastLogic
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
-
-
Field Summary
Fields Modifier and Type Field Description static int
STOREALL
Constant representing that all the user entered details relating to a signal mast 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.-
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add aPropertyChangeListener
to the listener list.void
addSensor(java.lang.String sensorName, int state, SignalMast destination)
Add an individual control Sensor and its set to state to the Signal Mast 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 generate a list of conflicting Signal Mast 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(java.util.List<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()
Remove references to and from this object, so that it can eventually be garbage-collected.SignalMast
getActiveDestination()
Get the active destination Signal Mast for this Signal Mast Logic.Section
getAssociatedSection(SignalMast destination)
Return the Section configured between the source and destination mast.java.util.List<Block>
getAutoBlocks(SignalMast destination)
Return all the blocks that have been detected as being in use for this logic.java.util.List<Block>
getAutoBlocksBetweenMasts(SignalMast destination)
Return a list of blocks just that have been detected as being directly between the source and destination mast.int
getAutoBlockState(Block block, SignalMast destination)
Return the Set State of a control block as it is configured between the source and destination mast.java.util.List<SignalMast>
getAutoMasts(SignalMast destination)
Return a list of control masts that have been automatically detected as being directly between the source and destination mast.java.lang.String
getAutoSignalMastState(SignalMast mast, SignalMast destination)
Return the Set State (Aspect) of a control mast as it is configured between the source and destination mast.java.util.List<Turnout>
getAutoTurnouts(SignalMast destination)
Return only the turnouts that have been detected as being directly between the source and destination mast.int
getAutoTurnoutState(Turnout turnout, SignalMast destination)
Return the Set State of a control turnout as it is configured between the source and destination mast.java.util.List<Block>
getBlocks(SignalMast destination)
Return the Layout Blocks that have been defined by the user to control the SML to the destination mast.int
getBlockState(Block block, SignalMast destination)
Return the Set To State of a control block as it is configured between the source and destination mast.java.lang.String
getComment(SignalMast destination)
Get the comment set on this SML.java.util.List<SignalMast>
getDestinationList()
Return a list of all Signal Masts that have been configured as Destination Masts on this SML.LayoutBlock
getFacingBlock()
Get the block defined as facing our source signal mast.float
getMaximumSpeed(SignalMast destination)
Get the Maximum Speed set for the destination Signal Mast in this SML.java.util.List<NamedBeanHandle<Sensor>>
getNamedSensors(SignalMast destination)
Return the Sensors that have been defined by the user to control the SML to the destination mast as NamedBeanHandles.java.util.List<NamedBeanHandle<Turnout>>
getNamedTurnouts(SignalMast destination)
Return the Turnouts that have been defined by the user to control the SML to the destination mast as NamedBeanHandles.int
getNumPropertyChangeListeners()
Return the number of current listeners defined on this SML.LayoutBlock
getProtectingBlock(SignalMast destination)
Get the block that the source signal is protecting on the path to the destination signal mast.java.util.List<Sensor>
getSensors(SignalMast destination)
Return the Sensors that have been defined by the user to control the SML to the destination mast.int
getSensorState(Sensor sensor, SignalMast destination)
Return the Set To State of a control Sensor as it is configured between the source and destination mast.java.util.List<SignalMast>
getSignalMasts(SignalMast destination)
Return the Signal Masts that have been defined by the user to control the SML to the destination mast.java.lang.String
getSignalMastState(SignalMast mast, SignalMast destination)
Return the Set To State (Aspect) of a control Signal Mast as it is configured between the source and destination mast.SignalMast
getSourceMast()
Get the Source Mast.int
getStoreState(SignalMast destination)
Return where the signal mast logic should be stored, if so how much.java.util.List<Turnout>
getTurnouts(SignalMast destination)
Return the Turnouts that have been defined by the user to control the SML to the destination mast.int
getTurnoutState(Turnout turnout, SignalMast destination)
Return the Set State of a control Turnout as it is configured between the source and destination mast.void
initialise()
General method to initialise all SMLs on the source SIgnal Mast using destListvoid
initialise(SignalMast destination)
Initialise the signal mast after all the parameters have been set.boolean
isActive(SignalMast destination)
Query if the Signal Mast Logic from the current source signal mast to the destination signal mast is active.boolean
isBlockIncluded(Block block, SignalMast destination)
Check whether the Block is part of at least one of the logics.boolean
isDestinationValid(SignalMast destination)
Check if signal mast is a destination signal mast in one of the logicsboolean
isEnabled(SignalMast destination)
Query if the Signal Mast Logic from the current source signal mast to the specified destination signal mast is enabled.boolean
isSensorIncluded(Sensor sensor, SignalMast destination)
Check if a sensor is part of at least one of the logics that set a SignalMast.boolean
isSignalMastIncluded(SignalMast signal, SignalMast destination)
Check if a signal mast is part of at least one of the logics that set another signal mast.boolean
isTurnoutIncluded(Turnout turnout, SignalMast destination)
Check if a turnout is part of at least one of the logics that set a signal mast.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)
Remove control elements for a SML pair containing a destination signal mast that itself is incompatible with an SML around a level crossing.boolean
removeDestination(SignalMast destination)
Remove the destination signal mast as a pair in this SML.void
removeDirectionSensors()
remove direction sensors from SML need to autoActiveTrains.void
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove the specified listener from this object.void
removeSensor(java.lang.String sensorName, SignalMast destination)
Remove an individual control Sensor from the Signal Mast Logic.void
replaceDestinationMast(SignalMast oldMast, SignalMast newMast)
Replace the existing destination Signal Mast with another signal mast.void
replaceSourceMast(SignalMast oldMast, SignalMast newMast)
Replace the existing source Signal Mast with another signal mast.void
setAssociatedSection(Section sec, SignalMast destination)
Define a Section between the source and destination mast.void
setAutoBlocks(java.util.LinkedHashMap<Block,java.lang.Integer> blocks, SignalMast destination)
Set which blocks must be in a given state for the signal mast not to be set to a Stop aspect.void
setAutoMasts(java.util.Hashtable<SignalMast,java.lang.String> masts, SignalMast destination)
Set which control signal masts must be in a given state before our source mast can be set.void
setAutoTurnouts(java.util.Hashtable<Turnout,java.lang.Integer> turnouts, SignalMast destination)
Set which turnouts must be set to a given state for the signal mast not to be set to a Stop aspect.void
setBlocks(java.util.Hashtable<Block,java.lang.Integer> blocks, SignalMast destination)
Set which blocks must be in a given state for the signal mast not to be set to a Stop aspect.void
setComment(java.lang.String comment, SignalMast destination)
Set the comment for this SML.void
setConflictingLogic(SignalMast sm, LevelXing lx)
Add control elements for a SML pair containing a destination signal mast that itself is skipped as it is incompatible with an SML around a level crossing.void
setDestinationMast(SignalMast destination)
Set the destination signal mast for this SML.void
setDisabled(SignalMast destination)
Set the logic to the destination signal mast to Disabled.void
setEnabled(SignalMast destination)
Set the logic to the destination signal mast to Enabled.void
setFacingBlock(LayoutBlock facing)
Set the block facing our source signal mast.void
setMasts(java.util.Hashtable<SignalMast,java.lang.String> masts, SignalMast destination)
Set which control signal masts must be in a given state before our source mast can be set.void
setSensors(java.util.Hashtable<NamedBeanHandle<Sensor>,java.lang.Integer> sensors, SignalMast destination)
Set which sensors must be in a given state before our source signal mast can be set.void
setStore(int store, SignalMast destination)
Determine if the signal mast logic is stored in the panel file and if all the information is stored.void
setTurnouts(java.util.Hashtable<NamedBeanHandle<Turnout>,java.lang.Integer> turnouts, SignalMast destination)
Set the states that each control turnout must be in for the source signal mast not to be set to a Stop aspect.int
setupDirectionSensors()
Set direction sensors in SML need to autoActiveTrains.void
setupLayoutEditorDetails()
Set up a Signal Mast Logic from the Layout Editor panel where its source Signal Mast is present, when useLayoutEditor is set to true.java.util.LinkedHashMap<Block,java.lang.Integer>
setupLayoutEditorTurnoutDetails(java.util.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)
Set whether this logic should use the details stored in the Layout Editor to determine 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)
Set whether this logic 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.void
vetoableChange(java.beans.PropertyChangeEvent evt)
-
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, getBeanType, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getState, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setState, setUserName, toString, updateListenerRef
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener
-
-
-
-
Field Detail
-
STOREALL
static final int STOREALL
Constant representing that all the user entered details relating to a signal mast 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 generate a list of conflicting Signal Mast that have a direct effect on our logic.- Parameters:
destination
- controlled signal mast- 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:
allow
- set true if we are to allow automatic generation.destination
- controlled signal mast
-
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:
lock
- set true if the system should lock the turnout.destination
- controlled signal mast
-
areBlocksIncluded
boolean areBlocksIncluded(java.util.List<Block> blks)
Returns true if any of the blocks in the supplied list are included in any of the logics that set this signal.- Parameters:
blks
- A list of Layout Blocks to query against- Returns:
- whether all supplied blocks are in at least one of the logics
-
replaceSourceMast
void replaceSourceMast(SignalMast oldMast, SignalMast newMast)
Replace the existing source Signal Mast with another signal mast. This is for use with such tools as the Layout Editor where a signal mast in a certain location can be replaced with another, while the remainder of the configuration stays the same.- Parameters:
oldMast
- Signal Mast currently configured as the source mastnewMast
- Signal Mast to act as the replacement source mast
-
replaceDestinationMast
void replaceDestinationMast(SignalMast oldMast, SignalMast newMast)
Replace the existing destination Signal Mast with another signal mast. This is for use with such tools as the Layout Editor where a signalmast in a certain location can be replaced with another, while the remainder of the configuration stays the same.- Parameters:
oldMast
- Signal Mast currently configured as the destination mastnewMast
- Signal Mast to act as the replacement destination mast
-
dispose
void dispose()
Remove references to and from this object, so that it can eventually be garbage-collected.
-
getAssociatedSection
Section getAssociatedSection(SignalMast destination)
Return the Section configured between the source and destination mast.- Parameters:
destination
- controlled signal mast- Returns:
- The section object
-
setAssociatedSection
void setAssociatedSection(Section sec, SignalMast destination)
Define a Section between the source and destination mast.- Parameters:
sec
- The sectiondestination
- controlled signal mast
-
getAutoBlockState
int getAutoBlockState(Block block, SignalMast destination)
Return the Set State of a control block as it is configured between the source and destination mast.- Parameters:
block
- The Control Layout Block.destination
- controlled signal mast- Returns:
- The int value representing the occupancy state that the block should show
-
getAutoBlocks
java.util.List<Block> getAutoBlocks(SignalMast destination)
Return 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 effect on the logic.- Parameters:
destination
- controlled signal mast- Returns:
- A list of Block objects
-
getAutoBlocksBetweenMasts
@Nonnull java.util.List<Block> getAutoBlocksBetweenMasts(SignalMast destination)
Return a list of blocks just that have been detected as being directly between the source and destination mast. The order of the blocks in the list is the order in which they are connected.- Parameters:
destination
- controlled signal mast- Returns:
- A list of block objects
-
getAutoMasts
java.util.List<SignalMast> getAutoMasts(SignalMast destination)
Return a list of control masts that have been automatically detected as being directly between the source and destination mast. The order of the control masts in the list is the order in which they are connected.- Parameters:
destination
- controlled signal mast- Returns:
- A list of signal mast objects
-
getAutoSignalMastState
@CheckForNull java.lang.String getAutoSignalMastState(SignalMast mast, SignalMast destination)
Return the Set State (Aspect) of a control mast as it is configured between the source and destination mast.- Parameters:
mast
- The Control Signal Mastdestination
- controlled signal mast- Returns:
- The name of the Aspect the Control Mast should display
-
getAutoTurnoutState
int getAutoTurnoutState(Turnout turnout, SignalMast destination)
Return the Set State of a control turnout as it is configured between the source and destination mast.- Parameters:
turnout
- The Control Turnoutdestination
- controlled signal mast- Returns:
- The name of the Aspect the Control Mast should display
-
getAutoTurnouts
@Nonnull java.util.List<Turnout> getAutoTurnouts(SignalMast destination)
Return only the turnouts that have been detected as being directly between the source and destination mast. The order of the turnouts in the list is the order in which they are connected.- Parameters:
destination
- controlled signal mast- Returns:
- A list of turnout objects
-
getBlockState
int getBlockState(Block block, SignalMast destination)
Return the Set To State of a control block as it is configured between the source and destination mast.- Parameters:
block
- The Control Layout Blockdestination
- controlled signal mast- Returns:
- Integer representing the state the control block should be in
-
getBlocks
@Nonnull java.util.List<Block> getBlocks(SignalMast destination)
Return the Layout Blocks that have been defined by the user to control the SML to the destination mast.- Parameters:
destination
- controlled signal mast- Returns:
- A list of Block objects
-
getComment
@Nonnull java.lang.String getComment(SignalMast destination)
Get the comment set on this SML.- Parameters:
destination
- the mast to get the comment from- Returns:
- the comment or an empty string
-
getDestinationList
@Nonnull java.util.List<SignalMast> getDestinationList()
Return a list of all Signal Masts that have been configured as Destination Masts on this SML.- Returns:
- A list of Signal Mast objects
-
getMaximumSpeed
float getMaximumSpeed(SignalMast destination)
Get the Maximum Speed set for the destination Signal Mast in this SML.- Parameters:
destination
- the destination mast- Returns:
- A number representing the speed
-
getNumPropertyChangeListeners
int getNumPropertyChangeListeners()
Return the number of current listeners defined on this SML.- Specified by:
getNumPropertyChangeListeners
in interfaceNamedBean
- Returns:
- the number of listeners; -1 if the information is not available for some reason.
-
getSensorState
int getSensorState(Sensor sensor, SignalMast destination)
Return the Set To State of a control Sensor as it is configured between the source and destination mast.- Parameters:
sensor
- The Control Sensordestination
- controlled signal mast- Returns:
- Integer representing the state the control Sensor should be in
-
getSensors
@Nonnull java.util.List<Sensor> getSensors(SignalMast destination)
Return the Sensors that have been defined by the user to control the SML to the destination mast.- Parameters:
destination
- controlled signal mast- Returns:
- A list of Sensor objects
-
getNamedSensors
@Nonnull java.util.List<NamedBeanHandle<Sensor>> getNamedSensors(SignalMast destination)
Return the Sensors that have been defined by the user to control the SML to the destination mast as NamedBeanHandles.- Parameters:
destination
- controlled signal mast- Returns:
- A list of Sensor NamedBeanHandles
-
getSignalMastState
java.lang.String getSignalMastState(SignalMast mast, SignalMast destination)
Return the Set To State (Aspect) of a control Signal Mast as it is configured between the source and destination mast.- Parameters:
mast
- The Control Signal Mastdestination
- controlled signal mast- Returns:
- Integer representing the state the control Signal Mast should be in
-
getSignalMasts
@Nonnull java.util.List<SignalMast> getSignalMasts(SignalMast destination)
Return the Signal Masts that have been defined by the user to control the SML to the destination mast.- Parameters:
destination
- controlled signal mast- Returns:
- A list of Signal Mast objects
-
getSourceMast
@Nonnull SignalMast getSourceMast()
Get the Source Mast.- Returns:
- Signal Mast object.
-
getTurnoutState
int getTurnoutState(Turnout turnout, SignalMast destination)
Return the Set State of a control Turnout as it is configured between the source and destination mast.- Parameters:
turnout
- The Control Turnoutdestination
- controlled signal mast- Returns:
- Integer representing the state the control Sensor should be in
-
getTurnouts
@Nonnull java.util.List<Turnout> getTurnouts(SignalMast destination)
Return the Turnouts that have been defined by the user to control the SML to the destination mast.- Parameters:
destination
- controlled signal mast- Returns:
- A list of Turnout objects
-
getNamedTurnouts
@Nonnull java.util.List<NamedBeanHandle<Turnout>> getNamedTurnouts(SignalMast destination)
Return the Turnouts that have been defined by the user to control the SML to the destination mast as NamedBeanHandles.- Parameters:
destination
- controlled signal mast- Returns:
- A list of Turnout NamedBeanHandles
-
initialise
void initialise()
General method to initialise all SMLs on the source SIgnal Mast using destList
-
initialise
void initialise(SignalMast destination)
Initialise the signal mast after all the parameters have been set.- Parameters:
destination
- controlled signal mast
-
isActive
boolean isActive(SignalMast destination)
Query if the Signal Mast Logic from the current source signal mast to the destination signal mast is active.- Parameters:
destination
- controlled signal mast- Returns:
- true if active; false otherwise
-
getActiveDestination
@CheckForNull SignalMast getActiveDestination()
Get the active destination Signal Mast for this Signal Mast Logic.- Returns:
- the active signal mast or null if none
-
isBlockIncluded
boolean isBlockIncluded(Block block, SignalMast destination)
Check whether the Block is part of at least one of the logics.- Parameters:
block
- a layout blockdestination
- controlled signal mast- Returns:
- true if block is included in any of the Signal Mast Logics that set destination
-
isDestinationValid
boolean isDestinationValid(SignalMast destination)
Check if signal mast is a destination signal mast in one of the logics- Parameters:
destination
- controlled signal mast- Returns:
- true if destination is a destination mast in this object
-
isEnabled
boolean isEnabled(SignalMast destination)
Query if the Signal Mast Logic from the current source signal mast to the specified destination signal mast is enabled.- Parameters:
destination
- controlled signal mast- Returns:
- true if enabled
-
isSensorIncluded
boolean isSensorIncluded(Sensor sensor, SignalMast destination)
Check if a sensor is part of at least one of the logics that set a SignalMast.- Parameters:
sensor
- the sensor to checkdestination
- controlled signal- Returns:
- true if sensor is included in any of the Signal Mast Logics that set destination
-
isSignalMastIncluded
boolean isSignalMastIncluded(SignalMast signal, SignalMast destination)
Check if a signal mast is part of at least one of the logics that set another signal mast.- Parameters:
signal
- the signal mast to checkdestination
- controlled signal mast- Returns:
- true if signal is included in any of the Signal Mast Logics that set destination
-
isTurnoutIncluded
boolean isTurnoutIncluded(Turnout turnout, SignalMast destination)
Check if a turnout is part of at least one of the logics that set a signal mast.- Parameters:
turnout
- the turnout to checkdestination
- controlled signal mast- Returns:
- true if turnout is included in any of the Signal Mast Logics that set destination
-
isTurnoutLockAllowed
boolean isTurnoutLockAllowed(SignalMast destination)
Query if we are allowing the system to lock turnouts when the logic goes active.- Parameters:
destination
- controlled signal mast- Returns:
- true if locking is allowed.
-
removeConflictingLogic
void removeConflictingLogic(SignalMast sm, LevelXing lx)
Remove control elements for a SML pair containing a destination signal mast that itself is incompatible with an SML around a level crossing.- Parameters:
sm
- The destination Signal Mastlx
- The LevelXing Layout Editor element
-
removeDestination
boolean removeDestination(SignalMast destination)
Remove the destination signal mast as a pair in this SML.- Parameters:
destination
- controlled signal mast- Returns:
- true if there are no more destination signal masts
-
setAutoBlocks
void setAutoBlocks(java.util.LinkedHashMap<Block,java.lang.Integer> blocks, SignalMast destination)
Set which blocks must be in a given state for the signal mast not to be set to a Stop aspect. These blocks are not stored in the panel file.- Parameters:
blocks
- map ofBlock
s and their respective set to state to be checkeddestination
- controlled signal mast
-
setAutoMasts
void setAutoMasts(java.util.Hashtable<SignalMast,java.lang.String> masts, SignalMast destination)
Set which control signal masts must be in a given state before our source mast can be set. These Signal Masts are not stored in the panel file.- Parameters:
masts
- list of control signal masts and their respective set to state to be checkeddestination
- controlled signal mast
-
setAutoTurnouts
void setAutoTurnouts(java.util.Hashtable<Turnout,java.lang.Integer> turnouts, SignalMast destination)
Set which turnouts must be set to a given state for the signal mast not to be set to a Stop aspect. These Turnouts are not stored in the panel file.- Parameters:
turnouts
- map of turnouts and their respective set to statedestination
- controlled signal mast
-
setBlocks
void setBlocks(java.util.Hashtable<Block,java.lang.Integer> blocks, SignalMast destination)
Set which blocks must be in a given state for the signal mast not to be set to a Stop aspect.- Parameters:
blocks
- map of Blocks and their respective set to statedestination
- controlled signal mast
-
setComment
void setComment(java.lang.String comment, SignalMast destination)
Set the comment for this SML.- Parameters:
comment
- text to add as commentdestination
- signal mast to add comment to
-
setConflictingLogic
void setConflictingLogic(SignalMast sm, LevelXing lx)
Add control elements for a SML pair containing a destination signal mast that itself is skipped as it is incompatible with an SML around a level crossing.- Parameters:
sm
- The destination Signal Mastlx
- The LevelXing Layout Editor element
-
setDestinationMast
void setDestinationMast(SignalMast destination)
Set the destination signal mast for this SML.- Parameters:
destination
- controlled signal mast
-
setDisabled
void setDisabled(SignalMast destination)
Set the logic to the destination signal mast to Disabled.- Parameters:
destination
- controlled signal mast
-
setEnabled
void setEnabled(SignalMast destination)
Set the logic to the destination signal mast to Enabled.- Parameters:
destination
- controlled signal mast
-
setFacingBlock
void setFacingBlock(LayoutBlock facing)
Set the block facing our source signal mast.- Parameters:
facing
- The Layout Block facing the source Signal Mast
-
getFacingBlock
LayoutBlock getFacingBlock()
Get the block defined as facing our source signal mast.- Returns:
- The Layout Block facing the source Signal Mast
-
setMasts
void setMasts(java.util.Hashtable<SignalMast,java.lang.String> masts, SignalMast destination)
Set which control signal masts must be in a given state before our source mast can be set.- Parameters:
masts
- map of control signal masts and respective set to states to be checkeddestination
- controlled signal mast
-
setSensors
void setSensors(java.util.Hashtable<NamedBeanHandle<Sensor>,java.lang.Integer> sensors, SignalMast destination)
Set which sensors must be in a given state before our source signal mast can be set.- Parameters:
sensors
- TheSensor
s to be checkeddestination
- controlled signal mast
-
addSensor
void addSensor(java.lang.String sensorName, int state, SignalMast destination)
Add an individual control Sensor and its set to state to the Signal Mast Logic.- Parameters:
sensorName
- The sensor to be removedstate
- Integer representing the state the control Sensor should be indestination
- controlled signal mast
-
removeSensor
void removeSensor(java.lang.String sensorName, SignalMast destination)
Remove an individual control Sensor from the Signal Mast Logic.- Parameters:
sensorName
- The sensor to be removeddestination
- controlled signal mast
-
setStore
void setStore(int store, SignalMast destination)
Determine if the signal mast logic is stored in the panel file and if all the information is stored.- Parameters:
store
- one ofSTOREALL
,STOREMASTSONLY
orSTORENONE
destination
- controlled signal mast
-
getStoreState
int getStoreState(SignalMast destination)
Return where the signal mast logic should be stored, if so how much.- Parameters:
destination
- controlled signal mast- Returns:
- one of
STOREALL
,STOREMASTSONLY
orSTORENONE
-
setTurnouts
void setTurnouts(java.util.Hashtable<NamedBeanHandle<Turnout>,java.lang.Integer> turnouts, SignalMast destination)
Set the states that each control turnout must be in for the source signal mast not to be set to a Stop aspect.- Parameters:
turnouts
- A list of named turnouts and their respective set to state to checkdestination
- controlled signal mast
-
setupLayoutEditorDetails
void setupLayoutEditorDetails()
Set up a Signal Mast Logic from the Layout Editor panel where its source Signal Mast is present, when useLayoutEditor is set to true.
-
useLayoutEditor
void useLayoutEditor(boolean boo, SignalMast destination) throws JmriException
Set whether this logic should use the details stored in the Layout Editor to determine 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 detailsdestination
- the Destination Signal Mast- Throws:
JmriException
- if a path on the layout editor is not valid
-
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 Signal Mast- 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 Signal Mast- Returns:
- true if we are using the block information from the Layout Editor.
-
useLayoutEditorDetails
void useLayoutEditorDetails(boolean turnouts, boolean blocks, SignalMast destination) throws JmriException
Set whether this logic should use the information from the Layout Editor for either blocks or turnouts.- Parameters:
turnouts
- set false if not to use the turnout information gathered from the layout editorblocks
- set false if not to use the block information gathered from the layout editordestination
- Destination Signal Mast- Throws:
JmriException
- if a path on the layout editor is not valid
-
useLayoutEditorTurnouts
boolean useLayoutEditorTurnouts(SignalMast destination)
Query if we are using the Layout Editor turnout information in the signal mast logic.- Parameters:
destination
- controlled signal mast- Returns:
- true if we are using the turnout information from the Layout Editor.
-
setupDirectionSensors
int setupDirectionSensors()
Set direction sensors in SML need to autoActiveTrains.- Returns:
- number of errors
-
removeDirectionSensors
void removeDirectionSensors()
remove direction sensors from SML need to autoActiveTrains.
-
disableLayoutEditorUse
void disableLayoutEditorUse()
-
removePropertyChangeListener
void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface:PropertyChangeProvider
Remove the specified listener from this object.- Specified by:
removePropertyChangeListener
in interfacePropertyChangeProvider
- Parameters:
l
- ThePropertyChangeListener
to remove.
-
addPropertyChangeListener
void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface:PropertyChangeProvider
Add aPropertyChangeListener
to the listener list.- Specified by:
addPropertyChangeListener
in interfacePropertyChangeProvider
- Parameters:
l
- The PropertyChangeListener to be added
-
getProtectingBlock
@CheckForNull LayoutBlock getProtectingBlock(SignalMast destination)
Get the block that the source signal is protecting on the path to the destination signal mast.- Parameters:
destination
- controlled signal mast- Returns:
- the Layout Block
-
setupLayoutEditorTurnoutDetails
@Nonnull java.util.LinkedHashMap<Block,java.lang.Integer> setupLayoutEditorTurnoutDetails(java.util.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 Blocks.destination
- Destination Signal Mast- Returns:
- A LinkedHashMap of the original blocks and their required state, plus any blocks found on double cross-overs that also need to be un-occupied.
-
vetoableChange
void vetoableChange(java.beans.PropertyChangeEvent evt) throws java.beans.PropertyVetoException
- Specified by:
vetoableChange
in interfaceNamedBean
- Throws:
java.beans.PropertyVetoException
-
-