Class DataLogRecord

java.lang.Object
edu.wpi.first.util.datalog.DataLogRecord

public class DataLogRecord
extends 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).
  • Method Details

    • getEntry

      public int getEntry()
      Gets the entry ID.
      Returns:
      entry ID
    • getTimestamp

      public long getTimestamp()
      Gets the record timestamp.
      Returns:
      Timestamp, in integer microseconds
    • getSize

      public int getSize()
      Gets the size of the raw data.
      Returns:
      size
    • getRaw

      public byte[] getRaw()
      Gets the raw data. Use the GetX functions to decode based on the data type in the entry's start record.
      Returns:
      byte array
    • getRawBuffer

      Gets the raw data. Use the GetX functions to decode based on the data type in the entry's start record.
      Returns:
      byte buffer
    • isControl

      public boolean isControl()
      Returns true if the record is a control record.
      Returns:
      True if control record, false if normal data record.
    • isStart

      public boolean isStart()
      Returns true if the record is a start control record. Use GetStartData() to decode the contents.
      Returns:
      True if start control record, false otherwise.
    • isFinish

      public boolean isFinish()
      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

      public boolean isSetMetadata()
      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.
    • getStartData

      Decodes a start control record.
      Returns:
      start record decoded data
      Throws:
      InputMismatchException - on error
    • getFinishEntry

      public int getFinishEntry()
      Decodes a finish control record.
      Returns:
      finish record entry ID
      Throws:
      InputMismatchException - on error
    • getSetMetadataData

      Decodes a set metadata control record.
      Returns:
      set metadata record decoded data
      Throws:
      InputMismatchException - on error
    • getBoolean

      public boolean getBoolean()
      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.
      Returns:
      boolean value
      Throws:
      InputMismatchException - on error
    • getInteger

      public long getInteger()
      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.
      Returns:
      integer value
      Throws:
      InputMismatchException - on error
    • getFloat

      public float getFloat()
      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.
      Returns:
      float value
      Throws:
      InputMismatchException - on error
    • getDouble

      public double getDouble()
      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.
      Returns:
      double value
      Throws:
      InputMismatchException - on error
    • getString

      public String getString()
      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.
      Returns:
      string value
    • getBooleanArray

      public boolean[] getBooleanArray()
      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.
      Returns:
      boolean array
    • getIntegerArray

      public long[] getIntegerArray()
      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.
      Returns:
      integer array
      Throws:
      InputMismatchException - on error
    • getIntegerBuffer

      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.
      Returns:
      integer buffer
      Throws:
      InputMismatchException - on error
    • getFloatArray

      public float[] getFloatArray()
      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.
      Returns:
      float array
      Throws:
      InputMismatchException - on error
    • getFloatBuffer

      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.
      Returns:
      float buffer
      Throws:
      InputMismatchException - on error
    • getDoubleArray

      public double[] getDoubleArray()
      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.
      Returns:
      double array
      Throws:
      InputMismatchException - on error
    • getDoubleBuffer

      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.
      Returns:
      double buffer
      Throws:
      InputMismatchException - on error
    • getStringArray

      public String[] getStringArray()
      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.
      Returns:
      string array
      Throws:
      InputMismatchException - on error