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 raw byte array values. */ 008public class RawLogEntry extends DataLogEntry { 009 public static final String kDataType = "raw"; 010 011 public RawLogEntry(DataLog log, String name, String metadata, String type, long timestamp) { 012 super(log, name, type, metadata, timestamp); 013 } 014 015 public RawLogEntry(DataLog log, String name, String metadata, String type) { 016 this(log, name, metadata, type, 0); 017 } 018 019 public RawLogEntry(DataLog log, String name, String metadata, long timestamp) { 020 this(log, name, metadata, kDataType, timestamp); 021 } 022 023 public RawLogEntry(DataLog log, String name, String metadata) { 024 this(log, name, metadata, 0); 025 } 026 027 public RawLogEntry(DataLog log, String name, long timestamp) { 028 this(log, name, "", timestamp); 029 } 030 031 public RawLogEntry(DataLog log, String name) { 032 this(log, name, 0); 033 } 034 035 /** 036 * Appends a record to the log. 037 * 038 * @param value Value to record 039 * @param timestamp Time stamp (0 to indicate now) 040 */ 041 public void append(byte[] value, long timestamp) { 042 m_log.appendRaw(m_entry, value, timestamp); 043 } 044 045 /** 046 * Appends a record to the log. 047 * 048 * @param value Value to record 049 */ 050 public void append(byte[] value) { 051 m_log.appendRaw(m_entry, value, 0); 052 } 053}