/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : OctansLog.cc                                                */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
/*-----------------------------------------------------------------------*
  CLASS: OctansLog.h

  DESCRIPTION: Logging object for the Octans

  $Id: KearfottLog.cc,v 1.4 2001/10/15 17:10:48 dorado Exp $
  *-----------------------------------------------------------------------*/

#include "KearfottLog.h"
#include "Kearfott.h"

KearfottLog::KearfottLog( Kearfott *kearfott,
			  DataLog::FileFormat format )
  : DataLogWriter( KearfottLogName, format, AutoTimeStamp )
{
  setMnemonic("dataK");

  addField( (_cycles     = new IntegerData("mCyclesK")) );
  addField( (_mode       = new IntegerData("mModeK")) );
  addField( (_monitor    = new IntegerData("mMonK")) );
  addField( (_lat        = new DoubleData("mLatK")) );
  _lat->setAsciiFormat("%3.8f"); //Necessary for large UTM values.
  addField( (_lon        = new DoubleData("mLonK")) );
  _lon->setAsciiFormat("%3.8f"); //Necessary for large UTM values.
  addField( (_northing        = new DoubleData("mNorthK")) );
  _northing->setAsciiFormat("%13.2f"); //Necessary for large UTM values.
  addField( (_easting         = new DoubleData("mEastK")) );
  _easting->setAsciiFormat("%13.2f"); //Necessary for large UTM values.
  addField( (_depth      = new DoubleData("mDepthK")) );
  addField( (_roll       = new DoubleData("mRollK")) );
  addField( (_pitch       = new DoubleData("mPitchK")) );
  addField( (_heading       = new DoubleData("mHeadK")) );
  addField( (_vbodyx       = new DoubleData("mVbodyxK")) );
  addField( (_vbodyy      = new DoubleData("mVbodyyK")) );
  addField( (_vbodyz       = new DoubleData("mVbodyzK")) );
  addField( (_accelx       = new DoubleData("mAccelxK")) );
  addField( (_accely       = new DoubleData("mAccelyK")) );
  addField( (_accelz       = new DoubleData("mAccelzK")) );
  addField( (_prate        = new DoubleData("mPrateK")) );
  addField( (_qrate        = new DoubleData("mQrateK")) );
  addField( (_rrate        = new DoubleData("mRrateK")) );
  
  _kearfott = kearfott;
}  

KearfottLog::~KearfottLog()
{

}

void KearfottLog::setFields()
{
    _cycles->setValue( _kearfott->_scaledNavData.cycles );
    _mode->setValue( _kearfott->_scaledNavData.mode );
    _monitor->setValue( _kearfott->_scaledNavData.monitor );
    _lat->setValue( _kearfott->_scaledNavData.lat );
    _lon->setValue( _kearfott->_scaledNavData.lon );
    _northing->setValue( _kearfott->_scaledNavData.northing );
    _easting->setValue( _kearfott->_scaledNavData.easting );
    _depth->setValue( _kearfott->_scaledNavData.depth );
    _roll->setValue( _kearfott->_scaledNavData.roll );
    _pitch->setValue( _kearfott->_scaledNavData.pitch );
    _heading->setValue( _kearfott->_scaledNavData.heading );
    _vbodyx->setValue( _kearfott->_scaledNavData.vbodyx );
    _vbodyy->setValue( _kearfott->_scaledNavData.vbodyy );
    _vbodyz->setValue( _kearfott->_scaledNavData.vbodyz );
    _accelx->setValue( _kearfott->_scaledNavData.accelx );
    _accely->setValue( _kearfott->_scaledNavData.accely );
    _accelz->setValue( _kearfott->_scaledNavData.accelz );
    _prate->setValue( _kearfott->_scaledNavData.prate );
    _qrate->setValue( _kearfott->_scaledNavData.qrate );
    _rrate->setValue( _kearfott->_scaledNavData.rrate );
}

