Package jmri.managers
Class DefaultSignalMastLogicManager
- All Implemented Interfaces:
PropertyChangeListener,VetoableChangeListener,EventListener,PropertyChangeFirer,PropertyChangeProvider,SilenceablePropertyChangeProvider,VetoableChangeFirer,VetoableChangeProvider,Manager<SignalMastLogic>,SignalMastLogicManager
public class DefaultSignalMastLogicManager
extends AbstractManager<SignalMastLogic>
implements SignalMastLogicManager
Default implementation of a SignalMastLogicManager.
- See Also:
-
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
FieldsFields inherited from class jmri.managers.AbstractManager
_beans, _tsys, _tuser, lastAutoNamedBeanRef, memo, paddedNumber, silenceableProperties, silencedPropertiesFields inherited from class jmri.beans.VetoableChangeSupport
vetoableChangeSupportFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupportFields 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, PROPERTY_BEANS, PROPERTY_CAN_DELETE, PROPERTY_DISPLAY_LIST_NAME, PROPERTY_DO_DELETE, PROPERTY_DO_NOT_DELETE, PROPERTY_LENGTH, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, STRINGIOS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTSFields inherited from interface jmri.SignalMastLogicManager
PROPERTY_AUTO_GENERATE_COMPLETE, PROPERTY_AUTO_GENERATE_UPDATE, PROPERTY_AUTO_SIGNALMAST_GENERATE_COMPLETE, PROPERTY_AUTO_SIGNALMAST_GENERATE_START -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) final voidvoidDiscover all possible valid source + destination signal mast pairs on all Layout Editor Panels.voidDisable the use of info from the Layout Editor Panels to configure a Signal Mast Logic for a specific Signal Mast.voiddiscoverSignallingDest(SignalMast source, LayoutEditor layout) Discover valid destination Signal Masts for a given source Signal Mast on a given Layout Editor Panel.voiddispose()Free resources when no longer used.voidPopulate Sections of type SIGNALMASTLOGIC used with Layout Editor with Signal Mast attributes as stored in Signal Mast Logic.getBeanTypeHandled(boolean plural) Get the user-readable name of the type of NamedBean handled by this manager.getLogicsByDestination(SignalMast destination) Gather a list of all the Signal Mast Logics, by destination Signal Mast.Get the class of NamedBean supported by this Manager.intgetSignalMastLogic(SignalMast source) Return the Signal Mast Logic for a specific Source Signal Mast.Return a list of all existing Signal Mast Logicsstatic final SignalSpeedMapintDetermine the order that types should be written when storing panel files.voidInitialise all the Signal Mast Logics.booleanisSignalMastUsed(SignalMast mast) Check if a Signal Mast is in use as either a Source or Destination mast in any Signal Mast LogicnewSignalMastLogic(SignalMast source) Provide / create New SML.voidremoveSignalMast(SignalMast mast) Completely remove a Signal Mast from all the SMLs that use it.voidCompletely remove a specific Signal Mast Logic by name.voidremoveSignalMastLogic(SignalMastLogic sml, SignalMast dest) Remove a destination Signal Mast and its settings from a Signal Mast Logic.voidIterate over the signal masts setting up direction Section sensors.voidreplaceSignalMast(SignalMast oldMast, SignalMast newMast) Replace all instances of an old SignalMast (either source or destination) with the new signal mast instance.voidsetSignalLogicDelay(int l) intIterate over the signal masts setting up direction Section sensors.voidswapSignalMasts(SignalMast mastA, SignalMast mastB) Replace the complete Signal Mast Logic configurations between two Source Signal Masts.charMethods inherited from class jmri.managers.AbstractManager
addDataListener, checkNumeric, createSystemName, deleteBean, deregister, fireDataListenersAdded, fireDataListenersRemoved, fireVetoableChange, getAutoSystemName, getBySystemName, getBySystemName, getByUserName, getKnownBeanProperties, getMemo, getNamedBean, getNamedBeanSet, getObjectCount, getOuterBean, getSystemPrefix, handleUserNameUniqueness, makeSystemName, propertyChange, register, registerSelf, registerUserName, removeDataListener, setDataListenerMute, setPropertyChangesSilenced, setRegisterSelf, updateAutoNumber, validSystemNameFormat, vetoableChangeMethods inherited from class jmri.beans.VetoableChangeSupport
addVetoableChangeListener, addVetoableChangeListener, fireVetoableChange, fireVetoableChange, fireVetoableChange, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListenerMethods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.Manager
addDataListener, deleteBean, deregister, getBeanTypeHandled, getBySystemName, getByUserName, getEntryToolTip, getKnownBeanProperties, getMemo, getNamedBean, getNamedBeanSet, getObjectCount, getSubSystemNamePrefix, getSystemNamePrefix, getSystemPrefix, isValidSystemNameFormat, makeSystemName, makeSystemName, makeSystemName, register, removeDataListener, setDataListenerMute, validateBadCharsInSystemNameFormat, validateIntegerSystemNameFormat, validateNmraAccessorySystemNameFormat, validateSystemNameFormat, validateSystemNameFormat, validateSystemNameFormatOnlyNumeric, validateSystemNamePrefix, validateTrimmedMin1NumberSystemNameFormat, validateTrimmedSystemNameFormat, validateUppercaseTrimmedSystemNameFormat, validSystemNameFormatMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from interface jmri.beans.SilenceablePropertyChangeProvider
setPropertyChangesSilencedMethods inherited from interface jmri.beans.VetoableChangeProvider
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
Field Details
-
signalLogicDelay
int signalLogicDelay
-
-
Constructor Details
-
DefaultSignalMastLogicManager
-
-
Method Details
-
addListeners
-
getXMLOrder
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:
getXMLOrderin interfaceManager<SignalMastLogic>- Returns:
- write order for this Manager; larger is later.
-
getSpeedMap
-
getSignalMastLogic
Return the Signal Mast Logic for a specific Source Signal Mast.- Specified by:
getSignalMastLogicin interfaceSignalMastLogicManager- Parameters:
source- The Source Signal Mast- Returns:
- The Signal Mast Logic for that mast
-
newSignalMastLogic
@Nonnull public SignalMastLogic newSignalMastLogic(@Nonnull SignalMast source) throws IllegalArgumentException Provide / create New SML. Create a new Signal Mast Logic for a source Signal Mast.- Specified by:
newSignalMastLogicin interfaceSignalMastLogicManager- Parameters:
source- The source Signal Mast- Returns:
- source The new SML instance
- Throws:
IllegalArgumentException- when needed
-
replaceSignalMast
Replace all instances of an old SignalMast (either source or destination) with the new signal mast instance. This is for use with such tools as the Layout Editor where a signal mast at a certain location can be replaced with another, while the remainder of the configuration stays the same.- Specified by:
replaceSignalMastin interfaceSignalMastLogicManager- Parameters:
oldMast- Current Signal MastnewMast- Replacement (new) Signal Mast
-
swapSignalMasts
Replace the complete Signal Mast Logic configurations between two Source Signal Masts.- Specified by:
swapSignalMastsin interfaceSignalMastLogicManager- Parameters:
mastA- Signal Mast AmastB- Signal Mast B
-
getLogicsByDestination
Gather a list of all the Signal Mast Logics, by destination Signal Mast.- Specified by:
getLogicsByDestinationin interfaceSignalMastLogicManager- Parameters:
destination- The destination Signal Mast- Returns:
- a list of logics for destination or an empty list if none
-
getSignalMastLogicList
Return a list of all existing Signal Mast Logics- Specified by:
getSignalMastLogicListin interfaceSignalMastLogicManager- Returns:
- An List of all Signal Mast Logics
-
isSignalMastUsed
Check if a Signal Mast is in use as either a Source or Destination mast in any Signal Mast Logic- Specified by:
isSignalMastUsedin interfaceSignalMastLogicManager- Parameters:
mast- the signal mast to check- Returns:
- true if mast is used by at least one Signal Mast Logic
-
removeSignalMastLogic
Remove a destination Signal Mast and its settings from a Signal Mast Logic.- Specified by:
removeSignalMastLogicin interfaceSignalMastLogicManager- Parameters:
sml- The Signal Mast Logicdest- The destination mast
-
removeSignalMastLogic
Completely remove a specific Signal Mast Logic by name.- Specified by:
removeSignalMastLogicin interfaceSignalMastLogicManager- Parameters:
sml- The Signal Mast Logic to be removed
-
removeSignalMast
Completely remove a Signal Mast from all the SMLs that use it.- Specified by:
removeSignalMastin interfaceSignalMastLogicManager- Parameters:
mast- The Signal Mast to be removed
-
disableLayoutEditorUse
Disable the use of info from the Layout Editor Panels to configure a Signal Mast Logic for a specific Signal Mast.- Specified by:
disableLayoutEditorUsein interfaceSignalMastLogicManager- Parameters:
mast- The Signal Mast for which LE info is to be disabled
-
initialise
Initialise all the Signal Mast Logics. Primarily used after loading a configuration.- Specified by:
initialisein interfaceSignalMastLogicManager
-
typeLetter
- Specified by:
typeLetterin interfaceManager<SignalMastLogic>- Returns:
- The type letter for a specific implementation
-
getSignalLogicDelay
- Specified by:
getSignalLogicDelayin interfaceSignalMastLogicManager- Returns:
- characteristic delay time in msec, used to control roughly when signal system computations are done. (Some are half this, some twice)
-
setSignalLogicDelay
- Specified by:
setSignalLogicDelayin interfaceSignalMastLogicManager- Parameters:
l- characteristic delay time in msec, used to control roughly when signal system computations are done. (Some are half this, some twice)
-
discoverSignallingDest
public void discoverSignallingDest(@Nonnull SignalMast source, @Nonnull LayoutEditor layout) throws JmriException Discover valid destination Signal Masts for a given source Signal Mast on a given Layout Editor Panel.- Specified by:
discoverSignallingDestin interfaceSignalMastLogicManager- Parameters:
source- Source SignalMastlayout- Layout Editor panel to check.- Throws:
JmriException- if there is an error discovering signaling destinations
-
automaticallyDiscoverSignallingPairs
Discover all possible valid source + destination signal mast pairs on all Layout Editor Panels.- Specified by:
automaticallyDiscoverSignallingPairsin interfaceSignalMastLogicManager- Throws:
JmriException- if there is an error discovering signaling pairs
-
generateSection
Populate Sections of type SIGNALMASTLOGIC used with Layout Editor with Signal Mast attributes as stored in Signal Mast Logic. -
getBeanTypeHandled
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:
getBeanTypeHandledin interfaceManager<SignalMastLogic>- 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
Get the class of NamedBean supported by this Manager. This should be the generic class used in the Manager's class declaration.- Specified by:
getNamedBeanClassin interfaceManager<SignalMastLogic>- Returns:
- the class supported by this Manager.
-
setupSignalMastsDirectionSensors
Iterate over the signal masts setting up direction Section sensors.- Specified by:
setupSignalMastsDirectionSensorsin interfaceSignalMastLogicManager- Returns:
- error count
-
removeSignalMastsDirectionSensors
Iterate over the signal masts setting up direction Section sensors.- Specified by:
removeSignalMastsDirectionSensorsin interfaceSignalMastLogicManager
-
dispose
Free resources when no longer used. Specifically, remove all references to and from this object, so it can be garbage-collected.- Specified by:
disposein interfaceManager<SignalMastLogic>- Specified by:
disposein interfaceSignalMastLogicManager- Overrides:
disposein classAbstractManager<SignalMastLogic>
-