#pragma once

#include "../../3rdParty/qwt/qwt_plot.h"
#include "../../3rdParty/qwt/qwt_plot_curve.h"
#include "../../3rdParty/qwt/qwt_plot_tradingcurve.h"
#include "../../3rdParty/qwt/qwt_plot_marker.h"
#include "../../3rdParty/qwt/qwt_plot_grid.h"
#include <QVector>
#include <memory>

class ChartCandle;
class QwtOHLCSample;

/**
 * @brief Neural network output plot
 */
class OutputPlot : public QwtPlot
{
    Q_OBJECT

public:
    explicit OutputPlot(QWidget* parent = nullptr);
    void threshold(double threshold);
    void thresholdVisible(bool visible);

    void plotData(
        QVector<double> timeValues, QVector<double> networkOutputs,
        QVector<double> sma12Values, QVector<QwtOHLCSample> priceSamples);

private:
    void initPlot();
    void initAxes();
    void initCurves();
    void initMarkers();
    void initGrid();

private:
    std::unique_ptr<QwtPlotCurve> outputCurve_;
    std::unique_ptr<QwtPlotCurve> sma12Curve_;
    std::unique_ptr<QwtPlotTradingCurve> tradingCurve_;
    std::unique_ptr<QwtPlotMarker> topMarker_;
    std::unique_ptr<QwtPlotMarker> bottomMarker_;
    std::unique_ptr<QwtPlotGrid> outputGrid_;
};

