Package edu.wpi.first.util.datalog
Class DoubleLogEntry
java.lang.Object
edu.wpi.first.util.datalog.DataLogEntry
edu.wpi.first.util.datalog.DoubleLogEntry
Log double values.
-
Field Summary
FieldsFields inherited from class edu.wpi.first.util.datalog.DataLogEntry
m_entry, m_log -
Constructor Summary
ConstructorsConstructorDescriptionDoubleLogEntry(DataLog log, String name) Constructs a double log entry.DoubleLogEntry(DataLog log, String name, long timestamp) Constructs a double log entry.DoubleLogEntry(DataLog log, String name, String metadata) Constructs a double log entry.DoubleLogEntry(DataLog log, String name, String metadata, long timestamp) Constructs a double log entry. -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(double value) Appends a record to the log.voidappend(double value, long timestamp) Appends a record to the log.doubleGets the last value.booleanGets whether there is a last value.voidupdate(double value) Updates the last value and appends a record to the log if it has changed.voidupdate(double value, long timestamp) Updates the last value and appends a record to the log if it has changed.Methods inherited from class edu.wpi.first.util.datalog.DataLogEntry
finish, finish, setMetadata, setMetadata
-
Field Details
-
kDataType
The data type for double values.- See Also:
-
-
Constructor Details
-
DoubleLogEntry
Constructs a double log entry.- Parameters:
log- datalogname- name of the entrymetadata- metadatatimestamp- entry creation timestamp (0=now)
-
DoubleLogEntry
Constructs a double log entry.- Parameters:
log- datalogname- name of the entrymetadata- metadata
-
DoubleLogEntry
Constructs a double log entry.- Parameters:
log- datalogname- name of the entrytimestamp- entry creation timestamp (0=now)
-
DoubleLogEntry
Constructs a double log entry.- Parameters:
log- datalogname- name of the entry
-
-
Method Details
-
append
Appends a record to the log.- Parameters:
value- Value to recordtimestamp- Time stamp (0 to indicate now)
-
append
Appends a record to the log.- Parameters:
value- Value to record
-
update
Updates the last value and appends a record to the log if it has changed.Note: the last value is local to this class instance; using update() with two instances pointing to the same underlying log entry name will likely result in unexpected results.
- Parameters:
value- Value to recordtimestamp- Time stamp (0 to indicate now)
-
update
Updates the last value and appends a record to the log if it has changed.Note: the last value is local to this class instance; using update() with two instances pointing to the same underlying log entry name will likely result in unexpected results.
- Parameters:
value- Value to record
-
hasLastValue
Gets whether there is a last value.Note: the last value is local to this class instance and updated only with update(), not append().
- Returns:
- True if last value exists, false otherwise.
-
getLastValue
Gets the last value.Note: the last value is local to this class instance and updated only with update(), not append().
- Returns:
- Last value, or 0 if none.
-