/** \file
 *
 *  Contains the SetNav class declaration.
 *
 *  SetNav.h should only be included by SetNav.cpp
 *  Other classes should include SetNavIF.h
 *
 *  Copyright (c) 2007,2008,2009 MBARI
 *  MBARI Proprietary Information.  All Rights Reserved
 */

#ifndef SETNAV_H_
#define SETNAV_H_

#include "component/Behavior.h"

/**
 *  Contains the SetNav Command. Sets the vehicle's
 *  latitude, longitude to desired coordinates.
 *
 *  SetNav.h should only be included by SetNav.cpp
 *  Other classes should include SetNavIF.h
 *
 *  \ingroup modules_guidance
 */
class SetNav : public Behavior
{
public:

    SetNav( const Str& prefix, const Module* module );

    virtual ~SetNav();

    /// Initialize function
    void initialize( void );

    /// The actual "payload" of the component
    void run();

    /// Otherwise returns true
    bool runIfUnsatisfied();

    bool isSatisfied();

    /// Uninit function
    void uninitialize( void );

    /// Mission Component factory interface
    static Behavior* CreateBehavior( const Str& prefix, const Module* module );

protected:

    /// Desired latitude
    SettingReader *latitudeSettingReader_;

    /// Desired longitude
    SettingReader *longitudeSettingReader_;

    /// Sets the specified latitude
    DataWriter *latitudeFixWriter_;

    /// Sets the specified longitude
    DataWriter *longitudeFixWriter_;

    /// Sets the time specified coordinates were recived
    DataWriter* timeFixWriter_;

    /// SetNav latitude, longitude universal writer accuracy
    static const float SETNAV_ACCURACY;

    float latitudeSetting_;
    float longitudeSetting_;
    Timestamp timeFix_;

    bool SetNav_;

    bool readSettings( void );

};

#endif /*SETNAV_H_*/
