/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : SimulationLog.h                                               */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
//
// PURPOSE: Log data from the Altex/Odyssey simulator.
// AUTHORS: Oreilly, McEwen
// DATE:    99/11/30
// NOTES:   1) The log points (or variables) below are not prefaced with
//          an underscore in this class, although they are class variables.
//
#ifndef SIMULATIONLOG_H
#define SIMULATIONLOG_H

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

#define SimulationLogName "simulation"



class Simulator;

/*

CLASS 
SimulationLog

DESCRIPTION
Logs simulator data through the DataLogWriter interface.

The following DynamicControl example shows how to use the logging class:

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 SimulationLog : 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.

  SimulationLog(Simulator *simulator,  DataLog::FileFormat fileFormat); 

  ~SimulationLog();


protected:

  virtual void setFields();

  DoubleData *pos_N_x;
  DoubleData *pos_N_y;
  DoubleData *pos_N_z;

  DoubleData *phi;
  DoubleData *theta;
  DoubleData *psi;

  DoubleData *vel_Bo_N_B_x;
  DoubleData *vel_Bo_N_B_y;
  DoubleData *vel_Bo_N_B_z;

  DoubleData *omega_B_N_B_x;
  DoubleData *omega_B_N_B_y;
  DoubleData *omega_B_N_B_z;

  DoubleData *deltaRCmd;
  DoubleData *deltaECmd;

  DoubleData *deltaR;
  DoubleData *deltaE;

  DoubleData *M1_1;
  DoubleData *M2_1;
  DoubleData *M3_1;
  DoubleData *M4_1;

  DoubleData *M1_2;
  DoubleData *M2_2;
  DoubleData *M3_2;
  DoubleData *M4_2;

  DoubleData *thrAmps;
  DoubleData *omega_P;

  Simulator *_simulator;
};


#endif
