#pragma once

#include "ann_one_hour.hh"
#include "../../3rdParty/qwt/qwt_samples.h"
#include "../../Indicators/Source/sma.hh"
#include "../../TradeCore/trade_data.hh"
#include <QDialog>
#include <QVector>
#include <memory>

constexpr int sampleCount = 48;

namespace Ui {
    class StatusDialog;
}

class ChartCandle;
class QwtPlotCurve;
class QwtPlotTradingCurve;
class QwtPlotMarker;
class QwtPlotGrid;
struct NetworkInfo;
struct Order;

/**
 * @brief Strategy status dialog
 */
class StatusDialog : public QDialog
{
    Q_OBJECT

public:
    explicit StatusDialog(QWidget* parent = nullptr);
    void updateInputPlot(const std::vector<double>& inputs);
    void updateOutputPlot(const ChartCandle& candle, double output);
    void networkOutput(double output, bool isTradingTime);
    void networkInfo(const NetworkInfo& networkInfo);
    void orders(const std::vector<Order>& orders);
    void updateInfoWidget();
    void replot();
    ~StatusDialog();

private:
    Ui::StatusDialog* ui_;
    QVector<double> timeValues_;
    QVector<double> networkOutputs_;
    QVector<double> sma12Values_;
    QVector<QwtOHLCSample> priceSamples_;
    AI::SMA sma12_;
    double networkOutput_;
    bool tradingTime_;
    NetworkInfo networkInfo_;
    std::vector<Order> orders_;
};
