/****************************************************************************/
/* Copyright (c) 2002 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : HydroscatLog.cc                                               */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 06/06/2002                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
#include "DataLogWriter.h"
#include "HydroscatLog.h"
#include "Hydroscat.h"
#include "TimeP.h"
#include "Syslog.h"

HydroscatLog::HydroscatLog(Hydroscat *hydro, DataLog::FileFormat format)
  : _hydro(hydro), DataLogWriter(HydroscatLogName, format, AutoTimeStamp) 
{
  setMnemonic(HydroscatLogName);

  addField(_seconds =  new IntegerData("Seconds"));
  addField(_hseconds = new IntegerData("HundrethsOfSeconds"));
  addField(_snorm1 = new IntegerData("Snorm1"));
  addField(_snorm2 = new IntegerData("Snorm2"));
  addField(_snorm3 = new IntegerData("Snorm3"));
  addField(_gainstatus1 = new IntegerData("Gain_Status_1"));
  addField(_gainstatus2 = new IntegerData("Gain_Status_2"));
  addField(_gainstatus3 = new IntegerData("Gain_Status_3"));
  addField(_depthraw = new IntegerData("RawDepthValue"));
  addField(_tempraw = new IntegerData("RawTempValue"));
  addField(_temp = new DoubleData("Temperature"));
  addField(_error = new IntegerData("ErrorValue"));

}


HydroscatLog::~HydroscatLog()
{
  delete _seconds;
  delete _hseconds;
  delete _snorm1;
  delete _snorm2;
  delete _snorm3;
  delete _gainstatus1;
  delete _gainstatus2;
  delete _gainstatus3;
  delete _depthraw;
  delete _tempraw;
  delete _temp;
  delete _error;
}


void HydroscatLog::setFields()
{
  _seconds->setValue(_hydro->_seconds);
  _hseconds->setValue(_hydro->_hseconds);
  _snorm1->setValue(_hydro->_snorm1);
  _snorm2->setValue(_hydro->_snorm2);
  _snorm3->setValue(_hydro->_snorm3);
  _gainstatus1->setValue(_hydro->_gainstatus1);
  _gainstatus2->setValue(_hydro->_gainstatus2);
  _gainstatus3->setValue(_hydro->_gainstatus3);
  _depthraw->setValue(_hydro->_depthraw);
  _tempraw->setValue(_hydro->_tempraw);
  _temp->setValue(_hydro->_temp);
  _error->setValue(_hydro->_error);
}

