Package jmri.jmrix.can.cbus
Class CbusNameService
- java.lang.Object
-
- jmri.jmrix.can.cbus.CbusNameService
-
public class CbusNameService extends java.lang.Object
Class to lookup CBUS event names via the event tableNode names from the Node Manager
-
-
Constructor Summary
Constructors Constructor Description CbusNameService()
Create a new instance for the default connectionCbusNameService(CanSystemConnectionMemo memo)
Create a new instance for a given connection
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getEventName(int nn, int en)
Return a formatted String attempting to locate the event name.java.lang.String
getEventNodeString(int nn, int en)
Return a formatted String attempting to use the event toString methodCbusEventBeanData
getJmriBeans(int nn, int en, CbusEventDataElements.EvState state)
Get the Sensor Turnout and Light user names associated with event onjava.lang.String
getNodeName(int nn)
Return a formatted String after attempting to locate the node name.
-
-
-
Constructor Detail
-
CbusNameService
public CbusNameService()
Create a new instance for the default connection
-
CbusNameService
public CbusNameService(CanSystemConnectionMemo memo)
Create a new instance for a given connection- Parameters:
memo
- System Connection
-
-
Method Detail
-
getEventNodeString
@Nonnull public java.lang.String getEventNodeString(int nn, int en)
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
@Nonnull public java.lang.String getEventName(int nn, int en)
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
@Nonnull public java.lang.String getNodeName(int nn)
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:
NamedBean
-
-