#ifndef CTRLBRIGHTPANEL_H
#define CTRLBRIGHTPANEL_H

#include "gutil/qgui.h"
#include <QLabel>
#include <QPushButton>
#include <QRadioButton>
#include <QCheckBox>
#include <QSlider>

class CtrlBrightPanel : public QWidget {
    Q_OBJECT
public:
    explicit CtrlBrightPanel(QWidget *parent = nullptr);
protected:
    void showEvent(QShowEvent *event) override;
    void init();
    void changeEvent(QEvent *) override;
    void transUi();

private:
    bool restoreScheduleJson(QJsonDocument &, int);
    void getScheduleJson(QJsonObject &, int);
    QLabel *lbBrightCfg;
    QRadioButton *radioAuto;
    QRadioButton *radioManual;
    QRadioButton *radioSchedule;
    QCheckBox *fdAdaptToOld;
    char mSensi{-1};
    char mTask{-1};

    QLabel *lbSensi;
    QSlider *fdSensi;
    QLabel *lbMinBright;
    QSlider *fdMinBright;
    QPushButton *btnSensiSet;
    QPushButton *btnSensiGet;
    QPushButton *btnMinBrightSet;
    QPushButton *btnMinBrightGet;
    QRadioButton *fdR68;
    QRadioButton *fdRL2;
    QPushButton *btnUpload;
    QPushButton *btnTableGet;
    QLabel *fdSensiTypeTip;
    QLabel *fdBrightTip;
    QLabel *lbCurBright;
    QLabel *fdCurBright;
    QPushButton *btnCurBrightGet;

    QLabel *lbFixedBright;
    QSlider *fdFixedBright;
    QPushButton *btnFixedSet;
    QPushButton *btnFixedGet;

    QLabel *fdScheTip;
    QPushButton *btnScheAdd;
    QPushButton *btnScheDel;
    QPushButton *btnScheClear;
    QLabel *lbDefBright;
    QSlider *fdDefBright;
    QPushButton *btnScheImport;
    QPushButton *btnScheExport;
    Table *tableSche;
    QPushButton *btnScheSet;
    QPushButton *btnScheGet;
};

#endif // CTRLBRIGHTPANEL_H
