/****************************************************************************/
/* Copyright (c) 2002 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : Lisst.h                                                       */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 07/09/2002                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
#ifndef _LISST_H
#define _LISST_H

#include "SerialDeviceDriver.h"
#include "LisstLog.h"
#include "Attributes.h"
#include "CtdIF.h"

/*
CLASS
Lisst

DESCRIPTION
LISST-100 Device Driver Interface

AUTHOR
Rich Henthorn

*/

class Lisst : public SerialDeviceDriver {
  
  friend class LisstLog;

public:

  Lisst(SerialDevice *serialDevice, Boolean verbose);

  virtual ~Lisst();

protected:

  DeviceIF::Status stop();

  DeviceIF::Status start();


protected:

  LisstLog  *_log;

  Boolean    _verbose;

  // Data to log
  //
  // Light intensity detectors 1 to 32
  int _det1,  _det2,  _det3,  _det4,  _det5,  _det6,  _det7,  _det8,  _det9,  _det10;
  int _det11, _det12, _det13, _det14, _det15, _det16, _det17, _det18, _det19, _det20;
  int _det21, _det22, _det23, _det24, _det25, _det26, _det27, _det28, _det29, _det30;
  int _det31, _det32;

  // Laser health
  int _laserTrans, _laserRef;

  // Voltage, auxiliary, pressure, temperature, timestamp
  int _volt, _aux1, _pressure, _temp, _time1, _time2;


  ////////////////////////////////////////////////////////////////////
  // initialization routine
  virtual DeviceIF::Status initialize();

  DeviceIF::Status flushReadBuffer(unsigned char *record,
				   int maxRecordBytes,
				   int *nBytesRead);

  ////////////////////////////////////////////////////////////////////
  // Read a fixed-length record
  virtual DeviceIF::Status readRecord(unsigned char *record,
				      int maxRecordBytes,
				      const char *recordTerminator,
				      unsigned readTimeout,
				      int *nBytesRead);
  
  ////////////////////////////////////////////////////////////////////
  // Process a record
  virtual DeviceIF::Status  processRecord(unsigned char *record, int nRecordBytes);

  DeviceIF::Status setTime(unsigned long secondsSince1970);

};

#endif
