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

  DESCRIPTION: Generic server for AHRS instruments

  $Id: AHRSServer.h,v 1.6 2000/03/21 21:31:35 oreilly Exp $
  *-----------------------------------------------------------------------*/

#ifndef _AHRSServer_H
#define _AHRSServer_H

#include "AhrsIF_SK.h"
#include "AHRSOutput.h"
#include "Semaphore.h"

class AHRSServer : public AhrsIF_SK {
     
public:
     
     AHRSServer(const char *driverProgram);

     ~AHRSServer();
     
protected:
     
     //-----------------------------------------------------------------------
     // Get all three axes (all in deg)
     // [output] heading: heading
     // [output] roll: roll
     // [output] pitch: pitch
     virtual long attitude(double *roll, double *pitch, double *heading,
			   long *time );

     //-----------------------------------------------------------------------
     // Get roll value and rate (deg and deg/S)
     // [output] roll: roll
     // [output] rollRate: roll rate
     virtual long roll(double *roll, double *rollRate,
		       long *time );

     //-----------------------------------------------------------------------
     // Get pitch value and rate (deg and deg/S)
     // [output] pitch: pitch
     // [output] pitchRate: pitch rate
     virtual long pitch(double *pitch, double *pitchRate,
			long *time );

     //-----------------------------------------------------------------------
     // Get heading value and rate (deg and deg/S)
     // [output] heading: heading
     // [output] headingRate: heading rate
     virtual long heading(double *heading, double *headingRate,
			  long *time );

     //-----------------------------------------------------------------------
     // Get all three axis rates (all in deg/S)
     // [output] rollRate: Roll rate
     // [output] pitchRate: Pitch rate
     // [output] headingRate: Yaw rate
     virtual long angRates(double *rollRate, 
			   double *pitchRate, 
			   double *headingRate,
			   long *time );

     //-----------------------------------------------------------------------
     // Get everything
     // [output] roll, pitch, heading
     // [output] rollRate, pitchRate, headingRate
     virtual long all(double *roll, 
		      double *pitch, 
		      double *heading, 
		      double *rollRate, 
		      double *pitchRate, 
		      double *headingRate,
		      long *time );


     virtual int spawnAuxTasks();

     AHRSOutput *_output;
     AHRSOutput::Data _outputData;

     const char *_driverProgram;

     Semaphore *_outputSem;
};

#endif
