/** \file
 *
 *  Specifies the interface details for the DepAvgTempFrontDetector
 *  component in the EstimationModule.
 *
 *  DepAvgTempFrontDetector.h should only be included by
 *  DepAvgTempFrontDetector.cpp
 *  Other classes should include DepAvgTempFrontDetectorIF.h
 *
 *  Copyright (c) 2013, 2014 MBARI
 *  MBARI Proprietary Information.  All Rights Reserved
 */

#ifndef DEPAVGTEMPFRONTDETECTOR_H_
#define DEPAVGTEMPFRONTDETECTOR_H_

#include "component/SyncComponent.h"

class ConfigReader;
class DataReader;
class DataWriter;

/**
 *  Specifies the interface details for the DepAvgTempFrontDetector
 *  component in the EstimationModule.
 *
 *  DepAvgTempFrontDetector.h should only be included by
 *  DepAvgTempFrontDetector.cpp
 *  Other classes should include DepAvgTempFrontDetectorIF.h
 *
 *  \ingroup modules_estimation
 */

class DepAvgTempFrontDetector : public SyncEstimationComponent
{
public:
    DepAvgTempFrontDetector( const Module* module );
    virtual ~DepAvgTempFrontDetector();

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

protected:

    void readConfig( void );
    bool readData( void );
    void writeData( void );

    int verbosity_;
    Timestamp dataTimestamp_;
    float value_, tempHoriGradThreshold_;
    int cntThreshold_, countColdToWarm_, countWarmToCold_;
    bool coldToWarm_, warmToCold_, flagLogColdToWarm_, flagLogWarmToCold_;

    ConfigReader* verbosityLevelConfigReader_;
    ConfigReader* tempHoriGradThresholdConfigReader_;
    ConfigReader* cntThresholdConfigReader_;

    DataReader* valueReader_;

    DataWriter* countColdToWarmWriter_;
    DataWriter* countWarmToColdWriter_;
    DataWriter* depAvgTempFrontWriter_;
    DataWriter* coldToWarmWriter_;
    DataWriter* warmToColdWriter_;

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

};

#endif /* DEPAVGTEMPFRONTDETECTOR_H_ */
