//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      GUI/View/Frame/Fit1DFrame.h
//! @brief     Defines class Fit1DFrame.
//!
//! @homepage  http://www.bornagainproject.org
//! @license   GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
//  ************************************************************************************************

#ifndef BORNAGAIN_GUI_VIEW_FRAME_FIT1DFRAME_H
#define BORNAGAIN_GUI_VIEW_FRAME_FIT1DFRAME_H

#include <QAction>
#include <QWidget>

class DataSource;
class PlotStatusLabel;
class SpecularPlotCanvas;

//! The Fit2DFrame class plots real data, simulated data and their relative difference
//! during the course of the fit.

class Fit1DFrame : public QWidget {
    Q_OBJECT
public:
    Fit1DFrame();
    ~Fit1DFrame();

    void updateFrame();

private:
    void onResetViewAction();
    void connectItems();
    void updateDiffData();

    SpecularPlotCanvas* m_data_canvas;
    SpecularPlotCanvas* m_diff_canvas;
    PlotStatusLabel* m_status_label;

    QAction* m_reset_view_action;
    std::unique_ptr<DataSource> m_data_source;
};

#endif // BORNAGAIN_GUI_VIEW_FRAME_FIT1DFRAME_H
