#ifndef POLLINGWINDOW_H
#define POLLINGWINDOW_H

#include <QDialog>
#include "qjsonarray.h"
#include "qjsondocument.h"
#include "qjsonobject.h"
#include "qjsonvalue.h"
#include "mainwindow.h"

namespace Ui {
class pollingwindow;
}

class pollingwindow : public QDialog
{
    Q_OBJECT

public:
    explicit pollingwindow(QWidget *parent = nullptr, QString cfg ="");
    ~pollingwindow();

private:
    Ui::pollingwindow *ui;
    QString configContent;
    QJsonDocument json;
    int updatePos = 0;

signals:
   void updateConfiguration(QString newconfig);
   void binaryFrameSend(uint8_t *buff, int len);
public slots:
   void binaryProtocolFrameComplete(uint8_t *header, size_t hlen, uint8_t *buff, size_t len);
private slots:
   void on_buttonBox_accepted();
   void on_cbMifareEn_stateChanged(int arg1);
   void on_cbIcodeEn_stateChanged(int arg1);
   void on_cbReadTagMem_stateChanged(int arg1);
   void on_cbKeyType0_currentIndexChanged(int index);
   void on_cbKeyType1_currentIndexChanged(int index);
   void on_cbKeyType2_currentIndexChanged(int index);
   void on_cbKeyType3_currentIndexChanged(int index);
   void on_cbKeyType4_currentIndexChanged(int index);
   void on_btOK_clicked();
   void on_btCancel_clicked();
   void on_cbDefinedAsyncPacket_currentIndexChanged(int index);
   void on_cbUndefinedAsyncPacket_currentIndexChanged(int index);
   void on_pushButton_clicked();
   void on_pushButton_2_clicked();
   void on_cbReadTagMemory_activated(int index);
   void on_cbReadTagMemory_currentIndexChanged(int index);
   void on_btGetList_clicked();
   QString byte2hexstring(uint8_t value);
   void on_btAdd_clicked();
   void on_btDelete_clicked();
   void on_btWrite2Device_clicked();
};

#endif // POLLINGWINDOW_H
