qt/LedOK/wDevicesManager/wupgradeapkitem.h

92 lines
2.7 KiB
C
Raw Normal View History

2022-01-04 18:11:48 +08:00
#ifndef WUPGRADEAPKITEM_H
#define WUPGRADEAPKITEM_H
#include <QObject>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QDir>
#include <QDateTime>
#include <QJsonObject>
#include <QJsonDocument>
#include <QPushButton>
2022-08-25 18:37:24 +08:00
#include <base/loqtreewidget.h>
2022-01-04 18:11:48 +08:00
#include <wDevicesManager/ledcard.h>
#include <communication/hpptclient.h>
#include "threadupgradeapk.h"
#include <QProgressBar>
#include <QLabel>
2022-08-25 18:37:24 +08:00
class wUpgradeApkItem : public QObject, public QTreeWidgetItem {
2022-01-04 18:11:48 +08:00
Q_OBJECT
public:
2022-08-25 18:37:24 +08:00
explicit wUpgradeApkItem(LedCard *pLedCard, LoQTreeWidget *parent = nullptr,QWidget *pWnd=nullptr);
~wUpgradeApkItem();
2022-01-04 18:11:48 +08:00
void refreshLable();
void SetItemParam(LedCard *p);
void onUpgradeApk(QString strFileName);
void onUpgradeFpga(QString strFileName);
void onUninstallApk(QString strApkName);
void onCheckRuningState(QString strApkName);
2022-08-25 18:37:24 +08:00
void SetLockFlagFalse();
2022-01-04 18:11:48 +08:00
2022-08-25 18:37:24 +08:00
LedCard *m_pLedCard = nullptr;
2022-01-04 18:11:48 +08:00
signals:
void sigUpgradeSuccess();
void sigUpgradeFail();
public slots:
void OnProHttpResponse(QString url, QString postMD5, QByteArray data);
void OnThreadFinished();
void OnThreadFpgaFinished();
void OnSendStatusTip(QString);
void onVerifyLockPassword();
void slotTimeout();
void OnCheckSoftVersions();
void OnCheckFpgaVersions();
private:
2022-08-25 18:37:24 +08:00
void init();
QString getRandomString(int length);
void SetPasswordItem(LedCard *p);
2022-01-04 18:11:48 +08:00
bool m_lockFlag=true;
void OnSendStatusTip(QString,QColor cr);
QLabel *m_ImageOnline=nullptr;
LoQTreeWidget *m_parent = nullptr;
QString m_strUrl="";
QWidget *m_pWnd=nullptr;
HpptClient *pHpptClient = nullptr;
QProgressBar *m_pProgress=nullptr;
int m_iSendingFlag=0;
QPushButton *m_bnLock = nullptr;//
QString m_strApkFilePathName="";
QString m_strFpgaFilePathName="";
2022-08-25 18:37:24 +08:00
void postFileTask(const QString& strUrl, const QString& strFilePath);//需要的数据
2022-01-04 18:11:48 +08:00
};
enum ENUM_DEVICE_PUBLISH_HEADERITEM
{
ENUM_DEVICE_PUBLISH_HEADE_CHECK=0,
ENUM_DEVICE_PUBLISH_HEADE_SCREEN_ID,
ENUM_DEVICE_PUBLISH_HEADE_ONLINE,
ENUM_DEVICE_PUBLISH_HEADE_SCREEN_IP,
ENUM_DEVICE_PUBLISH_HEADE_ENCRYPT,
ENUM_DEVICE_PUBLISH_HEADE_PROGRESS,
ENUM_DEVICE_PUBLISH_HEADE_XIXUNPLAYER_VERSION,
ENUM_DEVICE_PUBLISH_HEADE_CARDSYSTEM_VERSION,
ENUM_DEVICE_PUBLISH_HEADE_STARTER_VERSION,
ENUM_DEVICE_PUBLISH_HEADE_TAXIAPP_VERSION,
ENUM_DEVICE_PUBLISH_HEADE_DISPLAYER_VERSION,
ENUM_DEVICE_PUBLISH_HEADE_FPAG_VERSION,
ENUM_DEVICE_PUBLISH_HEADE_REMARKS,
ENUM_DEVICE_PUBLISH_HEADE_REMARK_NAME,
ENUM_DEVICE_PUBLISH_HEADE_CONNECTION_VERSION,
ENUM_DEVICE_PUBLISH_HEADE_UPDATE_VERSION,
// ENUM_DEVICE_PUBLISH_HEADE_BASICAPP_VERSION,
ENUM_DEVICE_PUBLISH_HEADE_END,
};
#endif // WPROGRAMPUBLISHITEM_H