/***************************************************************************
**
**  This file is part of QGpCoreWave.
**
**  This library is free software; you can redistribute it and/or
**  modify it under the terms of the GNU Lesser General Public
**  License as published by the Free Software Foundation; either
**  version 2.1 of the License, or (at your option) any later version.
**
**  This file is distributed in the hope that it will be useful, but WITHOUT
**  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
**  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
**  License for more details.
**
**  You should have received a copy of the GNU Lesser General Public
**  License along with this library; if not, write to the Free Software
**  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
**
**  See http://www.geopsy.org for more information.
**
**  Created: 2016-08-23
**  Copyright: 2016-2019
**    Marc Wathelet (ISTerre, Grenoble, France)
**
***************************************************************************/

#ifndef MAGNETOTELLURICPROXY_H
#define MAGNETOTELLURICPROXY_H

#include <QGpCoreMath.h>

#include "MagnetoTelluricPointOptions.h"
#include "MagnetoTelluricCurve.h"
#include "QGpCoreWaveDLLExport.h"

namespace QGpCoreWave {

  class QGPCOREWAVE_EXPORT MagnetoTelluricProxy : public CurveProxy
  {
  public:
    MagnetoTelluricProxy() : CurveProxy() {_curve=0;}

    virtual QString tag() const {return "MagnetoTelluricProxy";}

    virtual CurveProxy * clone() const {return new MagnetoTelluricProxy;}

    CURVEPROXY_BASICDECLARATIONS
    CURVEPROXY_NAMEDECLARATIONS
    CURVEPROXY_LOGDECLARATIONS
    void average(const CurveProxy * o) {
      curve().average(static_cast<const MagnetoTelluricProxy *>(o)->curve());
    }

    virtual int columnCount() const {return 10;}
    virtual QString columnName(int col) const;
    virtual QString columnUnit(int col) const;
    virtual QString columnTitle(int col) const;

    virtual QVariant columnValue(int sample, int col) const;
    virtual void setColumnValue(int sample, int col, const QVariant & value);

    virtual int xAxisColumn() const {return 0;}
    virtual int xAxisInversedColumn() const  {return 1;}
    virtual int yAxisColumn() const;
    virtual int yAxisInversedColumn() const {return -1;}

    virtual QStringList columnFileTypes() const;
    virtual QVector<int> defaultColumnFileTypes() const;
    virtual QVector<int> savedColumns() const;

    virtual bool parse(ColumnTextIterator& it);

    void setYMode(MagnetoTelluricPointOptions::OutputMode m) {_yMode=m;}
    MagnetoTelluricPointOptions::OutputMode yMode() const {return _yMode;}

    void setCurve(MagnetoTelluricCurve * c) {_curve=c;}
    const MagnetoTelluricCurve& curve() const {return *_curve;}
    MagnetoTelluricCurve& curve() {return *_curve;}
  private:
    MagnetoTelluricPointOptions::OutputMode _yMode;
    MagnetoTelluricCurve *_curve;
  };

} // namespace QGpCoreWave

#endif // MAGNETOTELLURICPROXY_H

