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

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

class DeltaT;
class SimulatedDeltaT;

#define DeltaTLogName "deltatlog"

/*
CLASS 
DeltaTLog

DESCRIPTION
Logs DeltaT data through the DataLogWriter interface.

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

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

  [...other stuff...]

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

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

public:

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

  ~DeltaTLog();

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 PSA916 
  // object.
  DeltaT *_delta_t;
  SimulatedDeltaT *_sim_delta_t;


private:

  FloatData   *_dt_altitude;
  IntegerData *_nbeams;
  FloatData   *_beam_ranges[120];
  IntegerData *_intensities[120];

};

#endif
