ledok
This commit is contained in:
parent
9f37fabd4b
commit
a560e62af7
|
@ -38,11 +38,14 @@ win32 {
|
||||||
CONFIG -= debug_and_release
|
CONFIG -= debug_and_release
|
||||||
LIBS += -lwinmm
|
LIBS += -lwinmm
|
||||||
LIBS += -lDbghelp
|
LIBS += -lDbghelp
|
||||||
}
|
|
||||||
RESOURCES += res.qrc
|
|
||||||
|
|
||||||
win32:RC_ICONS = res/Logo.ico
|
RC_ICONS = res/Logo.ico
|
||||||
osx:ICON = res/Logo-raw.png
|
}
|
||||||
|
osx {
|
||||||
|
ICON = res/Logo-raw.png
|
||||||
|
}
|
||||||
|
|
||||||
|
RESOURCES += res.qrc
|
||||||
|
|
||||||
|
|
||||||
copydir.files += AClock
|
copydir.files += AClock
|
||||||
|
|
|
@ -720,74 +720,6 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) {
|
||||||
|
|
||||||
vBox->addWidget(grpM80);
|
vBox->addWidget(grpM80);
|
||||||
|
|
||||||
{
|
|
||||||
grpY50 = new QGroupBox;
|
|
||||||
hBox = new HBox(grpY50);
|
|
||||||
|
|
||||||
auto fdY50Resolu = new QComboBox;
|
|
||||||
auto dirs = QDir(QApplication::applicationDirPath()+"/y50 param").entryList(QDir::Dirs | QDir::NoDotAndDotDot);
|
|
||||||
foreach(auto dir, dirs) fdY50Resolu->addItem(dir);
|
|
||||||
fdY50Resolu->setMinimumWidth(160);
|
|
||||||
hBox->addWidget(fdY50Resolu);
|
|
||||||
|
|
||||||
btnY50Set = new QPushButton;
|
|
||||||
btnY50Set->setProperty("ssType", "progManageTool");
|
|
||||||
connect(btnY50Set, &QPushButton::clicked, this, [=] {
|
|
||||||
if(gSelCards.isEmpty()) {
|
|
||||||
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
auto filePath = QApplication::applicationDirPath()+"/y50 param/"+fdY50Resolu->currentText()+"/rk_lcd_parameters";
|
|
||||||
QFile qFile(filePath);
|
|
||||||
if(! qFile.exists()) {
|
|
||||||
QMessageBox::information(this, tr("Tip"), tr("File not exist"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(! qFile.open(QIODevice::ReadOnly)) {
|
|
||||||
QMessageBox::information(this, tr("Tip"), tr("Cannot Open File")+": "+qFile.errorString()+"\n"+filePath);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
auto fileData = qFile.readAll();
|
|
||||||
qFile.close();
|
|
||||||
|
|
||||||
auto Boundary = "----QtLedOK_.oOo._"+QUuid::createUuid().toByteArray(QUuid::WithoutBraces);
|
|
||||||
QByteArray data;
|
|
||||||
data.append("--").append(Boundary).append("\r\nContent-Disposition: form-data; name=\"rk_lcd_parameters\"; filename=\"rk_lcd_parameters\"\r\n\r\n").append(fileData).append("\r\n");
|
|
||||||
data.append("--").append(Boundary).append("--\r\n");
|
|
||||||
|
|
||||||
if(gSelCards.count() == 1) {
|
|
||||||
auto waitingDlg = new WaitingDlg(this, tr("Uploading")+" ...");
|
|
||||||
waitingDlg->show();
|
|
||||||
NetReq req("http://"+gSelCards[0].ip+":2016/upload?type=update_display");
|
|
||||||
auto reply = req.timeout(120000).type("multipart/form-data; boundary="+Boundary).post(data);
|
|
||||||
waitingDlg->connAbort(reply);
|
|
||||||
connect(reply, &QNetworkReply::finished, this, [=] {
|
|
||||||
QString err = checkReply(reply);
|
|
||||||
if(! err.isEmpty()) {
|
|
||||||
waitingDlg->close();
|
|
||||||
QMessageBox::critical(this, tr("Error"), err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
waitingDlg->success();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
foreach(auto card, gSelCards) {
|
|
||||||
NetReq req("http://"+card.ip+":2016/upload?type=update_display");
|
|
||||||
auto reply = req.timeout(120000).type("multipart/form-data; boundary="+Boundary).post(data);
|
|
||||||
connect(reply, &QNetworkReply::finished, this, [=] {
|
|
||||||
QString err = checkReply(reply);
|
|
||||||
gFdResInfo->append(card.id+" "+tr("Update")+" "+(err.isEmpty()?tr("Success"):err));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
hBox->addWidget(btnY50Set);
|
|
||||||
|
|
||||||
hBox->addStretch();
|
|
||||||
|
|
||||||
vBox->addWidget(grpY50);
|
|
||||||
}
|
|
||||||
|
|
||||||
hBox = new HBox(vBox);
|
hBox = new HBox(vBox);
|
||||||
|
|
||||||
lbDisMode = new QLabel;
|
lbDisMode = new QLabel;
|
||||||
|
@ -999,7 +931,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) {
|
||||||
});
|
});
|
||||||
hBox->addWidget(btnLedSet4);
|
hBox->addWidget(btnLedSet4);
|
||||||
|
|
||||||
#ifndef Q_OS_WINDOWS
|
#ifndef Q_OS_WIN
|
||||||
btnLedSet3->setVisible(false);
|
btnLedSet3->setVisible(false);
|
||||||
btnLedSet4->setVisible(false);
|
btnLedSet4->setVisible(false);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1624,6 +1556,72 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) {
|
||||||
line->setFrameStyle(QFrame::HLine | QFrame::Sunken);
|
line->setFrameStyle(QFrame::HLine | QFrame::Sunken);
|
||||||
vBox->addWidget(line);
|
vBox->addWidget(line);
|
||||||
|
|
||||||
|
grpY50 = new QGroupBox;
|
||||||
|
{
|
||||||
|
hBox = new HBox(grpY50);
|
||||||
|
|
||||||
|
auto fdY50Resolu = new QComboBox;
|
||||||
|
auto dirs = QDir(QApplication::applicationDirPath()+"/y50 param").entryList(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||||
|
foreach(auto dir, dirs) fdY50Resolu->addItem(dir);
|
||||||
|
fdY50Resolu->setMinimumWidth(160);
|
||||||
|
hBox->addWidget(fdY50Resolu);
|
||||||
|
|
||||||
|
btnY50Set = new QPushButton;
|
||||||
|
btnY50Set->setProperty("ssType", "progManageTool");
|
||||||
|
connect(btnY50Set, &QPushButton::clicked, this, [=] {
|
||||||
|
if(gSelCards.isEmpty()) {
|
||||||
|
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
auto filePath = QApplication::applicationDirPath()+"/y50 param/"+fdY50Resolu->currentText()+"/rk_lcd_parameters";
|
||||||
|
QFile qFile(filePath);
|
||||||
|
if(! qFile.exists()) {
|
||||||
|
QMessageBox::information(this, tr("Tip"), tr("File not exist"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(! qFile.open(QIODevice::ReadOnly)) {
|
||||||
|
QMessageBox::information(this, tr("Tip"), tr("Cannot Open File")+": "+qFile.errorString()+"\n"+filePath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
auto fileData = qFile.readAll();
|
||||||
|
qFile.close();
|
||||||
|
|
||||||
|
auto Boundary = "----QtLedOK_.oOo._"+QUuid::createUuid().toByteArray(QUuid::WithoutBraces);
|
||||||
|
QByteArray data;
|
||||||
|
data.append("--").append(Boundary).append("\r\nContent-Disposition: form-data; name=\"rk_lcd_parameters\"; filename=\"rk_lcd_parameters\"\r\n\r\n").append(fileData).append("\r\n");
|
||||||
|
data.append("--").append(Boundary).append("--\r\n");
|
||||||
|
|
||||||
|
if(gSelCards.count() == 1) {
|
||||||
|
auto waitingDlg = new WaitingDlg(this, tr("Uploading")+" ...");
|
||||||
|
waitingDlg->show();
|
||||||
|
NetReq req("http://"+gSelCards[0].ip+":2016/upload?type=update_display");
|
||||||
|
auto reply = req.timeout(120000).type("multipart/form-data; boundary="+Boundary).post(data);
|
||||||
|
waitingDlg->connAbort(reply);
|
||||||
|
connect(reply, &QNetworkReply::finished, this, [=] {
|
||||||
|
QString err = checkReply(reply);
|
||||||
|
if(! err.isEmpty()) {
|
||||||
|
waitingDlg->close();
|
||||||
|
QMessageBox::critical(this, tr("Error"), err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
waitingDlg->success();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
foreach(auto card, gSelCards) {
|
||||||
|
NetReq req("http://"+card.ip+":2016/upload?type=update_display");
|
||||||
|
auto reply = req.timeout(120000).type("multipart/form-data; boundary="+Boundary).post(data);
|
||||||
|
connect(reply, &QNetworkReply::finished, this, [=] {
|
||||||
|
QString err = checkReply(reply);
|
||||||
|
gFdResInfo->append(card.id+" "+tr("Update")+" "+(err.isEmpty()?tr("Success"):err));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
hBox->addWidget(btnY50Set);
|
||||||
|
hBox->addStretch();
|
||||||
|
}
|
||||||
|
vBox->addWidget(grpY50);
|
||||||
|
|
||||||
hBox = new HBox(vBox);
|
hBox = new HBox(vBox);
|
||||||
|
|
||||||
lbRotate = new QLabel;
|
lbRotate = new QLabel;
|
||||||
|
|
|
@ -85,10 +85,14 @@ void wUpgradeApkItem::OnCheckFpgaVersions() {
|
||||||
QString strBuf;
|
QString strBuf;
|
||||||
auto vers = json["versions"].toArray();
|
auto vers = json["versions"].toArray();
|
||||||
for(int i=0; i<vers.size(); i++) {
|
for(int i=0; i<vers.size(); i++) {
|
||||||
if(i==0) strBuf += "["+QString::number(i)+"]:"+vers[i].toString();
|
if(i) strBuf += "\n";
|
||||||
else strBuf +="\r\n["+QString::number(i)+"]:"+vers[i].toString();
|
strBuf += "["+QString::number(i)+"]:"+vers[i].toString();
|
||||||
}
|
}
|
||||||
setData(Upgrade_FPAG_VERSION, 0, strBuf);
|
setData(Upgrade_FPAG_VERSION, 0, strBuf);
|
||||||
|
auto item = findItem(mCard.id);
|
||||||
|
if(item) {
|
||||||
|
item->mCard.HardVersion = strBuf;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void wUpgradeApkItem::OnCheckSoftVersions() {
|
void wUpgradeApkItem::OnCheckSoftVersions() {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "deviceitem.h"
|
#include "deviceitem.h"
|
||||||
#include "globaldefine.h"
|
#include "globaldefine.h"
|
||||||
#include "base/waitingdlg.h"
|
#include "base/waitingdlg.h"
|
||||||
#include "gutil/qgui.h"
|
#include "gutil/qgui.h"
|
||||||
|
@ -124,6 +124,7 @@ void DeviceItem::DeviceItemHttpPost() {
|
||||||
mCard.FirmwareVersion = json["FirmwareVersion"].toString();
|
mCard.FirmwareVersion = json["FirmwareVersion"].toString();
|
||||||
mCard.HardVersion = json["HardVersion"].toString();
|
mCard.HardVersion = json["HardVersion"].toString();
|
||||||
mCard.ScreenResolution = json["ScreenResolution"].toString();
|
mCard.ScreenResolution = json["ScreenResolution"].toString();
|
||||||
|
mCard.IMEI = json["IMEI"].toString();
|
||||||
auto androidVersion = json["AndroidVersion"].toString();
|
auto androidVersion = json["AndroidVersion"].toString();
|
||||||
if(! androidVersion.isEmpty()) mCard.androidVersion = androidVersion;
|
if(! androidVersion.isEmpty()) mCard.androidVersion = androidVersion;
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "devicepanel.h"
|
#include "devicepanel.h"
|
||||||
#include "globaldefine.h"
|
#include "globaldefine.h"
|
||||||
#include "gutil/qgui.h"
|
#include "gutil/qgui.h"
|
||||||
#include "gutil/qnetwork.h"
|
#include "gutil/qnetwork.h"
|
||||||
|
@ -182,30 +182,41 @@ QPushButton:hover {background-color: #08b;}
|
||||||
item->mCard.ip = addr;
|
item->mCard.ip = addr;
|
||||||
}
|
}
|
||||||
connect(item->m_bnCardDetailInfo, &QPushButton::clicked, item, [=] {
|
connect(item->m_bnCardDetailInfo, &QPushButton::clicked, item, [=] {
|
||||||
|
QString msgpre;
|
||||||
|
msgpre.append(tr("Current Brightness")).append(": ").append(QString::number(item->mCard.bright)).append("%").append("\n");
|
||||||
|
msgpre.append(tr("Brightness Level")).append(": ").append(QString::number(item->mCard.BrightnessLevel)).append("\n");
|
||||||
|
msgpre.append(tr("Android OS Resolution")).append(": ").append(item->mCard.ScreenResolution).append("\n");
|
||||||
|
msgpre.append(tr("Android Version")).append(": ").append(item->mCard.androidVersion).append("\n");
|
||||||
|
msgpre.append(tr("FPGA Version")).append(": ").append(item->mCard.HardVersion).append("\n");
|
||||||
|
msgpre.append(tr("Firmware Version")).append(": ").append(item->mCard.FirmwareVersion).append("\n");
|
||||||
|
msgpre.append(tr("IMEI")).append(": ").append(item->mCard.IMEI).append("\n");
|
||||||
|
QMessageBox msgBox(QMessageBox::Information, item->mCard.id+" "+tr("Detail Info"), msgpre + tr("Player Version")+": "+tr("Getting")+" ...");
|
||||||
QJsonObject json;
|
QJsonObject json;
|
||||||
json.insert("_id", "CheckSoftVersions");
|
json.insert("_id", "CheckSoftVersions");
|
||||||
json.insert("_type", "CheckSoftVersions");
|
json.insert("_type", "CheckSoftVersions");
|
||||||
auto waitingDlg = new WaitingDlg(this, tr("CheckSoftVersions")+" ...");
|
|
||||||
waitingDlg->show();
|
|
||||||
auto card = item->mCard;
|
auto card = item->mCard;
|
||||||
auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json);
|
auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json);
|
||||||
waitingDlg->connAbort(reply);
|
connect(&msgBox, &QMessageBox::finished, reply, [reply] {
|
||||||
connect(reply, &QNetworkReply::finished, this, [=] {
|
abortSilence(reply);
|
||||||
Def_CtrlSingleGetReply
|
|
||||||
waitingDlg->close();
|
|
||||||
QString strTip;
|
|
||||||
strTip.append(tr("Current Brightness")).append(": ").append(QString::number(item->mCard.bright)).append("%").append("\n");
|
|
||||||
strTip.append(tr("Brightness Level")).append(": ").append(QString::number(item->mCard.BrightnessLevel)).append("\n");
|
|
||||||
strTip.append(tr("Android OS Resolution")).append(": ").append(item->mCard.ScreenResolution).append("\n");
|
|
||||||
strTip.append(tr("Android Version")).append(": ").append(item->mCard.androidVersion).append("\n");
|
|
||||||
strTip.append(tr("FPGA Version")).append(": ").append(item->mCard.HardVersion).append("\n");
|
|
||||||
strTip.append(tr("Firmware Version")).append(": ").append(item->mCard.FirmwareVersion).append("\n");
|
|
||||||
foreach(QJsonValue value, json["apps"].toArray()) {
|
|
||||||
QJsonObject app = value.toObject();
|
|
||||||
if(app["packageName"].toString().contains("xixunplayer")) strTip.append(tr("Player Version")).append(": ").append(app["versionName"].toString()).append("\n");
|
|
||||||
}
|
|
||||||
QMessageBox::information(this, tr("Detail Info"), strTip);
|
|
||||||
});
|
});
|
||||||
|
connect(reply, &QNetworkReply::finished, &msgBox, [=, &msgBox] {
|
||||||
|
QJsonDocument json;
|
||||||
|
QString err = checkReplyForJson(reply, &json);
|
||||||
|
if(! err.isEmpty()) {
|
||||||
|
msgBox.setText(msgpre + tr("Player Version")+": "+err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
auto apps = json["apps"].toArray();
|
||||||
|
foreach(QJsonValue value, apps) {
|
||||||
|
QJsonObject app = value.toObject();
|
||||||
|
if(app["packageName"].toString().contains("xixunplayer")) {
|
||||||
|
msgBox.setText(msgpre + tr("Player Version")+": "+app["versionName"].toString());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
msgBox.setText(msgpre + tr("Player Version")+":");
|
||||||
|
});
|
||||||
|
msgBox.exec();
|
||||||
});
|
});
|
||||||
item->init();
|
item->init();
|
||||||
item->DeviceItemHttpPost();
|
item->DeviceItemHttpPost();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef GLOBALDEFINE_H
|
#ifndef GLOBALDEFINE_H
|
||||||
#define GLOBALDEFINE_H
|
#define GLOBALDEFINE_H
|
||||||
|
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
|
@ -17,6 +17,7 @@ public:
|
||||||
QString ScreenResolution;
|
QString ScreenResolution;
|
||||||
QString androidVersion;
|
QString androidVersion;
|
||||||
QString alias;
|
QString alias;
|
||||||
|
QString IMEI;
|
||||||
bool hasPassword{false};
|
bool hasPassword{false};
|
||||||
bool isLocked{true};
|
bool isLocked{true};
|
||||||
bool isScreenOn{true};
|
bool isScreenOn{true};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user