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

#ifndef PAR_LICOR_H_
#define PAR_LICOR_H_

#include "component/SyncComponent.h"
#include "io/AnalogToDigital.h"
#include "io/LoadControl.h"

class UniversalDataReader;
class UniversalDataWriter;

/**
 *  Provides software interface to the Keller depth sensor
 *  Can also use SimSlate to provide simulated depth values when
 *  they are available.
 *
 *  PAR_Licor.h should only be included by PAR_Licor.cpp
 *  Other classes should include PAR_LicorIF.h
 *
 *  \ingroup modules_sensor
 */
class PAR_Licor: public SyncSensorComponent
{
public:
    PAR_Licor( const Module* module );
    virtual ~PAR_Licor();

    void initialize();
    void run();
    void uninitialize();

    /// Should return [myNamespace]::SIMULATE_HARDWARE, or [myNamespace]::POWER, etc
    virtual ConfigURI getConfigURI( ConfigOption configOption ) const;

private:

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

    ConfigReader* adcCalCfgReader_;
    ConfigReader* darkCountCfgReader_;
    ConfigReader* multiplierCfgReader_;
    ConfigReader* parCalCfgReader_;
    ConfigReader* maxBoundCfgReader_;
    ConfigReader* minBoundCfgReader_;
    ConfigReader* maxValidPitchCfgReader_;
    ConfigReader* minValidPitchCfgReader_;

    UniversalDataWriter* parWriter_;
    UniversalDataReader* pitchReader_;
    DataWriter* adcCountWriter_;

    // the pressure reading is out of bounds. We only want to report the error once
    bool boundingError_;

    float adcCalCfg_;
    float darkCountCfg_;
    float multiplierCfg_;
    float parCalCfg_;
    float maxBoundCfg_;
    float minBoundCfg_;
    float maxValidPitchCfg_;
    float minValidPitchCfg_;

    AnalogToDigital analogToDigital_;

    LoadControl loadControl_;

    void readConfig();

};

#endif /* DEPTH_Keller_H_ */
