#ifndef _MetraByteLOG_H
#define _MetraByteLOG_H

#include "DataLogWriter.h"
#include "DoubleData.h"

class MetraByte;

#define MetraByteLogName "metrabytelog"

/*
CLASS 
MetraByteLog

DESCRIPTION
Logs MetraByte data through the DataLogWriter interface.

To use this class, instantiate an instance within a MetraByte object
and periodically invoke the write() method:
<pre>

  MetraByteLog *log = new MetraByteLog(this, DataLog::AsciiFormat);

  [...other stuff...]

  // Log the data
  log->write();

</pre>
AUTHOR
John O'Rieffel
*/
class MetraByteLog : public DataLogWriter {

public:

  ///////////////////////////////////////////////////////////////////
  // Constructor
  // [input] navigation: MetraByte object. The setFields() method
  //         accesses this object as the source of the logged data.
  // [input] fileFormat: Specifies either DataLog::AsciiFormat or 
  //         DataLog::BinaryFormat.
  MetraByteLog(MetraByte *metrabyte, DataLog::FileFormat fileFormat); 

  ~MetraByteLog();

protected:

  ///////////////////////////////////////////////////////////////////
  // Set values in record array elements. This virtual method is called
  // by DataLogWriter::write()
  virtual void setFields();

  ///////////////////////////////////////////////////////////////////
  // setFields() accesses the data to be logged from this MetraByte 
  // object.
  MetraByte *_metrabyte;


private:

  DoubleData *_current;
  DoubleData *_voltage;

};

#endif
