/****************************************************************************/
/* Copyright (c) 2006 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : Gulper.h                                                      */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 12/01/2006                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
#ifndef _Gulper_H
#define _Gulper_H
#include "SerialDevice.h"
#include "PolledSerialDriver.h"
#include "GulperIF.h"
#include "GulperLog.h"
#include "GulperOutput.h"

class Gulper : public PeriodicTask {

  friend class GulperLog;

public:

  Gulper(SerialDevice *device);
  ~Gulper();

  ////////////////////////////////////////////////////////////////////
  // Initialize device. Returned DeviceIF::Status
  // will be propagated to subscribers in other tasks.
  void initialize();
  void readData();

  ////////////////////////////////////////////////////////////////////
  // Read a fixed-length record - use the default:

  ////////////////////////////////////////////////////////////////////
  // Process device data record. Returned DeviceIF::Status
  // will be propagated to subscribers in other tasks.
  // [input] record: Record from device
  // [input] nRecordBytes: Bytes in record


protected:

  void fireGulper(long gulperToFire);

  SerialDevice *_device;
  GulperLog *_log;
  GulperOutput *_output;
private:

  short GulperSolenoidOut, GulperProxIn, GulperHighSideStat, GulperSolenoidFB;

};

#endif
