#ifndef _CTDLOG_H
#define _CTDLOG_H

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

class CTD;

#define CTDLogName "ctdlog"

/*
CLASS 
CTDLog

DESCRIPTION
Logs CTD data through the DataLogWriter interface.

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

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

  [...other stuff...]

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

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

public:

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

  ~CTDLog();

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 CTD 
  // object.
  CTD *_ctd;


private:

  DoubleData *_cond;
  DoubleData *_temp;
  DoubleData *_cfreq;
  DoubleData *_tfreq;
  
//  CharData *_valid;

};

#endif
