Package jmri.jmrix.can.cbus
Class CbusNameService
java.lang.Object
jmri.jmrix.can.cbus.CbusNameService
Class to lookup CBUS event names via the event table
Node names from the Node Manager
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance for the default connectionCreate a new instance for a given connection -
Method Summary
Modifier and TypeMethodDescriptiongetEventName(int nn, int en) Return a formatted String attempting to locate the event name.getEventNodeString(int nn, int en) Return a formatted String attempting to use the event toString methodgetJmriBeans(int nn, int en, CbusEventDataElements.EvState state) Get the Sensor Turnout and Light user names associated with event ongetNodeName(int nn) Return a formatted String after attempting to locate the node name.
-
Constructor Details
-
CbusNameService
public CbusNameService()Create a new instance for the default connection -
CbusNameService
Create a new instance for a given connection- Parameters:
memo- System Connection
-
-
Method Details
-
getEventNodeString
Return a formatted String attempting to use the event toString methodeg no event table (123,456) will return NN:123 EN:456 with event table instance would return NN:123 Node Name EN:456 Event Name No node present returns just event (0,56) EN:56 All with trailing space
- Parameters:
nn- Node Numberen- Event Number- Returns:
- Event and node number with event and node name if available
-
getEventName
Return a formatted String attempting to locate the event name.get the event name, empty string if event not on event table, or if event name is empty
- Parameters:
nn- Node Numberen- Event Number- Returns:
- Event name if available , else empty string
-
getNodeName
Return a formatted String after attempting to locate the node name.1st attempt - Node Username in node table ( eg. Control Panel West )
2nd attempt - Node Type Name ( eg. CANPAN )
fallback empty string
- Parameters:
nn- Node Number- Returns:
- Node name if available , else empty string
-
getJmriBeans
@Nonnull public CbusEventBeanData getJmriBeans(int nn, int en, @Nonnull CbusEventDataElements.EvState state) Get the Sensor Turnout and Light user names associated with event on- Parameters:
nn- Node Numberen- Event Numberstate- Event State, either on or off- Returns:
- Sensor Turnout and Light Beans associated with the CBUS Event.
- See Also:
-