#ifndef CONTROLVOLUMESCHEDULE_H
#define CONTROLVOLUMESCHEDULE_H

#include <QWidget>
#include <device/ledcard.h>
#include <communication/hpptclient.h>
#include <base/loemptydialog.h>
#include <QStandardItemModel>
#include <QStyledItemDelegate>

namespace Ui {
class ControlVolumeSchedule;
}

class ControlVolumeSchedule : public QWidget
{
    Q_OBJECT

public:
    explicit ControlVolumeSchedule(QWidget *parent = nullptr,QList<LedCard *> *m_pLedlist=nullptr);
    ~ControlVolumeSchedule();
    void refreshLable();
protected slots:
    void  OnClickAdd();
    void  OnClickImport();
    void  OnClickExport();
    void  OnClickDelete();
    void  OnClickClear();
    void  OnClickApply();
    void  OnClickReadback();
private:
    Ui::ControlVolumeSchedule *ui;
    //类似的控制操作信号和槽函数和变量定义
    signals:
        void sigSend(QJsonObject &,QString);
        void sigHaveSchedule(bool);
    protected slots:
        void DeletePostingDlg();
        void OnProHttpResponse(QString url, QString postMD5, QByteArray data);
        void OnProHttpResponseAll(QString url, QString postMD5, QByteArray data);
        void onSelectedDeviceList(QList<LedCard*> *);
        void onReadbackAllThisPage();
        void OnControlTypeSwitchIndexChanged(int index);
    private:
        QList<LedCard *> *m_pLedlist=nullptr;
        LedCard   *m_pLedCard = nullptr;
        LedCard   *m_oldLedlist = nullptr;
        HpptClient *pHpptClient = nullptr;
        HpptClient *pHpptClientAll = nullptr;
        QString m_strUrl="";
        LoEmptyDialog * m_PostingDlg=nullptr;
        QTimer *m_pGetAskTimer=nullptr;
        bool m_bSelected=false;
        QStandardItemModel * m_pModel;
        bool JieXiJsonTaskVolume(QJsonObject oTaskVolume);
        QJsonObject GetJsonObjectVolumeSchedule();

};

#endif // CONTROLVOLUMESCHEDULE_H
