Package jmri.jmrix.anyma
Class AnymaDMX_SystemConnectionMemo
java.lang.Object
jmri.beans.UnboundBean
jmri.beans.Bean
jmri.jmrix.DefaultSystemConnectionMemo
jmri.jmrix.anyma.AnymaDMX_SystemConnectionMemo
- All Implemented Interfaces:
BeanInterface,PropertyChangeFirer,PropertyChangeProvider,Disposable,ConfiguringSystemConnectionMemo,SystemConnectionMemo
public class AnymaDMX_SystemConnectionMemo
extends DefaultSystemConnectionMemo
implements ConfiguringSystemConnectionMemo
Minimal SystemConnectionMemo for anyma dmx systems.
- Since:
- 4.9.6
-
Field Summary
Fields inherited from class jmri.jmrix.DefaultSystemConnectionMemo
classObjectMapFields inherited from class jmri.beans.Bean
propertyChangeSupportFields inherited from interface jmri.SystemConnectionMemo
DEREGISTER, DISABLED, INTERVAL, STORE, SYSTEM_PREFIX, USER_NAME -
Constructor Summary
ConstructorsConstructorDescriptionconstructorAnymaDMX_SystemConnectionMemo(String prefix, String userName) constructor. -
Method Summary
Modifier and TypeMethodDescriptionintcheckSystemPrefix(String systemName) Public static method to check and skip the System Prefix string on a system name.voidConfigure the common managers for anyma dmx connections.convertSystemNameToAlternate(String systemName) Public static method to convert one format anyma dmx system name to the alternate format.voiddispose()dispose<T> TGet a manager for a specific type.protected ResourceBundleget the action model resource bundleintgetChannelFromSystemName(String systemName) Public static method to parse a anyma dmx system name and return the channel number.get the LightManager<B extends NamedBean>
Comparator<B>getNamedBeanComparator(Class<B> type) Get the Comparator to be used for two NamedBeans.intgetNodeAddressFromSystemName(String systemName) Public static method to parse a anyma dmx system name and return the Usb Node Addressprotected AnymaDMX_TrafficControllerget the traffic controllergetUserNameFromSystemName(String systemName) public method to get the user name for a valid system namebooleanCheck if this connection provides a specific manager type.protected voidsetTrafficController(AnymaDMX_TrafficController trafficController) set the traffic controllerbooleanvalidSystemNameConfig(String systemName, char type) Public static method to validate anyma dmx system name for configuration.validSystemNameFormat(String systemName, char type) Public static method to validate system name format.Methods inherited from class jmri.jmrix.DefaultSystemConnectionMemo
deregister, getActionFactory, getConsistManager, getDefaultOutputInterval, getDisabled, getOutputInterval, getSystemPrefix, getUserName, isDirty, isRestartRequired, register, setConsistManager, setDisabled, setOutputInterval, setSystemPrefix, setUserName, storeMethods inherited from class jmri.beans.Bean
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, isNotifyOnEDT, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class jmri.beans.UnboundBean
getIndexedProperty, getProperty, getPropertyNames, hasIndexedProperty, hasProperty, setIndexedProperty, setPropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from interface jmri.SystemConnectionMemo
getActionFactory, getDefaultOutputInterval, getDisabled, getOutputInterval, getSystemPrefix, getUserName, isDirty, isRestartRequired, register, setDisabled, setOutputInterval, setSystemPrefix, setUserName
-
Constructor Details
-
AnymaDMX_SystemConnectionMemo
public AnymaDMX_SystemConnectionMemo()constructor -
AnymaDMX_SystemConnectionMemo
constructor.- Parameters:
prefix- system prefix.userName- system username.
-
-
Method Details
-
getTrafficController
get the traffic controller- Returns:
- the traffic controller
-
setTrafficController
set the traffic controller- Parameters:
trafficController- the traffic controller
-
getUserNameFromSystemName
public method to get the user name for a valid system name- Parameters:
systemName- the system name- Returns:
- "" (null string) if system name is not valid or does not exist
-
getChannelFromSystemName
Public static method to parse a anyma dmx system name and return the channel number. Notes:- Channels are numbered from 1 to 512.
- Does not check whether that node is defined on current system.
- Parameters:
systemName- system name.- Returns:
- 0 if an error is found.
-
checkSystemPrefix
Public static method to check and skip the System Prefix string on a system name.- Parameters:
systemName- system name string.- Returns:
- offset of the 1st character past the prefix, or -1 if not valid for this connection
-
convertSystemNameToAlternate
Public static method to convert one format anyma dmx system name to the alternate format.- Parameters:
systemName- system name string.- Returns:
- "" (empty string) if the supplied system name does not have a valid format, or if there is no representation in the alternate naming scheme
-
validSystemNameFormat
Public static method to validate system name format. Does not check whether that node is defined on current system.- Parameters:
systemName- proposed system name.type- bean type, only L supported.- Returns:
- enum indicating current validity, which might be just as a prefix
-
validSystemNameConfig
Public static method to validate anyma dmx system name for configuration. Does validate node number and system prefix.- Parameters:
systemName- anya dmx systemName.type- bean type, only L supported.- Returns:
- 'true' if system name has a valid meaning in current configuration, else returns 'false'.
-
getNodeAddressFromSystemName
Public static method to parse a anyma dmx system name and return the Usb Node AddressNodes are numbered from 0 - 127. Does not check whether that node is defined on current system.
- Parameters:
systemName- system name.- Returns:
- '-1' if invalid systemName format or if the node is not found.
-
provides
Check if this connection provides a specific manager type. This method must return false if a manager for the specific type is not provided, and must return true if a manager for the specific type is provided.- Specified by:
providesin interfaceSystemConnectionMemo- Overrides:
providesin classDefaultSystemConnectionMemo- Parameters:
c- The class type for the manager to be provided- Returns:
- true if the specified manager is provided
- See Also:
-
get
Get a manager for a specific type. This method must return a non-null value ifDefaultSystemConnectionMemo.provides(java.lang.Class)is true for the type, and must return null if provides() is false for the type.- Specified by:
getin interfaceSystemConnectionMemo- Overrides:
getin classDefaultSystemConnectionMemo- Type Parameters:
T- Type of manager to get- Parameters:
T- Type of manager to get- Returns:
- The manager or null if provides() is false for T
- See Also:
-
configureManagers
Configure the common managers for anyma dmx connections. This puts the common manager config in one place.- Specified by:
configureManagersin interfaceConfiguringSystemConnectionMemo
-
getLightManager
get the LightManager- Returns:
- the LightManager
-
getActionModelResourceBundle
get the action model resource bundle- Specified by:
getActionModelResourceBundlein classDefaultSystemConnectionMemo- Returns:
- the ResourceBundle
-
getNamedBeanComparator
Description copied from class:DefaultSystemConnectionMemoGet the Comparator to be used for two NamedBeans. This is typically anNamedBeanComparator, but may be any Comparator that works for this connection type.- Specified by:
getNamedBeanComparatorin interfaceSystemConnectionMemo- Specified by:
getNamedBeanComparatorin classDefaultSystemConnectionMemo- Type Parameters:
B- the type of NamedBean- Parameters:
type- the class of NamedBean- Returns:
- the Comparator
-
dispose
dispose- Specified by:
disposein interfaceDisposable- Specified by:
disposein interfaceSystemConnectionMemo- Overrides:
disposein classDefaultSystemConnectionMemo
-