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

#include "DataLogWriter.h"
#include "DoubleData.h"
#include "AngleData.h"
#include "IntegerData.h"
#include "CharData.h"
#include "ShortData.h"

class LoggableGps;

#define GpsLogName "gps"

/*
CLASS 
GpsLog

DESCRIPTION
Logs GPS data through the DataLogWriter interface. Constructor
takes an instance of an object that implements the Gps interface.

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

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

  [...other stuff...]

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

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

public:

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

  ~GpsLog();

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 Gps 
  // object.
  LoggableGps *_gps;


 private:

		  
  IntegerData *_sampleTime;
  AngleData *_latitude;
  CharData *_NSHem;
  AngleData *_longitude;
  CharData *_EWHem;
  ShortData *_quality;
  ShortData *_nSatellites;
  DoubleData *_hdop;
  DoubleData *_altitude;
  DoubleData *_geoidHeight;
  ShortData *_dgpsDataAge;
  ShortData *_dgpsStationID;

};

#endif
