Class CbusBasicNodeTableOperations

    • Method Detail

      • addNode

        public void addNode​(CbusNode node)
        Register new node to table
        Parameters:
        node - The CbusNode to add to the table
      • getCsByNum

        @CheckForNull
        public CbusNode getCsByNum​(int csnum)
        Returns an existing command station by cs number, NOT node number
        Parameters:
        csnum - The Command Station Number ( the default in CBUS is 0 )
        Returns:
        the Node which has the command station number, else null
      • provideCsByNum

        @Nonnull
        protected CbusNode provideCsByNum​(int csnum,
                                          int nodenum)
        Returns a new or existing command station by cs number, NOT node number
        Parameters:
        csnum - The Command Station Number to provide by
        nodenum - if existing CS sets node num to this, else node with this number and starts param lookup
        Returns:
        the Node which has the command station number
      • provideNodeByNodeNum

        @Nonnull
        public CbusNode provideNodeByNodeNum​(int nodenum)
        Returns a new or existing node by node number
        Parameters:
        nodenum - number to search nodes by, else creates node with this number and starts param lookup
        Returns:
        the Node which has the node number
      • getNodeByRowNum

        public CbusNode getNodeByRowNum​(int rowNum)
        Returns an existing node by table row number
        Parameters:
        rowNum - The Row Number
        Returns:
        the Node
      • getNodeRowFromNodeNum

        public int getNodeRowFromNodeNum​(int nodenum)
        Returns the table row number by node number
        Parameters:
        nodenum - The Node Number ( min 1, max 65535 )
        Returns:
        the Model Row which has the node number, else -1
      • getNodeNameFromCanId

        public java.lang.String getNodeNameFromCanId​(int canId)
        For a given CAN ID, if in use, return formatted Node Name and number else returns zero length string
        Parameters:
        canId - the CAN ID to search the table for
        Returns:
        Node Number and name
      • getAnyNodeInLearnMode

        public int getAnyNodeInLearnMode()
        Returns Node number of any node currently in Learn Mode
        Returns:
        Node Num, else -1 if no nodes known to be in learn mode
      • getNodeByNodeNum

        @CheckForNull
        public CbusNode getNodeByNodeNum​(int nodenum)
        Returns an existing node by node number
        Parameters:
        nodenum - The Node Number ( min 1, max 65535 )
        Returns:
        the Node which has the node number, else null
      • removeRow

        public void removeRow​(int row,
                              boolean removeXml)
        Remove Row from table and dispose of it
        Parameters:
        row - int row number
        removeXml - true to also remove the Node xml file
      • getNextAvailableNodeNumber

        public int getNextAvailableNodeNumber​(int higherthan)
        Returns the next available Node Number
        Parameters:
        higherthan - Node Number
        Returns:
        calculated next available number, else original value
      • getListOfNodeNumberNames

        @Nonnull
        public java.util.ArrayList<java.lang.String> getListOfNodeNumberNames()
        Returns a string ArrayList of all Node Number and User Names on the table
        Returns:
        Node Number + either node model or Username.
      • getNodeNumberName

        public java.lang.String getNodeNumberName​(int nodenum)
        Returns formatted Node Number and User Name by node number
        Parameters:
        nodenum - The Node Number ( min 1, max 65535 )
        Returns:
        Node Number + either node model or Username.
      • getNodeName

        @Nonnull
        public java.lang.String getNodeName​(int nn)
        Single Node User Name
        Parameters:
        nn - Node Number, NOT row number
        Returns:
        Node Username, if unset returns node type name, else empty String