Package edu.wpi.first.util.datalog
Class StringLogEntry
java.lang.Object
edu.wpi.first.util.datalog.DataLogEntry
edu.wpi.first.util.datalog.StringLogEntry
Log string values.
-
Field Summary
Fields inherited from class edu.wpi.first.util.datalog.DataLogEntry
m_entry, m_log
-
Constructor Summary
ConstructorDescriptionStringLogEntry
(DataLog log, String name) Constructs a String log entry.StringLogEntry
(DataLog log, String name, long timestamp) Constructs a String log entry.StringLogEntry
(DataLog log, String name, String metadata) Constructs a String log entry.StringLogEntry
(DataLog log, String name, String metadata, long timestamp) Constructs a String log entry.StringLogEntry
(DataLog log, String name, String metadata, String type) Constructs a String log entry.StringLogEntry
(DataLog log, String name, String metadata, String type, long timestamp) Constructs a String log entry. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Appends a record to the log.void
Appends a record to the log.Gets the last value.boolean
Gets whether there is a last value.void
Updates the last value and appends a record to the log if it has changed.void
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 string values.- See Also:
-
-
Constructor Details
-
StringLogEntry
Constructs a String log entry.- Parameters:
log
- datalogname
- name of the entrymetadata
- metadatatype
- Data typetimestamp
- entry creation timestamp (0=now)
-
StringLogEntry
Constructs a String log entry.- Parameters:
log
- datalogname
- name of the entrymetadata
- metadatatype
- Data type
-
StringLogEntry
Constructs a String log entry.- Parameters:
log
- datalogname
- name of the entrymetadata
- metadatatimestamp
- entry creation timestamp (0=now)
-
StringLogEntry
Constructs a String log entry.- Parameters:
log
- datalogname
- name of the entrymetadata
- metadata
-
StringLogEntry
Constructs a String log entry.- Parameters:
log
- datalogname
- name of the entrytimestamp
- entry creation timestamp (0=now)
-
StringLogEntry
Constructs a String 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 null if none.
-