#ifndef CONTROLBRIGHTNESSSCHEDULE_H
#define CONTROLBRIGHTNESSSCHEDULE_H

#include <QWidget>
#include <wDevicesManager/ledcard.h>
#include <communication/hpptclient.h>
#include <LoUIClass/loemptydialog.h>
#include <QStandardItemModel>
#include <QUuid>
namespace Ui {
class ControlBrightnessSchedule;
}

class ControlBrightnessSchedule : public QWidget
{
    Q_OBJECT

public:
    explicit ControlBrightnessSchedule(QWidget *parent = nullptr,QList<LedCard *> *m_pLedlist=nullptr);
    ~ControlBrightnessSchedule();
private:
    Ui::ControlBrightnessSchedule *ui;
    QStandardItemModel * m_pModel;
    QString newUuid()  { return QUuid::createUuid().toString().remove('{').remove('}'); }
    QJsonObject GetJsonObjectBrightnessSchedule();
    bool  JieXiJsonTaskBrightness(QJsonObject oTaskBrightness);

protected slots:
    void DeletePostingDlg();
    void  OnClickAdd();
    void  OnClickImport();
    void  OnClickExport();
    void  OnClickDelete();
    void  OnClickClear();
    void  OnClickApply();
    void  OnClickReadback();
    void  OnAddOneItem(QString strStartTime,QString strEndTime,int iBrightnessValue);
     //类似的控制操作信号和槽函数和变量定义
    signals:
    void sigHaveSchedule(bool);
         void sigSend(QJsonObject &,QString);
    protected slots:
        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);
        void refreshLable();
    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;

};

#endif // CONTROLBRIGHTNESSSCHEDULE_H
