/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : NavigationLog.h                                               */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
#ifndef _NAVIGATIONLOG_H
#define _NAVIGATIONLOG_H

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

class Navigation;

#define NavigationLogName "navigation"

/*
CLASS 
NavigationLog

DESCRIPTION
Logs Navigation data through the DataLogWriter interface.

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

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

  [...other stuff...]

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

</pre>
AUTHOR
Tom O'Reilly
*/
class NavigationLog : public DataLogWriter {

public:

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

  ~NavigationLog();

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 Navigation 
  // object.
  Navigation *_navigation;


private:

  DoubleData *_x;
  DoubleData *_y;
  DoubleData *_z;

  DoubleData  *_gpsNorth;
  DoubleData  *_gpsEast;
  IntegerData *_gpsValid;

  DoubleData *_roll;
  DoubleData *_pitch;
  DoubleData *_yaw;

  DoubleData *_omega_B_x;
  DoubleData *_omega_B_y;
  DoubleData *_omega_B_z;

  DoubleData *mMAltimeterRange;
  DoubleData *mMAltitude;

  DoubleData *mMWaterSpeed;

  DoubleData *_nfix, *_efix;
  DoubleData *_filter_north, *_filter_east, *_filter_depth, *_north_current,
             *_east_current, *_speed_bias, *_heading_bias;

};

#endif
