Class RawLogEntry

java.lang.Object
edu.wpi.first.util.datalog.DataLogEntry
edu.wpi.first.util.datalog.RawLogEntry

public class RawLogEntry extends DataLogEntry
Log raw byte array values.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The data type for raw values.

    Fields inherited from class edu.wpi.first.util.datalog.DataLogEntry

    m_entry, m_log
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a raw log entry.
    RawLogEntry(DataLog log, String name, long timestamp)
    Constructs a raw log entry.
    RawLogEntry(DataLog log, String name, String metadata)
    Constructs a raw log entry.
    RawLogEntry(DataLog log, String name, String metadata, long timestamp)
    Constructs a raw log entry.
    RawLogEntry(DataLog log, String name, String metadata, String type)
    Constructs a raw log entry.
    RawLogEntry(DataLog log, String name, String metadata, String type, long timestamp)
    Constructs a raw log entry.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    append(byte[] value)
    Appends a record to the log.
    void
    append(byte[] value, int start, int len)
    Appends a record to the log.
    void
    append(byte[] value, int start, int len, long timestamp)
    Appends a record to the log.
    void
    append(byte[] value, long timestamp)
    Appends a record to the log.
    void
    Appends a record to the log.
    void
    append(ByteBuffer value, int start, int len)
    Appends a record to the log.
    void
    append(ByteBuffer value, int start, int len, long timestamp)
    Appends a record to the log.
    void
    append(ByteBuffer value, long timestamp)
    Appends a record to the log.
    byte[]
    Gets the last value.
    boolean
    Gets whether there is a last value.
    void
    update(byte[] value)
    Updates the last value and appends a record to the log if it has changed.
    void
    update(byte[] value, int start, int len)
    Updates the last value and appends a record to the log if it has changed.
    void
    update(byte[] value, int start, int len, long timestamp)
    Updates the last value and appends a record to the log if it has changed.
    void
    update(byte[] value, long timestamp)
    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.
    void
    update(ByteBuffer value, int start, int len)
    Updates the last value and appends a record to the log if it has changed.
    void
    update(ByteBuffer value, int start, int len, long timestamp)
    Updates the last value and appends a record to the log if it has changed.
    void
    update(ByteBuffer value, long timestamp)
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • RawLogEntry

      public RawLogEntry(DataLog log, String name, String metadata, String type, long timestamp)
      Constructs a raw log entry.
      Parameters:
      log - datalog
      name - name of the entry
      metadata - metadata
      type - Data type
      timestamp - entry creation timestamp (0=now)
    • RawLogEntry

      public RawLogEntry(DataLog log, String name, String metadata, String type)
      Constructs a raw log entry.
      Parameters:
      log - datalog
      name - name of the entry
      metadata - metadata
      type - Data type
    • RawLogEntry

      public RawLogEntry(DataLog log, String name, String metadata, long timestamp)
      Constructs a raw log entry.
      Parameters:
      log - datalog
      name - name of the entry
      metadata - metadata
      timestamp - entry creation timestamp (0=now)
    • RawLogEntry

      public RawLogEntry(DataLog log, String name, String metadata)
      Constructs a raw log entry.
      Parameters:
      log - datalog
      name - name of the entry
      metadata - metadata
    • RawLogEntry

      public RawLogEntry(DataLog log, String name, long timestamp)
      Constructs a raw log entry.
      Parameters:
      log - datalog
      name - name of the entry
      timestamp - entry creation timestamp (0=now)
    • RawLogEntry

      public RawLogEntry(DataLog log, String name)
      Constructs a raw log entry.
      Parameters:
      log - datalog
      name - name of the entry
  • Method Details

    • append

      public void append(byte[] value, long timestamp)
      Appends a record to the log.
      Parameters:
      value - Value to record; will send entire array contents
      timestamp - Time stamp (0 to indicate now)
    • append

      public void append(byte[] value)
      Appends a record to the log.
      Parameters:
      value - Value to record; will send entire array contents
    • append

      public void append(byte[] value, int start, int len, long timestamp)
      Appends a record to the log.
      Parameters:
      value - Data to record
      start - Start position of data (in byte array)
      len - Length of data (must be less than or equal to value.length - offset)
      timestamp - Time stamp (0 to indicate now)
    • append

      public void append(byte[] value, int start, int len)
      Appends a record to the log.
      Parameters:
      value - Data to record
      start - Start position of data (in byte array)
      len - Length of data (must be less than or equal to value.length - offset)
    • append

      public void append(ByteBuffer value, long timestamp)
      Appends a record to the log.
      Parameters:
      value - Data to record; will send from value.position() to value.limit()
      timestamp - Time stamp (0 to indicate now)
    • append

      public void append(ByteBuffer value)
      Appends a record to the log.
      Parameters:
      value - Data to record; will send from value.position() to value.limit()
    • append

      public void append(ByteBuffer value, int start, int len, long timestamp)
      Appends a record to the log.
      Parameters:
      value - Data to record
      start - Start position of data (in value buffer)
      len - Length of data (must be less than or equal to value.length - offset)
      timestamp - Time stamp (0 to indicate now)
    • append

      public void append(ByteBuffer value, int start, int len)
      Appends a record to the log.
      Parameters:
      value - Data to record
      start - Start position of data (in value buffer)
      len - Length of data (must be less than or equal to value.length - offset)
    • update

      public void update(byte[] value, long timestamp)
      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; will send entire array contents
      timestamp - Time stamp (0 to indicate now)
    • update

      public void update(byte[] value)
      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; will send entire array contents
    • update

      public void update(byte[] value, int start, int len, long timestamp)
      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 - Data to record
      start - Start position of data (in byte array)
      len - Length of data (must be less than or equal to value.length - offset)
      timestamp - Time stamp (0 to indicate now)
    • update

      public void update(byte[] value, int start, int len)
      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 - Data to record
      start - Start position of data (in byte array)
      len - Length of data (must be less than or equal to value.length - offset)
    • update

      public void update(ByteBuffer value, long timestamp)
      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 - Data to record; will send from value.position() to value.limit()
      timestamp - Time stamp (0 to indicate now)
    • update

      public void update(ByteBuffer value)
      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 - Data to record; will send from value.position() to value.limit()
    • update

      public void update(ByteBuffer value, int start, int len, long timestamp)
      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 - Data to record
      start - Start position of data (in value buffer)
      len - Length of data (must be less than or equal to value.length - offset)
      timestamp - Time stamp (0 to indicate now)
    • update

      public void update(ByteBuffer value, int start, int len)
      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 - Data to record
      start - Start position of data (in value buffer)
      len - Length of data (must be less than or equal to value.length - offset)
    • hasLastValue

      public boolean 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

      public byte[] 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.