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

#include "ourTypes.h"
#include "Behavior.h"
#include "MathP.h"

#define WaypointHomingBehaviorName "waypoint_homing"
#define MEDIANSIZE  11       //Must be an odd number.

/*
CLASS 
WaypointHoming

DESCRIPTION
Attempts to achieve a position using the specified direction
of approach.


AUTHOR
R. McEwen, following Tom O'Reilly's code.
*/
class WaypointHoming : public Behavior {

public:

  WaypointHoming();
  virtual ~WaypointHoming();

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

  virtual Boolean shouldBehaviorStart( void );

protected:

  double _dtw;
  double _northing;
  double _easting;
  double _newNorthing;
  double _newEasting;
  double _newBearing;
  double _inTrkOffset;
  double _xTrkOffset;
  double _clusterRadius;
  double _finalApproach;
  double _beaconNorthing;
  double _beaconEasting;
  double _northingOffset;
  double _eastingOffset;
  char   *_beaconAddr;
  double _nList[MEDIANSIZE];
  double _eList[MEDIANSIZE];
  long _nSorted[MEDIANSIZE];
  long _eSorted[MEDIANSIZE];
  double _latitude;
  double _longitude;
  double _speed;
  double _depth;
  double _bearing;
  double _dockBearing;
  double _captureRadius;
  double _gain;
  short  _consecutiveGood;
  long   _ngood;
  Boolean _circleMode;
  Boolean _first;
  Boolean _firstValid;
  Boolean _dvlNewData;
  Boolean _beaconInFov, _beaconInFovLast;
  double  _navReset;
  DvlIF::Data _dvlData;
  enum ProbeStateEnum  { Down, Raising, Up, Lowering, Unknown };
  ProbeStateEnum _probeState;
  enum NetworkStatusEnum { Present, Absent  };
  NetworkStatusEnum _networkStatus;

};



#endif
