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

#ifndef ESPCARTRIDGESELECT_H_
#define ESPCARTRIDGESELECT_H_

#include "component/Behavior.h"

/**
 *  Contains the ESPCartridgeSelect Behavior/Command
 *
 *  Returns statisfied if the elpased time since
 *  last valid acoustic_receive_time (universal variable)
 *  exceeds the allowed duration.
 *
 *  ESPCartridgeSelect.h should only be included by ESPCartridgeSelect.cpp
 *  Other classes should include ESPCartridgeSelectIF.h
 *
 *  \ingroup modules_science
 **/

class ESPCartridgeSelect : public Behavior
{
public:

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

    virtual ~ESPCartridgeSelect();

    /// Initialize function
    void initialize( void );

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

    /// Runs and returns true if acoustic timer has expired
    /// Otherwise returns false
    bool runIfUnsatisfied( void );

    /// Returns true when acoustic timer has expired
    bool isSatisfied( void );

    /// Uninit function
    void uninitialize( void );

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

protected:

    // Desired ESP cartridge type
    int cartridgeSetting_;

    // Indicates successful initialization
    bool initialized_;

    /// Setting Readers
    SettingReader* cartridgeSettingReader_;

    /// ESP cartridge type selection
    DataWriter* cartridgeSelectWriter_;

private:

    // Note that the copy constructor below is private and not given a body.
    // Any attempt to call it will return a compiler error.
    ESPCartridgeSelect( const ESPCartridgeSelect& old ); // disallow copy constructor
};

#endif /* ESPCARTRIDGESELECT_H_ */
