Package jmri.jmrix.can.cbus.node
Class CbusNodeFromBackup
- java.lang.Object
-
- jmri.jmrix.can.cbus.node.CbusBasicNode
-
- jmri.jmrix.can.cbus.node.CbusBasicNodeWithManagers
-
- jmri.jmrix.can.cbus.node.CbusBasicNodeWithMgrsCommandStation
-
- jmri.jmrix.can.cbus.node.CbusNode
-
- jmri.jmrix.can.cbus.node.CbusNodeFromBackup
-
- All Implemented Interfaces:
java.lang.Comparable<CbusNodeFromBackup>
public class CbusNodeFromBackup extends CbusNode implements java.lang.Comparable<CbusNodeFromBackup>
Class to represent a node imported from FCU file or CbusNodeXml.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
CbusNodeFromBackup.DoNothingCanListener
Ignores Incoming and Outgoing CAN Frames.
-
Field Summary
-
Fields inherited from class jmri.jmrix.can.cbus.node.CbusNode
BOOT_LONG_TIMEOUT_TIME, BOOT_PROG_TIMEOUT_FAST, BOOT_PROG_TIMEOUT_SLOW, SINGLE_MESSAGE_TIMEOUT_TIME
-
Fields inherited from class jmri.jmrix.can.cbus.node.CbusBasicNodeWithManagers
_fwBuild, _fwMaj, _fwMin
-
Fields inherited from class jmri.jmrix.can.cbus.node.CbusBasicNode
_listeners, _memo, send
-
-
Constructor Summary
Constructors Constructor Description CbusNodeFromBackup(CanSystemConnectionMemo connmemo, int nodenumber)
Create a new CbusNodeFrommBackup by connection type and Node NumberCbusNodeFromBackup(CbusNode node, java.util.Date timeStamp)
Create a new CbusNodeFrommBackup from an existing Node
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBupEvent(int nn, int en, java.lang.String evVars)
Add an event to the Node in backup formatint
compareTo(CbusNodeFromBackup o)
Compares to the Time Date Stamp of the Backupjava.lang.String
compareWithString(CbusNodeFromBackup toTest)
Get a String comparison with another CbusNodeFromBackupboolean
equals(java.lang.Object obj)
java.lang.String
getBackupComment()
Get the Backup Comment eg.CbusNodeConstants.BackupType
getBackupResult()
Get the Backup Resultjava.util.Date
getBackupTimeStamp()
Get the Backup DateTimeint
getEventArrayHash()
Get a Hashcode for the Event ArrayCbusNodeCanListener
getNewCanListener()
Ignores incoming and outgoing CAN Framesint
hashCode()
void
setBackupComment(java.lang.String backupComment)
Set the backup commentprotected void
setBackupResult(CbusNodeConstants.BackupType type)
Set the Backup Resultprotected void
setBackupTimeStamp(java.util.Date thisDate)
Set the Backup DateTimejava.lang.String
toString()
toString reports the Node Number Name and backup timestamp-
Methods inherited from class jmri.jmrix.can.cbus.node.CbusNode
getliveUpdate, getName, getNodeFlags, getNodeNameFromName, getnvWriteInLearnOnly, getResyncName, getsendsWRACKonNVSET, getUserComment, nodeOnNetwork, resetNodeAll, saveForResync, setliveUpdate, setNameIfNoName, setNodeFlags, setNodeNameFromName, setnvWriteInLearnOnly, setsendsWRACKonNVSET, setUserComment
-
Methods inherited from class jmri.jmrix.can.cbus.node.CbusBasicNodeWithMgrsCommandStation
getCsNum, getStatResponseFlagsAccurate, setCsFlags, setCsNum, setStatResponseFlagsAccurate
-
Methods inherited from class jmri.jmrix.can.cbus.node.CbusBasicNodeWithManagers
dispose, getCanListener, getNodeBackupManager, getNodeEventManager, getNodeNvManager, getNodeParamManager, getNodeStats, getNodeTimerManager, getPnnManufacturer, getPnnModule, getTableModel, getUserName, setFW, setManuModule, setTableModel, setUserName
-
Methods inherited from class jmri.jmrix.can.cbus.node.CbusBasicNode
addPropertyChangeListener, getMemo, getNodeCanId, getNodeInFLiMMode, getNodeInLearnMode, getNodeInSetupMode, getNodeNumber, notifyPropertyChangeListener, removePropertyChangeListener, setCanId, setCanId, setNodeInFLiMMode, setNodeInLearnMode, setNodeInSetupMode, setNodeNumber
-
-
-
-
Constructor Detail
-
CbusNodeFromBackup
public CbusNodeFromBackup(CanSystemConnectionMemo connmemo, int nodenumber)
Create a new CbusNodeFrommBackup by connection type and Node Number- Parameters:
connmemo
- CAN Connectionnodenumber
- 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 oftimeStamp
- to set the Backup TimeStamp
-
-
Method Detail
-
getNewCanListener
public CbusNodeCanListener getNewCanListener()
Ignores incoming and outgoing CAN Frames- Overrides:
getNewCanListener
in classCbusBasicNodeWithManagers
-
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
-
setBackupResult
protected final void setBackupResult(CbusNodeConstants.BackupType type)
Set the Backup Result- Parameters:
type
- Backup Type Enum
-
getBackupResult
public final CbusNodeConstants.BackupType getBackupResult()
Get the Backup Result- Returns:
- enum
-
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 Numberen
- Event Event NumberevVars
- 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"
-
compareTo
public int compareTo(CbusNodeFromBackup o)
Compares to the Time Date Stamp of the Backup- Specified by:
compareTo
in interfacejava.lang.Comparable<CbusNodeFromBackup>
-
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 classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getEventArrayHash
public int getEventArrayHash()
Get a Hashcode for the Event Array- Returns:
- 0 if event array null
-
-