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

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

#define DynamicControlLogName "dynamicControl"



class DynamicControlServer;

/*
CLASS 
DynamicControlLog

DESCRIPTION
Logs DynamicControl data through the DataLogWriter interface.

To use this class, instantiate an instance within a DynamicControl object
and periodically invoke the write() method:
<pre>
  DynamicControlLog *log = new DynamicControlLog(this, DataLog::BinaryFormat);

  [...other stuff...]

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

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

public:

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

  ~DynamicControlLog();


protected:

  virtual void setFields();

  DoubleData *_myTimeStamp;

  DoubleData *_heading;
  DoubleData *_rudder;
  DoubleData *mT_Psi;
  DoubleData *mPsiProp;
  DoubleData *mPsiInt;
  DoubleData *mPsiRate;

  DoubleData *_speed;
  DoubleData *_propOmega;

  DoubleData *mDepth;
  DoubleData *mT_depth;
  DoubleData *mDepthIntegral;
  DoubleData *mcTheta;
  DoubleData *_pitchProportional;
  DoubleData *_pitchIntegral;
  DoubleData *_pitchRate;    
  DoubleData *_p_dbg;        
  DoubleData *_elevBefLim;
  DoubleData *_elevator;

  DoubleData *_pitch;

  DynamicControlServer *_dynamicControl;
};


#endif
