qt/LedOK/wDevicesManager/controlpowerschedule.h

78 lines
2.2 KiB
C
Raw Normal View History

2022-01-04 18:11:48 +08:00
#ifndef CONTROLPOWERSCHEDULE_H
#define CONTROLPOWERSCHEDULE_H
#include <QWidget>
#include <wDevicesManager/ledcard.h>
#include <communication/hpptclient.h>
2022-10-27 15:07:45 +08:00
#include <base/loemptydialog.h>
2022-01-04 18:11:48 +08:00
#include <QStandardItemModel>
#include <QStyledItemDelegate>
namespace Ui {
class ControlPowerSchedule;
}
class ControlPowerSchedule : public QWidget
{
Q_OBJECT
public:
explicit ControlPowerSchedule(QWidget *parent = nullptr,QList<LedCard *> *m_pLedlist=nullptr);
~ControlPowerSchedule();
private:
Ui::ControlPowerSchedule *ui;
protected slots:
void refreshLable();
void OnClickAdd();
void OnClickImport();
void OnClickExport();
void OnClickDelete();
void OnClickClear();
void OnClickApply();
void OnClickReadback();
void OnClickClearSchedule();
//类似的控制操作信号和槽函数和变量定义
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 JieXiJsonTaskPower(QJsonObject oTaskPower);
QJsonObject GetJsonObjectPowerSchedule();
};
class ReadOnlyDelegate: public QStyledItemDelegate
{
Q_OBJECT
public:
ReadOnlyDelegate(QWidget *parent = nullptr):QStyledItemDelegate(parent)
{}
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
const QModelIndex &index) const override //final
{
Q_UNUSED(parent)
Q_UNUSED(option)
Q_UNUSED(index)
return nullptr;
}
};
#endif // CONTROLPOWERSCHEDULE_H