/*-----------------------------------------------------------------------*
  CLASS: WatchdogLog.h

  DESCRIPTION: Logging object for the Watchdog

  $Id: WatchdogLog.cc,v 1.2 1999/12/20 20:28:05 jrieffel Exp $
  *-----------------------------------------------------------------------*/

#include "WatchdogLog.h"
#include "WatchdogServer.h"

WatchdogLog::WatchdogLog( Watchdog *Watchdog,
			  DataLog::FileFormat format )
  : DataLogWriter( WatchdogLogName, format, AutoTimeStamp )
{
     setMnemonic("watchdog");

     //     addField( (_updateTime = new IntegerData("updateTime") ) );
     addField( (sphere_temp = new DoubleData("sphere temperature") ) );
     addField( (sphere_pressure = new DoubleData("sphere pressure") ) );
     addField( (mast_status = new CharData("mast status") ) );
     addField( (shore_command = new ShortData("sphere temperature") ) );
     addField( (watchdog_status = new ShortData("status") ) );
     addField( (watchdog_runlevel = new ShortData("runlevel") ) );
     addField( (watchdog_mode = new ShortData("mode") ) );
     addField( (shore_action = new ShortData("action") ) );


     _watchdog = Watchdog;
}  

WatchdogLog::~WatchdogLog()
{
     delete _updateTime;
}

void WatchdogLog::setFields()
{
  //     _updateTime->setValue( _watchdog->_outputData.updateTime );
  sphere_temp->setValue( _watchdog->_sphere_temp);
  sphere_pressure->setValue( _watchdog->_sphere_pressure);
  mast_status->setValue( _watchdog->_mast_status);
  shore_command->setValue( _watchdog->_shore_command);
  watchdog_status->setValue( _watchdog->_watchdog_status);
  watchdog_runlevel->setValue( _watchdog->_watchdog_runlevel);
  watchdog_mode->setValue( _watchdog->_watchdog_mode);
  shore_action->setValue( _watchdog->_shore_action);
  
}
