Class CbusNameService

java.lang.Object
jmri.jmrix.can.cbus.CbusNameService

public class CbusNameService
extends Object
Class to lookup CBUS event names via the event table

Node names from the Node Manager

  • Constructor Details

  • Method Details

    • getEventNodeString

      @Nonnull public String getEventNodeString​(int nn, int en)
      Return a formatted String attempting to use the event toString method

      eg 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 Number
      en - Event Number
      Returns:
      Event and node number with event and node name if available
    • getEventName

      @Nonnull public 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 Number
      en - Event Number
      Returns:
      Event name if available , else empty string
    • getNodeName

      @Nonnull public 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

      Get the Sensor Turnout and Light user names associated with event on
      Parameters:
      nn - Node Number
      en - Event Number
      state - Event State, either on or off
      Returns:
      Sensor Turnout and Light Beans associated with the CBUS Event.
      See Also:
      NamedBean