Package jmri.jmrix.ecos
Class EcosLocoAddressManager
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.beans.VetoableChangeSupport
-
- jmri.managers.AbstractManager<NamedBean>
-
- jmri.jmrix.ecos.EcosLocoAddressManager
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.beans.VetoableChangeListener
,java.util.EventListener
,PropertyChangeFirer
,PropertyChangeProvider
,SilenceablePropertyChangeProvider
,VetoableChangeFirer
,VetoableChangeProvider
,AbstractMRListener
,EcosListener
,Manager<NamedBean>
public class EcosLocoAddressManager extends AbstractManager<NamedBean> implements EcosListener
Class to manage the ECoS Loco entries within JMRI.
-
-
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) ShutDownTask
ecosLocoShutDownTask
-
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 EcosLocoAddressManager(EcosSystemConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
checkLocoList(java.lang.String[] ecoslines)
void
clearLocoToRoster()
(package private) void
decodeLocoDetails(EcosLocoAddress tmploco, java.lang.String line, boolean addToRoster)
void
deleteEcosLoco(EcosLocoAddress s)
void
deregister(EcosLocoAddress s)
Forget a NamedBean Object created outside the manager.void
dispose()
Free resources when no longer used.java.lang.String
getBeanTypeHandled(boolean plural)
Get the user-readable name of the type of NamedBean handled by this manager.EcosLocoAddress
getByDccAddress(int dccAddress)
EcosLocoAddress
getByEcosObject(java.lang.String ecosObject)
java.lang.String[]
getEcosObjectArray()
java.util.List<java.lang.String>
getEcosObjectList()
boolean
getLocoToRoster()
EcosSystemConnectionMemo
getMemo()
Get the system connection for this manager.java.lang.Class<NamedBean>
getNamedBeanClass()
Get the class of NamedBean supported by this Manager.int
getXMLOrder()
Determine the order that types should be written when storing panel files.java.lang.String
makeSystemName(java.lang.String s)
EcosLocoAddresses have no system prefix, so return input unchanged.void
message(EcosMessage m)
void
monitorLocos(boolean monitor)
void
propertyChange(java.beans.PropertyChangeEvent e)
The PropertyChangeListener interface in this class is intended to keep track of roster entries and sync them up with the Ecos.EcosLocoAddress
provideByDccAddress(int dccAddress)
EcosLocoAddress
provideByEcosObject(java.lang.String ecosObject)
EcosLocoAddress
provideEcosLoco(java.lang.String EcosObject, int DCCAddress)
void
refreshItems()
void
register(EcosLocoAddress s)
void
reply(EcosReply m)
void
setLocoToRoster()
boolean
shutdownDispose()
void
terminateThreads()
protected boolean
threadsRunning()
char
typeLetter()
-
Methods inherited from class jmri.managers.AbstractManager
addDataListener, checkNumeric, createSystemName, deleteBean, deregister, fireDataListenersAdded, fireDataListenersRemoved, fireVetoableChange, getAutoSystemName, getBySystemName, getBySystemName, getByUserName, getKnownBeanProperties, getNamedBean, getNamedBeanSet, getObjectCount, getOuterBean, getSystemPrefix, handleUserNameUniqueness, makeSystemName, 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, 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
-
ecosLocoShutDownTask
ShutDownTask ecosLocoShutDownTask
-
-
Constructor Detail
-
EcosLocoAddressManager
public EcosLocoAddressManager(@Nonnull EcosSystemConnectionMemo memo)
-
-
Method Detail
-
getMemo
@Nonnull public EcosSystemConnectionMemo getMemo()
Get the system connection for this manager.
-
typeLetter
public char typeLetter()
- Specified by:
typeLetter
in interfaceManager<NamedBean>
- Returns:
- The type letter for a specific implementation
-
getNamedBeanClass
public java.lang.Class<NamedBean> getNamedBeanClass()
Description copied from interface:Manager
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<NamedBean>
- Returns:
- the class supported by this Manager.
-
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<NamedBean>
- Returns:
- write order for this Manager; larger is later.
-
makeSystemName
@Nonnull public java.lang.String makeSystemName(@Nonnull java.lang.String s)
EcosLocoAddresses have no system prefix, so return input unchanged.- Specified by:
makeSystemName
in interfaceManager<NamedBean>
- Parameters:
s
- the input to make a system name- Returns:
- the resultant system name
-
clearLocoToRoster
public void clearLocoToRoster()
-
setLocoToRoster
public void setLocoToRoster()
-
getLocoToRoster
public boolean getLocoToRoster()
-
provideEcosLoco
public EcosLocoAddress provideEcosLoco(java.lang.String EcosObject, int DCCAddress)
-
provideByDccAddress
public EcosLocoAddress provideByDccAddress(int dccAddress)
-
provideByEcosObject
public EcosLocoAddress provideByEcosObject(java.lang.String ecosObject)
-
getByEcosObject
public EcosLocoAddress getByEcosObject(java.lang.String ecosObject)
-
getByDccAddress
public EcosLocoAddress getByDccAddress(int dccAddress)
-
getEcosObjectArray
public java.lang.String[] getEcosObjectArray()
-
getEcosObjectList
public java.util.List<java.lang.String> getEcosObjectList()
-
monitorLocos
public void monitorLocos(boolean monitor)
-
deleteEcosLoco
public void deleteEcosLoco(EcosLocoAddress s)
-
register
public void register(EcosLocoAddress s)
-
deregister
public void deregister(EcosLocoAddress s)
Forget a NamedBean Object created outside the manager.The non-system-specific RouteManager uses this method.
- Parameters:
s
- Ecos Loco Address to de-register.
-
dispose
public void dispose()
Description copied from class:AbstractManager
Free resources when no longer used. Specifically, remove all references to and from this object, so it can be garbage-collected.
-
terminateThreads
public void terminateThreads()
-
threadsRunning
protected boolean threadsRunning()
-
shutdownDispose
public boolean shutdownDispose()
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
The PropertyChangeListener interface in this class is intended to keep track of roster entries and sync them up with the Ecos.- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
- Overrides:
propertyChange
in classAbstractManager<NamedBean>
- Parameters:
e
- the event
-
reply
public void reply(EcosReply m)
- Specified by:
reply
in interfaceEcosListener
-
decodeLocoDetails
void decodeLocoDetails(EcosLocoAddress tmploco, java.lang.String line, boolean addToRoster)
-
checkLocoList
void checkLocoList(java.lang.String[] ecoslines)
-
message
public void message(EcosMessage m)
- Specified by:
message
in interfaceEcosListener
-
refreshItems
public void refreshItems()
-
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<NamedBean>
- 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
-
-