/****************************************************************************/
/* Copyright (c) 2014 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : CathxM12Log.h                                                 */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 09/17/2015                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
#ifndef _CathxM12Log_H
#define _CathxM12Log_H

#include "DataLogWriter.h"
#include "FloatData.h"
#include "IntegerData.h"

class CathxM12;

#define CathxM12LogName "CathxM12Log"

/*
CLASS
CathxM12Log

DESCRIPTION
Logs CathxM12 data through the DataLogWriter interface.

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

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

  [...other stuff...]

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

</pre>
AUTHOR
Henthorn
*/
class CathxM12Log : public DataLogWriter {

public:

  ///////////////////////////////////////////////////////////////////
  // Constructor
  // [input] fileFormat: Specifies either DataLog::AsciiFormat or
  //         DataLog::BinaryFormat.
  //Log(CathxM12 *mb, DataLog::FileFormat fileFormat);
  CathxM12Log(CathxM12 *c, DataLog::FileFormat fileFormat,
       const char* postfix = "");

  ~CathxM12Log();

protected:

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

  void init(void);

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


private:

  // CathxM12 state
  //
  IntegerData *_req_capture, *_act_capture;
  IntegerData *_req_profile, *_act_profile;

};

#endif
