001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package edu.wpi.first.util.datalog;
006
007/** Log array of float values. */
008public class FloatArrayLogEntry extends DataLogEntry {
009  public static final String kDataType = "float[]";
010
011  public FloatArrayLogEntry(DataLog log, String name, String metadata, long timestamp) {
012    super(log, name, kDataType, metadata, timestamp);
013  }
014
015  public FloatArrayLogEntry(DataLog log, String name, String metadata) {
016    this(log, name, metadata, 0);
017  }
018
019  public FloatArrayLogEntry(DataLog log, String name, long timestamp) {
020    this(log, name, "", timestamp);
021  }
022
023  public FloatArrayLogEntry(DataLog log, String name) {
024    this(log, name, 0);
025  }
026
027  /**
028   * Appends a record to the log.
029   *
030   * @param value Value to record
031   * @param timestamp Time stamp (0 to indicate now)
032   */
033  public void append(float[] value, long timestamp) {
034    m_log.appendFloatArray(m_entry, value, timestamp);
035  }
036
037  /**
038   * Appends a record to the log.
039   *
040   * @param value Value to record
041   */
042  public void append(float[] value) {
043    m_log.appendFloatArray(m_entry, value, 0);
044  }
045}