ledok
This commit is contained in:
parent
8d8c61695c
commit
5668845592
|
@ -83,7 +83,6 @@ SOURCES += \
|
|||
main.cpp \
|
||||
mainwindow.cpp \
|
||||
mguangyingpinwidget.cpp \
|
||||
passwordindlg.cpp \
|
||||
player/digiclock.cpp \
|
||||
player/eleanaclock.cpp \
|
||||
player/elebase.cpp \
|
||||
|
@ -159,7 +158,6 @@ HEADERS += \
|
|||
gutil/qnetwork.h \
|
||||
mainwindow.h \
|
||||
mguangyingpinwidget.h \
|
||||
passwordindlg.h \
|
||||
player/digiclock.h \
|
||||
player/eleanaclock.h \
|
||||
player/elebase.h \
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
#include "ctrladvancedpanel.h"
|
||||
#include "globaldefine.h"
|
||||
#include "base/waitingdlg.h"
|
||||
#include "passwordindlg.h"
|
||||
#include "base/changepasswordform.h"
|
||||
#include "tools.h"
|
||||
#include "gutil/qgui.h"
|
||||
#include "gutil/qnetwork.h"
|
||||
#include "program/ephoto.h"
|
||||
#include "upgradeapkdialog.h"
|
||||
#include <QBoxLayout>
|
||||
#include <QComboBox>
|
||||
#include <QFileDialog>
|
||||
#include <QJsonArray>
|
||||
|
@ -24,6 +23,7 @@
|
|||
#include <QSpinBox>
|
||||
#include <QButtonGroup>
|
||||
#include "devicepanel.h"
|
||||
#include <QDialogButtonBox>
|
||||
|
||||
CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) {
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
|
@ -737,12 +737,16 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) {
|
|||
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
|
||||
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()) {
|
||||
QMessageBox::information(this, tr("Tip"), tr("File not exist"));
|
||||
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();
|
||||
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\n");
|
||||
|
||||
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;
|
||||
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));
|
||||
});
|
||||
}
|
||||
waitingDlg->success();
|
||||
});
|
||||
}
|
||||
});
|
||||
hBox->addWidget(btnY50Set);
|
||||
|
||||
|
@ -1392,8 +1407,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) {
|
|||
auto filePath = QFileDialog::getOpenFileName(this, "Open File", QString(), ".bin file (*.bin)");
|
||||
if(filePath.isEmpty()) return;
|
||||
QFile qFile(filePath);
|
||||
if(! qFile.exists()) return;
|
||||
if(! qFile.open(QIODevice::ReadOnly)) return;
|
||||
if(! qFile.exists()) {
|
||||
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();
|
||||
qFile.close();
|
||||
|
||||
|
@ -1420,12 +1441,11 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) {
|
|||
});
|
||||
} else {
|
||||
foreach(auto card, gSelCards) {
|
||||
auto cardId = card.id;
|
||||
NetReq req("http://"+card.ip+":2016/upload?type=mcu_update");
|
||||
auto reply = req.timeout(120000).type("multipart/form-data; boundary="+Boundary).post(data);
|
||||
connect(reply, &QNetworkReply::finished, this, [=] {
|
||||
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() {
|
||||
if(! isPassed) {
|
||||
hide();
|
||||
PasswordInChDlg dlg(this);
|
||||
connect(dlg.btnBox, &QDialogButtonBox::accepted, &dlg, [&dlg]() {
|
||||
QDialog dlg(this);
|
||||
#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 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"));
|
||||
});
|
||||
if(dlg.exec()==QDialog::Accepted) {
|
||||
|
|
|
@ -223,7 +223,7 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
|
|||
connect(btngrp, &QButtonGroup::idClicked, this, [=](int id) {
|
||||
if(lineEdit->text().contains("-")) lineEdit->clear();
|
||||
lineEdit->setText(lineEdit->text() + QString::number(id));
|
||||
pushButton_13->setEnabled(true);
|
||||
btnAnycast->setEnabled(true);
|
||||
});
|
||||
|
||||
pushButton_11 = new QPushButton;
|
||||
|
@ -234,8 +234,8 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
|
|||
pushButton_12->setFixedSize(QSize(60, 30));
|
||||
gridLayout->addWidget(pushButton_12, 3, 2, 1, 1);
|
||||
|
||||
pushButton_13 = new QPushButton;
|
||||
vv->addWidget(pushButton_13);
|
||||
btnAnycast = new QPushButton;
|
||||
vv->addWidget(btnAnycast);
|
||||
vv->addStretch();
|
||||
|
||||
hBox->addStretch();
|
||||
|
@ -247,7 +247,7 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
|
|||
pushButtonStopTest->setProperty("ssType", "progManageTool");
|
||||
pushButton_11->setProperty("ssType", "progManageTool");
|
||||
pushButton_12->setProperty("ssType", "progManageTool");
|
||||
pushButton_13->setProperty("ssType", "progManageTool");
|
||||
btnAnycast->setProperty("ssType", "progManageTool");
|
||||
|
||||
spinBoxLineSpeed->setValue(10);
|
||||
spinBoxLineDistance->setValue(15);
|
||||
|
@ -273,15 +273,10 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
|
|||
json.insert("_type", "TestScreen");
|
||||
json.insert("mode", 1);// 0:停止; 1:斜线; 2:灰度; 3:颜色;4:渐变
|
||||
json.insert("speed", spinBoxLineSpeed->value());
|
||||
if(radioButtonRed->isChecked())
|
||||
json.insert("color", "#FFFF0000");
|
||||
else if(radioButtonGreen->isChecked())
|
||||
json.insert("color", "#FF00FF00");
|
||||
else if(radioButtonBlue->isChecked())
|
||||
json.insert("color", "#FF0000FF");
|
||||
else
|
||||
json.insert("color", "#FFFFFFFF");
|
||||
|
||||
if(radioButtonRed->isChecked()) json.insert("color", "#FFFF0000");
|
||||
else if(radioButtonGreen->isChecked()) json.insert("color", "#FF00FF00");
|
||||
else if(radioButtonBlue->isChecked()) json.insert("color", "#FF0000FF");
|
||||
else json.insert("color", "#FFFFFFFF");
|
||||
json.insert("interval", spinBoxLineDistance->value());
|
||||
json.insert("horizonalLine", checkBoxHorizontal->isChecked());
|
||||
json.insert("verticalLine", checkBoxVertical->isChecked());
|
||||
|
@ -314,15 +309,10 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
|
|||
json.insert("_type", "TestScreen");
|
||||
json.insert("mode", 2);// 0:停止; 1:斜线; 2:灰度; 3:颜色;4:渐变
|
||||
json.insert("speed", spinBoxGraySpeed->value());
|
||||
// qDebug()<<"speed="<<spinBoxGraySpeed->value();
|
||||
if(radioButtonRed->isChecked())
|
||||
json.insert("color", "#FFFF0000");
|
||||
else if(radioButtonGreen->isChecked())
|
||||
json.insert("color", "#FF00FF00");
|
||||
else if(radioButtonBlue->isChecked())
|
||||
json.insert("color", "#FF0000FF");
|
||||
else
|
||||
json.insert("color", "#FFFFFFFF");
|
||||
if(radioButtonRed->isChecked()) json.insert("color", "#FFFF0000");
|
||||
else if(radioButtonGreen->isChecked()) json.insert("color", "#FF00FF00");
|
||||
else if(radioButtonBlue->isChecked()) json.insert("color", "#FF0000FF");
|
||||
else json.insert("color", "#FFFFFFFF");
|
||||
json.insert("interval", spinBoxLineDistance->value());
|
||||
json.insert("horizonalLine", checkBoxHorizontal->isChecked());
|
||||
json.insert("verticalLine", checkBoxVertical->isChecked());
|
||||
|
@ -336,9 +326,9 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
|
|||
if(gSelCards.count() == 1) {
|
||||
auto waitingDlg = new WaitingDlg(this, tr("StartTest")+" ...");
|
||||
Def_CtrlReqPre
|
||||
connect(reply, &QNetworkReply::finished, this, [=] {
|
||||
Def_CtrlSetReqAfter
|
||||
});
|
||||
connect(reply, &QNetworkReply::finished, this, [=] {
|
||||
Def_CtrlSetReqAfter
|
||||
});
|
||||
} else {
|
||||
foreach(auto card, gSelCards) {
|
||||
Def_CtrlSetMulti(tr("StartTest"))
|
||||
|
@ -353,20 +343,12 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
|
|||
QJsonObject json;
|
||||
json.insert("_id", "TestScreen");
|
||||
json.insert("_type", "TestScreen");
|
||||
if(checkBoxGradient->isChecked())
|
||||
json.insert("mode", 4);// 0:停止; 1:斜线; 2:灰度; 3:颜色;4:渐变
|
||||
else
|
||||
json.insert("mode", 3);// 0:停止; 1:斜线; 2:灰度; 3:颜色;4:渐变
|
||||
json.insert("mode", checkBoxGradient->isChecked() ? 4 : 3);// 0:停止; 1:斜线; 2:灰度; 3:颜色;4:渐变
|
||||
json.insert("speed", spinBoxLineSpeed->value());
|
||||
if(radioButton_red->isChecked())
|
||||
json.insert("color", "#FFFF0000");
|
||||
else if(radioButton_Green->isChecked())
|
||||
json.insert("color", "#FF00FF00");
|
||||
else if(radioButton_Blue->isChecked())
|
||||
json.insert("color", "#FF0000FF");
|
||||
else
|
||||
json.insert("color", "#FFFFFFFF");
|
||||
|
||||
if(radioButton_red->isChecked()) json.insert("color", "#FFFF0000");
|
||||
else if(radioButton_Green->isChecked()) json.insert("color", "#FF00FF00");
|
||||
else if(radioButton_Blue->isChecked()) json.insert("color", "#FF0000FF");
|
||||
else json.insert("color", "#FFFFFFFF");
|
||||
json.insert("interval", spinBoxLineDistance->value());
|
||||
json.insert("horizonalLine", checkBoxHorizontal->isChecked());
|
||||
json.insert("verticalLine", checkBoxVertical->isChecked());
|
||||
|
@ -412,7 +394,7 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
|
|||
});
|
||||
connect(pushButton_11, &QPushButton::clicked, this, [=] {
|
||||
lineEdit->clear();
|
||||
pushButton_13->setEnabled(false);
|
||||
btnAnycast->setEnabled(false);
|
||||
});
|
||||
connect(pushButton_12, &QPushButton::clicked, this, [=] {
|
||||
if(gSelCards.isEmpty()) {
|
||||
|
@ -425,9 +407,9 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
|
|||
foreach(auto card, gSelCards) SendAnycastCmd(card, iIndex, false);
|
||||
}
|
||||
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()) {
|
||||
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
|
||||
return;
|
||||
|
@ -436,10 +418,10 @@ CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) {
|
|||
if(gSelCards.count()==1) SendAnycastCmd(gSelCards[0], iIndex, true);
|
||||
else foreach(auto card, gSelCards) SendAnycastCmd(card, iIndex, false);
|
||||
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));
|
||||
|
||||
|
@ -488,7 +470,7 @@ void CtrlTestPanel::transUi() {
|
|||
pushButtonStopTest->setText(tr("Stop"));
|
||||
pushButton_11->setText(tr("Clear"));
|
||||
pushButton_12->setText(tr("Reset"));
|
||||
pushButton_13->setText(tr("Anycast"));
|
||||
btnAnycast->setText(tr("Anycast"));
|
||||
}
|
||||
|
||||
void CtrlTestPanel::SendAnycastCmd(LedCard card, int iProgramIndex, bool isSingle) {
|
||||
|
|
|
@ -62,7 +62,7 @@ private:
|
|||
QLineEdit *lineEdit;
|
||||
QPushButton *pushButton_11;
|
||||
QPushButton *pushButton_12;
|
||||
QPushButton *pushButton_13;
|
||||
QPushButton *btnAnycast;
|
||||
};
|
||||
|
||||
#endif // CTRLTESTPANEL_H
|
||||
|
|
|
@ -127,7 +127,7 @@ void DeviceCtrlPanel::hideEvent(QHideEvent *event) {
|
|||
mDevWgt->mDeviceTable->setSelectionMode(QAbstractItemView::NoSelection);
|
||||
}
|
||||
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_NetCfg)->setText(tr("Net Config"));
|
||||
mBtnGrp->button(Setting_VerifyClock)->setText(tr("Time Sync"));
|
||||
|
|
|
@ -128,18 +128,20 @@ void DeviceItem::DeviceItemHttpPost() {
|
|||
if(! androidVersion.isEmpty()) mCard.androidVersion = androidVersion;
|
||||
});
|
||||
|
||||
json = QJsonObject();
|
||||
json.insert("_id", "GetScreenSize");
|
||||
json.insert("_type", "GetScreenSize");
|
||||
reply = NetReq("http://"+mCard.ip+":2016/settings").timeout(120000).post(json);
|
||||
connect(reply, &QNetworkReply::finished, this, [=] {
|
||||
QJsonDocument json;
|
||||
QString err = checkReplyForJson(reply, &json);
|
||||
if(! err.isEmpty()) return;
|
||||
mCard.mWidth = json["width"].toInt();
|
||||
mCard.mHeight = json["height"].toInt();
|
||||
setData(DeviceTable_ScreenSize, 0, QString("%1 x %2").arg(mCard.mWidth).arg(mCard.mHeight));
|
||||
});
|
||||
if(mCard.mWidth==0 || mCard.mHeight==0) {
|
||||
json = QJsonObject();
|
||||
json.insert("_id", "GetScreenSize");
|
||||
json.insert("_type", "GetScreenSize");
|
||||
reply = NetReq("http://"+mCard.ip+":2016/settings").timeout(120000).post(json);
|
||||
connect(reply, &QNetworkReply::finished, this, [=] {
|
||||
QJsonDocument json;
|
||||
QString err = checkReplyForJson(reply, &json);
|
||||
if(! err.isEmpty()) return;
|
||||
mCard.mWidth = json["width"].toInt();
|
||||
mCard.mHeight = json["height"].toInt();
|
||||
setData(DeviceTable_ScreenSize, 0, QString("%1 x %2").arg(mCard.mWidth).arg(mCard.mHeight));
|
||||
});
|
||||
}
|
||||
|
||||
json = QJsonObject();
|
||||
json.insert("_id", "GetBrightness");
|
||||
|
|
|
@ -23,8 +23,8 @@ void setCard(LedCard &card, const QString &addr, const QJsonDocument &json) {
|
|||
card.ip = json["newIp"].toString();
|
||||
if(card.ip.isEmpty()) card.ip = json["ip"].toString();
|
||||
}
|
||||
card.mWidth = json["width"].toInt();
|
||||
card.mHeight = json["height"].toInt();
|
||||
if(card.mWidth==0) card.mWidth = json["width"].toInt();
|
||||
if(card.mHeight==0) card.mHeight = json["height"].toInt();
|
||||
card.androidVersion = json["androidVersion"].toString();
|
||||
}
|
||||
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_Remark, tr("Remark Name"));
|
||||
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_Password, tr("Security"));
|
||||
m_headerItem->setText(DeviceTable_Info, tr("More Info"));
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <QMessageBox>
|
||||
#include <QSerialPortInfo>
|
||||
#include <QEvent>
|
||||
#include <QButtonGroup>
|
||||
|
||||
mGuangYingPinWidget::mGuangYingPinWidget(QWidget *parent) : QWidget(parent) {
|
||||
setAutoFillBackground(true);
|
||||
|
@ -372,173 +373,25 @@ mGuangYingPinWidget::mGuangYingPinWidget(QWidget *parent) : QWidget(parent) {
|
|||
vBox->addWidget(line);
|
||||
|
||||
verticalLayout_4 = new QVBoxLayout();
|
||||
verticalLayout_4->setObjectName(QString::fromUtf8("verticalLayout_4"));
|
||||
horizontalLayout_14 = new QHBoxLayout();
|
||||
horizontalLayout_14->setObjectName(QString::fromUtf8("horizontalLayout_14"));
|
||||
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);
|
||||
|
||||
pushButton2 = new QPushButton;
|
||||
pushButton2->setObjectName(QString::fromUtf8("pushButton2"));
|
||||
pushButton2->setMinimumSize(QSize(40, 40));
|
||||
pushButton2->setMaximumSize(QSize(40, 40));
|
||||
|
||||
horizontalLayout_13->addWidget(pushButton2);
|
||||
|
||||
pushButton3 = new QPushButton;
|
||||
pushButton3->setObjectName(QString::fromUtf8("pushButton3"));
|
||||
pushButton3->setMinimumSize(QSize(40, 40));
|
||||
pushButton3->setMaximumSize(QSize(40, 40));
|
||||
|
||||
horizontalLayout_13->addWidget(pushButton3);
|
||||
|
||||
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);
|
||||
auto grid = new Grid(horizontalLayout_14);
|
||||
auto grp = new QButtonGroup(grid);
|
||||
for(int i=0; i<20; ++i) {
|
||||
auto btn = new QPushButton(QString::number(i+1));
|
||||
grp->addButton(btn, i+1);
|
||||
btn->setFixedSize(40, 40);
|
||||
btn->setProperty("ssType", "progManageTool");
|
||||
grid->addWidget(btn, i/5, i%5);
|
||||
}
|
||||
connect(grp, &QButtonGroup::idClicked, this, [=](int id) {
|
||||
if(groupBox_com->isChecked()) {
|
||||
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);
|
||||
});
|
||||
|
||||
line = new QFrame;
|
||||
line->setFrameShape(QFrame::VLine);
|
||||
|
@ -568,23 +421,25 @@ mGuangYingPinWidget::mGuangYingPinWidget(QWidget *parent) : QWidget(parent) {
|
|||
line->setFrameShadow(QFrame::Sunken);
|
||||
horizontalLayout_19->addWidget(line);
|
||||
|
||||
pushButtonPrevious = new QPushButton;
|
||||
auto pushButtonPrevious = new QPushButton;
|
||||
pushButtonPrevious->setMinimumSize(QSize(40, 40));
|
||||
pushButtonPrevious->setIconSize(QSize(32, 32));
|
||||
pushButtonPrevious->setFlat(true);
|
||||
horizontalLayout_19->addWidget(pushButtonPrevious);
|
||||
|
||||
pushButtonNext = new QPushButton;
|
||||
auto pushButtonNext = new QPushButton;
|
||||
pushButtonNext->setMinimumSize(QSize(40, 40));
|
||||
pushButtonNext->setIconSize(QSize(32, 32));
|
||||
pushButtonNext->setFlat(true);
|
||||
horizontalLayout_19->addWidget(pushButtonNext);
|
||||
|
||||
pushButtonLoop = new QPushButton;
|
||||
pushButtonLoop->setMinimumSize(QSize(40, 40));
|
||||
pushButtonLoop->setIconSize(QSize(32, 32));
|
||||
pushButtonLoop->setFlat(true);
|
||||
horizontalLayout_19->addWidget(pushButtonLoop);
|
||||
auto btnLoop = new QPushButton(QIcon(":/res/loop.png"), QString());
|
||||
btnLoop->setProperty("ssType", "progManageTool");
|
||||
btnLoop->setMinimumSize(QSize(40, 40));
|
||||
btnLoop->setIconSize(QSize(32, 32));
|
||||
btnLoop->setFlat(true);
|
||||
grp->addButton(btnLoop, 0);
|
||||
horizontalLayout_19->addWidget(btnLoop);
|
||||
|
||||
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"));
|
||||
label_DelayMill->setText(tr("Delay millsecond"));
|
||||
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"));
|
||||
pushButtonSend->setText(tr("Send"));
|
||||
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");
|
||||
pushButtonPrevious->setProperty("ssType", "progManageTool");
|
||||
pushButtonPrevious->setIcon(QIcon(":/res/previous.png"));
|
||||
pushButtonNext->setProperty("ssType", "progManageTool");
|
||||
pushButtonNext->setIcon(QIcon(":/res/next.png"));
|
||||
pushButtonLoop->setProperty("ssType", "progManageTool");
|
||||
pushButtonLoop->setIcon(QIcon(":/res/loop.png"));
|
||||
|
||||
pushButtonMainOpen->setProperty("ssType", "progManageTool");
|
||||
pushButtonAuxOpen->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(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(pushButtonSend, SIGNAL(clicked()), this, SLOT(OnAnsyProgramCustom()));
|
||||
connect(pushButtonNext, SIGNAL(clicked()), this, SLOT(OnAnsyProgramNext()));
|
||||
connect(pushButtonPrevious, SIGNAL(clicked()), this, SLOT(OnAnsyProgramPrevious()));
|
||||
connect(pushButtonLoop, SIGNAL(clicked()), this, SLOT(OnAnsyProgramLoop()));
|
||||
connect(pushButtonBrightnessSet, SIGNAL(clicked()), this, SLOT(OnBrightnessSet()));
|
||||
connect(pushButtonScreenOn, SIGNAL(clicked()), this, SLOT(OnScreenOn()));
|
||||
connect(pushButtonScreenOff, SIGNAL(clicked()), this, SLOT(OnScreenOff()));
|
||||
|
@ -867,122 +660,62 @@ mGuangYingPinWidget::mGuangYingPinWidget(QWidget *parent) : QWidget(parent) {
|
|||
|
||||
void mGuangYingPinWidget::changeEvent(QEvent *event) {
|
||||
QWidget::changeEvent(event);
|
||||
if(event->type() == QEvent::LanguageChange) {
|
||||
pushButtonSend->setText(tr("Send"));
|
||||
pushButtonMainOpen->setText(tr("Open"));
|
||||
pushButtonAuxOpen->setText(tr("Open"));
|
||||
pushButtonBrightnessSet->setText(tr("Set"));
|
||||
pushButtonScreenOn->setText(tr("Screen On"));
|
||||
pushButtonScreenOff->setText(tr("Screen Off"));
|
||||
pushButtonRefresh->setText(tr("Refresh"));
|
||||
groupBoxMain->setTitle(tr("Main"));
|
||||
groupBoxAux->setTitle(tr("Auxiliary"));
|
||||
groupBoxParam->setTitle(tr("Param configuration"));
|
||||
label_PortName->setText(tr("PortName"));
|
||||
label_BaudRate->setText(tr("BaudRate"));
|
||||
label_DataBit->setText(tr("DataBit"));
|
||||
label_OEBit->setText(tr("OEBit"));
|
||||
label_StopBit->setText(tr("StopBit"));
|
||||
label_PortNameAux->setText(tr("PortName"));
|
||||
label_BaudRateAux->setText(tr("BaudRate"));
|
||||
label_DataBitAux->setText(tr("DataBit"));
|
||||
label_OEBitAux->setText(tr("OEBit"));
|
||||
label_StopBitAux->setText(tr("StopBit"));
|
||||
if(event->type() == QEvent::LanguageChange) transUi();
|
||||
}
|
||||
void mGuangYingPinWidget::transUi() {
|
||||
pushButtonSend->setText(tr("Send"));
|
||||
pushButtonMainOpen->setText(tr("Open"));
|
||||
pushButtonAuxOpen->setText(tr("Open"));
|
||||
pushButtonBrightnessSet->setText(tr("Set"));
|
||||
pushButtonScreenOn->setText(tr("Screen On"));
|
||||
pushButtonScreenOff->setText(tr("Screen Off"));
|
||||
pushButtonRefresh->setText(tr("Refresh"));
|
||||
groupBoxMain->setTitle(tr("Main"));
|
||||
groupBoxAux->setTitle(tr("Auxiliary"));
|
||||
groupBoxParam->setTitle(tr("Param configuration"));
|
||||
label_PortName->setText(tr("PortName"));
|
||||
label_BaudRate->setText(tr("BaudRate"));
|
||||
label_DataBit->setText(tr("DataBit"));
|
||||
label_OEBit->setText(tr("OEBit"));
|
||||
label_StopBit->setText(tr("StopBit"));
|
||||
label_PortNameAux->setText(tr("PortName"));
|
||||
label_BaudRateAux->setText(tr("BaudRate"));
|
||||
label_DataBitAux->setText(tr("DataBit"));
|
||||
label_OEBitAux->setText(tr("OEBit"));
|
||||
label_StopBitAux->setText(tr("StopBit"));
|
||||
|
||||
label_ResendTimes->setText(tr("Resend times"));
|
||||
label_DelayMill->setText(tr("Delay millsecond"));
|
||||
label_ProgramNum->setText(tr("Program number"));
|
||||
label_BrightNess->setText(tr("Brightness"));
|
||||
label_ComStatus->setText(tr("State:Off"));
|
||||
label_ComStatusAux->setText(tr("State:Off"));
|
||||
pushButtonClearLog->setText(tr("Clear"));
|
||||
checkBoxDebug->setText(tr("Debug"));
|
||||
groupBox_Network->setTitle(tr("Network"));
|
||||
groupBox_com->setTitle(tr("Com"));
|
||||
}
|
||||
label_ResendTimes->setText(tr("Resend times"));
|
||||
label_DelayMill->setText(tr("Delay millsecond"));
|
||||
label_ProgramNum->setText(tr("Program number"));
|
||||
label_BrightNess->setText(tr("Brightness"));
|
||||
label_ComStatus->setText(tr("State:Off"));
|
||||
label_ComStatusAux->setText(tr("State:Off"));
|
||||
pushButtonClearLog->setText(tr("Clear"));
|
||||
checkBoxDebug->setText(tr("Debug"));
|
||||
groupBox_Network->setTitle(tr("Network"));
|
||||
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)
|
||||
{
|
||||
textEditReadBuf->clear();
|
||||
}
|
||||
void mGuangYingPinWidget::OnAnsyProgramCustom(void)
|
||||
{
|
||||
int itemp=spinBox_ProgramIndex->value();
|
||||
MACRO_ANSY_PROGRAM(itemp)
|
||||
|
||||
if(checkBoxDebug->isChecked())
|
||||
{
|
||||
textEditReadBuf->append("OnAnsyProgramCustom");
|
||||
int id = spinBox_ProgramIndex->value();
|
||||
if(groupBox_com->isChecked()) {
|
||||
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);
|
||||
if(checkBoxDebug->isChecked()) textEditReadBuf->append("OnAnsyProgramCustom");
|
||||
}
|
||||
void mGuangYingPinWidget::OnAnsyProgramCustomByChanged(int icurIndex)
|
||||
{
|
||||
MACRO_ANSY_PROGRAM(icurIndex)
|
||||
void mGuangYingPinWidget::OnAnsyProgramCustomByChanged(int id) {
|
||||
if(groupBox_com->isChecked()) {
|
||||
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)
|
||||
{
|
||||
|
@ -996,25 +729,13 @@ void mGuangYingPinWidget::OnAnsyProgramNext(void)
|
|||
{
|
||||
spinBox_ProgramIndex->setValue(spinBox_ProgramIndex->value()+1);
|
||||
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)
|
||||
{
|
||||
spinBox_ProgramIndex->setValue(spinBox_ProgramIndex->value()-1);
|
||||
OnAnsyProgramCustom();
|
||||
// int itemp=spinBox_ProgramIndex->value();
|
||||
// MACRO_ANSY_PROGRAM(itemp)
|
||||
}
|
||||
void mGuangYingPinWidget::OnAnsyProgramLoop(void)
|
||||
{
|
||||
MACRO_ANSY_PROGRAM(0)
|
||||
}
|
||||
|
||||
void mGuangYingPinWidget::OnBrightnessSet(void)
|
||||
{
|
||||
if(groupBox_com->isChecked())
|
||||
|
|
|
@ -19,13 +19,6 @@
|
|||
#include <QtWidgets/QTextEdit>
|
||||
#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 {
|
||||
public:
|
||||
TA_SerialThread();
|
||||
|
@ -63,31 +56,10 @@ public slots:
|
|||
void MWReadDataAux(void);
|
||||
void MWClearRecv(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 OnAnsyProgramCustom(void);
|
||||
void OnAnsyProgramNext(void);
|
||||
void OnAnsyProgramPrevious(void);
|
||||
void OnAnsyProgramLoop(void);
|
||||
void OnBrightnessSet(void);
|
||||
void OnScreenOn(void);
|
||||
void OnScreenOff(void);
|
||||
|
@ -177,40 +149,12 @@ private:
|
|||
QSpacerItem *horizontalSpacer_2;
|
||||
QVBoxLayout *verticalLayout_4;
|
||||
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;
|
||||
QHBoxLayout *horizontalLayout_19;
|
||||
QLabel *label_ProgramNum;
|
||||
QSpinBox *spinBox_ProgramIndex;
|
||||
QPushButton *pushButtonSend;
|
||||
QPushButton *pushButtonPrevious;
|
||||
QPushButton *pushButtonNext;
|
||||
QPushButton *pushButtonLoop;
|
||||
QSpacerItem *horizontalSpacer_7;
|
||||
QHBoxLayout *horizontalLayout_21;
|
||||
QLabel *label_BrightNess;
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -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
|
|
@ -363,7 +363,7 @@ QWidget* EText::attrWgt() {
|
|||
if(filePath.isEmpty()) return;
|
||||
QFile file(filePath);
|
||||
if(! file.open(QFile::ReadOnly)) {
|
||||
QMessageBox::critical(wgtAttr, tr("Fail"), tr("File Open Fail"));
|
||||
QMessageBox::critical(wgtAttr, tr("Fail"), tr("File Open Failed"));
|
||||
return;
|
||||
}
|
||||
auto data = file.readAll();
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 27 KiB |
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
Loading…
Reference in New Issue
Block a user