This commit is contained in:
gangphon 2023-05-16 18:03:53 +08:00
parent 8d8c61695c
commit 5668845592
18 changed files with 6404 additions and 8362 deletions

View File

@ -83,7 +83,6 @@ SOURCES += \
main.cpp \ main.cpp \
mainwindow.cpp \ mainwindow.cpp \
mguangyingpinwidget.cpp \ mguangyingpinwidget.cpp \
passwordindlg.cpp \
player/digiclock.cpp \ player/digiclock.cpp \
player/eleanaclock.cpp \ player/eleanaclock.cpp \
player/elebase.cpp \ player/elebase.cpp \
@ -159,7 +158,6 @@ HEADERS += \
gutil/qnetwork.h \ gutil/qnetwork.h \
mainwindow.h \ mainwindow.h \
mguangyingpinwidget.h \ mguangyingpinwidget.h \
passwordindlg.h \
player/digiclock.h \ player/digiclock.h \
player/eleanaclock.h \ player/eleanaclock.h \
player/elebase.h \ player/elebase.h \

View File

@ -1,13 +1,12 @@
#include "ctrladvancedpanel.h" #include "ctrladvancedpanel.h"
#include "globaldefine.h" #include "globaldefine.h"
#include "base/waitingdlg.h" #include "base/waitingdlg.h"
#include "passwordindlg.h" #include "base/changepasswordform.h"
#include "tools.h" #include "tools.h"
#include "gutil/qgui.h" #include "gutil/qgui.h"
#include "gutil/qnetwork.h" #include "gutil/qnetwork.h"
#include "program/ephoto.h" #include "program/ephoto.h"
#include "upgradeapkdialog.h" #include "upgradeapkdialog.h"
#include <QBoxLayout>
#include <QComboBox> #include <QComboBox>
#include <QFileDialog> #include <QFileDialog>
#include <QJsonArray> #include <QJsonArray>
@ -24,6 +23,7 @@
#include <QSpinBox> #include <QSpinBox>
#include <QButtonGroup> #include <QButtonGroup>
#include "devicepanel.h" #include "devicepanel.h"
#include <QDialogButtonBox>
CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) {
setFocusPolicy(Qt::StrongFocus); setFocusPolicy(Qt::StrongFocus);
@ -737,12 +737,16 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return; return;
} }
QFile qFile(QApplication::applicationDirPath()+"/y50 param/"+fdY50Resolu->currentText()+"/rk_lcd_parameters"); auto filePath = QApplication::applicationDirPath()+"/y50 param/"+fdY50Resolu->currentText()+"/rk_lcd_parameters";
QFile qFile(filePath);
if(! qFile.exists()) { if(! qFile.exists()) {
QMessageBox::information(this, tr("Tip"), tr("File not exist")); QMessageBox::information(this, tr("Tip"), tr("File not exist"));
return; return;
} }
if(! qFile.open(QIODevice::ReadOnly)) return; if(! qFile.open(QIODevice::ReadOnly)) {
QMessageBox::information(this, tr("Tip"), tr("File Open Failed")+": "+qFile.errorString()+"\n"+filePath);
return;
}
auto fileData = qFile.readAll(); auto fileData = qFile.readAll();
qFile.close(); qFile.close();
@ -751,20 +755,31 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) {
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\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"); data.append("--").append(Boundary).append("--\r\n");
auto waitingDlg = new WaitingDlg(this, tr("Uploading")+" ..."); if(gSelCards.count() == 1) {
waitingDlg->show(); auto waitingDlg = new WaitingDlg(this, tr("Uploading")+" ...");
NetReq req("http://"+gSelCards[0].ip+":2016/upload?type=update_display"); waitingDlg->show();
auto reply = req.timeout(120000).type("multipart/form-data; boundary="+Boundary).post(data); NetReq req("http://"+gSelCards[0].ip+":2016/upload?type=update_display");
waitingDlg->connAbort(reply); auto reply = req.timeout(120000).type("multipart/form-data; boundary="+Boundary).post(data);
connect(reply, &QNetworkReply::finished, this, [=] { waitingDlg->connAbort(reply);
QString err = checkReply(reply); connect(reply, &QNetworkReply::finished, this, [=] {
if(! err.isEmpty()) { QString err = checkReply(reply);
waitingDlg->close(); if(! err.isEmpty()) {
QMessageBox::critical(this, tr("Error"), err); waitingDlg->close();
return; 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));
});
} }
waitingDlg->success(); }
});
}); });
hBox->addWidget(btnY50Set); hBox->addWidget(btnY50Set);
@ -1392,8 +1407,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) {
auto filePath = QFileDialog::getOpenFileName(this, "Open File", QString(), ".bin file (*.bin)"); auto filePath = QFileDialog::getOpenFileName(this, "Open File", QString(), ".bin file (*.bin)");
if(filePath.isEmpty()) return; if(filePath.isEmpty()) return;
QFile qFile(filePath); QFile qFile(filePath);
if(! qFile.exists()) return; if(! qFile.exists()) {
if(! qFile.open(QIODevice::ReadOnly)) return; QMessageBox::information(this, tr("Tip"), tr("File not exist"));
return;
}
if(! qFile.open(QIODevice::ReadOnly)) {
QMessageBox::information(this, tr("Tip"), tr("File Open Failed")+": "+qFile.errorString()+"\n"+filePath);
return;
}
auto fileData = qFile.readAll(); auto fileData = qFile.readAll();
qFile.close(); qFile.close();
@ -1420,12 +1441,11 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) {
}); });
} else { } else {
foreach(auto card, gSelCards) { foreach(auto card, gSelCards) {
auto cardId = card.id;
NetReq req("http://"+card.ip+":2016/upload?type=mcu_update"); NetReq req("http://"+card.ip+":2016/upload?type=mcu_update");
auto reply = req.timeout(120000).type("multipart/form-data; boundary="+Boundary).post(data); auto reply = req.timeout(120000).type("multipart/form-data; boundary="+Boundary).post(data);
connect(reply, &QNetworkReply::finished, this, [=] { connect(reply, &QNetworkReply::finished, this, [=] {
QString err = checkReply(reply); QString err = checkReply(reply);
gFdResInfo->append(cardId+" "+tr("Update MCU")+" "+(err.isEmpty()?tr("Success"):err)); gFdResInfo->append(card.id+" "+tr("Update MCU")+" "+(err.isEmpty()?tr("Success"):err));
}); });
} }
} }
@ -2035,11 +2055,38 @@ void CtrlAdvancedPanel::showEvent(QShowEvent *event) {
void CtrlAdvancedPanel::init() { void CtrlAdvancedPanel::init() {
if(! isPassed) { if(! isPassed) {
hide(); hide();
PasswordInChDlg dlg(this); QDialog dlg(this);
connect(dlg.btnBox, &QDialogButtonBox::accepted, &dlg, [&dlg]() { #ifdef Q_OS_WIN
dlg.setWindowFlag(Qt::WindowContextHelpButtonHint, false);
#endif
dlg.resize(240, 150);
auto vBox = new VBox(&dlg);
vBox->addStretch();
auto hBox = new HBox(vBox);
hBox->addWidget(new QLabel(tr("Input password")));
auto fdPassword = new QLineEdit;
fdPassword->setEchoMode(QLineEdit::Password);
fdPassword->setFocus();
hBox->addWidget(fdPassword);
auto btnChangePassword = new QPushButton(tr("Change Password"));
vBox->addWidget(btnChangePassword, 0, Qt::AlignRight);
connect(btnChangePassword, &QPushButton::clicked, &dlg, [&dlg] {
ChangePasswordForm cdlg(&dlg);
cdlg.exec();
});
vBox->addStretch();
auto btnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(btnBox, &QDialogButtonBox::rejected, &dlg, &QDialog::reject);
vBox->addWidget(btnBox);
connect(btnBox, &QDialogButtonBox::accepted, &dlg, [=, &dlg] {
QString pwdRaw = QSettings().value("advUiPs").toString(); QString pwdRaw = QSettings().value("advUiPs").toString();
QString password = pwdRaw.isEmpty() ? "888" : QString::fromUtf8(QByteArray::fromBase64(pwdRaw.toLatin1())); QString password = pwdRaw.isEmpty() ? "888" : QString::fromUtf8(QByteArray::fromBase64(pwdRaw.toLatin1()));
if(dlg.fdPassword->text() == password) dlg.accept(); if(fdPassword->text() == password) dlg.accept();
else QMessageBox::critical(&dlg, tr("Tip"),tr("Password is error")); else QMessageBox::critical(&dlg, tr("Tip"),tr("Password is error"));
}); });
if(dlg.exec()==QDialog::Accepted) { if(dlg.exec()==QDialog::Accepted) {

View File

@ -223,7 +223,7 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
connect(btngrp, &QButtonGroup::idClicked, this, [=](int id) { connect(btngrp, &QButtonGroup::idClicked, this, [=](int id) {
if(lineEdit->text().contains("-")) lineEdit->clear(); if(lineEdit->text().contains("-")) lineEdit->clear();
lineEdit->setText(lineEdit->text() + QString::number(id)); lineEdit->setText(lineEdit->text() + QString::number(id));
pushButton_13->setEnabled(true); btnAnycast->setEnabled(true);
}); });
pushButton_11 = new QPushButton; pushButton_11 = new QPushButton;
@ -234,8 +234,8 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
pushButton_12->setFixedSize(QSize(60, 30)); pushButton_12->setFixedSize(QSize(60, 30));
gridLayout->addWidget(pushButton_12, 3, 2, 1, 1); gridLayout->addWidget(pushButton_12, 3, 2, 1, 1);
pushButton_13 = new QPushButton; btnAnycast = new QPushButton;
vv->addWidget(pushButton_13); vv->addWidget(btnAnycast);
vv->addStretch(); vv->addStretch();
hBox->addStretch(); hBox->addStretch();
@ -247,7 +247,7 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
pushButtonStopTest->setProperty("ssType", "progManageTool"); pushButtonStopTest->setProperty("ssType", "progManageTool");
pushButton_11->setProperty("ssType", "progManageTool"); pushButton_11->setProperty("ssType", "progManageTool");
pushButton_12->setProperty("ssType", "progManageTool"); pushButton_12->setProperty("ssType", "progManageTool");
pushButton_13->setProperty("ssType", "progManageTool"); btnAnycast->setProperty("ssType", "progManageTool");
spinBoxLineSpeed->setValue(10); spinBoxLineSpeed->setValue(10);
spinBoxLineDistance->setValue(15); spinBoxLineDistance->setValue(15);
@ -273,15 +273,10 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
json.insert("_type", "TestScreen"); json.insert("_type", "TestScreen");
json.insert("mode", 1);// 0停止 1斜线 2灰度; 3:颜色4渐变 json.insert("mode", 1);// 0停止 1斜线 2灰度; 3:颜色4渐变
json.insert("speed", spinBoxLineSpeed->value()); json.insert("speed", spinBoxLineSpeed->value());
if(radioButtonRed->isChecked()) if(radioButtonRed->isChecked()) json.insert("color", "#FFFF0000");
json.insert("color", "#FFFF0000"); else if(radioButtonGreen->isChecked()) json.insert("color", "#FF00FF00");
else if(radioButtonGreen->isChecked()) else if(radioButtonBlue->isChecked()) json.insert("color", "#FF0000FF");
json.insert("color", "#FF00FF00"); else json.insert("color", "#FFFFFFFF");
else if(radioButtonBlue->isChecked())
json.insert("color", "#FF0000FF");
else
json.insert("color", "#FFFFFFFF");
json.insert("interval", spinBoxLineDistance->value()); json.insert("interval", spinBoxLineDistance->value());
json.insert("horizonalLine", checkBoxHorizontal->isChecked()); json.insert("horizonalLine", checkBoxHorizontal->isChecked());
json.insert("verticalLine", checkBoxVertical->isChecked()); json.insert("verticalLine", checkBoxVertical->isChecked());
@ -314,15 +309,10 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
json.insert("_type", "TestScreen"); json.insert("_type", "TestScreen");
json.insert("mode", 2);// 0停止 1斜线 2灰度; 3:颜色4渐变 json.insert("mode", 2);// 0停止 1斜线 2灰度; 3:颜色4渐变
json.insert("speed", spinBoxGraySpeed->value()); json.insert("speed", spinBoxGraySpeed->value());
// qDebug()<<"speed="<<spinBoxGraySpeed->value(); if(radioButtonRed->isChecked()) json.insert("color", "#FFFF0000");
if(radioButtonRed->isChecked()) else if(radioButtonGreen->isChecked()) json.insert("color", "#FF00FF00");
json.insert("color", "#FFFF0000"); else if(radioButtonBlue->isChecked()) json.insert("color", "#FF0000FF");
else if(radioButtonGreen->isChecked()) else json.insert("color", "#FFFFFFFF");
json.insert("color", "#FF00FF00");
else if(radioButtonBlue->isChecked())
json.insert("color", "#FF0000FF");
else
json.insert("color", "#FFFFFFFF");
json.insert("interval", spinBoxLineDistance->value()); json.insert("interval", spinBoxLineDistance->value());
json.insert("horizonalLine", checkBoxHorizontal->isChecked()); json.insert("horizonalLine", checkBoxHorizontal->isChecked());
json.insert("verticalLine", checkBoxVertical->isChecked()); json.insert("verticalLine", checkBoxVertical->isChecked());
@ -336,9 +326,9 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
if(gSelCards.count() == 1) { if(gSelCards.count() == 1) {
auto waitingDlg = new WaitingDlg(this, tr("StartTest")+" ..."); auto waitingDlg = new WaitingDlg(this, tr("StartTest")+" ...");
Def_CtrlReqPre Def_CtrlReqPre
connect(reply, &QNetworkReply::finished, this, [=] { connect(reply, &QNetworkReply::finished, this, [=] {
Def_CtrlSetReqAfter Def_CtrlSetReqAfter
}); });
} else { } else {
foreach(auto card, gSelCards) { foreach(auto card, gSelCards) {
Def_CtrlSetMulti(tr("StartTest")) Def_CtrlSetMulti(tr("StartTest"))
@ -353,20 +343,12 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
QJsonObject json; QJsonObject json;
json.insert("_id", "TestScreen"); json.insert("_id", "TestScreen");
json.insert("_type", "TestScreen"); json.insert("_type", "TestScreen");
if(checkBoxGradient->isChecked()) json.insert("mode", checkBoxGradient->isChecked() ? 4 : 3);// 0停止 1斜线 2灰度; 3:颜色4渐变
json.insert("mode", 4);// 0停止 1斜线 2灰度; 3:颜色4渐变
else
json.insert("mode", 3);// 0停止 1斜线 2灰度; 3:颜色4渐变
json.insert("speed", spinBoxLineSpeed->value()); json.insert("speed", spinBoxLineSpeed->value());
if(radioButton_red->isChecked()) if(radioButton_red->isChecked()) json.insert("color", "#FFFF0000");
json.insert("color", "#FFFF0000"); else if(radioButton_Green->isChecked()) json.insert("color", "#FF00FF00");
else if(radioButton_Green->isChecked()) else if(radioButton_Blue->isChecked()) json.insert("color", "#FF0000FF");
json.insert("color", "#FF00FF00"); else json.insert("color", "#FFFFFFFF");
else if(radioButton_Blue->isChecked())
json.insert("color", "#FF0000FF");
else
json.insert("color", "#FFFFFFFF");
json.insert("interval", spinBoxLineDistance->value()); json.insert("interval", spinBoxLineDistance->value());
json.insert("horizonalLine", checkBoxHorizontal->isChecked()); json.insert("horizonalLine", checkBoxHorizontal->isChecked());
json.insert("verticalLine", checkBoxVertical->isChecked()); json.insert("verticalLine", checkBoxVertical->isChecked());
@ -412,7 +394,7 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
}); });
connect(pushButton_11, &QPushButton::clicked, this, [=] { connect(pushButton_11, &QPushButton::clicked, this, [=] {
lineEdit->clear(); lineEdit->clear();
pushButton_13->setEnabled(false); btnAnycast->setEnabled(false);
}); });
connect(pushButton_12, &QPushButton::clicked, this, [=] { connect(pushButton_12, &QPushButton::clicked, this, [=] {
if(gSelCards.isEmpty()) { if(gSelCards.isEmpty()) {
@ -425,9 +407,9 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
foreach(auto card, gSelCards) SendAnycastCmd(card, iIndex, false); foreach(auto card, gSelCards) SendAnycastCmd(card, iIndex, false);
} }
lineEdit->setText("-"+tr("loopback mode")+"-"); lineEdit->setText("-"+tr("loopback mode")+"-");
pushButton_13->setEnabled(false); btnAnycast->setEnabled(false);
}); });
connect(pushButton_13, &QPushButton::clicked, this, [=] { connect(btnAnycast, &QPushButton::clicked, this, [=] {
if(gSelCards.isEmpty()) { if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return; return;
@ -436,10 +418,10 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
if(gSelCards.count()==1) SendAnycastCmd(gSelCards[0], iIndex, true); if(gSelCards.count()==1) SendAnycastCmd(gSelCards[0], iIndex, true);
else foreach(auto card, gSelCards) SendAnycastCmd(card, iIndex, false); else foreach(auto card, gSelCards) SendAnycastCmd(card, iIndex, false);
lineEdit->setText(tr("Anycast")+" - "+lineEdit->text()); lineEdit->setText(tr("Anycast")+" - "+lineEdit->text());
pushButton_13->setEnabled(false); btnAnycast->setEnabled(false);
}); });
pushButton_13->setEnabled(false); btnAnycast->setEnabled(false);
lineEdit->setValidator(new QIntValidator(0, 100, this)); lineEdit->setValidator(new QIntValidator(0, 100, this));
@ -488,7 +470,7 @@ void CtrlTestPanel::transUi() {
pushButtonStopTest->setText(tr("Stop")); pushButtonStopTest->setText(tr("Stop"));
pushButton_11->setText(tr("Clear")); pushButton_11->setText(tr("Clear"));
pushButton_12->setText(tr("Reset")); pushButton_12->setText(tr("Reset"));
pushButton_13->setText(tr("Anycast")); btnAnycast->setText(tr("Anycast"));
} }
void CtrlTestPanel::SendAnycastCmd(LedCard card, int iProgramIndex, bool isSingle) { void CtrlTestPanel::SendAnycastCmd(LedCard card, int iProgramIndex, bool isSingle) {

View File

@ -62,7 +62,7 @@ private:
QLineEdit *lineEdit; QLineEdit *lineEdit;
QPushButton *pushButton_11; QPushButton *pushButton_11;
QPushButton *pushButton_12; QPushButton *pushButton_12;
QPushButton *pushButton_13; QPushButton *btnAnycast;
}; };
#endif // CTRLTESTPANEL_H #endif // CTRLTESTPANEL_H

View File

@ -127,7 +127,7 @@ void DeviceCtrlPanel::hideEvent(QHideEvent *event) {
mDevWgt->mDeviceTable->setSelectionMode(QAbstractItemView::NoSelection); mDevWgt->mDeviceTable->setSelectionMode(QAbstractItemView::NoSelection);
} }
void DeviceCtrlPanel::transUi() { void DeviceCtrlPanel::transUi() {
mBtnGrp->button(Setting_Bright)->setText(tr("Brightness Adjustment")); mBtnGrp->button(Setting_Bright)->setText(tr("Brightness Adj."));
mBtnGrp->button(Setting_PowerControl)->setText(tr("Power Control")); mBtnGrp->button(Setting_PowerControl)->setText(tr("Power Control"));
mBtnGrp->button(Setting_NetCfg)->setText(tr("Net Config")); mBtnGrp->button(Setting_NetCfg)->setText(tr("Net Config"));
mBtnGrp->button(Setting_VerifyClock)->setText(tr("Time Sync")); mBtnGrp->button(Setting_VerifyClock)->setText(tr("Time Sync"));

View File

@ -128,18 +128,20 @@ void DeviceItem::DeviceItemHttpPost() {
if(! androidVersion.isEmpty()) mCard.androidVersion = androidVersion; if(! androidVersion.isEmpty()) mCard.androidVersion = androidVersion;
}); });
json = QJsonObject(); if(mCard.mWidth==0 || mCard.mHeight==0) {
json.insert("_id", "GetScreenSize"); json = QJsonObject();
json.insert("_type", "GetScreenSize"); json.insert("_id", "GetScreenSize");
reply = NetReq("http://"+mCard.ip+":2016/settings").timeout(120000).post(json); json.insert("_type", "GetScreenSize");
connect(reply, &QNetworkReply::finished, this, [=] { reply = NetReq("http://"+mCard.ip+":2016/settings").timeout(120000).post(json);
QJsonDocument json; connect(reply, &QNetworkReply::finished, this, [=] {
QString err = checkReplyForJson(reply, &json); QJsonDocument json;
if(! err.isEmpty()) return; QString err = checkReplyForJson(reply, &json);
mCard.mWidth = json["width"].toInt(); if(! err.isEmpty()) return;
mCard.mHeight = json["height"].toInt(); mCard.mWidth = json["width"].toInt();
setData(DeviceTable_ScreenSize, 0, QString("%1 x %2").arg(mCard.mWidth).arg(mCard.mHeight)); mCard.mHeight = json["height"].toInt();
}); setData(DeviceTable_ScreenSize, 0, QString("%1 x %2").arg(mCard.mWidth).arg(mCard.mHeight));
});
}
json = QJsonObject(); json = QJsonObject();
json.insert("_id", "GetBrightness"); json.insert("_id", "GetBrightness");

View File

@ -23,8 +23,8 @@ void setCard(LedCard &card, const QString &addr, const QJsonDocument &json) {
card.ip = json["newIp"].toString(); card.ip = json["newIp"].toString();
if(card.ip.isEmpty()) card.ip = json["ip"].toString(); if(card.ip.isEmpty()) card.ip = json["ip"].toString();
} }
card.mWidth = json["width"].toInt(); if(card.mWidth==0) card.mWidth = json["width"].toInt();
card.mHeight = json["height"].toInt(); if(card.mHeight==0) card.mHeight = json["height"].toInt();
card.androidVersion = json["androidVersion"].toString(); card.androidVersion = json["androidVersion"].toString();
} }
DevicePanel::DevicePanel(QSettings &settings, QWidget *parent) : QWidget(parent) { DevicePanel::DevicePanel(QSettings &settings, QWidget *parent) : QWidget(parent) {
@ -349,7 +349,7 @@ void DevicePanel::transUi() {
m_headerItem->setText(DeviceTable_ScreenSize, tr("Screen Size")); m_headerItem->setText(DeviceTable_ScreenSize, tr("Screen Size"));
m_headerItem->setText(DeviceTable_Remark, tr("Remark Name")); m_headerItem->setText(DeviceTable_Remark, tr("Remark Name"));
m_headerItem->setText(DeviceTable_Screenshot, tr("readback pic")); m_headerItem->setText(DeviceTable_Screenshot, tr("readback pic"));
m_headerItem->setText(DeviceTable_Brightness, tr("Cur Brightness")); m_headerItem->setText(DeviceTable_Brightness, tr("Screen Brightness"));
m_headerItem->setText(DeviceTable_Power, tr("Power Status")); m_headerItem->setText(DeviceTable_Power, tr("Power Status"));
m_headerItem->setText(DeviceTable_Password, tr("Security")); m_headerItem->setText(DeviceTable_Password, tr("Security"));
m_headerItem->setText(DeviceTable_Info, tr("More Info")); m_headerItem->setText(DeviceTable_Info, tr("More Info"));

View File

@ -5,6 +5,7 @@
#include <QMessageBox> #include <QMessageBox>
#include <QSerialPortInfo> #include <QSerialPortInfo>
#include <QEvent> #include <QEvent>
#include <QButtonGroup>
mGuangYingPinWidget::mGuangYingPinWidget(QWidget *parent) : QWidget(parent) { mGuangYingPinWidget::mGuangYingPinWidget(QWidget *parent) : QWidget(parent) {
setAutoFillBackground(true); setAutoFillBackground(true);
@ -372,173 +373,25 @@ mGuangYingPinWidget::mGuangYingPinWidget(QWidget *parent) : QWidget(parent) {
vBox->addWidget(line); vBox->addWidget(line);
verticalLayout_4 = new QVBoxLayout(); verticalLayout_4 = new QVBoxLayout();
verticalLayout_4->setObjectName(QString::fromUtf8("verticalLayout_4"));
horizontalLayout_14 = new QHBoxLayout(); horizontalLayout_14 = new QHBoxLayout();
horizontalLayout_14->setObjectName(QString::fromUtf8("horizontalLayout_14"));
horizontalLayout_14->setContentsMargins(-1, 2, -1, -1); horizontalLayout_14->setContentsMargins(-1, 2, -1, -1);
horizontalLayout_16 = new QHBoxLayout();
horizontalLayout_16->setObjectName(QString::fromUtf8("horizontalLayout_16"));
horizontalLayout_16->setContentsMargins(-1, 0, -1, -1);
verticalLayout_5 = new QVBoxLayout();
verticalLayout_5->setObjectName(QString::fromUtf8("verticalLayout_5"));
verticalLayout_5->setContentsMargins(-1, 0, -1, -1);
horizontalLayout_13 = new QHBoxLayout();
horizontalLayout_13->setObjectName(QString::fromUtf8("horizontalLayout_13"));
pushButton1 = new QPushButton;
pushButton1->setObjectName(QString::fromUtf8("pushButton1"));
pushButton1->setMinimumSize(QSize(40, 40));
pushButton1->setMaximumSize(QSize(40, 40));
horizontalLayout_13->addWidget(pushButton1); auto grid = new Grid(horizontalLayout_14);
auto grp = new QButtonGroup(grid);
pushButton2 = new QPushButton; for(int i=0; i<20; ++i) {
pushButton2->setObjectName(QString::fromUtf8("pushButton2")); auto btn = new QPushButton(QString::number(i+1));
pushButton2->setMinimumSize(QSize(40, 40)); grp->addButton(btn, i+1);
pushButton2->setMaximumSize(QSize(40, 40)); btn->setFixedSize(40, 40);
btn->setProperty("ssType", "progManageTool");
horizontalLayout_13->addWidget(pushButton2); grid->addWidget(btn, i/5, i%5);
}
pushButton3 = new QPushButton; connect(grp, &QButtonGroup::idClicked, this, [=](int id) {
pushButton3->setObjectName(QString::fromUtf8("pushButton3")); if(groupBox_com->isChecked()) {
pushButton3->setMinimumSize(QSize(40, 40)); if(pushButtonMainOpen->text()==tr("Close")) Set_program_buf_and_send(comboBox_SPortName->currentIndex(), id);
pushButton3->setMaximumSize(QSize(40, 40)); if(pushButtonAuxOpen->text()==tr("Close")) Set_program_buf_and_send(comboBox_SPortNameAux->currentIndex(), id);
}
horizontalLayout_13->addWidget(pushButton3); if(groupBox_Network->isChecked()) Set_program_buf_and_send_by_udp(id);
});
pushButton4 = new QPushButton;
pushButton4->setObjectName(QString::fromUtf8("pushButton4"));
pushButton4->setMinimumSize(QSize(40, 40));
pushButton4->setMaximumSize(QSize(40, 40));
horizontalLayout_13->addWidget(pushButton4);
pushButton5 = new QPushButton;
pushButton5->setObjectName(QString::fromUtf8("pushButton5"));
pushButton5->setMinimumSize(QSize(40, 40));
pushButton5->setMaximumSize(QSize(40, 40));
horizontalLayout_13->addWidget(pushButton5);
verticalLayout_5->addLayout(horizontalLayout_13);
horizontalLayout_12 = new QHBoxLayout();
pushButton6 = new QPushButton;
pushButton6->setObjectName(QString::fromUtf8("pushButton6"));
pushButton6->setMinimumSize(QSize(40, 40));
pushButton6->setMaximumSize(QSize(40, 40));
horizontalLayout_12->addWidget(pushButton6);
pushButton7 = new QPushButton;
pushButton7->setObjectName(QString::fromUtf8("pushButton7"));
pushButton7->setMinimumSize(QSize(40, 40));
pushButton7->setMaximumSize(QSize(40, 40));
horizontalLayout_12->addWidget(pushButton7);
pushButton8 = new QPushButton;
pushButton8->setObjectName(QString::fromUtf8("pushButton8"));
pushButton8->setMinimumSize(QSize(40, 40));
pushButton8->setMaximumSize(QSize(40, 40));
horizontalLayout_12->addWidget(pushButton8);
pushButton9 = new QPushButton;
pushButton9->setObjectName(QString::fromUtf8("pushButton9"));
pushButton9->setMinimumSize(QSize(40, 40));
pushButton9->setMaximumSize(QSize(40, 40));
horizontalLayout_12->addWidget(pushButton9);
pushButton10 = new QPushButton;
pushButton10->setObjectName(QString::fromUtf8("pushButton10"));
pushButton10->setMinimumSize(QSize(40, 40));
pushButton10->setMaximumSize(QSize(40, 40));
horizontalLayout_12->addWidget(pushButton10);
verticalLayout_5->addLayout(horizontalLayout_12);
horizontalLayout_11 = new QHBoxLayout();
horizontalLayout_11->setObjectName(QString::fromUtf8("horizontalLayout_11"));
pushButton11 = new QPushButton;
pushButton11->setObjectName(QString::fromUtf8("pushButton11"));
pushButton11->setMinimumSize(QSize(40, 40));
pushButton11->setMaximumSize(QSize(40, 40));
horizontalLayout_11->addWidget(pushButton11);
pushButton12 = new QPushButton;
pushButton12->setObjectName(QString::fromUtf8("pushButton12"));
pushButton12->setMinimumSize(QSize(40, 40));
pushButton12->setMaximumSize(QSize(40, 40));
horizontalLayout_11->addWidget(pushButton12);
pushButton13 = new QPushButton;
pushButton13->setObjectName(QString::fromUtf8("pushButton13"));
pushButton13->setMinimumSize(QSize(40, 40));
pushButton13->setMaximumSize(QSize(40, 40));
horizontalLayout_11->addWidget(pushButton13);
pushButton14 = new QPushButton;
pushButton14->setObjectName(QString::fromUtf8("pushButton14"));
pushButton14->setMinimumSize(QSize(40, 40));
pushButton14->setMaximumSize(QSize(40, 40));
horizontalLayout_11->addWidget(pushButton14);
pushButton15 = new QPushButton;
pushButton15->setObjectName(QString::fromUtf8("pushButton15"));
pushButton15->setMinimumSize(QSize(40, 40));
pushButton15->setMaximumSize(QSize(40, 40));
horizontalLayout_11->addWidget(pushButton15);
verticalLayout_5->addLayout(horizontalLayout_11);
horizontalLayout_10 = new QHBoxLayout();
horizontalLayout_10->setObjectName(QString::fromUtf8("horizontalLayout_10"));
pushButton16 = new QPushButton;
pushButton16->setObjectName(QString::fromUtf8("pushButton16"));
pushButton16->setMinimumSize(QSize(40, 40));
pushButton16->setMaximumSize(QSize(40, 40));
horizontalLayout_10->addWidget(pushButton16);
pushButton17 = new QPushButton;
pushButton17->setObjectName(QString::fromUtf8("pushButton17"));
pushButton17->setMinimumSize(QSize(40, 40));
pushButton17->setMaximumSize(QSize(40, 40));
horizontalLayout_10->addWidget(pushButton17);
pushButton18 = new QPushButton;
pushButton18->setObjectName(QString::fromUtf8("pushButton18"));
pushButton18->setMinimumSize(QSize(40, 40));
pushButton18->setMaximumSize(QSize(40, 40));
horizontalLayout_10->addWidget(pushButton18);
pushButton19 = new QPushButton;
pushButton19->setMinimumSize(QSize(40, 40));
pushButton19->setMaximumSize(QSize(40, 40));
horizontalLayout_10->addWidget(pushButton19);
pushButton20 = new QPushButton;
pushButton20->setMinimumSize(QSize(40, 40));
pushButton20->setMaximumSize(QSize(40, 40));
horizontalLayout_10->addWidget(pushButton20);
verticalLayout_5->addLayout(horizontalLayout_10);
horizontalLayout_16->addLayout(verticalLayout_5);
horizontalLayout_14->addLayout(horizontalLayout_16);
line = new QFrame; line = new QFrame;
line->setFrameShape(QFrame::VLine); line->setFrameShape(QFrame::VLine);
@ -568,23 +421,25 @@ mGuangYingPinWidget::mGuangYingPinWidget(QWidget *parent) : QWidget(parent) {
line->setFrameShadow(QFrame::Sunken); line->setFrameShadow(QFrame::Sunken);
horizontalLayout_19->addWidget(line); horizontalLayout_19->addWidget(line);
pushButtonPrevious = new QPushButton; auto pushButtonPrevious = new QPushButton;
pushButtonPrevious->setMinimumSize(QSize(40, 40)); pushButtonPrevious->setMinimumSize(QSize(40, 40));
pushButtonPrevious->setIconSize(QSize(32, 32)); pushButtonPrevious->setIconSize(QSize(32, 32));
pushButtonPrevious->setFlat(true); pushButtonPrevious->setFlat(true);
horizontalLayout_19->addWidget(pushButtonPrevious); horizontalLayout_19->addWidget(pushButtonPrevious);
pushButtonNext = new QPushButton; auto pushButtonNext = new QPushButton;
pushButtonNext->setMinimumSize(QSize(40, 40)); pushButtonNext->setMinimumSize(QSize(40, 40));
pushButtonNext->setIconSize(QSize(32, 32)); pushButtonNext->setIconSize(QSize(32, 32));
pushButtonNext->setFlat(true); pushButtonNext->setFlat(true);
horizontalLayout_19->addWidget(pushButtonNext); horizontalLayout_19->addWidget(pushButtonNext);
pushButtonLoop = new QPushButton; auto btnLoop = new QPushButton(QIcon(":/res/loop.png"), QString());
pushButtonLoop->setMinimumSize(QSize(40, 40)); btnLoop->setProperty("ssType", "progManageTool");
pushButtonLoop->setIconSize(QSize(32, 32)); btnLoop->setMinimumSize(QSize(40, 40));
pushButtonLoop->setFlat(true); btnLoop->setIconSize(QSize(32, 32));
horizontalLayout_19->addWidget(pushButtonLoop); btnLoop->setFlat(true);
grp->addButton(btnLoop, 0);
horizontalLayout_19->addWidget(btnLoop);
horizontalSpacer_7 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); horizontalSpacer_7 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
@ -723,26 +578,6 @@ mGuangYingPinWidget::mGuangYingPinWidget(QWidget *parent) : QWidget(parent) {
lineEdit_ResendTimes->setText(tr("10")); lineEdit_ResendTimes->setText(tr("10"));
label_DelayMill->setText(tr("Delay millsecond")); label_DelayMill->setText(tr("Delay millsecond"));
lineEdit_DelayMill->setText(tr("10")); lineEdit_DelayMill->setText(tr("10"));
pushButton1->setText(tr("1"));
pushButton2->setText(tr("2"));
pushButton3->setText(tr("3"));
pushButton4->setText(tr("4"));
pushButton5->setText(tr("5"));
pushButton6->setText(tr("6"));
pushButton7->setText(tr("7"));
pushButton8->setText(tr("8"));
pushButton9->setText(tr("9"));
pushButton10->setText(tr("10"));
pushButton11->setText(tr("11"));
pushButton12->setText(tr("12"));
pushButton13->setText(tr("13"));
pushButton14->setText(tr("14"));
pushButton15->setText(tr("15"));
pushButton16->setText(tr("16"));
pushButton17->setText(tr("17"));
pushButton18->setText(tr("18"));
pushButton19->setText(tr("19"));
pushButton20->setText(tr("20"));
label_ProgramNum->setText(tr("Program number")); label_ProgramNum->setText(tr("Program number"));
pushButtonSend->setText(tr("Send")); pushButtonSend->setText(tr("Send"));
label_BrightNess->setText(tr("Brightness")); label_BrightNess->setText(tr("Brightness"));
@ -754,35 +589,12 @@ mGuangYingPinWidget::mGuangYingPinWidget(QWidget *parent) : QWidget(parent) {
pushButton1->setProperty("ssType", "progManageTool");
pushButton2->setProperty("ssType", "progManageTool");
pushButton3->setProperty("ssType", "progManageTool");
pushButton4->setProperty("ssType", "progManageTool");
pushButton5->setProperty("ssType", "progManageTool");
pushButton6->setProperty("ssType", "progManageTool");
pushButton7->setProperty("ssType", "progManageTool");
pushButton8->setProperty("ssType", "progManageTool");
pushButton9->setProperty("ssType", "progManageTool");
pushButton10->setProperty("ssType", "progManageTool");
pushButton11->setProperty("ssType", "progManageTool");
pushButton12->setProperty("ssType", "progManageTool");
pushButton13->setProperty("ssType", "progManageTool");
pushButton14->setProperty("ssType", "progManageTool");
pushButton15->setProperty("ssType", "progManageTool");
pushButton16->setProperty("ssType", "progManageTool");
pushButton17->setProperty("ssType", "progManageTool");
pushButton18->setProperty("ssType", "progManageTool");
pushButton19->setProperty("ssType", "progManageTool");
pushButton20->setProperty("ssType", "progManageTool");
pushButtonSend->setProperty("ssType", "progManageTool"); pushButtonSend->setProperty("ssType", "progManageTool");
pushButtonPrevious->setProperty("ssType", "progManageTool"); pushButtonPrevious->setProperty("ssType", "progManageTool");
pushButtonPrevious->setIcon(QIcon(":/res/previous.png")); pushButtonPrevious->setIcon(QIcon(":/res/previous.png"));
pushButtonNext->setProperty("ssType", "progManageTool"); pushButtonNext->setProperty("ssType", "progManageTool");
pushButtonNext->setIcon(QIcon(":/res/next.png")); pushButtonNext->setIcon(QIcon(":/res/next.png"));
pushButtonLoop->setProperty("ssType", "progManageTool");
pushButtonLoop->setIcon(QIcon(":/res/loop.png"));
pushButtonMainOpen->setProperty("ssType", "progManageTool"); pushButtonMainOpen->setProperty("ssType", "progManageTool");
pushButtonAuxOpen->setProperty("ssType", "progManageTool"); pushButtonAuxOpen->setProperty("ssType", "progManageTool");
pushButtonBrightnessSet->setProperty("ssType", "progManageTool"); pushButtonBrightnessSet->setProperty("ssType", "progManageTool");
@ -832,31 +644,12 @@ mGuangYingPinWidget::mGuangYingPinWidget(QWidget *parent) : QWidget(parent) {
connect(pushButtonMainOpen, SIGNAL(clicked(bool)), this, SLOT(MWOnoffPort())); connect(pushButtonMainOpen, SIGNAL(clicked(bool)), this, SLOT(MWOnoffPort()));
connect(pushButtonAuxOpen, SIGNAL(clicked(bool)), this, SLOT(MWOnoffPortAux())); connect(pushButtonAuxOpen, SIGNAL(clicked(bool)), this, SLOT(MWOnoffPortAux()));
connect(pushButton1, SIGNAL(clicked()), this, SLOT(OnAnsyProgram1()));
connect(pushButton2, SIGNAL(clicked()), this, SLOT(OnAnsyProgram2()));
connect(pushButton3, SIGNAL(clicked()), this, SLOT(OnAnsyProgram3()));
connect(pushButton4, SIGNAL(clicked()), this, SLOT(OnAnsyProgram4()));
connect(pushButton5, SIGNAL(clicked()), this, SLOT(OnAnsyProgram5()));
connect(pushButton6, SIGNAL(clicked()), this, SLOT(OnAnsyProgram6()));
connect(pushButton7, SIGNAL(clicked()), this, SLOT(OnAnsyProgram7()));
connect(pushButton8, SIGNAL(clicked()), this, SLOT(OnAnsyProgram8()));
connect(pushButton9, SIGNAL(clicked()), this, SLOT(OnAnsyProgram9()));
connect(pushButton10, SIGNAL(clicked()), this, SLOT(OnAnsyProgram10()));
connect(pushButton11, SIGNAL(clicked()), this, SLOT(OnAnsyProgram11()));
connect(pushButton12, SIGNAL(clicked()), this, SLOT(OnAnsyProgram12()));
connect(pushButton13, SIGNAL(clicked()), this, SLOT(OnAnsyProgram13()));
connect(pushButton14, SIGNAL(clicked()), this, SLOT(OnAnsyProgram14()));
connect(pushButton15, SIGNAL(clicked()), this, SLOT(OnAnsyProgram15()));
connect(pushButton16, SIGNAL(clicked()), this, SLOT(OnAnsyProgram16()));
connect(pushButton17, SIGNAL(clicked()), this, SLOT(OnAnsyProgram17()));
connect(pushButton18, SIGNAL(clicked()), this, SLOT(OnAnsyProgram18()));
connect(pushButton19, SIGNAL(clicked()), this, SLOT(OnAnsyProgram19()));
connect(pushButton20, SIGNAL(clicked()), this, SLOT(OnAnsyProgram20()));
connect(pushButtonClearLog, SIGNAL(clicked()), this, SLOT(OnClearLog())); connect(pushButtonClearLog, SIGNAL(clicked()), this, SLOT(OnClearLog()));
connect(pushButtonSend, SIGNAL(clicked()), this, SLOT(OnAnsyProgramCustom())); connect(pushButtonSend, SIGNAL(clicked()), this, SLOT(OnAnsyProgramCustom()));
connect(pushButtonNext, SIGNAL(clicked()), this, SLOT(OnAnsyProgramNext())); connect(pushButtonNext, SIGNAL(clicked()), this, SLOT(OnAnsyProgramNext()));
connect(pushButtonPrevious, SIGNAL(clicked()), this, SLOT(OnAnsyProgramPrevious())); connect(pushButtonPrevious, SIGNAL(clicked()), this, SLOT(OnAnsyProgramPrevious()));
connect(pushButtonLoop, SIGNAL(clicked()), this, SLOT(OnAnsyProgramLoop()));
connect(pushButtonBrightnessSet, SIGNAL(clicked()), this, SLOT(OnBrightnessSet())); connect(pushButtonBrightnessSet, SIGNAL(clicked()), this, SLOT(OnBrightnessSet()));
connect(pushButtonScreenOn, SIGNAL(clicked()), this, SLOT(OnScreenOn())); connect(pushButtonScreenOn, SIGNAL(clicked()), this, SLOT(OnScreenOn()));
connect(pushButtonScreenOff, SIGNAL(clicked()), this, SLOT(OnScreenOff())); connect(pushButtonScreenOff, SIGNAL(clicked()), this, SLOT(OnScreenOff()));
@ -867,122 +660,62 @@ mGuangYingPinWidget::mGuangYingPinWidget(QWidget *parent) : QWidget(parent) {
void mGuangYingPinWidget::changeEvent(QEvent *event) { void mGuangYingPinWidget::changeEvent(QEvent *event) {
QWidget::changeEvent(event); QWidget::changeEvent(event);
if(event->type() == QEvent::LanguageChange) { if(event->type() == QEvent::LanguageChange) transUi();
pushButtonSend->setText(tr("Send")); }
pushButtonMainOpen->setText(tr("Open")); void mGuangYingPinWidget::transUi() {
pushButtonAuxOpen->setText(tr("Open")); pushButtonSend->setText(tr("Send"));
pushButtonBrightnessSet->setText(tr("Set")); pushButtonMainOpen->setText(tr("Open"));
pushButtonScreenOn->setText(tr("Screen On")); pushButtonAuxOpen->setText(tr("Open"));
pushButtonScreenOff->setText(tr("Screen Off")); pushButtonBrightnessSet->setText(tr("Set"));
pushButtonRefresh->setText(tr("Refresh")); pushButtonScreenOn->setText(tr("Screen On"));
groupBoxMain->setTitle(tr("Main")); pushButtonScreenOff->setText(tr("Screen Off"));
groupBoxAux->setTitle(tr("Auxiliary")); pushButtonRefresh->setText(tr("Refresh"));
groupBoxParam->setTitle(tr("Param configuration")); groupBoxMain->setTitle(tr("Main"));
label_PortName->setText(tr("PortName")); groupBoxAux->setTitle(tr("Auxiliary"));
label_BaudRate->setText(tr("BaudRate")); groupBoxParam->setTitle(tr("Param configuration"));
label_DataBit->setText(tr("DataBit")); label_PortName->setText(tr("PortName"));
label_OEBit->setText(tr("OEBit")); label_BaudRate->setText(tr("BaudRate"));
label_StopBit->setText(tr("StopBit")); label_DataBit->setText(tr("DataBit"));
label_PortNameAux->setText(tr("PortName")); label_OEBit->setText(tr("OEBit"));
label_BaudRateAux->setText(tr("BaudRate")); label_StopBit->setText(tr("StopBit"));
label_DataBitAux->setText(tr("DataBit")); label_PortNameAux->setText(tr("PortName"));
label_OEBitAux->setText(tr("OEBit")); label_BaudRateAux->setText(tr("BaudRate"));
label_StopBitAux->setText(tr("StopBit")); label_DataBitAux->setText(tr("DataBit"));
label_OEBitAux->setText(tr("OEBit"));
label_StopBitAux->setText(tr("StopBit"));
label_ResendTimes->setText(tr("Resend times")); label_ResendTimes->setText(tr("Resend times"));
label_DelayMill->setText(tr("Delay millsecond")); label_DelayMill->setText(tr("Delay millsecond"));
label_ProgramNum->setText(tr("Program number")); label_ProgramNum->setText(tr("Program number"));
label_BrightNess->setText(tr("Brightness")); label_BrightNess->setText(tr("Brightness"));
label_ComStatus->setText(tr("State:Off")); label_ComStatus->setText(tr("State:Off"));
label_ComStatusAux->setText(tr("State:Off")); label_ComStatusAux->setText(tr("State:Off"));
pushButtonClearLog->setText(tr("Clear")); pushButtonClearLog->setText(tr("Clear"));
checkBoxDebug->setText(tr("Debug")); checkBoxDebug->setText(tr("Debug"));
groupBox_Network->setTitle(tr("Network")); groupBox_Network->setTitle(tr("Network"));
groupBox_com->setTitle(tr("Com")); groupBox_com->setTitle(tr("Com"));
}
} }
void mGuangYingPinWidget::OnAnsyProgram1(void)
{
MACRO_ANSY_PROGRAM(1)
}
void mGuangYingPinWidget::OnAnsyProgram2(void)
{
MACRO_ANSY_PROGRAM(2)
}void mGuangYingPinWidget::OnAnsyProgram3(void)
{
MACRO_ANSY_PROGRAM(3)
}void mGuangYingPinWidget::OnAnsyProgram4(void)
{
MACRO_ANSY_PROGRAM(4)
}void mGuangYingPinWidget::OnAnsyProgram5(void)
{
MACRO_ANSY_PROGRAM(5)
}void mGuangYingPinWidget::OnAnsyProgram6(void)
{
MACRO_ANSY_PROGRAM(6)
}void mGuangYingPinWidget::OnAnsyProgram7(void)
{
MACRO_ANSY_PROGRAM(7)
}void mGuangYingPinWidget::OnAnsyProgram8(void)
{
MACRO_ANSY_PROGRAM(8)
}void mGuangYingPinWidget::OnAnsyProgram9(void)
{
MACRO_ANSY_PROGRAM(9)
}void mGuangYingPinWidget::OnAnsyProgram10(void)
{
MACRO_ANSY_PROGRAM(10)
}void mGuangYingPinWidget::OnAnsyProgram11(void)
{
MACRO_ANSY_PROGRAM(11)
}void mGuangYingPinWidget::OnAnsyProgram12(void)
{
MACRO_ANSY_PROGRAM(12)
}void mGuangYingPinWidget::OnAnsyProgram13(void)
{
MACRO_ANSY_PROGRAM(13)
}void mGuangYingPinWidget::OnAnsyProgram14(void)
{
MACRO_ANSY_PROGRAM(14)
}void mGuangYingPinWidget::OnAnsyProgram15(void)
{
MACRO_ANSY_PROGRAM(15)
}void mGuangYingPinWidget::OnAnsyProgram16(void)
{
MACRO_ANSY_PROGRAM(16)
}void mGuangYingPinWidget::OnAnsyProgram17(void)
{
MACRO_ANSY_PROGRAM(17)
}void mGuangYingPinWidget::OnAnsyProgram18(void)
{
MACRO_ANSY_PROGRAM(18)
}void mGuangYingPinWidget::OnAnsyProgram19(void)
{
MACRO_ANSY_PROGRAM(19)
}
void mGuangYingPinWidget::OnAnsyProgram20(void)
{
MACRO_ANSY_PROGRAM(20)
}
void mGuangYingPinWidget::OnClearLog(void) void mGuangYingPinWidget::OnClearLog(void)
{ {
textEditReadBuf->clear(); textEditReadBuf->clear();
} }
void mGuangYingPinWidget::OnAnsyProgramCustom(void) void mGuangYingPinWidget::OnAnsyProgramCustom(void)
{ {
int itemp=spinBox_ProgramIndex->value(); int id = spinBox_ProgramIndex->value();
MACRO_ANSY_PROGRAM(itemp) if(groupBox_com->isChecked()) {
if(pushButtonMainOpen->text()==tr("Close")) Set_program_buf_and_send(comboBox_SPortName->currentIndex(), id);
if(checkBoxDebug->isChecked()) if(pushButtonAuxOpen->text()==tr("Close")) Set_program_buf_and_send(comboBox_SPortNameAux->currentIndex(), id);
{
textEditReadBuf->append("OnAnsyProgramCustom");
} }
if(groupBox_Network->isChecked()) Set_program_buf_and_send_by_udp(id);
if(checkBoxDebug->isChecked()) textEditReadBuf->append("OnAnsyProgramCustom");
} }
void mGuangYingPinWidget::OnAnsyProgramCustomByChanged(int icurIndex) void mGuangYingPinWidget::OnAnsyProgramCustomByChanged(int id) {
{ if(groupBox_com->isChecked()) {
MACRO_ANSY_PROGRAM(icurIndex) if(pushButtonMainOpen->text()==tr("Close")) Set_program_buf_and_send(comboBox_SPortName->currentIndex(), id);
if(pushButtonAuxOpen->text()==tr("Close")) Set_program_buf_and_send(comboBox_SPortNameAux->currentIndex(), id);
}
if(groupBox_Network->isChecked()) Set_program_buf_and_send_by_udp(id);
} }
void mGuangYingPinWidget::OnBrightnessSetByChanged(int icurValue) void mGuangYingPinWidget::OnBrightnessSetByChanged(int icurValue)
{ {
@ -996,25 +729,13 @@ void mGuangYingPinWidget::OnAnsyProgramNext(void)
{ {
spinBox_ProgramIndex->setValue(spinBox_ProgramIndex->value()+1); spinBox_ProgramIndex->setValue(spinBox_ProgramIndex->value()+1);
OnAnsyProgramCustom(); OnAnsyProgramCustom();
// int itemp=spinBox_ProgramIndex->value();
// MACRO_ANSY_PROGRAM(itemp)
// if(pushButtonMainOpen->text()==tr("Close"))
// NextProgram_buf_and_send(comboBox_SPortName->currentIndex());
// if(pushButtonAuxOpen->text()==tr("Close"))
// NextProgram_buf_and_send(comboBox_SPortNameAux->currentIndex());
} }
void mGuangYingPinWidget::OnAnsyProgramPrevious(void) void mGuangYingPinWidget::OnAnsyProgramPrevious(void)
{ {
spinBox_ProgramIndex->setValue(spinBox_ProgramIndex->value()-1); spinBox_ProgramIndex->setValue(spinBox_ProgramIndex->value()-1);
OnAnsyProgramCustom(); OnAnsyProgramCustom();
// int itemp=spinBox_ProgramIndex->value();
// MACRO_ANSY_PROGRAM(itemp)
}
void mGuangYingPinWidget::OnAnsyProgramLoop(void)
{
MACRO_ANSY_PROGRAM(0)
} }
void mGuangYingPinWidget::OnBrightnessSet(void) void mGuangYingPinWidget::OnBrightnessSet(void)
{ {
if(groupBox_com->isChecked()) if(groupBox_com->isChecked())

View File

@ -19,13 +19,6 @@
#include <QtWidgets/QTextEdit> #include <QtWidgets/QTextEdit>
#include <QtWidgets/QVBoxLayout> #include <QtWidgets/QVBoxLayout>
#define MACRO_ANSY_PROGRAM(PROGRAM_INDEX) \
if(groupBox_com->isChecked()) {\
if(pushButtonMainOpen->text()==tr("Close")) Set_program_buf_and_send(comboBox_SPortName->currentIndex(),PROGRAM_INDEX);\
if(pushButtonAuxOpen->text()==tr("Close")) Set_program_buf_and_send(comboBox_SPortNameAux->currentIndex(),PROGRAM_INDEX);\
}\
if(groupBox_Network->isChecked()) Set_program_buf_and_send_by_udp(PROGRAM_INDEX);
class TA_SerialThread { class TA_SerialThread {
public: public:
TA_SerialThread(); TA_SerialThread();
@ -63,31 +56,10 @@ public slots:
void MWReadDataAux(void); void MWReadDataAux(void);
void MWClearRecv(void); void MWClearRecv(void);
void MWRSNumDisplay(void); void MWRSNumDisplay(void);
void OnAnsyProgram1(void);
void OnAnsyProgram2(void);
void OnAnsyProgram3(void);
void OnAnsyProgram4(void);
void OnAnsyProgram5(void);
void OnAnsyProgram6(void);
void OnAnsyProgram7(void);
void OnAnsyProgram8(void);
void OnAnsyProgram9(void);
void OnAnsyProgram10(void);
void OnAnsyProgram11(void);
void OnAnsyProgram12(void);
void OnAnsyProgram13(void);
void OnAnsyProgram14(void);
void OnAnsyProgram15(void);
void OnAnsyProgram16(void);
void OnAnsyProgram17(void);
void OnAnsyProgram18(void);
void OnAnsyProgram19(void);
void OnAnsyProgram20(void);
void OnClearLog(void); void OnClearLog(void);
void OnAnsyProgramCustom(void); void OnAnsyProgramCustom(void);
void OnAnsyProgramNext(void); void OnAnsyProgramNext(void);
void OnAnsyProgramPrevious(void); void OnAnsyProgramPrevious(void);
void OnAnsyProgramLoop(void);
void OnBrightnessSet(void); void OnBrightnessSet(void);
void OnScreenOn(void); void OnScreenOn(void);
void OnScreenOff(void); void OnScreenOff(void);
@ -177,40 +149,12 @@ private:
QSpacerItem *horizontalSpacer_2; QSpacerItem *horizontalSpacer_2;
QVBoxLayout *verticalLayout_4; QVBoxLayout *verticalLayout_4;
QHBoxLayout *horizontalLayout_14; QHBoxLayout *horizontalLayout_14;
QHBoxLayout *horizontalLayout_16;
QVBoxLayout *verticalLayout_5;
QHBoxLayout *horizontalLayout_13;
QPushButton *pushButton1;
QPushButton *pushButton2;
QPushButton *pushButton3;
QPushButton *pushButton4;
QPushButton *pushButton5;
QHBoxLayout *horizontalLayout_12;
QPushButton *pushButton6;
QPushButton *pushButton7;
QPushButton *pushButton8;
QPushButton *pushButton9;
QPushButton *pushButton10;
QHBoxLayout *horizontalLayout_11;
QPushButton *pushButton11;
QPushButton *pushButton12;
QPushButton *pushButton13;
QPushButton *pushButton14;
QPushButton *pushButton15;
QHBoxLayout *horizontalLayout_10;
QPushButton *pushButton16;
QPushButton *pushButton17;
QPushButton *pushButton18;
QPushButton *pushButton19;
QPushButton *pushButton20;
QVBoxLayout *verticalLayout_7; QVBoxLayout *verticalLayout_7;
QHBoxLayout *horizontalLayout_19; QHBoxLayout *horizontalLayout_19;
QLabel *label_ProgramNum; QLabel *label_ProgramNum;
QSpinBox *spinBox_ProgramIndex; QSpinBox *spinBox_ProgramIndex;
QPushButton *pushButtonSend; QPushButton *pushButtonSend;
QPushButton *pushButtonPrevious;
QPushButton *pushButtonNext;
QPushButton *pushButtonLoop;
QSpacerItem *horizontalSpacer_7; QSpacerItem *horizontalSpacer_7;
QHBoxLayout *horizontalLayout_21; QHBoxLayout *horizontalLayout_21;
QLabel *label_BrightNess; QLabel *label_BrightNess;

View File

@ -1,32 +0,0 @@
#include "passwordindlg.h"
#include "base/changepasswordform.h"
#include "gutil/qgui.h"
#include <QLabel>
#include <QPushButton>
PasswordInChDlg::PasswordInChDlg(QWidget *parent) : QDialog(parent) {
resize(240, 150);
auto vBox = new VBox(this);
vBox->addStretch();
auto hBox = new HBox(vBox);
hBox->addWidget(new QLabel(tr("Input password")));
fdPassword = new QLineEdit();
fdPassword->setEchoMode(QLineEdit::Password);
fdPassword->setFocus();
hBox->addWidget(fdPassword);
btnChangePassword = new QPushButton(tr("Change Password"));
vBox->addWidget(btnChangePassword, 0, Qt::AlignRight);
connect(btnChangePassword, &QPushButton::clicked, this, [this]() {
ChangePasswordForm dlg(this);
dlg.exec();
});
vBox->addStretch();
btnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(btnBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
vBox->addWidget(btnBox);
}

View File

@ -1,18 +0,0 @@
#ifndef PASSWORDINDLG_H
#define PASSWORDINDLG_H
#include <QDialog>
#include <QLineEdit>
#include <QDialogButtonBox>
class PasswordInChDlg : public QDialog {
Q_OBJECT
public:
explicit PasswordInChDlg(QWidget *parent = 0);
QLineEdit *fdPassword;
QPushButton *btnChangePassword;
QDialogButtonBox *btnBox;
};
#endif // PASSWORDINDLG_H

View File

@ -363,7 +363,7 @@ QWidget* EText::attrWgt() {
if(filePath.isEmpty()) return; if(filePath.isEmpty()) return;
QFile file(filePath); QFile file(filePath);
if(! file.open(QFile::ReadOnly)) { if(! file.open(QFile::ReadOnly)) {
QMessageBox::critical(wgtAttr, tr("Fail"), tr("File Open Fail")); QMessageBox::critical(wgtAttr, tr("Fail"), tr("File Open Failed"));
return; return;
} }
auto data = file.readAll(); auto data = file.readAll();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 27 KiB

BIN
LedOK/res/random2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff