|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.grapevine.SerialAddress
public class SerialAddress
Utility Class supporting parsing and testing of addresses
Multiple address formats are supported: Gtnnnxxx where: t is the type code, 'T' for turnouts, 'S' for sensors, 'H' for signals and 'L' for lights nn is the node address (0-127) xxx is a bit number of the input or output bit (001-999) nnxxx = (node address x 1000) + bit number examples: GT2 (node address 0, bit 2), GS1003 (node address 1, bit 3), GL11234 (node address 11, bit234) Gtnnnaxxxx where: t is the type code, 'T' for turnouts, 'S' for sensors, 'H' for signals and 'L' for lights nnn is the node address of the input or output bit (0-127) xxxx is a bit number of the input or output bit (1-2048) a is a subtype-specific letter: 'B' for a bit number (e.g. GT12B3 is a shorter form of GT12003) 'a' is for advanced serial occupancy sensors 'm' is for advanced serial motion sensors 'p' is for parallel sensors 's' is for serial occupancy sensors examples: GT0B2 (node address 0, bit 2), GS1B3 (node address 1, bit 3), GL11B234 (node address 11, bit234)
| Constructor Summary | |
|---|---|
SerialAddress()
|
|
| Method Summary | |
|---|---|
static String |
convertSystemNameToAlternate(String systemName)
Public static method to convert any format system name for the alternate format (nnBnn) If the supplied system name does not have a valid format, or if there is no representation in the alternate naming scheme, an empty string is returned. |
static int |
getBitFromSystemName(String systemName)
Public static method to parse a system name and return the bit number Notes: Bits are numbered from 1. |
static int |
getNodeAddressFromSystemName(String systemName)
Public static method to parse a system name and return the node number Notes: Nodes are numbered from 1. |
static SerialNode |
getNodeFromSystemName(String systemName)
Public static method to parse a system name and return the Serial Node Note: Returns 'NULL' if illegal systemName format or if the node is not found |
static String |
normalizeSystemName(String systemName)
Public static method to normalize a system name This routine is used to ensure that each system name is uniquely linked to one bit, by removing extra zeros inserted by the user. |
static boolean |
validSystemNameConfig(String systemName,
char type)
Public static method to validate system name for configuration returns 'true' if system name has a valid meaning in current configuration, else returns 'false' |
static boolean |
validSystemNameFormat(String systemName,
char type)
Public static method to validate system name format |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SerialAddress()
| Method Detail |
|---|
public static SerialNode getNodeFromSystemName(String systemName)
public static int getBitFromSystemName(String systemName)
public static int getNodeAddressFromSystemName(String systemName)
public static boolean validSystemNameFormat(String systemName,
char type)
systemName - name to checktype - expected device type letter
public static boolean validSystemNameConfig(String systemName,
char type)
public static String convertSystemNameToAlternate(String systemName)
public static String normalizeSystemName(String systemName)
This routine is used to ensure that each system name is uniquely linked to one bit, by removing extra zeros inserted by the user.
If the supplied system name does not have a valid format, an empty string is returned. Otherwise a normalized name is returned in the same format as the input name.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||