#include "DataLogWriter.h"
#include "MetraByteLog.h"
#include "MetraByte.h"
#include "TimeP.h"
#include "Syslog.h"

MetraByteLog::MetraByteLog(MetraByte *metrabyte, 
			     DataLog::FileFormat fileFormat) 
  : DataLogWriter(MetraByteLogName, fileFormat, AutoTimeStamp) 
{
  setMnemonic("metrabyte");

  addField((_voltage = new DoubleData("voltage")));
  addField((_current = new DoubleData("current")));
  _metrabyte = metrabyte;
}


MetraByteLog::~MetraByteLog()
{
  delete _current;
  delete _voltage;
}


void MetraByteLog::setFields()
{

  // Set range value
  _current->setValue(_metrabyte->_output->data.current);
  _voltage->setValue(_metrabyte->_output->data.voltage);

}



