#ifndef _epiBattLOG_H
#define _epiBattLOG_H

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

class epiBatt;

#define epiBattLogName "epiBattlog"

/*
CLASS 
BattLog

DESCRIPTION
Logs epiBatt data through the DataLogWriter interface.

AUTHOR
Hans Thomas
*/
class epiBattLog : public DataLogWriter {

public:

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

  ~epiBattLog();

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 BluefinBatt 
  // object.
  epiBatt *_batt;

  int _numBatts;

private:

  // Data from #q0 query
  struct battdata
  {
    DoubleData  *gasGauge;
    DoubleData  *cellVoltage[8];
    DoubleData  *current;
    IntegerData *temp[9];
    IntegerData *rH;
    IntegerData *balance;
    IntegerData *tempAlertFlag;
    IntegerData *voltAlertFlag;
    IntegerData *batteryStateFlag; 
  };

  struct battdata *_data;

};

#endif
