|
RobotCore 1.0
WPILib port to raspberry Pi
|
Public Member Functions | |
| void | flush () |
| void | pause () |
| void | resume () |
| void | stop () |
| boolean | hasSchema (String name) |
| void | addSchema (String name, String type, byte[] schema, long timestamp) |
| void | addSchema (String name, String type, byte[] schema) |
| void | addSchema (String name, String type, String schema, long timestamp) |
| void | addSchema (String name, String type, String schema) |
| void | addSchema (Protobuf<?, ?> proto, long timestamp) |
| void | addSchema (Protobuf<?, ?> proto) |
| void | addSchema (Struct<?> struct, long timestamp) |
| void | addSchema (Struct<?> struct) |
| int | start (String name, String type, String metadata, long timestamp) |
| int | start (String name, String type, String metadata) |
| int | start (String name, String type) |
| void | finish (int entry, long timestamp) |
| void | finish (int entry) |
| void | setMetadata (int entry, String metadata, long timestamp) |
| void | setMetadata (int entry, String metadata) |
| void | close () |
| void | appendRaw (int entry, byte[] data, long timestamp) |
| void | appendRaw (int entry, byte[] data, int start, int len, long timestamp) |
| void | appendRaw (int entry, ByteBuffer data, long timestamp) |
| void | appendRaw (int entry, ByteBuffer data, int start, int len, long timestamp) |
| void | appendBoolean (int entry, boolean value, long timestamp) |
| void | appendInteger (int entry, long value, long timestamp) |
| void | appendFloat (int entry, float value, long timestamp) |
| void | appendDouble (int entry, double value, long timestamp) |
| void | appendString (int entry, String value, long timestamp) |
| void | appendBooleanArray (int entry, boolean[] arr, long timestamp) |
| void | appendIntegerArray (int entry, long[] arr, long timestamp) |
| void | appendFloatArray (int entry, float[] arr, long timestamp) |
| void | appendDoubleArray (int entry, double[] arr, long timestamp) |
| void | appendStringArray (int entry, String[] arr, long timestamp) |
| long | getImpl () |
Protected Member Functions | |
| DataLog (long impl) | |
Protected Attributes | |
| long | m_impl |
A data log for high-speed writing of data values.
The finish() function is needed only to indicate in the log that a particular entry is no longer being used (it releases the name to ID mapping). The finish() function is not required to be called for data to be flushed to disk; entries in the log are written as append() calls are being made. In fact, finish() does not need to be called at all.
DataLog calls are thread safe. DataLog uses a typical multiple-supplier, single-consumer setup. Writes to the log are atomic, but there is no guaranteed order in the log when multiple threads are writing to it; whichever thread grabs the write mutex first will get written first. For this reason (as well as the fact that timestamps can be set to arbitrary values), records in the log are not guaranteed to be sorted by timestamp.
Definition at line 30 of file DataLog.java.
|
protected |
| void org.wpilib.datalog.DataLog.addSchema | ( | Protobuf<?, ?> | proto | ) |
Registers a protobuf schema. Duplicate calls to this function with the same name are silently ignored.
| proto | protobuf serialization object |
Definition at line 162 of file DataLog.java.
| void org.wpilib.datalog.DataLog.addSchema | ( | Protobuf<?, ?> | proto, |
| long | timestamp ) |
Registers a protobuf schema. Duplicate calls to this function with the same name are silently ignored.
| proto | protobuf serialization object |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 148 of file DataLog.java.
| void org.wpilib.datalog.DataLog.addSchema | ( | String | name, |
| String | type, | ||
| byte[] | schema ) |
Registers a data schema. Data schemas provide information for how a certain data type string can be decoded. The type string of a data schema indicates the type of the schema itself (e.g. "protobuf" for protobuf schemas, "struct" for struct schemas, etc). In the data log, schemas are saved just like normal records, with the name being generated from the provided name: "/.schema/name". Duplicate calls to this function with the same name are silently ignored.
| name | Name (the string passed as the data type for records using this schema) |
| type | Type of schema (e.g. "protobuf", "struct", etc) |
| schema | Schema data |
Definition at line 103 of file DataLog.java.
| void org.wpilib.datalog.DataLog.addSchema | ( | String | name, |
| String | type, | ||
| byte[] | schema, | ||
| long | timestamp ) |
Registers a data schema. Data schemas provide information for how a certain data type string can be decoded. The type string of a data schema indicates the type of the schema itself (e.g. "protobuf" for protobuf schemas, "struct" for struct schemas, etc). In the data log, schemas are saved just like normal records, with the name being generated from the provided name: "/.schema/name". Duplicate calls to this function with the same name are silently ignored.
| name | Name (the string passed as the data type for records using this schema) |
| type | Type of schema (e.g. "protobuf", "struct", etc) |
| schema | Schema data |
| timestamp | Time stamp in nanoseconds (may be 0 to indicate now) |
Definition at line 85 of file DataLog.java.
| void org.wpilib.datalog.DataLog.addSchema | ( | String | name, |
| String | type, | ||
| String | schema ) |
Registers a data schema. Data schemas provide information for how a certain data type string can be decoded. The type string of a data schema indicates the type of the schema itself (e.g. "protobuf" for protobuf schemas, "struct" for struct schemas, etc). In the data log, schemas are saved just like normal records, with the name being generated from the provided name: "/.schema/name". Duplicate calls to this function with the same name are silently ignored.
| name | Name (the string passed as the data type for records using this schema) |
| type | Type of schema (e.g. "protobuf", "struct", etc) |
| schema | Schema data |
Definition at line 137 of file DataLog.java.
| void org.wpilib.datalog.DataLog.addSchema | ( | String | name, |
| String | type, | ||
| String | schema, | ||
| long | timestamp ) |
Registers a data schema. Data schemas provide information for how a certain data type string can be decoded. The type string of a data schema indicates the type of the schema itself (e.g. "protobuf" for protobuf schemas, "struct" for struct schemas, etc). In the data log, schemas are saved just like normal records, with the name being generated from the provided name: "/.schema/name". Duplicate calls to this function with the same name are silently ignored.
| name | Name (the string passed as the data type for records using this schema) |
| type | Type of schema (e.g. "protobuf", "struct", etc) |
| schema | Schema data |
| timestamp | Time stamp in nanoseconds (may be 0 to indicate now) |
Definition at line 119 of file DataLog.java.
| void org.wpilib.datalog.DataLog.addSchema | ( | Struct<?> | struct | ) |
Registers a struct schema. Duplicate calls to this function with the same name are silently ignored.
| struct | struct serialization object |
Definition at line 183 of file DataLog.java.
| void org.wpilib.datalog.DataLog.addSchema | ( | Struct<?> | struct, |
| long | timestamp ) |
Registers a struct schema. Duplicate calls to this function with the same name are silently ignored.
| struct | struct serialization object |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 173 of file DataLog.java.
| void org.wpilib.datalog.DataLog.appendBoolean | ( | int | entry, |
| boolean | value, | ||
| long | timestamp ) |
Appends a boolean record to the log.
| entry | Entry index, as returned by start() |
| value | Boolean value to record |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 334 of file DataLog.java.
| void org.wpilib.datalog.DataLog.appendBooleanArray | ( | int | entry, |
| boolean[] | arr, | ||
| long | timestamp ) |
Appends a boolean array record to the log.
| entry | Entry index, as returned by start() |
| arr | Boolean array to record |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 389 of file DataLog.java.
| void org.wpilib.datalog.DataLog.appendDouble | ( | int | entry, |
| double | value, | ||
| long | timestamp ) |
Appends a double record to the log.
| entry | Entry index, as returned by start() |
| value | Double value to record |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 367 of file DataLog.java.
| void org.wpilib.datalog.DataLog.appendDoubleArray | ( | int | entry, |
| double[] | arr, | ||
| long | timestamp ) |
Appends a double array record to the log.
| entry | Entry index, as returned by start() |
| arr | Double array to record |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 422 of file DataLog.java.
| void org.wpilib.datalog.DataLog.appendFloat | ( | int | entry, |
| float | value, | ||
| long | timestamp ) |
Appends a float record to the log.
| entry | Entry index, as returned by start() |
| value | Float value to record |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 356 of file DataLog.java.
| void org.wpilib.datalog.DataLog.appendFloatArray | ( | int | entry, |
| float[] | arr, | ||
| long | timestamp ) |
Appends a float array record to the log.
| entry | Entry index, as returned by start() |
| arr | Float array to record |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 411 of file DataLog.java.
| void org.wpilib.datalog.DataLog.appendInteger | ( | int | entry, |
| long | value, | ||
| long | timestamp ) |
Appends an integer record to the log.
| entry | Entry index, as returned by start() |
| value | Integer value to record |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 345 of file DataLog.java.
| void org.wpilib.datalog.DataLog.appendIntegerArray | ( | int | entry, |
| long[] | arr, | ||
| long | timestamp ) |
Appends an integer array record to the log.
| entry | Entry index, as returned by start() |
| arr | Integer array to record |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 400 of file DataLog.java.
| void org.wpilib.datalog.DataLog.appendRaw | ( | int | entry, |
| byte[] | data, | ||
| int | start, | ||
| int | len, | ||
| long | timestamp ) |
Appends a record to the log.
| entry | Entry index, as returned by start() |
| data | Byte array to record |
| start | Start position of data (in byte array) |
| len | Length of data (must be less than or equal to data.length - start) |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 298 of file DataLog.java.
| void org.wpilib.datalog.DataLog.appendRaw | ( | int | entry, |
| byte[] | data, | ||
| long | timestamp ) |
Appends a raw record to the log.
| entry | Entry index, as returned by start() |
| data | Byte array to record; will send entire array contents |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 285 of file DataLog.java.
| void org.wpilib.datalog.DataLog.appendRaw | ( | int | entry, |
| ByteBuffer | data, | ||
| int | start, | ||
| int | len, | ||
| long | timestamp ) |
Appends a record to the log.
| entry | Entry index, as returned by start() |
| data | Buffer to record |
| start | Start position of data (in buffer) |
| len | Length of data (must be less than or equal to data.capacity() - start) |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 323 of file DataLog.java.
| void org.wpilib.datalog.DataLog.appendRaw | ( | int | entry, |
| ByteBuffer | data, | ||
| long | timestamp ) |
Appends a record to the log.
| entry | Entry index, as returned by start() |
| data | Buffer to record; will send from data.position() to data.limit() |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 309 of file DataLog.java.
| void org.wpilib.datalog.DataLog.appendString | ( | int | entry, |
| String | value, | ||
| long | timestamp ) |
Appends a string record to the log.
| entry | Entry index, as returned by start() |
| value | String value to record |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 378 of file DataLog.java.
| void org.wpilib.datalog.DataLog.appendStringArray | ( | int | entry, |
| String[] | arr, | ||
| long | timestamp ) |
Appends a string array record to the log.
| entry | Entry index, as returned by start() |
| arr | String array to record |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 433 of file DataLog.java.
| void org.wpilib.datalog.DataLog.close | ( | ) |
Definition at line 273 of file DataLog.java.
| void org.wpilib.datalog.DataLog.finish | ( | int | entry | ) |
| void org.wpilib.datalog.DataLog.finish | ( | int | entry, |
| long | timestamp ) |
Finish an entry.
| entry | Entry index |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 238 of file DataLog.java.
| void org.wpilib.datalog.DataLog.flush | ( | ) |
Explicitly flushes the log data to disk.
Definition at line 41 of file DataLog.java.
| long org.wpilib.datalog.DataLog.getImpl | ( | ) |
Gets the JNI implementation handle.
Definition at line 442 of file DataLog.java.
| boolean org.wpilib.datalog.DataLog.hasSchema | ( | String | name | ) |
Returns whether there is a data schema already registered with the given name.
| name | Name (the string passed as the data type for records using this schema) |
Definition at line 69 of file DataLog.java.
| void org.wpilib.datalog.DataLog.pause | ( | ) |
Pauses appending of data records to the log. While paused, no data records are saved (e.g. AppendX is a no-op). Has no effect on entry starts / finishes / metadata changes.
Definition at line 49 of file DataLog.java.
| void org.wpilib.datalog.DataLog.resume | ( | ) |
Resumes appending of data records to the log.
Reimplemented in org.wpilib.datalog.DataLogBackgroundWriter.
Definition at line 54 of file DataLog.java.
| void org.wpilib.datalog.DataLog.setMetadata | ( | int | entry, |
| String | metadata ) |
Updates the metadata for an entry.
| entry | Entry index |
| metadata | New metadata for the entry |
Definition at line 268 of file DataLog.java.
| void org.wpilib.datalog.DataLog.setMetadata | ( | int | entry, |
| String | metadata, | ||
| long | timestamp ) |
Updates the metadata for an entry.
| entry | Entry index |
| metadata | New metadata for the entry |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 258 of file DataLog.java.
| int org.wpilib.datalog.DataLog.start | ( | String | name, |
| String | type ) |
Start an entry. Duplicate names are allowed (with the same type), and result in the same index being returned (start/finish are reference counted). A duplicate name with a different type will result in an error message being printed to the console and 0 being returned (which will be ignored by the append functions).
| name | Name |
| type | Data type |
Definition at line 228 of file DataLog.java.
| int org.wpilib.datalog.DataLog.start | ( | String | name, |
| String | type, | ||
| String | metadata ) |
Start an entry. Duplicate names are allowed (with the same type), and result in the same index being returned (start/finish are reference counted). A duplicate name with a different type will result in an error message being printed to the console and 0 being returned (which will be ignored by the append functions).
| name | Name |
| type | Data type |
| metadata | Initial metadata (e.g. data properties) |
Definition at line 214 of file DataLog.java.
| int org.wpilib.datalog.DataLog.start | ( | String | name, |
| String | type, | ||
| String | metadata, | ||
| long | timestamp ) |
Start an entry. Duplicate names are allowed (with the same type), and result in the same index being returned (start/finish are reference counted). A duplicate name with a different type will result in an error message being printed to the console and 0 being returned (which will be ignored by the append functions).
| name | Name |
| type | Data type |
| metadata | Initial metadata (e.g. data properties) |
| timestamp | Time stamp in nanoseconds (0 to indicate now) |
Definition at line 199 of file DataLog.java.
| void org.wpilib.datalog.DataLog.stop | ( | ) |
Stops appending all records to the log, and closes the log file.
Definition at line 59 of file DataLog.java.
|
protected |
Implementation handle.
Definition at line 462 of file DataLog.java.