#ifndef COUNTERWINDOW_H
#define COUNTERWINDOW_H

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

#include "common/utils/SettingConfig.h"
#include "common/HttpRequestController.h"
#include "CounterDevice.h"

namespace Ui {
class CounterWindow;
}

class CounterWindow : public QWidget
{
    Q_OBJECT

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

public slots:
    void drawCounterDataOnPage(CounterDataDto * counterData);

private slots:
    void on_exitButt_clicked();

    void on_minButt_clicked();

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

    Ui::CounterWindow *ui;

    HttpRequestController * httpReq;

    QList<CounterDevice *> deviceList;

    void generateWidgetForDevice();
};

#endif // COUNTERWINDOW_H
