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

#include "Behavior.h"
#include "MissionClock.h"

#define NoAbortDepth -99999.
#define NoMinimumAltitude -99999.
#define NoAbortAltitude -999999.

#define DepthEnvelopeBehaviorName "depthEnvelope"

/*
CLASS 
DepthEnvelope

DESCRIPTION
This behavior prevents the vehicle from decending below the "maxDepth"
or ascending above the "minDepth".  If "minAltitude" != NoMinimumAltitude, 
then it also prevents the vehicle from approaching closer to the bottom than
"minAltitude".  If "abortDepth" != NoAbortDepth, then the
mission is aborted if the "abortDepth" is reached.

Attribute       Type               Meaning
---------       ----               -------
minDepth        Float              Minimum depth
maxDepth        Float              Maximum depth
minAltitude     Float              Minimum altitude
abortDepth      Float              Abort when below this depth
abortAltitude   Float              Abort when below this altitude

AUTHOR
Tom O'Reilly
*/
class DepthEnvelope : public Behavior {

public:

  ///////////////////////////////////////////////////////////////////
  // Constructor
  DepthEnvelope();

  virtual ~DepthEnvelope();

  virtual void execute();
  virtual Boolean validInput();

protected:

  double _maxDepth;
  double _minDepth;
  double _minAltitude;
  double _abortDepth;
  double _abortAltitude;
};

#endif
