Package jmri.jmrix.roco.z21
Class Z21RMBusAddress
java.lang.Object
jmri.jmrix.roco.z21.Z21RMBusAddress
public class Z21RMBusAddress extends Object
Utility Class supporting parsing and testing of addresses for Z21 RMBus
One address format are supported:
- ZSxxxx where: 'S' for sensors,
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
MAXSENSORADDRESS
(package private) static int
MINSENSORADDRESS
-
Method Summary
Modifier and Type Method Description static int
getBitFromSystemName(String systemName, String prefix)
Public static method to parse a Z21RMBus system name.Note: Bits are numbered from 1.static String
getUserNameFromSystemName(String systemName, String prefix)
Public static method to check the user name for a valid system name.static String
validateSystemNameFormat(String name, Manager manager, Locale locale)
Validate a system name format.static Manager.NameValidity
validSystemNameFormat(String systemName, char type, String prefix)
Public static method to validate system name format.
-
Field Details
-
MINSENSORADDRESS
- See Also:
- Constant Field Values
-
MAXSENSORADDRESS
- See Also:
- Constant Field Values
-
-
Method Details
-
getBitFromSystemName
Public static method to parse a Z21RMBus system name.Note: Bits are numbered from 1.- Parameters:
systemName
- system name.prefix
- system prefix.- Returns:
- the hardware address number, return -1 if an error is found
-
validateSystemNameFormat
Validate a system name format.- Parameters:
name
- the name to validatemanager
- the manager requesting validationlocale
- the locale for user messages- Returns:
- name, unchanged
- See Also:
Manager.validateSystemNameFormat(java.lang.String, java.util.Locale)
-
validSystemNameFormat
public static Manager.NameValidity validSystemNameFormat(@Nonnull String systemName, char type, String prefix)Public static method to validate system name format. Logging of handled cases no higher than WARN.- Parameters:
systemName
- system name.type
- bean type, S for Sensor, T for Turnout.prefix
- system prefix.- Returns:
- VALID if system name has a valid format, else return INVALID
-
getUserNameFromSystemName
Public static method to check the user name for a valid system name.- Parameters:
systemName
- system name.prefix
- system prefix.- Returns:
- "" (null string) if the system name is not valid or does not exist
-