Class CbusNameService


  • public class CbusNameService
    extends java.lang.Object
    Class to lookup CBUS event names via the event table

    Node names from the Node Manager

    • 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 method
      CbusEventBeanData getJmriBeans​(int nn, int en, CbusEventDataElements.EvState state)
      Get the Sensor Turnout and Light user names associated with event on
      java.lang.String getNodeName​(int nn)
      Return a formatted String after attempting to locate the node name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getEventNodeString

        @Nonnull
        public java.lang.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 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 Number
        en - 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