Class LayoutBlockManager
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.beans.VetoableChangeSupport
-
- jmri.managers.AbstractManager<LayoutBlock>
-
- jmri.jmrit.display.layoutEditor.LayoutBlockManager
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.beans.VetoableChangeListener
,java.util.EventListener
,PropertyChangeFirer
,PropertyChangeProvider
,SilenceablePropertyChangeProvider
,VetoableChangeFirer
,VetoableChangeProvider
,InstanceManagerAutoDefault
,Manager<LayoutBlock>
public class LayoutBlockManager extends AbstractManager<LayoutBlock> implements InstanceManagerAutoDefault
Implementation of a Manager to handle LayoutBlocks. Note: the same LayoutBlocks may appear in multiple LayoutEditor panels.This manager does not enforce any particular system naming convention.
LayoutBlocks are usually addressed by userName. The systemName is hidden from the user for the most part.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.Manager
Manager.ManagerDataEvent<E extends NamedBean>, Manager.ManagerDataListener<E extends NamedBean>, Manager.NameValidity
-
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
checking
protected boolean
enableAdvancedRouting
(package private) LayoutBlockConnectivityTools
lbct
(package private) boolean
stabilised
-
Fields inherited from class jmri.managers.AbstractManager
_beans, _tsys, _tuser, memo, silenceableProperties, silencedProperties
-
Fields inherited from class jmri.beans.VetoableChangeSupport
vetoableChangeSupport
-
Fields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport
-
Fields inherited from interface jmri.Manager
ANALOGIOS, AUDIO, BLOCKBOSS, BLOCKS, CONDITIONALS, CTCDATA, ENTRYEXIT, IDTAGS, LAYOUTBLOCKS, LIGHTS, LOGIXNG_ANALOG_ACTIONS, LOGIXNG_ANALOG_EXPRESSIONS, LOGIXNG_CONDITIONALNGS, LOGIXNG_DIGITAL_ACTIONS, LOGIXNG_DIGITAL_BOOLEAN_ACTIONS, LOGIXNG_DIGITAL_EXPRESSIONS, LOGIXNG_GLOBAL_VARIABLES, LOGIXNG_MODULES, LOGIXNG_STRING_ACTIONS, LOGIXNG_STRING_EXPRESSIONS, LOGIXNG_TABLES, LOGIXNGS, LOGIXS, MEMORIES, METERFRAMES, METERS, OBLOCKS, PANELFILES, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, STRINGIOS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS
-
-
Constructor Summary
Constructors Constructor Description LayoutBlockManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBadBeanError()
LayoutBlock
createNewLayoutBlock()
LayoutBlock
createNewLayoutBlock(java.lang.String systemName, java.lang.String userName)
Create a new LayoutBlock if the LayoutBlock does not exist.void
deleteLayoutBlock(LayoutBlock block)
Remove an existing LayoutBlock.void
enableAdvancedRouting(boolean boo)
java.lang.String
getBeanTypeHandled(boolean plural)
Get the user-readable name of the type of NamedBean handled by this manager.LayoutBlock
getBlockWithMemoryAssigned(Memory m)
Find a LayoutBlock with a specified Memory assigned as its value display.LayoutBlock
getBlockWithSensorAssigned(Sensor s)
Find a LayoutBlock with a specified Sensor assigned as its occupancy sensor.NamedBean
getFacingBean(Block facingBlock, Block protectedBlock, LayoutEditor panel, java.lang.Class<?> T)
Get a facing bean into a specified Block from a specified protected Block.LayoutBlock
getFacingBlock(java.lang.String signalName, LayoutEditor panel)
Get the LayoutBlock that a given signal is facing.LayoutBlock
getFacingBlock(SignalHead signalHead, LayoutEditor panel)
LayoutBlock
getFacingBlockByMast(SignalMast signalMast, LayoutEditor panel)
Get the LayoutBlock that a given signal is facing.LayoutBlock
getFacingBlockByNamedBean(NamedBean nb, LayoutEditor panel)
Get the block facing a given bean object (Sensor, SignalMast or SignalHead).LayoutBlock
getFacingBlockBySensor(java.lang.String sensorName, LayoutEditor panel)
Get the LayoutBlock that a given sensor is facing.LayoutBlock
getFacingBlockBySensor(Sensor sensor, LayoutEditor panel)
Get the LayoutBlock that a given sensor is facing.NamedBean
getFacingNamedBean(Block facingBlock, Block protectedBlock, LayoutEditor panel)
Get the named bean of either a Sensor or signalmast facing into a specified Block from a specified protected Block.Sensor
getFacingSensor(Block facingBlock, Block protectedBlock, LayoutEditor panel)
Get the Sensor facing into a specified Block from a specified protected Block.SignalHead
getFacingSignalHead(Block facingBlock, Block protectedBlock)
Get the Signal Head facing into a specified Block from a specified protected Block.SignalMast
getFacingSignalMast(Block facingBlock, Block protectedBlock)
SignalMast
getFacingSignalMast(Block facingBlock, Block protectedBlock, LayoutEditor panel)
Get the Signal Mast facing into a specified Block from a specified protected Block.java.lang.Object
getFacingSignalObject(Block facingBlock, Block protectedBlock)
In the first instance get a Signal Mast or if none exists a Signal Head for a given facing block and protected block combination.long
getLastRoutingChange()
LayoutBlock
getLayoutBlock(java.lang.String name)
Get an existing LayoutBlock.LayoutBlock
getLayoutBlock(Block block)
LayoutBlockConnectivityTools
getLayoutBlockConnectivityTools()
java.util.List<LayoutBlock>
getLayoutBlocksOccupiedByRosterEntry(RosterEntry re)
Get a list of layout blocks which this roster entry appears to be occupying.NamedBean
getNamedBeanAtEndBumper(Block facingBlock, LayoutEditor panel)
Get the named bean of either a Sensor or signalmast facing into a specified Block from a specified protected Block.java.lang.Class<LayoutBlock>
getNamedBeanClass()
Get the class of NamedBean supported by this Manager.NamedBeanHandle<Sensor>
getNamedStabilisedSensor()
Get the sensor used for the stability indication.LayoutBlock
getProtectedBlock(java.lang.String signalName, LayoutEditor panel)
Get the LayoutBlock that a given signal is protecting.LayoutBlock
getProtectedBlock(SignalHead signalHead, LayoutEditor panel)
LayoutBlock
getProtectedBlockByMast(SignalMast signalMast, LayoutEditor panel)
LayoutBlock
getProtectedBlockByNamedBean(NamedBean nb, LayoutEditor panel)
Get the block that a given bean object (Sensor, SignalMast or SignalHead) is protecting.LayoutBlock
getProtectedBlockBySensor(java.lang.String sensorName, LayoutEditor panel)
Get the LayoutBlock that a given sensor is protecting.LayoutBlock
getProtectedBlockBySensor(Sensor sensor, LayoutEditor panel)
Get the LayoutBlock that a given sensor is protecting.java.util.List<LayoutBlock>
getProtectingBlocksByNamedBean(NamedBean nb, LayoutEditor panel)
java.util.List<LayoutBlock>
getProtectingBlocksBySensor(Sensor sensor, LayoutEditor panel)
java.util.List<LayoutBlock>
getProtectingBlocksBySensorOld(Sensor sensor, LayoutEditor panel)
Sensor
getSensorAtEndBumper(Block facingBlock, LayoutEditor panel)
Get a Sensor facing into a specific Block.SignalMast
getSignalMastAtEndBumper(Block facingBlock, LayoutEditor panel)
Get a Signal Mast that is assigned to a block which has an end bumper at one end.Sensor
getStabilisedSensor()
Get the sensor used to indicate if the routing protocol has stabilised or not.int
getXMLOrder()
Determine the order that types should be written when storing panel files.void
initializeLayoutBlockPaths()
Initialize/check the Paths of all Blocks associated with LayoutBlocks.boolean
isAdvancedRoutingEnabled()
boolean
routingStablised()
(package private) void
setLastRoutingChange()
void
setStabilisedSensor(java.lang.String pName)
Assign a sensor to the routing protocol, that changes state dependant upon if the routing protocol has stabilised or is under going a change.void
turnOffWarning()
char
typeLetter()
boolean
warn()
Controls switching off incompatible block connectivity messages.-
Methods inherited from class jmri.managers.AbstractManager
addDataListener, checkNumeric, createSystemName, deleteBean, deregister, dispose, fireDataListenersAdded, fireDataListenersRemoved, fireVetoableChange, getAutoSystemName, getBySystemName, getBySystemName, getByUserName, getKnownBeanProperties, getMemo, getNamedBean, getNamedBeanSet, getObjectCount, getOuterBean, getSystemPrefix, handleUserNameUniqueness, makeSystemName, propertyChange, register, registerSelf, registerUserName, removeDataListener, setDataListenerMute, setPropertyChangesSilenced, updateAutoNumber, validSystemNameFormat, vetoableChange
-
Methods inherited from class jmri.beans.VetoableChangeSupport
addVetoableChangeListener, addVetoableChangeListener, fireVetoableChange, fireVetoableChange, fireVetoableChange, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.Manager
getBeanTypeHandled, getEntryToolTip, getSubSystemNamePrefix, getSystemNamePrefix, isValidSystemNameFormat, makeSystemName, makeSystemName, validateBadCharsInSystemNameFormat, validateIntegerSystemNameFormat, validateNmraAccessorySystemNameFormat, validateSystemNameFormat, validateSystemNameFormat, validateSystemNameFormatOnlyNumeric, validateSystemNamePrefix, validateTrimmedMin1NumberSystemNameFormat, validateTrimmedSystemNameFormat, validateUppercaseTrimmedSystemNameFormat
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from interface jmri.beans.VetoableChangeProvider
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
-
-
-
Field Detail
-
enableAdvancedRouting
protected boolean enableAdvancedRouting
-
checking
boolean checking
-
stabilised
boolean stabilised
-
-
Constructor Detail
-
LayoutBlockManager
public LayoutBlockManager()
-
-
Method Detail
-
getXMLOrder
public int getXMLOrder()
Description copied from interface:Manager
Determine the order that types should be written when storing panel files. Uses one of the constants defined in this class.Yes, that's an overly-centralized methodology, but it works for now.
- Specified by:
getXMLOrder
in interfaceManager<LayoutBlock>
- Returns:
- write order for this Manager; larger is later.
-
typeLetter
public char typeLetter()
- Specified by:
typeLetter
in interfaceManager<LayoutBlock>
- Returns:
- The type letter for a specific implementation
-
createNewLayoutBlock
@CheckReturnValue @CheckForNull public LayoutBlock createNewLayoutBlock(@CheckForNull java.lang.String systemName, java.lang.String userName)
Create a new LayoutBlock if the LayoutBlock does not exist.Note that since the userName is used to address LayoutBlocks, the user name must be present. If the user name is not present, the new LayoutBlock is not created, and null is returned.
- Parameters:
systemName
- block system name.userName
- block username, must be non-empty.- Returns:
- null if a LayoutBlock with the same systemName or userName already exists, or if there is trouble creating a new LayoutBlock
-
createNewLayoutBlock
@CheckReturnValue @CheckForNull public LayoutBlock createNewLayoutBlock()
-
deleteLayoutBlock
public void deleteLayoutBlock(LayoutBlock block)
Remove an existing LayoutBlock.- Parameters:
block
- the block to remove.
-
getLayoutBlock
@CheckReturnValue @CheckForNull public LayoutBlock getLayoutBlock(@Nonnull java.lang.String name)
Get an existing LayoutBlock. First looks up assuming that name is a User Name. If this fails, looks up assuming that name is a System Name.- Parameters:
name
- ideally block username, can be system name.- Returns:
- LayoutBlock, or null if not found by either user name or system name
-
getLayoutBlock
@CheckReturnValue @CheckForNull public LayoutBlock getLayoutBlock(@CheckForNull Block block)
-
getBlockWithSensorAssigned
@CheckReturnValue @CheckForNull public LayoutBlock getBlockWithSensorAssigned(@CheckForNull Sensor s)
Find a LayoutBlock with a specified Sensor assigned as its occupancy sensor.- Parameters:
s
- the sensor to search for.- Returns:
- the block or null if no existing LayoutBlock has the Sensor assigned
-
getBlockWithMemoryAssigned
@CheckReturnValue @CheckForNull public LayoutBlock getBlockWithMemoryAssigned(Memory m)
Find a LayoutBlock with a specified Memory assigned as its value display.- Parameters:
m
- the memory to search for.- Returns:
- the block or null if no existing LayoutBlock has the memory assigned.
-
initializeLayoutBlockPaths
public void initializeLayoutBlockPaths()
Initialize/check the Paths of all Blocks associated with LayoutBlocks.This routine should be called when loading panels, after all Layout Editor panels have been loaded.
-
addBadBeanError
public void addBadBeanError()
-
getFacingSignalHead
@CheckReturnValue @CheckForNull public SignalHead getFacingSignalHead(@CheckForNull Block facingBlock, @CheckForNull Block protectedBlock)
Get the Signal Head facing into a specified Block from a specified protected Block.This method is primarily designed for use with scripts to get information initially residing in a Layout Editor panel. If either of the input Blocks is null, or if the two blocks do not join at a block boundary, or if either of the input Blocks are not Layout Editor panel blocks, an error message is logged, and "null" is returned. If the signal at the block boundary has two heads--is located at the facing point of a turnout-- the Signal Head that applies for the current setting of turnout (THROWN or CLOSED) is returned. If the turnout state is UNKNOWN or INCONSISTENT, an error message is logged, and "null" is returned. If the signal at the block boundary has three heads--the facing point of a 3-way turnout--the Signal Head that applies for the current settings of the two turnouts of the 3-way turnout is returned. If the turnout state of either turnout is UNKNOWN or INCONSISTENT, an error is logged and "null" is returned. "null" is returned if the block boundary is between the two turnouts of a THROAT_TO_THROAT turnout or a 3-way turnout. "null" is returned for block boundaries exiting a THROAT_TO_THROAT turnout block, since there are no signals that apply there.
- Parameters:
facingBlock
- the facing block.protectedBlock
- the protected block.- Returns:
- the signal head, may be null.
-
getNamedBeanAtEndBumper
@CheckReturnValue @CheckForNull public NamedBean getNamedBeanAtEndBumper(@CheckForNull Block facingBlock, @CheckForNull LayoutEditor panel)
Get the named bean of either a Sensor or signalmast facing into a specified Block from a specified protected Block.- Parameters:
facingBlock
- the facing block.panel
- the main layout editor.- Returns:
- The assigned sensor or signal mast as a named bean
-
getSignalMastAtEndBumper
@CheckReturnValue @CheckForNull public SignalMast getSignalMastAtEndBumper(@CheckForNull Block facingBlock, @CheckForNull LayoutEditor panel)
Get a Signal Mast that is assigned to a block which has an end bumper at one end.- Parameters:
facingBlock
- the facing block.panel
- the main layout editor.- Returns:
- the signal mast.
-
getSensorAtEndBumper
@CheckReturnValue @CheckForNull public Sensor getSensorAtEndBumper(@CheckForNull Block facingBlock, @CheckForNull LayoutEditor panel)
Get a Sensor facing into a specific Block. This is used for Blocks that have an end bumper at one end.- Parameters:
facingBlock
- the facing block.panel
- the main layout editor.- Returns:
- the facing sensor.
-
getFacingNamedBean
@CheckReturnValue @CheckForNull public NamedBean getFacingNamedBean(@CheckForNull Block facingBlock, @CheckForNull Block protectedBlock, @CheckForNull LayoutEditor panel)
Get the named bean of either a Sensor or signalmast facing into a specified Block from a specified protected Block.- Parameters:
facingBlock
- the facing block.protectedBlock
- the protected block.panel
- the main layout editor.- Returns:
- The assigned sensor or signal mast as a named bean
-
getFacingSignalMast
@CheckReturnValue @CheckForNull public SignalMast getFacingSignalMast(@Nonnull Block facingBlock, @CheckForNull Block protectedBlock)
-
getFacingSignalMast
@CheckReturnValue @CheckForNull public SignalMast getFacingSignalMast(@Nonnull Block facingBlock, @CheckForNull Block protectedBlock, @CheckForNull LayoutEditor panel)
Get the Signal Mast facing into a specified Block from a specified protected Block.- Parameters:
facingBlock
- the facing block.protectedBlock
- the protected block.panel
- the main layout editor.- Returns:
- The assigned signalMast.
-
getFacingSensor
@CheckReturnValue @CheckForNull public Sensor getFacingSensor(@CheckForNull Block facingBlock, @CheckForNull Block protectedBlock, @CheckForNull LayoutEditor panel)
Get the Sensor facing into a specified Block from a specified protected Block.- Parameters:
facingBlock
- the facing block.protectedBlock
- the protected block.panel
- the main layout editor.- Returns:
- The assigned sensor
-
getFacingBean
@CheckReturnValue @CheckForNull public NamedBean getFacingBean(@CheckForNull Block facingBlock, @CheckForNull Block protectedBlock, @CheckForNull LayoutEditor panel, java.lang.Class<?> T)
Get a facing bean into a specified Block from a specified protected Block.- Parameters:
facingBlock
- the facing block.protectedBlock
- the protected block.panel
- the layout editor panel the block is assigned, if null then the maximum connected panel of the facing block is usedT
- The class of the item that we are looking for, either SignalMast or Sensor- Returns:
- The assigned sensor.
-
getFacingSignalObject
@CheckReturnValue @CheckForNull public java.lang.Object getFacingSignalObject(@Nonnull Block facingBlock, @CheckForNull Block protectedBlock)
In the first instance get a Signal Mast or if none exists a Signal Head for a given facing block and protected block combination. See #getFacingSignalMast() and #getFacingSignalHead() as to how they deal with what each returns.- Parameters:
facingBlock
- the facing block to search for.protectedBlock
- the protected block to search for.- Returns:
- either a signalMast or signalHead
-
getProtectedBlockByNamedBean
@CheckReturnValue @CheckForNull public LayoutBlock getProtectedBlockByNamedBean(@CheckForNull NamedBean nb, @CheckForNull LayoutEditor panel)
Get the block that a given bean object (Sensor, SignalMast or SignalHead) is protecting.- Parameters:
nb
- NamedBeanpanel
- panel that this bean is on- Returns:
- The block that the bean object is facing
-
getProtectingBlocksByNamedBean
@CheckReturnValue @Nonnull public java.util.List<LayoutBlock> getProtectingBlocksByNamedBean(@CheckForNull NamedBean nb, @CheckForNull LayoutEditor panel)
-
getProtectedBlockByMast
@CheckReturnValue @CheckForNull public LayoutBlock getProtectedBlockByMast(@CheckForNull SignalMast signalMast, @CheckForNull LayoutEditor panel)
-
getProtectedBlockBySensor
@CheckReturnValue @CheckForNull public LayoutBlock getProtectedBlockBySensor(@Nonnull java.lang.String sensorName, @CheckForNull LayoutEditor panel)
Get the LayoutBlock that a given sensor is protecting.- Parameters:
sensorName
- the sensor name to search for.panel
- the layout editor panel.- Returns:
- the layout block, may be null.
-
getProtectingBlocksBySensor
@Nonnull public java.util.List<LayoutBlock> getProtectingBlocksBySensor(@CheckForNull Sensor sensor, @CheckForNull LayoutEditor panel)
-
getProtectingBlocksBySensorOld
@Nonnull public java.util.List<LayoutBlock> getProtectingBlocksBySensorOld(@CheckForNull Sensor sensor, @Nonnull LayoutEditor panel)
-
getProtectedBlockBySensor
@CheckReturnValue @CheckForNull public LayoutBlock getProtectedBlockBySensor(@CheckForNull Sensor sensor, @CheckForNull LayoutEditor panel)
Get the LayoutBlock that a given sensor is protecting.- Parameters:
sensor
- sensor to search for.panel
- layout editor panel to search.- Returns:
- the layout block, may be null.
-
getFacingBlockByNamedBean
@CheckReturnValue @CheckForNull public LayoutBlock getFacingBlockByNamedBean(@Nonnull NamedBean nb, @CheckForNull LayoutEditor panel)
Get the block facing a given bean object (Sensor, SignalMast or SignalHead).- Parameters:
nb
- NamedBeanpanel
- panel that this bean is on- Returns:
- The block that the bean object is facing
-
getFacingBlockBySensor
@CheckReturnValue @CheckForNull public LayoutBlock getFacingBlockBySensor(@Nonnull java.lang.String sensorName, @CheckForNull LayoutEditor panel)
Get the LayoutBlock that a given sensor is facing.- Parameters:
sensorName
- the sensor name.panel
- the layout editor panel.- Returns:
- the facing layout block, may be null.
-
getFacingBlockByMast
@CheckReturnValue @CheckForNull public LayoutBlock getFacingBlockByMast(@Nonnull SignalMast signalMast, @Nonnull LayoutEditor panel)
Get the LayoutBlock that a given signal is facing.- Parameters:
signalMast
- the signal mast to search for.panel
- the layout editor panel.- Returns:
- the layout block, may be null.
-
getFacingBlockBySensor
@CheckReturnValue @CheckForNull public LayoutBlock getFacingBlockBySensor(@Nonnull Sensor sensor, @Nonnull LayoutEditor panel)
Get the LayoutBlock that a given sensor is facing.- Parameters:
sensor
- the sensor to search for.panel
- the layout editor panel to search.- Returns:
- the layout block, may be null.
-
getProtectedBlock
@CheckReturnValue @CheckForNull public LayoutBlock getProtectedBlock(@Nonnull SignalHead signalHead, @CheckForNull LayoutEditor panel)
-
getProtectedBlock
@CheckReturnValue @CheckForNull public LayoutBlock getProtectedBlock(@Nonnull java.lang.String signalName, @Nonnull LayoutEditor panel)
Get the LayoutBlock that a given signal is protecting.- Parameters:
signalName
- the signal name to search for.panel
- the main layout editor panel.- Returns:
- the layout block, may be null.
-
getFacingBlock
@CheckReturnValue @CheckForNull public LayoutBlock getFacingBlock(@Nonnull SignalHead signalHead, @CheckForNull LayoutEditor panel)
-
getFacingBlock
@CheckReturnValue @CheckForNull public LayoutBlock getFacingBlock(@Nonnull java.lang.String signalName, @Nonnull LayoutEditor panel)
Get the LayoutBlock that a given signal is facing.- Parameters:
signalName
- signal name.panel
- layout editor panel.- Returns:
- the facing layout block.
-
warn
public boolean warn()
Controls switching off incompatible block connectivity messages.Warnings are always on when program starts up. Once stopped by the user, these messages may not be switched on again until program restarts.
- Returns:
- true if connectivity warning flag set, else false.
-
turnOffWarning
public void turnOffWarning()
-
isAdvancedRoutingEnabled
public boolean isAdvancedRoutingEnabled()
- Returns:
- true if advanced layout block routing has been enabled
-
enableAdvancedRouting
public void enableAdvancedRouting(boolean boo)
-
getLayoutBlockConnectivityTools
@Nonnull public LayoutBlockConnectivityTools getLayoutBlockConnectivityTools()
-
setLastRoutingChange
void setLastRoutingChange()
-
setStabilisedSensor
public void setStabilisedSensor(@Nonnull java.lang.String pName) throws JmriException
Assign a sensor to the routing protocol, that changes state dependant upon if the routing protocol has stabilised or is under going a change.- Parameters:
pName
- sensor name, will be provided if not existing.- Throws:
JmriException
- if no sensor manager.
-
getStabilisedSensor
public Sensor getStabilisedSensor()
Get the sensor used to indicate if the routing protocol has stabilised or not.- Returns:
- routing stability sensor, may be null.
-
getNamedStabilisedSensor
@CheckReturnValue @CheckForNull public NamedBeanHandle<Sensor> getNamedStabilisedSensor()
Get the sensor used for the stability indication.- Returns:
- stability sensor, may be null.
-
routingStablised
public boolean routingStablised()
- Returns:
- true if the layout block routing protocol has stabilised
-
getLastRoutingChange
public long getLastRoutingChange()
- Returns:
- the time when the last routing change was made, recorded as System.nanoTime()
-
getBeanTypeHandled
@Nonnull public java.lang.String getBeanTypeHandled(boolean plural)
Description copied from interface:Manager
Get the user-readable name of the type of NamedBean handled by this manager.For instance, in the code where we are dealing with just a bean and a message that needs to be passed to the user or in a log.
- Specified by:
getBeanTypeHandled
in interfaceManager<LayoutBlock>
- Parameters:
plural
- true to return plural form of the type; false to return singular form- Returns:
- a string of the bean type that the manager handles, eg Turnout, Sensor etc
-
getNamedBeanClass
public java.lang.Class<LayoutBlock> getNamedBeanClass()
Get the class of NamedBean supported by this Manager. This should be the generic class used in the Manager's class declaration.- Specified by:
getNamedBeanClass
in interfaceManager<LayoutBlock>
- Returns:
- the class supported by this Manager.
-
getLayoutBlocksOccupiedByRosterEntry
@Nonnull public java.util.List<LayoutBlock> getLayoutBlocksOccupiedByRosterEntry(@Nonnull RosterEntry re)
Get a list of layout blocks which this roster entry appears to be occupying. A layout block is assumed to contain this roster entry if the value of the underlying block is the RosterEntry itself, or a string with the entry's id or dcc address.- Parameters:
re
- the roster entry- Returns:
- list of layout block user names
-
-