public class CsvLogger
extends java.lang.Object
| Constructor and Description |
|---|
CsvLogger() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addLoggingFieldBoolean(java.lang.String dataFieldName,
java.lang.String unitName,
java.lang.String methodName,
java.lang.Class<?> classRef,
java.lang.Object... args)
Add a field to be logged at each loop of the robot code.
|
static void |
addLoggingFieldBoolean(java.lang.String dataFieldName,
java.lang.String unitName,
java.lang.String methodName,
java.lang.Object reference,
java.lang.Object... args)
Add a field to be logged at each loop of the robot code.
|
static void |
addLoggingFieldDouble(java.lang.String dataFieldName,
java.lang.String unitName,
java.lang.String methodName,
java.lang.Class<?> classRef,
java.lang.Object... args)
Add a field to be logged at each loop of the robot code.
|
static void |
addLoggingFieldDouble(java.lang.String dataFieldName,
java.lang.String unitName,
java.lang.String methodName,
java.lang.Object reference,
java.lang.Object... args)
Add a field to be logged at each loop of the robot code.
|
static int |
close()
Closes the log file and ensures everything is written to disk.
|
static int |
forceSync()
Clears the IO buffer in memory and forces things to file.
|
static int |
init()
Determines a unique file name based on current timestamp, and opens a file in the data
captures directory and writes the initial lines to it.
|
static boolean |
isLogOpen()
Check whether there is presently a log file open and being written to.
|
static int |
logData(boolean forceSync)
Logs data for all stored method handles.
|
static void |
preCacheAllMethods()
our wonderful attempt at optimization to do a "dry run" with all methods in an attempt to
cache the results and not bog down the first loop.
|
public static int forceSync()
public static int close()
public static boolean isLogOpen()
public static int init()
public static int logData(boolean forceSync)
forceSync - set true if a forced write is desired (i.e. brownout conditions)public static void preCacheAllMethods()
public static void addLoggingFieldDouble(java.lang.String dataFieldName,
java.lang.String unitName,
java.lang.String methodName,
java.lang.Object reference,
java.lang.Object... args)
dataFieldName - Name of the field/column in the output data. Also used for determining
what to do for "complex" methodsunitName - Name of the units for field/column in the output data.classRef - Class where the method is held, such as Joystick.class for getRawButton()methodName - Actual method name to be called for this field, such as "getRawButton"reference - A reference to the object whose method will be called. If static method,
this should be null.args - Optional list of arguments that are passed to the method, such as 0 in
getRawButton(0)public static void addLoggingFieldDouble(java.lang.String dataFieldName,
java.lang.String unitName,
java.lang.String methodName,
java.lang.Class<?> classRef,
java.lang.Object... args)
dataFieldName - Name of the field/column in the output data. Also used for determining
what to do for "complex" methodsunitName - Name of the units for field/column in the output data.methodName - Actual method name to be called for this field, such as "getRawButton"classRef - Static Class where the method is held, such as Joystick.class for getRawButton()args - Optional list of arguments that are passed to the method, such as 0 in
getRawButton(0)public static void addLoggingFieldBoolean(java.lang.String dataFieldName,
java.lang.String unitName,
java.lang.String methodName,
java.lang.Object reference,
java.lang.Object... args)
dataFieldName - Name of the field/column in the output data. Also used for determining
what to do for "complex" methodsunitName - Name of the units for field/column in the output data.methodName - Actual method name to be called for this field, such as "getRawButton"reference - A reference to the object whose method will be called. If static method,
this should be null.args - Optional list of arguments that are passed to the method, such as 0 in
getRawButton(0)public static void addLoggingFieldBoolean(java.lang.String dataFieldName,
java.lang.String unitName,
java.lang.String methodName,
java.lang.Class<?> classRef,
java.lang.Object... args)
dataFieldName - Name of the field/column in the output data. Also used for determining
what to do for "complex" methodsunitName - Name of the units for field/column in the output data.methodName - Actual method name to be called for this field, such as "getRawButton"classRef - Class where the method is held, such as Joystick.class for getRawButton()args - Optional list of arguments that are passed to the method, such as 0 in
getRawButton(0)