Class CbusNode

    • Method Detail

      • setNameIfNoName

        public void setNameIfNoName​(java.lang.String newName)
        Set Node UserName only if UserName not currently set used in RestoreFromFCU
        Parameters:
        newName - UserName of the node
      • getNodeNameFromName

        public java.lang.String getNodeNameFromName()
        Get Module Type Name from a previous NAME OPC response Used when a module type is not identified within JMRI.
        Returns:
        Module type name, NOT prefixed with CAN or ETH, may be empty.
      • setNodeNameFromName

        public void setNodeNameFromName​(java.lang.String newName)
        Set Module Type Name Used when a module is not identified within JMRI so the NAME is requested.
        Parameters:
        newName - The module type name, should NOT be prefixed with CAN or ETH
      • setNodeFlags

        public void setNodeFlags​(int flags)
        Set the Node Flags

        Bit 0: Consumer Bit 1: Producer Bit 2: FLiM Mode Bit 3: The module supports bootloading Bit 4: The module can consume its own produced events Bit 5: Module is in learn mode - CBUS Spec 6c

        Parameters:
        flags - the int value of the flags.
      • getNodeFlags

        public int getNodeFlags()
        Get Node Flags

        Captured from a PNN node response

        Returns:
        flags in int form, will need decoding to bit, -1 if unset
      • getResyncName

        public java.lang.String getResyncName()
        Get name of node being resync'ed
        Returns:
        String node name
      • saveForResync

        protected void saveForResync()
        Save module name when Resync is in progress Resync resets all node parameters, etc. To re0display the NV edit GUI before the resync completes we save a copy of the name of the node.
      • resetNodeAll

        protected void resetNodeAll()
        Resets NV's, Events and Parameters
      • getUserComment

        public java.lang.String getUserComment()
        Get a Node User Comment
        Returns:
        user generated comment string
      • setUserComment

        public void setUserComment​(java.lang.String comment)
        Set a Node User Comment

        Typically output from JTextArea

        If a backup has completed for this session, updates the xml file

        Parameters:
        comment - user comment
      • toString

        public java.lang.String toString()
        Custom toString reports the Node Number Name
        Overrides:
        toString in class java.lang.Object
        Returns:
        string eg "1234 UserName" or "256 CANPAN" if no UserName. No trailing space.
      • getName

        public java.lang.String getName()
        Reports just the name, not the user name.
        Returns:
        string eg "CANPAN"
      • nodeOnNetwork

        protected void nodeOnNetwork​(boolean isFound)
        Set node on network
        Parameters:
        isFound - false if not on network
      • setsendsWRACKonNVSET

        public void setsendsWRACKonNVSET​(java.lang.Boolean sendsWRACK)
        DO NOT RELY ON, TO BE REMOVED IN FUTURE RELEASE when the NV will automatically be queried if no NVSET is received
        Parameters:
        sendsWRACK - true if sends
      • getsendsWRACKonNVSET

        public boolean getsendsWRACKonNVSET()
        DO NOT RELY ON, TO BE REMOVED IN FUTURE RELEASE when the NV will automatically be queried if no NVSET is received
        Returns:
        true if sends WRACK, else false
      • setnvWriteInLearnOnly

        public void setnvWriteInLearnOnly​(java.lang.Boolean nvWriteInLearn)
        CANSERVO8C and related modules only accept NV writes in learn mode. This was used by the MERG FCU to update servo positions in "real time" in response to interaction with the GUI. Call this method to indicate that a node must be in learn mode to support NV writes.
        Parameters:
        nvWriteInLearn - true if node requires to be in learn mode for NV writes
      • getnvWriteInLearnOnly

        public boolean getnvWriteInLearnOnly()
        CANSERVO8C and related modules only accept NV writes in learn mode. This was used by the MERG FCU to update servo positions in "real time" in response to interaction with the GUI. Call this method to query if a node must be in learn mode to support NV writes.
        Returns:
        true if sends WRACK, else false
      • setliveUpdate

        public void setliveUpdate​(boolean liveUpdate)
        Set flag to say node is in live update mode.
        Parameters:
        liveUpdate - true if in live update mode
      • getliveUpdate

        public boolean getliveUpdate()
        Get live update mode
        Returns:
        true in live update