/*
********************************************************
Copyright 2000 MBARI.
MBARI Proprietary Information. All rights reserved.
NOTE: This file is automatically generated.
DO NOT MODIFY.
********************************************************
*/

#ifndef __FanIF_H
#define __FanIF_H

#include "TaskInterface.h"


#define FanIFServerName "FanIFServer"

/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : FanIF.idl                                                     */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
//#include "InstrumentIF.idl"
/*
CLASS 
FanIF

DESCRIPTION
TaskInterface to Fan device driver 

*/
class FanIF : public TaskInterface {

  friend class FanIF_SK;

  public:

  // Forward declarations of public structures
  struct Data;
  
  
  typedef double Vector[2];
  typedef short VectorInt[2];
  typedef short VectorInt8[8];
  
  struct Data {
    //
    // Temperature, high and low limits from the DS1620, in Centigrade.
    // Channel[0] is on the fan card, [1] is on Sib's power board.
    //
    FanIF::Vector Temp1620;
    FanIF::Vector Temp1620Hi;
    FanIF::Vector Temp1620Lo;
    //
    // 1620 Status
    //
    FanIF::VectorInt Temp1620Status;
    //
    // Temperature in Centigrade, and humidity in relative , from the
    // SHT1x on the fan card.
    //
    double Humidity;
    double TempSHT1x;
    //
    // Pressure in kPa from the MPX2200 on the fan card.
    //
    double Pressure;
    //
    // A/D channels:
    //
    FanIF::VectorInt8 Ana;
    short TestFlag2;
  };
  FanIF(const char *name, int timeout = 10);

  FanIF(const char *name, const char *serverName, int timeout = 10);

  ~FanIF();

  //    /////////////////////////////////////////////////////////
  //    // Get data from instrument
  //    // [output] Data: 
  short Get(FanIF::Data *data);

  //    //Test:
  short EnvDiagLED(short state);

  //    // I/O
  //    short EnvReadCfg();   //Put these in the Data structure if necessary
  //    short EnvReadDig();   //Put these in the Data structure if necessary
  //    short EnvSetDig(in short value);
  //    short EnvFan(in short value);
  //    short EnvSetEnables(in short value);
  //    // Temperature
  short EnvWriteTemp(short TempHi, short TempLo, short Ch);

  
  protected:

  // Message codes for each method
  enum FanIFMsgCode {
    GetMsgCode,
    EnvDiagLEDMsgCode,
    EnvWriteTempMsgCode
  };

  // Define message structure for each method
  struct GetMsg : Request, Reply {
    short returnVal;
    FanIF::Data data;
  
  } _GetMsg;

  struct EnvDiagLEDMsg : Request, Reply {
    short returnVal;
    short state;
  
  } _EnvDiagLEDMsg;

  struct EnvWriteTempMsg : Request, Reply {
    short returnVal;
    short TempHi;
    short TempLo;
    short Ch;
  
  } _EnvWriteTempMsg;

};

#endif

