DataLogRecord¶
- class wpiutil.log.DataLogRecord¶
Bases:
pybind11_object
A record in the data log. May represent either a control record (entry == 0) or a data record. Used only for reading (e.g. with DataLogReader).
- getBoolean() bool ¶
Decodes a data record as a boolean. Note if the data type (as indicated in the corresponding start control record for this entry) is not “boolean”, invalid results may be returned or TypeError will be raised.
- getBooleanArray() list ¶
Decodes a data record as a boolean array. Note if the data type (as indicated in the corresponding start control record for this entry) is not “boolean[]”, invalid results may be returned or a TypeError may be raised.
- getDouble() float ¶
Decodes a data record as a double. Note if the data type (as indicated in the corresponding start control record for this entry) is not “double”, invalid results may be returned or TypeError will be raised.
- getDoubleArray() List[float] ¶
Decodes a data record as a double array. Note if the data type (as indicated in the corresponding start control record for this entry) is not “double[]”, invalid results may be returned or a TypeError may be raised.
- getEntry() int ¶
Gets the entry ID.
- Returns
entry ID
- getFinishEntry() int ¶
Decodes a finish control record. Raises TypeError on error.
- getFloat() float ¶
Decodes a data record as a float. Note if the data type (as indicated in the corresponding start control record for this entry) is not “float”, invalid results may be returned or TypeError will be raised.
- getFloatArray() List[float] ¶
Decodes a data record as a float array. Note if the data type (as indicated in the corresponding start control record for this entry) is not “float[]”, invalid results may be returned or a TypeError may be raised.
- getInteger() int ¶
Decodes a data record as an integer. Note if the data type (as indicated in the corresponding start control record for this entry) is not “int64”, invalid results may be returned or TypeError will be raised.
- getIntegerArray() List[int] ¶
Decodes a data record as an integer array. Note if the data type (as indicated in the corresponding start control record for this entry) is not “int64[]”, invalid results may be returned or a TypeError may be raised.
- getRaw() bytes ¶
Gets the raw data. Use the GetX functions to decode based on the data type in the entry’s start record.
- getSetMetadataData() wpiutil._wpiutil.log.MetadataRecordData ¶
Decodes a set metadata control record. Raises TypeError on error.
- getSize() int ¶
Gets the size of the raw data.
- Returns
size
- getStartData() wpiutil._wpiutil.log.StartRecordData ¶
Decodes a start control record. Raises TypeError on error.
- getString() str ¶
Decodes a data record as a string. Note if the data type (as indicated in the corresponding start control record for this entry) is not “string”, invalid results may be returned or TypeError will be raised.
- getStringArray() List[str] ¶
Decodes a data record as a string array. Note if the data type (as indicated in the corresponding start control record for this entry) is not “string[]”, invalid results may be returned or a TypeError may be raised.
- getTimestamp() int ¶
Gets the record timestamp.
- Returns
Timestamp, in integer microseconds
- isControl() bool ¶
Returns true if the record is a control record.
- Returns
True if control record, false if normal data record.
- isFinish() bool ¶
Returns true if the record is a finish control record. Use GetFinishEntry() to decode the contents.
- Returns
True if finish control record, false otherwise.
- isSetMetadata() bool ¶
Returns true if the record is a set metadata control record. Use GetSetMetadataData() to decode the contents.
- Returns
True if set metadata control record, false otherwise.
- isStart() bool ¶
Returns true if the record is a start control record. Use GetStartData() to decode the contents.
- Returns
True if start control record, false otherwise.