/****************************************************************************/
/* Copyright (c) 2015 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : CARL.h                                                        */
/* Author   :                                                               */
/* Project  : Henthorn                                                      */
/* Version  : 1.0                                                           */
/* Created  : 02/10/2015                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
#ifndef _CARL_H
#define _CARL_H

#include "Behavior.h"
#include "CARL_IF.h"

#define CARLBehaviorName "CARL"

#define NullLegDuration -1.0

class FloatAttribute;
class AngleAttribute;
class StringAttribute;

/*
CLASS 
CARL

DESCRIPTION
This behavior forwards commands to the CAmera Recorder and Logger CARL controller


AUTHOR
Henthorn
*/
class CARL : public Behavior {

public:

  CARL();

  virtual ~CARL();

  virtual Boolean validInput();

  void test() { shouldBehaviorStart(); execute(); }

protected:

  // Control the sequencing of consecutive CARL behaviors
  //
  static Boolean Locked;
  static unsigned Instance;
  unsigned _instance;

  virtual void execute();
  Boolean shouldBehaviorStart( void );

  long _cameraSwitch;     // On or Off
  long _recorderSwitch;   // On or Off
  long _ctdSwitch;        // On or Off
  long _lightSwitch;      // On or Off
  long _brightness;       // 0 to 100
  long _fstop;            // coded fstop position
  long _homeIris;
  long _clipname;

  long _record;           // 1 => start, 0 => stop

  // Timing variables
  long _timer;

  // Initialize flag
  Boolean _init;

  // Tracking flags
  Boolean _inCameraSwitch;
  Boolean _inRecorderSwitch;
  Boolean _inLightSwitch;
  Boolean _inBrightness;
  Boolean _inRecord;
  Boolean _inHomeIris;
  Boolean _inFstop;

  // CARLIF server
  CARL_IF *_server;
};



#endif
