Class CbusNodeFromBackup

    • Constructor Detail

      • CbusNodeFromBackup

        public CbusNodeFromBackup​(CanSystemConnectionMemo connmemo,
                                  int nodenumber)
        Create a new CbusNodeFrommBackup by connection type and Node Number
        Parameters:
        connmemo - CAN Connection
        nodenumber - Node Number between 1 and 65535
      • CbusNodeFromBackup

        public CbusNodeFromBackup​(CbusNode node,
                                  java.util.Date timeStamp)
        Create a new CbusNodeFrommBackup from an existing Node
        Parameters:
        node - The Node to make a copy of
        timeStamp - to set the Backup TimeStamp
    • Method Detail

      • setBackupTimeStamp

        protected void setBackupTimeStamp​(java.util.Date thisDate)
        Set the Backup DateTime
        Parameters:
        thisDate - Timestamp
      • getBackupTimeStamp

        public java.util.Date getBackupTimeStamp()
        Get the Backup DateTime
        Returns:
        DateTime in format
      • setBackupComment

        public void setBackupComment​(java.lang.String backupComment)
        Set the backup comment
        Parameters:
        backupComment - text representation of the single backup state
      • getBackupComment

        public java.lang.String getBackupComment()
        Get the Backup Comment eg. Completed No Issues, 9 NVs, 12 Events with 4 EVs
        Returns:
        index number, -1 if unset
      • addBupEvent

        public void addBupEvent​(int nn,
                                int en,
                                java.lang.String evVars)
        Add an event to the Node in backup format
        Parameters:
        nn - Event Node Number
        en - Event Event Number
        evVars - Event Variable Hex String eg. "0102DC3AFF"
      • compareWithString

        public java.lang.String compareWithString​(CbusNodeFromBackup toTest)
        Get a String comparison with another CbusNodeFromBackup
        Parameters:
        toTest - The CbusNodeFromBackup to test against
        Returns:
        eg. "Parameters Changed"
      • equals

        public boolean equals​(java.lang.Object obj)

        Used for highlighting changes to Node Backups, so the Date Time Stamp does NOT need to be equal. checking for Node Number, Parameters, NVs, Events. Events can be in any order, are sorted mid comparison.

        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getEventArrayHash

        public int getEventArrayHash()
        Get a Hashcode for the Event Array
        Returns:
        0 if event array null
      • toString

        public java.lang.String toString()
        toString reports the Node Number Name and backup timestamp
        Overrides:
        toString in class CbusNode
        Returns:
        string eg "1234 UserName Backup Sun Jul 07 22:41:22". string eg "1234 UserName" or "256 CANPAN" if no UserName. No trailing space.