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

#ifndef _FastCatOutput_H
#define _FastCatOutput_H

#include <time.h>
#include "SharedData.h"

#define FastCatOutputName "FastCatOutput_ShmemName"

/*
CLASS 
FastCatOutput

DESCRIPTION
Output of FastCAT Ctd driver

AUTHOR
Rich Henthorn
*/
class FastCatOutput : public SharedData {

public:

  struct Data {

    Boolean deviceReady;

    timespec temp_updateTime;
    timespec cond_updateTime;
    long tcounts;       // raw temp sensor A/D counts
    float cfreq;         // raw conductivity frequency
    long pcounts;       // raw pressure sensor A/D counts
    float pvolts;        // pressure sensor temp compensation voltage
    float conductivity;  // calculated conductivity
    float temperature;   // calculated temp
    float pressure;      // calculated pressure
    float salinity;      // calculated salinity
    float sound_velocity;// calculated sound velocity
  };

  FastCatOutput(Access access = NoAccess, Boolean init = False);

  ~FastCatOutput();


  ////////////////////////////////////////////////////////////////////
  // Read from shared memory to this object's Data::data element
  void read();

  ////////////////////////////////////////////////////////////////////
  // Write from this object's Data::data element to shared memory
  void write();

  Data data;

};

#endif
