This commit is contained in:
Gangphon 2024-07-03 18:32:38 +08:00
parent 10aa14fab4
commit cd2f566bcd
10 changed files with 3586 additions and 3586 deletions

View File

@ -27,7 +27,7 @@ CONFIG += embed_translations
# You can also select to disable deprecated APIs only up to a certain version of Qt. # You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
VERSION = 2.0.0 VERSION = 2.0.1
DEFINES += APP_VERSION=\\\"$$VERSION\\\" DEFINES += APP_VERSION=\\\"$$VERSION\\\"
msvc { msvc {
contains(QT_ARCH, i386) { contains(QT_ARCH, i386) {

View File

@ -60,9 +60,9 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdScreenHeight->setMaximumWidth(60); fdScreenHeight->setMaximumWidth(60);
hBox->addWidget(fdScreenHeight); hBox->addWidget(fdScreenHeight);
btnScreenSet = new QPushButton; auto btn = new QPushButton;
btnScreenSet->setProperty("ssType", "progManageTool"); btnSets.push_back(btn);
connect(btnScreenSet, &QPushButton::clicked, this, [this] { connect(btn, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) { if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return; return;
@ -106,7 +106,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnScreenSet); hBox->addWidget(btn);
hBox->addSpacing(20); hBox->addSpacing(20);
@ -117,9 +117,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdAlias->setMaximumWidth(200); fdAlias->setMaximumWidth(200);
hBox->addWidget(fdAlias); hBox->addWidget(fdAlias);
btnAliasSet = new QPushButton; btnSets.push_back(btn = new QPushButton);
btnAliasSet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [this] {
connect(btnAliasSet, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) { if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return; return;
@ -156,7 +155,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnAliasSet); hBox->addWidget(btn);
hBox->addStretch(); hBox->addStretch();
@ -183,9 +182,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdCompanyId->setFixedWidth(100); fdCompanyId->setFixedWidth(100);
hBox->addWidget(fdCompanyId); hBox->addWidget(fdCompanyId);
btnWebServerSet = new QPushButton; btnSets.push_back(btn = new QPushButton);
btnWebServerSet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [this] {
connect(btnWebServerSet, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) { if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return; return;
@ -211,7 +209,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnWebServerSet); hBox->addWidget(btn);
hBox->addStretch(); hBox->addStretch();
@ -224,9 +222,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdRealtimeServer->setEditable(true); fdRealtimeServer->setEditable(true);
hBox->addWidget(fdRealtimeServer); hBox->addWidget(fdRealtimeServer);
btnRealtimeServerSet = new QPushButton; btnSets.push_back(btn = new QPushButton);
btnRealtimeServerSet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [this] {
connect(btnRealtimeServerSet, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) { if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return; return;
@ -247,7 +244,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnRealtimeServerSet); hBox->addWidget(btn);
btnRealtimeClear = new QPushButton; btnRealtimeClear = new QPushButton;
btnRealtimeClear->setProperty("ssType", "progManageTool"); btnRealtimeClear->setProperty("ssType", "progManageTool");
@ -948,9 +945,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdRebootTime->setMaximumWidth(60); fdRebootTime->setMaximumWidth(60);
hBox->addWidget(fdRebootTime); hBox->addWidget(fdRebootTime);
btnTimingRebootSet = new QPushButton; btnSets.push_back(btn = new QPushButton);
btnTimingRebootSet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [=] {
connect(btnTimingRebootSet, &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;
@ -971,11 +967,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnTimingRebootSet); hBox->addWidget(btn);
btnTimingRebootGet = new QPushButton; btnGets.push_back(btn = new QPushButton);
btnTimingRebootGet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [=] {
connect(btnTimingRebootGet, &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;
@ -1004,7 +999,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnTimingRebootGet); hBox->addWidget(btn);
hBox->addStretch(); hBox->addStretch();
@ -1085,9 +1080,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdDisMode->addItem("Part", 2); fdDisMode->addItem("Part", 2);
hBox->addWidget(fdDisMode); hBox->addWidget(fdDisMode);
btnDisModeSet = new QPushButton; btnSets.push_back(btn = new QPushButton);
btnDisModeSet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [=] {
connect(btnDisModeSet, &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;
@ -1108,11 +1102,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnDisModeSet); hBox->addWidget(btn);
btnDisModeGet = new QPushButton; btnGets.push_back(btn = new QPushButton);
btnDisModeGet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [=] {
connect(btnDisModeGet, &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;
@ -1146,7 +1139,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnDisModeGet); hBox->addWidget(btn);
hBox->addSpacing(40); hBox->addSpacing(40);
lbScreenPos = new QLabel; lbScreenPos = new QLabel;
@ -1163,9 +1156,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdScreenOff->setRange(-9999, 99999); fdScreenOff->setRange(-9999, 99999);
hBox->addWidget(fdScreenOff); hBox->addWidget(fdScreenOff);
btnScreenOffSet = new QPushButton; btnSets.push_back(btn = new QPushButton);
btnScreenOffSet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [=] {
connect(btnScreenOffSet, &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;
@ -1187,11 +1179,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnScreenOffSet); hBox->addWidget(btn);
btnScreenOffGet = new QPushButton; btnGets.push_back(btn = new QPushButton);
btnScreenOffGet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [=] {
connect(btnScreenOffGet, &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;
@ -1223,9 +1214,105 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnScreenOffGet); hBox->addWidget(btn);
hBox->addStretch(); hBox->addStretch();
{
hBox = new HBox(vBox);
lbCameraDis = new QLabel;
hBox->addWidget(lbCameraDis);
auto edCameraDisMin = new QSpinBox;
edCameraDisMin->setRange(0, 99999);
hBox->addWidget(edCameraDisMin);
hBox->addLabel("~");
auto edCameraDisMax = new QSpinBox;
edCameraDisMax->setRange(0, 99999);
hBox->addWidget(edCameraDisMax);
hBox->addLabel("mm");
btnSets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [=] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
}
JObj json;
json.insert("_id", "SetCameraRange");
json.insert("_type", "SetCameraRange");
json.insert("min", edCameraDisMin->value());
json.insert("max", edCameraDisMax->value());
json.insert("zVer", "xixun1");
if(gSelCards.count() == 1) {
WaitingDlg waitingDlg(this, tr("Setting Camera Range")+" ...");
waitingDlg.showLater();
auto card = gSelCards[0];
TcpSocket tcp;
tcp.connectToHost(card.ip, 3333);
if(! tcp.waitForConnected(10000)) {
tcp.close();
if(! waitingDlg.isVisible()) return;
waitingDlg.close();
QMessageBox::critical(this, tr("Error"), QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at WaitConnected");
return;
}
auto resNum = tcp.write(JToBytes(json));
tcp.flush();
if(resNum == -1 || ! tcp.waitForBytesWritten(10000)) {
tcp.close();
if(! waitingDlg.isVisible()) return;
waitingDlg.close();
QMessageBox::critical(this, tr("Error"), QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at write");
return;
}
if(! tcp.waitForReadyRead(10000)) {
tcp.close();
if(! waitingDlg.isVisible()) return;
waitingDlg.close();
QMessageBox::critical(this, tr("Error"), QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at WaitForReadyRead");
return;
}
tcp.readAll();
tcp.close();
waitingDlg.success();
} else {
for(auto &card : gSelCards) {
auto tcp = new TcpSocket;
auto cardId = card.id;
connect(tcp, &QTcpSocket::connected, tcp, [=] {
tcp->stopTimer();
tcp->write(JToBytes(json));
tcp->startTimer(10000);
});
connect(tcp, &QTcpSocket::readyRead, tcp, [=] {
tcp->stopTimer();
auto resp = tcp->readAll();
tcp->close();
tcp->deleteLater();
QString error;
auto json = JFrom(resp, &error);
if(! error.isEmpty()) {
gFdResInfo->append(cardId+" "+tr("Set Camera Range")+" "+error);
return;
}
gFdResInfo->append(cardId+" "+tr("Set Camera Range")+" "+tr("Success"));
});
connect(tcp, &QTcpSocket::errorOccurred, tcp, [=](QAbstractSocket::SocketError err) {
tcp->close();
tcp->deleteLater();
gFdResInfo->append(cardId+" "+tr("Set Camera Range")+" "+socketErrKey(err)+" ("+QString::number(err)+") "+tcp->errorString());
});
tcp->connectToHost(card.ip, 3333);
tcp->startTimer(10000);
}
}
});
hBox->addWidget(btn);
hBox->addStretch();
}
hBox = new HBox(vBox); hBox = new HBox(vBox);
btnLedSet = new QPushButton; btnLedSet = new QPushButton;
@ -1402,9 +1489,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdTopLevelLH = new QRadioButton; fdTopLevelLH = new QRadioButton;
hBox->addWidget(fdTopLevelLH); hBox->addWidget(fdTopLevelLH);
btnHighForBusySet = new QPushButton; btnSets.push_back(btn = new QPushButton);
btnHighForBusySet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [this] {
connect(btnHighForBusySet, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) { if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return; return;
@ -1425,7 +1511,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnHighForBusySet); hBox->addWidget(btn);
btnGetTopLevel = new QPushButton; btnGetTopLevel = new QPushButton;
btnGetTopLevel->setProperty("ssType", "progManageTool"); btnGetTopLevel->setProperty("ssType", "progManageTool");
@ -1478,9 +1564,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
hBox->addWidget(fdMinBright); hBox->addWidget(fdMinBright);
hBox->addWidget(new QLabel("%")); hBox->addWidget(new QLabel("%"));
btnMinBrightSet = new QPushButton; btnSets.push_back(btn = new QPushButton);
btnMinBrightSet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [this] {
connect(btnMinBrightSet, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) { if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return; return;
@ -1501,11 +1586,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnMinBrightSet); hBox->addWidget(btn);
btnMinBrightGet = new QPushButton(); btnGets.push_back(btn = new QPushButton);
btnMinBrightGet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [this] {
connect(btnMinBrightGet, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) { if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return; return;
@ -1542,7 +1626,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnMinBrightGet); hBox->addWidget(btn);
hBox->addSpacing(10); hBox->addSpacing(10);
@ -1555,9 +1639,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
hBox->addWidget(fdMaxBright); hBox->addWidget(fdMaxBright);
hBox->addWidget(new QLabel("%")); hBox->addWidget(new QLabel("%"));
btnMaxBrightSet = new QPushButton; btnSets.push_back(btn = new QPushButton);
btnMaxBrightSet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [this] {
connect(btnMaxBrightSet, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) { if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return; return;
@ -1578,11 +1661,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnMaxBrightSet); hBox->addWidget(btn);
btnMaxBrightGet = new QPushButton; btnGets.push_back(btn = new QPushButton);
btnMaxBrightGet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [this] {
connect(btnMaxBrightGet, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) { if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return; return;
@ -1619,7 +1701,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnMaxBrightGet); hBox->addWidget(btn);
hBox->addStretch(); hBox->addStretch();
vBox->addWidget(grpMinMaxBrightness); vBox->addWidget(grpMinMaxBrightness);
@ -2053,9 +2135,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
btnGrp->addButton(fdDeg180, 2); btnGrp->addButton(fdDeg180, 2);
btnGrp->addButton(fdDeg270, 3); btnGrp->addButton(fdDeg270, 3);
btnRotateSet = new QPushButton; btnSets.push_back(btn = new QPushButton);
btnRotateSet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [=] {
connect(btnRotateSet, &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;
@ -2077,11 +2158,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnRotateSet); hBox->addWidget(btn);
btnRotateGet = new QPushButton; btnGets.push_back(btn = new QPushButton);
btnRotateGet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [=] {
connect(btnRotateGet, &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;
@ -2114,8 +2194,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnRotateGet); hBox->addWidget(btn);
hBox->addStretch(); hBox->addStretch();
@ -2128,9 +2207,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdChargingStation->setMaximumWidth(120); fdChargingStation->setMaximumWidth(120);
hBox->addWidget(fdChargingStation); hBox->addWidget(fdChargingStation);
btnChargingStationSet = new QPushButton; btnSets.push_back(btn = new QPushButton);
btnChargingStationSet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [=] {
connect(btnChargingStationSet, &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;
@ -2151,7 +2229,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnChargingStationSet); hBox->addWidget(btn);
hBox->addStretch(); hBox->addStretch();
@ -2223,9 +2301,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdBaud->setMaximumWidth(70); fdBaud->setMaximumWidth(70);
hBox->addWidget(fdBaud); hBox->addWidget(fdBaud);
btnBaudSet = new QPushButton; btnSets.push_back(btn = new QPushButton);
btnBaudSet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [this, fdUart, fdBaud] {
connect(btnBaudSet, &QPushButton::clicked, this, [this, fdUart, fdBaud] {
if(gSelCards.isEmpty()) { if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return; return;
@ -2247,11 +2324,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnBaudSet); hBox->addWidget(btn);
btnBaudGet = new QPushButton; btnGets.push_back(btn = new QPushButton);
btnBaudGet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [this, fdUart, fdBaud] {
connect(btnBaudGet, &QPushButton::clicked, this, [this, fdUart, fdBaud] {
if(gSelCards.isEmpty()) { if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return; return;
@ -2280,7 +2356,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnBaudGet); hBox->addWidget(btn);
hBox->addStretch(); hBox->addStretch();
@ -2415,9 +2491,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdTraficProtocol->addItem("三思协议", 1); fdTraficProtocol->addItem("三思协议", 1);
hBox->addWidget(fdTraficProtocol); hBox->addWidget(fdTraficProtocol);
btnTraficProtSet = new QPushButton; btnSets.push_back(btn = new QPushButton);
btnTraficProtSet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [this, fdTraficProtocol] {
connect(btnTraficProtSet, &QPushButton::clicked, this, [this, fdTraficProtocol] {
if(gSelCards.isEmpty()) { if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return; return;
@ -2438,11 +2513,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnTraficProtSet); hBox->addWidget(btn);
btnTraficProtGet = new QPushButton; btnGets.push_back(btn = new QPushButton);
btnTraficProtGet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [this, fdTraficProtocol] {
connect(btnTraficProtGet, &QPushButton::clicked, this, [this, fdTraficProtocol] {
if(gSelCards.isEmpty()) { if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return; return;
@ -2476,7 +2550,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnTraficProtGet); hBox->addWidget(btn);
hBox->addStretch(); hBox->addStretch();
hBox = new HBox(vBox); hBox = new HBox(vBox);
@ -2501,9 +2575,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdPort->setValue(5000); fdPort->setValue(5000);
hBox->addWidget(fdPort); hBox->addWidget(fdPort);
btnTraficSet = new QPushButton; btnSets.push_back(btn = new QPushButton);
btnTraficSet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [=] {
connect(btnTraficSet, &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;
@ -2525,11 +2598,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnTraficSet); hBox->addWidget(btn);
btnTraficGet = new QPushButton; btnGets.push_back(btn = new QPushButton);
btnTraficGet->setProperty("ssType", "progManageTool"); connect(btn, &QPushButton::clicked, this, [=] {
connect(btnTraficGet, &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;
@ -2566,13 +2638,13 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
} }
} }
}); });
hBox->addWidget(btnTraficGet); hBox->addWidget(btn);
hBox->addStretch(); hBox->addStretch();
} }
vBox->addWidget(grpBoxHiddenSettings); vBox->addWidget(grpBoxHiddenSettings);
hBox = new HBox(vBox); hBox = new HBox(vBox);
auto btn = new QPushButton("List Card Infos"); btn = new QPushButton("List Card Infos");
btn->setProperty("ssType", "progManageTool"); btn->setProperty("ssType", "progManageTool");
connect(btn, &QPushButton::clicked, this, [this] { connect(btn, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) { if(gSelCards.isEmpty()) {
@ -2594,6 +2666,9 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
vBox->addStretch(); vBox->addStretch();
for(auto btn : btnSets) btn->setProperty("ssType", "progManageTool");
for(auto btn : btnGets) btn->setProperty("ssType", "progManageTool");
if(QSettings().value("advUiPs", "888").toString().isEmpty()) isPassed = true; if(QSettings().value("advUiPs", "888").toString().isEmpty()) isPassed = true;
connect(gDevicePanel, &DevicePanel::sigSelectedDeviceList, this, [this] { connect(gDevicePanel, &DevicePanel::sigSelectedDeviceList, this, [this] {
if(isVisible()) init(); if(isVisible()) init();
@ -2718,6 +2793,9 @@ void CtrlAdvancedPanel::changeEvent(QEvent *event) {
if(event->type() == QEvent::LanguageChange) transUi(); if(event->type() == QEvent::LanguageChange) transUi();
} }
void CtrlAdvancedPanel::transUi() { void CtrlAdvancedPanel::transUi() {
for(auto btn : btnSets) btn->setText(tr("Set"));
for(auto btn : btnGets) btn->setText(tr("Get"));
btnBindTaxiIc->setText(tr("Binding *.ic account indentity voucher")); btnBindTaxiIc->setText(tr("Binding *.ic account indentity voucher"));
btnGetTopLevel->setText(tr("Readback")); btnGetTopLevel->setText(tr("Readback"));
btnLedSet->setText(tr("Start LedSet4")); btnLedSet->setText(tr("Start LedSet4"));
@ -2733,26 +2811,18 @@ void CtrlAdvancedPanel::transUi() {
fdDisMode->setItemText(1, tr("Part")); fdDisMode->setItemText(1, tr("Part"));
btnY50Set->setText(tr("Set")); btnY50Set->setText(tr("Set"));
lbDisMode->setText(tr("Display Mode")); lbDisMode->setText(tr("Display Mode")+":");
btnDisModeSet->setText(tr("Set"));
btnDisModeGet->setText(tr("Get"));
lbScreenPos->setText(tr("Screen Position")); lbScreenPos->setText(tr("Screen Position")+":");
lbScreenOff->setText(tr("Offset")); lbScreenOff->setText(tr("Offset")+":");
btnScreenOffSet->setText(tr("Set"));
btnScreenOffGet->setText(tr("Get")); lbCameraDis->setText(tr("Camera Distance")+":");
btnAliasSet->setText(tr("Set"));
btnScreenSet->setText(tr("Set"));
btnHighForBusySet->setText(tr("Set"));
fdScreenHeight->setPlaceholderText(tr("Height")); fdScreenHeight->setPlaceholderText(tr("Height"));
fdScreenWidth->setPlaceholderText(tr("Width")); fdScreenWidth->setPlaceholderText(tr("Width"));
fdHighForBusy->setText(tr("Service:High Out of service:Low")); fdHighForBusy->setText(tr("Service:High Out of service:Low"));
fdTopLevelLH->setText(tr("Service:Low Out of service:High")); fdTopLevelLH->setText(tr("Service:Low Out of service:High"));
lbRotate->setText(tr("Rotate")); lbRotate->setText(tr("Rotate"));
btnRotateSet->setText(tr("Set"));
btnRotateGet->setText(tr("Get"));
btnChargingStationSet->setText(tr("Set"));
grpBoxHiddenSettings->setTitle(tr("Hidden Settings")+" ("+tr("Click right button to hide")+")"); grpBoxHiddenSettings->setTitle(tr("Hidden Settings")+" ("+tr("Click right button to hide")+")");
btnSysUpd->setText(tr("System Update")); btnSysUpd->setText(tr("System Update"));
@ -2761,8 +2831,6 @@ void CtrlAdvancedPanel::transUi() {
lbBaudModel->setText(tr("Model")); lbBaudModel->setText(tr("Model"));
lbUart->setText(tr("Uart")); lbUart->setText(tr("Uart"));
lbBaud->setText(tr("Baud")); lbBaud->setText(tr("Baud"));
btnBaudSet->setText(tr("Set"));
btnBaudGet->setText(tr("Get"));
fdIsOpenADB->setText(tr("Open ADB")); fdIsOpenADB->setText(tr("Open ADB"));
lbCustomJson->setText(tr("Post Custom JSON")); lbCustomJson->setText(tr("Post Custom JSON"));
btnSendCustomJson->setText(tr("Send")); btnSendCustomJson->setText(tr("Send"));
@ -2791,29 +2859,17 @@ void CtrlAdvancedPanel::transUi() {
btnPlayerBackClear->setText(tr("Clear player background")); btnPlayerBackClear->setText(tr("Clear player background"));
btnRealtimeClear->setText(tr("Clear")); btnRealtimeClear->setText(tr("Clear"));
btnMinBrightSet->setText(tr("Set"));
btnMinBrightGet->setText(tr("Readback"));
btnMaxBrightSet->setText(tr("Set"));
btnMaxBrightGet->setText(tr("Readback"));
btnRestart->setText(tr("Restart")); btnRestart->setText(tr("Restart"));
btnIsRunning->setText(tr("Running check")); btnIsRunning->setText(tr("Running check"));
btnRealtimeServerSet->setText(tr("Set"));
btnWebServerSet->setText(tr("Set"));
fdUninstall->setText(tr("Uninstall")); fdUninstall->setText(tr("Uninstall"));
lbTimingReboot->setText(tr("Timing Reboot")); lbTimingReboot->setText(tr("Timing Reboot"));
btnTimingRebootSet->setText(tr("Set"));
btnTimingRebootGet->setText(tr("Get"));
lbTraficProtocol->setText(tr("Protocol")); lbTraficProtocol->setText(tr("Protocol"));
lbCardMode->setText(tr("Card work mode")); lbCardMode->setText(tr("Card work mode"));
fdServerType->setItemText(0, tr("Server")); fdServerType->setItemText(0, tr("Server"));
fdServerType->setItemText(1, tr("Client")); fdServerType->setItemText(1, tr("Client"));
lbTraficPort->setText(tr("Port")); lbTraficPort->setText(tr("Port"));
btnTraficProtSet->setText(tr("Set"));
btnTraficProtGet->setText(tr("Get"));
btnTraficSet->setText(tr("Set"));
btnTraficGet->setText(tr("Get"));
} }
void messageHandler(QtMsgType type, const QMessageLogContext &, const QString &msg) { void messageHandler(QtMsgType type, const QMessageLogContext &, const QString &msg) {

View File

@ -27,25 +27,20 @@ protected:
void mouseReleaseEvent(QMouseEvent *) override; void mouseReleaseEvent(QMouseEvent *) override;
private: private:
bool isPassed{false}; std::vector<QPushButton *> btnSets, btnGets;
QLabel *lbTitle; QLabel *lbTitle;
QLabel *lbScreenWidth; QLabel *lbScreenWidth;
QLineEdit *fdScreenWidth; QLineEdit *fdScreenWidth;
QLabel *lbScreenHeight; QLabel *lbScreenHeight;
QLineEdit *fdScreenHeight; QLineEdit *fdScreenHeight;
QPushButton *btnScreenSet;
QLabel *lbAlias; QLabel *lbAlias;
QLineEdit *fdAlias; QLineEdit *fdAlias;
QPushButton *btnAliasSet;
QLabel *labelWebServer; QLabel *labelWebServer;
QComboBox *fdWebServerAddr; QComboBox *fdWebServerAddr;
QLabel *lbCompanyId; QLabel *lbCompanyId;
QLineEdit *fdCompanyId; QLineEdit *fdCompanyId;
QPushButton *btnWebServerSet;
QLabel *lbRealtime; QLabel *lbRealtime;
QComboBox *fdRealtimeServer; QComboBox *fdRealtimeServer;
QPushButton *btnRealtimeServerSet;
QPushButton *btnRealtimeClear; QPushButton *btnRealtimeClear;
QPushButton *btnWareUpdate; QPushButton *btnWareUpdate;
QLabel *lbWareTip; QLabel *lbWareTip;
@ -59,7 +54,6 @@ private:
QPushButton *btnSetBack, *btnPlayerBackSet, *btnPlayerBackClear; QPushButton *btnSetBack, *btnPlayerBackSet, *btnPlayerBackClear;
QLabel *lbTimingReboot; QLabel *lbTimingReboot;
QPushButton *btnTimingRebootSet, *btnTimingRebootGet;
QGroupBox *grpM80, *grpY50; QGroupBox *grpM80, *grpY50;
QComboBox *fdM80Resolu, *fdDisMode; QComboBox *fdM80Resolu, *fdDisMode;
@ -68,33 +62,23 @@ private:
QPushButton *btnM80Restore; QPushButton *btnM80Restore;
QLabel *lbDisMode; QLabel *lbDisMode;
QPushButton *btnDisModeSet, *btnDisModeGet;
QLabel *lbScreenPos, *lbScreenOff; QLabel *lbScreenPos, *lbScreenOff;
QPushButton *btnScreenOffSet, *btnScreenOffGet; QLabel *lbCameraDis;
QGroupBox *grpHighForBusy; QGroupBox *grpHighForBusy;
QRadioButton *fdHighForBusy; QRadioButton *fdHighForBusy;
QRadioButton *fdTopLevelLH; QRadioButton *fdTopLevelLH;
QPushButton *btnHighForBusySet;
QPushButton *btnGetTopLevel; QPushButton *btnGetTopLevel;
QPushButton *btnLedSet; QPushButton *btnLedSet;
QPushButton *btnReceCardsGet, *btnBindTaxiIc; QPushButton *btnReceCardsGet, *btnBindTaxiIc;
QGroupBox *grpMinMaxBrightness; QGroupBox *grpMinMaxBrightness;
QLabel *lbMinBright; QLabel *lbMinBright, *label_3;
QLineEdit *fdMinBright; QLineEdit *fdMinBright, *fdMaxBright;
QPushButton *btnMinBrightGet;
QPushButton *btnMinBrightSet;
QLabel *label_3;
QLineEdit *fdMaxBright;
QPushButton *btnMaxBrightGet;
QPushButton *btnMaxBrightSet;
QGroupBox *grpBoxHiddenSettings; QGroupBox *grpBoxHiddenSettings;
QPushButton *btnSysUpd, *btnMcuUpd, *btnMcuGet; QPushButton *btnSysUpd, *btnMcuUpd, *btnMcuGet;
QPushButton *btnRotateSet, *btnRotateGet, *btnChargingStationSet;
QLabel *lbRotate, *lbChargingStation, *lbBaudCfg, *lbBaudModel, *lbUart, *lbBaud; QLabel *lbRotate, *lbChargingStation, *lbBaudCfg, *lbBaudModel, *lbUart, *lbBaud;
QPushButton *btnBaudSet, *btnBaudGet;
QCheckBox *fdIsOpenADB; QCheckBox *fdIsOpenADB;
QLabel *lbCustomJson; QLabel *lbCustomJson;
QTextEdit *fdCustomJson; QTextEdit *fdCustomJson;
@ -102,7 +86,8 @@ private:
QLabel *lbTraficProtocol, *lbCardMode, *lbTraficPort; QLabel *lbTraficProtocol, *lbCardMode, *lbTraficPort;
QComboBox *fdServerType; QComboBox *fdServerType;
QPushButton *btnTraficProtSet, *btnTraficProtGet, *btnTraficSet, *btnTraficGet;
bool isPassed = false;
}; };
class PlayerBackSendThread : public QThread { class PlayerBackSendThread : public QThread {

View File

@ -120,11 +120,10 @@ PlayWin::PlayWin(int x, int y, int width, int height, QString dir, const JValue
src.view = lb; src.view = lb;
} }
} else if(src.type.startsWith("Environ")) { } else if(src.type.startsWith("Environ")) {
auto arrayPics = source["arrayPics"]; auto previewImg = source["previewImg"].toStr();
for(int i=(int)arrayPics.size()-1; i>=0; i--) if(arrayPics[i]["name"].toString() == "previewTmp") { if(! previewImg.isEmpty()) {
if(source["bSingleScroll"].toBool()) src.view = new EleScroll(box, dir+"/" + arrayPics[i]["id"].toString(), 'l', source["iScrollSpeed"].toDouble()); if(source["bSingleScroll"].toBool()) src.view = new EleScroll(box, dir+"/"+previewImg, 'l', source["iScrollSpeed"].toDouble());
else src.view = new EleScroll(box, dir+"/"+arrayPics[i]["id"].toString()); else src.view = new EleScroll(box, dir+"/"+previewImg);
break;
} }
} else if(src.type=="MultiPng" || src.type=="SplitText") { } else if(src.type=="MultiPng" || src.type=="SplitText") {
auto imgs = source["arrayPics"]; auto imgs = source["arrayPics"];

View File

@ -43,6 +43,14 @@ JObj EEnviron::genProg(const JValue &json, const QString &dstDir, const QString
for(auto &str : str0_9) Tools::saveImg(dstDir, metric, font, color, values, str, str); for(auto &str : str0_9) Tools::saveImg(dstDir, metric, font, color, values, str, str);
Tools::saveImg(dstDir, metric, font, color, values, ".", "."); Tools::saveImg(dstDir, metric, font, color, values, ".", ".");
Tools::saveImg(dstDir, metric, font, color, values, "-", "-"); Tools::saveImg(dstDir, metric, font, color, values, "-", "-");
Tools::saveImg(dstDir, metric, font, color, values, tr("N"), "N");
Tools::saveImg(dstDir, metric, font, color, values, tr("NE"), "NE");
Tools::saveImg(dstDir, metric, font, color, values, tr("E"), "E");
Tools::saveImg(dstDir, metric, font, color, values, tr("SE"), "SE");
Tools::saveImg(dstDir, metric, font, color, values, tr("S"), "S");
Tools::saveImg(dstDir, metric, font, color, values, tr("SW"), "SW");
Tools::saveImg(dstDir, metric, font, color, values, tr("W"), "W");
Tools::saveImg(dstDir, metric, font, color, values, tr("NW"), "NW");
res["values"] = values; res["values"] = values;
JArray oitems; JArray oitems;
@ -60,63 +68,13 @@ JObj EEnviron::genProg(const JValue &json, const QString &dstDir, const QString
oitem["unit"] = url; oitem["unit"] = url;
} }
res["items"] = oitems; res["items"] = oitems;
auto srcFile = srcPageDir+"/previewTmp.png";
res["以下字段用来兼容旧播放器"] = 0;
res["bTitle"] = ! title.isEmpty();
res["bgColor"] = Tools::color2Int(json["backColor"].toString());
res["bTemperature"] = items["temperature"]["has"];
res["bHumidity"] = items["humidity"]["has"];
res["bNoise"] = items["noise"]["has"];
res["bWindSpeed"] = items["windSpeed"]["has"];
res["bWindDirection"] = items["windDirection"]["has"];
res["bPM25"] = items["pm2.5"]["has"];
res["bPM10"] = items["pm10"]["has"];
JArray arrayPics;
for(auto &str : str0_9) Tools::saveImg2(dstDir, metric, font, color, arrayPics, str, str);
Tools::saveImg2(dstDir, metric, font, color, arrayPics, title, "labeltitle");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, items["temperature"]["label"].toString(), "labeltemperature");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, items["humidity"]["label"].toString(), "labelhumidity");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, items["noise"]["label"].toString(), "labelnoise");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, items["windSpeed"]["label"].toString(), "labelwindSpeed");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, items["windDirection"]["label"].toString(), "labelwindDirection");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, items["pm10"]["label"].toString(), "labelpm10");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, items["pm2.5"]["label"].toString(), "labelpm25");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, "", "unit_celsius");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, "", "unit_fahrenheit");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, "%", "unit_humidity");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, "dB", "unit_noise");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, "m/s", "unit_windspeed");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, "μg/m³", "unit_pm10");
arrayPics.append(arrayPics->back());
Tools::saveImg2(dstDir, metric, font, color, arrayPics, "-", "minus_sign");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, tr("N"), "N");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, tr("N")+tr("NE"), "NNE");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, tr("NE"), "NE");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, tr("E")+tr("NE"), "ENE");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, tr("E"), "E");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, tr("E")+tr("SE"), "ESE");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, tr("SE"), "SE");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, tr("S")+tr("SE"), "SSE");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, tr("S"), "S");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, tr("S")+tr("SW"), "SSW");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, tr("SW"), "SW");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, tr("W")+tr("SW"), "WSW");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, tr("W"), "W");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, tr("W")+tr("NW"), "WNW");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, tr("NW"), "NW");
Tools::saveImg2(dstDir, metric, font, color, arrayPics, tr("N")+tr("NW"), "NNW");
JObj arrayPic;
arrayPic["name"] = "previewTmp";
QString srcFile = srcPageDir+"/previewTmp.png";
QFile srcQFile(srcFile); QFile srcQFile(srcFile);
if(srcQFile.exists()) { if(srcQFile.exists()) {
QString id = Tools::fileMd5(srcFile); auto id = Tools::fileMd5(srcFile);
srcQFile.copy(dstDir+"/"+id); srcQFile.copy(dstDir+"/"+id);
arrayPic["id"] = id; res["previewImg"] = id;
} }
arrayPics.append(arrayPic);
res["arrayPics"] = arrayPics;
res["旧播放器兼容结束"] = 0;
} }
return res; return res;
} }

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

File diff suppressed because it is too large Load Diff