#ifndef PHASEWINDOW_H
#define PHASEWINDOW_H

#include <QWidget>
#include <QMessageBox>
#include <QStandardItemModel>
#include <QVBoxLayout>

#include "PhaseDevice.h"
#include "common/utils/SettingConfig.h"
#include "common/HttpRequestController.h"
#include "common/HttpServer.h"

namespace Ui {
class PhaseWindow;
}

class PhaseWindow : public QWidget
{
    Q_OBJECT

public:
    explicit PhaseWindow(QWidget *parent = nullptr);
    ~PhaseWindow();

public slots:
    void drawPhaseDataOnPage(PhaseDataDto * phaseData);

private slots:
    void on_minButt_clicked();

    void on_exitButt_clicked();

    void on_startButt_clicked();

    void on_endButt_clicked();

    void on_devSelect_currentIndexChanged(int index);

private:
    int initHttpToken();
    int initDictDeviceTypes();
    QJsonObject initDeviceList();

    Ui::PhaseWindow *ui;

    HttpRequestController * httpReq;

    QList<PhaseDevice *> deviceList;

    void generateWidgetForDevice();
};

#endif // PHASEWINDOW_H
