84 lines
2.4 KiB
C++
84 lines
2.4 KiB
C++
#ifndef CDEVHISDATAWIDGET_H
|
|
#define CDEVHISDATAWIDGET_H
|
|
|
|
#include <QObject>
|
|
#include "CDbInterface.h"
|
|
#include "CHisDataManage.h"
|
|
#include "CDevHisTableModel.h"
|
|
|
|
namespace Ui {
|
|
class CDevHisDataWidget;
|
|
}
|
|
|
|
struct SDevManage
|
|
{
|
|
QString tag_name;
|
|
QString description;
|
|
iot_dbms::EnMeasPiontType pointType; //< MPT_AI ,MPT_DI ,MPT_MIX ,MPT_ACC
|
|
};
|
|
|
|
class CDevHisDataWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit CDevHisDataWidget(bool editMode, QVector<void *> ptrVec, QWidget *parent = 0);
|
|
~CDevHisDataWidget();
|
|
|
|
int currentLocationId();
|
|
QString currentLocationTag();
|
|
QString currentLocation();
|
|
int currentDevType();
|
|
QString currentDevTag();
|
|
QString currentDevice();
|
|
qint64 currentStartTime();
|
|
qint64 currentEndTime();
|
|
|
|
QString hexTo26(int number);
|
|
|
|
signals:
|
|
void sigReadHistoryPolymericData(std::vector<SMeasPointKey> *vecMpKey, int64_t nTimeBegin, int64_t nTimeEnd, int nGroupByMs, EnComputeMethod method, EnFillMethod fill);
|
|
|
|
private slots:
|
|
void on_m_locationComb_currentIndexChanged(int index);
|
|
void on_m_devTypeComb_currentIndexChanged(int index);
|
|
void on_m_devComb_currentIndexChanged(int index);
|
|
void on_m_startTime_dateTimeChanged(const QDateTime &dateTime);
|
|
void on_m_endTime_dateTimeChanged(const QDateTime &dateTime);
|
|
void on_m_searchBtn_clicked();
|
|
void on_m_clearBtn_clicked();
|
|
void on_m_excelBtn_clicked();
|
|
void on_m_pdfBtn_clicked();
|
|
void on_m_printBtn_clicked();
|
|
void updateHisPolymericData(std::vector<SMeasPointKey> *vecMpKey, std::vector<std::vector<SVarHisValue> *> *vecResult);
|
|
void updateTableColumnWidth();
|
|
|
|
protected:
|
|
void resizeEvent(QResizeEvent *event);
|
|
|
|
private:
|
|
void initView();
|
|
void initData();
|
|
|
|
void readDevManageXml();
|
|
double getValue(const VarMeasPiontVal &pointVal);
|
|
QString getDispValue(const SMeasPointKey& measPointKey, const VarMeasPiontVal &pointVal);
|
|
QList<QString> getValueInitList(int size);
|
|
QList<QString> getPointDescList();
|
|
|
|
void setEnable(bool enable);
|
|
|
|
private:
|
|
Ui::CDevHisDataWidget *ui;
|
|
CDbInterface *m_dbInterface;
|
|
QThread *m_pHisEventThread;
|
|
CHisDataManage *m_hisDataManage;
|
|
CDevHisTableModel *m_devHisModel;
|
|
bool m_editModel;
|
|
QMap<int, QList<SDevManage>> m_devManageMap;
|
|
QMap<QString, QString> m_digTextMap; //< tag_name,state_text_name
|
|
QList<QString> m_nanList;
|
|
};
|
|
|
|
#endif // CDEVHISDATAWIDGET_H
|