Class CbusNodeFromBackup

All Implemented Interfaces:
Comparable<CbusNodeFromBackup>

public class CbusNodeFromBackup extends CbusNode implements Comparable<CbusNodeFromBackup>
Class to represent a node imported from FCU file or CbusNodeXml.
  • Constructor Details

    • 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, 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 Details

    • getNewCanListener

      Ignores incoming and outgoing CAN Frames
      Overrides:
      getNewCanListener in class CbusBasicNodeWithManagers
    • setBackupTimeStamp

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

      Get the Backup DateTime
      Returns:
      DateTime in format
    • setBackupResult

      protected final void setBackupResult(CbusNodeConstants.BackupType type)
      Set the Backup Result
      Parameters:
      type - Backup Type Enum
    • getBackupResult

      Get the Backup Result
      Returns:
      enum
    • setBackupComment

      public void setBackupComment(String backupComment)
      Set the backup comment
      Parameters:
      backupComment - text representation of the single backup state
    • 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, 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

      Get a String comparison with another CbusNodeFromBackup
      Parameters:
      toTest - The CbusNodeFromBackup to test against
      Returns:
      eg. "Parameters Changed"
    • compareTo

      public int compareTo(CbusNodeFromBackup o)
      Compares to the Time Date Stamp of the Backup
      Specified by:
      compareTo in interface Comparable<CbusNodeFromBackup>
    • equals

      public boolean equals(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 Object
    • hashCode

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

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

      public 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.