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.
#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\\\"
msvc {
contains(QT_ARCH, i386) {

View File

@ -60,9 +60,9 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdScreenHeight->setMaximumWidth(60);
hBox->addWidget(fdScreenHeight);
btnScreenSet = new QPushButton;
btnScreenSet->setProperty("ssType", "progManageTool");
connect(btnScreenSet, &QPushButton::clicked, this, [this] {
auto btn = new QPushButton;
btnSets.push_back(btn);
connect(btn, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -106,7 +106,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnScreenSet);
hBox->addWidget(btn);
hBox->addSpacing(20);
@ -117,9 +117,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdAlias->setMaximumWidth(200);
hBox->addWidget(fdAlias);
btnAliasSet = new QPushButton;
btnAliasSet->setProperty("ssType", "progManageTool");
connect(btnAliasSet, &QPushButton::clicked, this, [this] {
btnSets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -156,7 +155,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnAliasSet);
hBox->addWidget(btn);
hBox->addStretch();
@ -183,9 +182,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdCompanyId->setFixedWidth(100);
hBox->addWidget(fdCompanyId);
btnWebServerSet = new QPushButton;
btnWebServerSet->setProperty("ssType", "progManageTool");
connect(btnWebServerSet, &QPushButton::clicked, this, [this] {
btnSets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -211,7 +209,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnWebServerSet);
hBox->addWidget(btn);
hBox->addStretch();
@ -224,9 +222,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdRealtimeServer->setEditable(true);
hBox->addWidget(fdRealtimeServer);
btnRealtimeServerSet = new QPushButton;
btnRealtimeServerSet->setProperty("ssType", "progManageTool");
connect(btnRealtimeServerSet, &QPushButton::clicked, this, [this] {
btnSets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -247,7 +244,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnRealtimeServerSet);
hBox->addWidget(btn);
btnRealtimeClear = new QPushButton;
btnRealtimeClear->setProperty("ssType", "progManageTool");
@ -948,9 +945,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdRebootTime->setMaximumWidth(60);
hBox->addWidget(fdRebootTime);
btnTimingRebootSet = new QPushButton;
btnTimingRebootSet->setProperty("ssType", "progManageTool");
connect(btnTimingRebootSet, &QPushButton::clicked, this, [=] {
btnSets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [=] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -971,11 +967,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnTimingRebootSet);
hBox->addWidget(btn);
btnTimingRebootGet = new QPushButton;
btnTimingRebootGet->setProperty("ssType", "progManageTool");
connect(btnTimingRebootGet, &QPushButton::clicked, this, [=] {
btnGets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [=] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -1004,7 +999,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnTimingRebootGet);
hBox->addWidget(btn);
hBox->addStretch();
@ -1085,9 +1080,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdDisMode->addItem("Part", 2);
hBox->addWidget(fdDisMode);
btnDisModeSet = new QPushButton;
btnDisModeSet->setProperty("ssType", "progManageTool");
connect(btnDisModeSet, &QPushButton::clicked, this, [=] {
btnSets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [=] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")+" ...");
return;
@ -1108,11 +1102,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnDisModeSet);
hBox->addWidget(btn);
btnDisModeGet = new QPushButton;
btnDisModeGet->setProperty("ssType", "progManageTool");
connect(btnDisModeGet, &QPushButton::clicked, this, [=] {
btnGets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [=] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -1146,7 +1139,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnDisModeGet);
hBox->addWidget(btn);
hBox->addSpacing(40);
lbScreenPos = new QLabel;
@ -1163,9 +1156,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdScreenOff->setRange(-9999, 99999);
hBox->addWidget(fdScreenOff);
btnScreenOffSet = new QPushButton;
btnScreenOffSet->setProperty("ssType", "progManageTool");
connect(btnScreenOffSet, &QPushButton::clicked, this, [=] {
btnSets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [=] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -1187,11 +1179,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnScreenOffSet);
hBox->addWidget(btn);
btnScreenOffGet = new QPushButton;
btnScreenOffGet->setProperty("ssType", "progManageTool");
connect(btnScreenOffGet, &QPushButton::clicked, this, [=] {
btnGets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [=] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -1223,9 +1214,105 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnScreenOffGet);
hBox->addWidget(btn);
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);
btnLedSet = new QPushButton;
@ -1402,9 +1489,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdTopLevelLH = new QRadioButton;
hBox->addWidget(fdTopLevelLH);
btnHighForBusySet = new QPushButton;
btnHighForBusySet->setProperty("ssType", "progManageTool");
connect(btnHighForBusySet, &QPushButton::clicked, this, [this] {
btnSets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -1425,7 +1511,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnHighForBusySet);
hBox->addWidget(btn);
btnGetTopLevel = new QPushButton;
btnGetTopLevel->setProperty("ssType", "progManageTool");
@ -1478,9 +1564,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
hBox->addWidget(fdMinBright);
hBox->addWidget(new QLabel("%"));
btnMinBrightSet = new QPushButton;
btnMinBrightSet->setProperty("ssType", "progManageTool");
connect(btnMinBrightSet, &QPushButton::clicked, this, [this] {
btnSets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -1501,11 +1586,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnMinBrightSet);
hBox->addWidget(btn);
btnMinBrightGet = new QPushButton();
btnMinBrightGet->setProperty("ssType", "progManageTool");
connect(btnMinBrightGet, &QPushButton::clicked, this, [this] {
btnGets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -1542,7 +1626,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnMinBrightGet);
hBox->addWidget(btn);
hBox->addSpacing(10);
@ -1555,9 +1639,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
hBox->addWidget(fdMaxBright);
hBox->addWidget(new QLabel("%"));
btnMaxBrightSet = new QPushButton;
btnMaxBrightSet->setProperty("ssType", "progManageTool");
connect(btnMaxBrightSet, &QPushButton::clicked, this, [this] {
btnSets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -1578,11 +1661,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnMaxBrightSet);
hBox->addWidget(btn);
btnMaxBrightGet = new QPushButton;
btnMaxBrightGet->setProperty("ssType", "progManageTool");
connect(btnMaxBrightGet, &QPushButton::clicked, this, [this] {
btnGets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -1619,7 +1701,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnMaxBrightGet);
hBox->addWidget(btn);
hBox->addStretch();
vBox->addWidget(grpMinMaxBrightness);
@ -2053,9 +2135,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
btnGrp->addButton(fdDeg180, 2);
btnGrp->addButton(fdDeg270, 3);
btnRotateSet = new QPushButton;
btnRotateSet->setProperty("ssType", "progManageTool");
connect(btnRotateSet, &QPushButton::clicked, this, [=] {
btnSets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [=] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -2077,11 +2158,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnRotateSet);
hBox->addWidget(btn);
btnRotateGet = new QPushButton;
btnRotateGet->setProperty("ssType", "progManageTool");
connect(btnRotateGet, &QPushButton::clicked, this, [=] {
btnGets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [=] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -2114,8 +2194,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnRotateGet);
hBox->addWidget(btn);
hBox->addStretch();
@ -2128,9 +2207,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdChargingStation->setMaximumWidth(120);
hBox->addWidget(fdChargingStation);
btnChargingStationSet = new QPushButton;
btnChargingStationSet->setProperty("ssType", "progManageTool");
connect(btnChargingStationSet, &QPushButton::clicked, this, [=] {
btnSets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [=] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -2151,7 +2229,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnChargingStationSet);
hBox->addWidget(btn);
hBox->addStretch();
@ -2223,9 +2301,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdBaud->setMaximumWidth(70);
hBox->addWidget(fdBaud);
btnBaudSet = new QPushButton;
btnBaudSet->setProperty("ssType", "progManageTool");
connect(btnBaudSet, &QPushButton::clicked, this, [this, fdUart, fdBaud] {
btnSets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [this, fdUart, fdBaud] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -2247,11 +2324,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnBaudSet);
hBox->addWidget(btn);
btnBaudGet = new QPushButton;
btnBaudGet->setProperty("ssType", "progManageTool");
connect(btnBaudGet, &QPushButton::clicked, this, [this, fdUart, fdBaud] {
btnGets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [this, fdUart, fdBaud] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -2280,7 +2356,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnBaudGet);
hBox->addWidget(btn);
hBox->addStretch();
@ -2415,9 +2491,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdTraficProtocol->addItem("三思协议", 1);
hBox->addWidget(fdTraficProtocol);
btnTraficProtSet = new QPushButton;
btnTraficProtSet->setProperty("ssType", "progManageTool");
connect(btnTraficProtSet, &QPushButton::clicked, this, [this, fdTraficProtocol] {
btnSets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [this, fdTraficProtocol] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -2438,11 +2513,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnTraficProtSet);
hBox->addWidget(btn);
btnTraficProtGet = new QPushButton;
btnTraficProtGet->setProperty("ssType", "progManageTool");
connect(btnTraficProtGet, &QPushButton::clicked, this, [this, fdTraficProtocol] {
btnGets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [this, fdTraficProtocol] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -2476,7 +2550,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnTraficProtGet);
hBox->addWidget(btn);
hBox->addStretch();
hBox = new HBox(vBox);
@ -2501,9 +2575,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
fdPort->setValue(5000);
hBox->addWidget(fdPort);
btnTraficSet = new QPushButton;
btnTraficSet->setProperty("ssType", "progManageTool");
connect(btnTraficSet, &QPushButton::clicked, this, [=] {
btnSets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [=] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -2525,11 +2598,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnTraficSet);
hBox->addWidget(btn);
btnTraficGet = new QPushButton;
btnTraficGet->setProperty("ssType", "progManageTool");
connect(btnTraficGet, &QPushButton::clicked, this, [=] {
btnGets.push_back(btn = new QPushButton);
connect(btn, &QPushButton::clicked, this, [=] {
if(gSelCards.isEmpty()) {
QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));
return;
@ -2566,13 +2638,13 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
}
}
});
hBox->addWidget(btnTraficGet);
hBox->addWidget(btn);
hBox->addStretch();
}
vBox->addWidget(grpBoxHiddenSettings);
hBox = new HBox(vBox);
auto btn = new QPushButton("List Card Infos");
btn = new QPushButton("List Card Infos");
btn->setProperty("ssType", "progManageTool");
connect(btn, &QPushButton::clicked, this, [this] {
if(gSelCards.isEmpty()) {
@ -2594,6 +2666,9 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() {
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;
connect(gDevicePanel, &DevicePanel::sigSelectedDeviceList, this, [this] {
if(isVisible()) init();
@ -2718,6 +2793,9 @@ void CtrlAdvancedPanel::changeEvent(QEvent *event) {
if(event->type() == QEvent::LanguageChange) 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"));
btnGetTopLevel->setText(tr("Readback"));
btnLedSet->setText(tr("Start LedSet4"));
@ -2733,26 +2811,18 @@ void CtrlAdvancedPanel::transUi() {
fdDisMode->setItemText(1, tr("Part"));
btnY50Set->setText(tr("Set"));
lbDisMode->setText(tr("Display Mode"));
btnDisModeSet->setText(tr("Set"));
btnDisModeGet->setText(tr("Get"));
lbDisMode->setText(tr("Display Mode")+":");
lbScreenPos->setText(tr("Screen Position"));
lbScreenOff->setText(tr("Offset"));
btnScreenOffSet->setText(tr("Set"));
btnScreenOffGet->setText(tr("Get"));
lbScreenPos->setText(tr("Screen Position")+":");
lbScreenOff->setText(tr("Offset")+":");
lbCameraDis->setText(tr("Camera Distance")+":");
btnAliasSet->setText(tr("Set"));
btnScreenSet->setText(tr("Set"));
btnHighForBusySet->setText(tr("Set"));
fdScreenHeight->setPlaceholderText(tr("Height"));
fdScreenWidth->setPlaceholderText(tr("Width"));
fdHighForBusy->setText(tr("Service:High Out of service:Low"));
fdTopLevelLH->setText(tr("Service:Low Out of service:High"));
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")+")");
btnSysUpd->setText(tr("System Update"));
@ -2761,8 +2831,6 @@ void CtrlAdvancedPanel::transUi() {
lbBaudModel->setText(tr("Model"));
lbUart->setText(tr("Uart"));
lbBaud->setText(tr("Baud"));
btnBaudSet->setText(tr("Set"));
btnBaudGet->setText(tr("Get"));
fdIsOpenADB->setText(tr("Open ADB"));
lbCustomJson->setText(tr("Post Custom JSON"));
btnSendCustomJson->setText(tr("Send"));
@ -2791,29 +2859,17 @@ void CtrlAdvancedPanel::transUi() {
btnPlayerBackClear->setText(tr("Clear player background"));
btnRealtimeClear->setText(tr("Clear"));
btnMinBrightSet->setText(tr("Set"));
btnMinBrightGet->setText(tr("Readback"));
btnMaxBrightSet->setText(tr("Set"));
btnMaxBrightGet->setText(tr("Readback"));
btnRestart->setText(tr("Restart"));
btnIsRunning->setText(tr("Running check"));
btnRealtimeServerSet->setText(tr("Set"));
btnWebServerSet->setText(tr("Set"));
fdUninstall->setText(tr("Uninstall"));
lbTimingReboot->setText(tr("Timing Reboot"));
btnTimingRebootSet->setText(tr("Set"));
btnTimingRebootGet->setText(tr("Get"));
lbTraficProtocol->setText(tr("Protocol"));
lbCardMode->setText(tr("Card work mode"));
fdServerType->setItemText(0, tr("Server"));
fdServerType->setItemText(1, tr("Client"));
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) {

View File

@ -27,25 +27,20 @@ protected:
void mouseReleaseEvent(QMouseEvent *) override;
private:
bool isPassed{false};
std::vector<QPushButton *> btnSets, btnGets;
QLabel *lbTitle;
QLabel *lbScreenWidth;
QLineEdit *fdScreenWidth;
QLabel *lbScreenHeight;
QLineEdit *fdScreenHeight;
QPushButton *btnScreenSet;
QLabel *lbAlias;
QLineEdit *fdAlias;
QPushButton *btnAliasSet;
QLabel *labelWebServer;
QComboBox *fdWebServerAddr;
QLabel *lbCompanyId;
QLineEdit *fdCompanyId;
QPushButton *btnWebServerSet;
QLabel *lbRealtime;
QComboBox *fdRealtimeServer;
QPushButton *btnRealtimeServerSet;
QPushButton *btnRealtimeClear;
QPushButton *btnWareUpdate;
QLabel *lbWareTip;
@ -59,7 +54,6 @@ private:
QPushButton *btnSetBack, *btnPlayerBackSet, *btnPlayerBackClear;
QLabel *lbTimingReboot;
QPushButton *btnTimingRebootSet, *btnTimingRebootGet;
QGroupBox *grpM80, *grpY50;
QComboBox *fdM80Resolu, *fdDisMode;
@ -68,33 +62,23 @@ private:
QPushButton *btnM80Restore;
QLabel *lbDisMode;
QPushButton *btnDisModeSet, *btnDisModeGet;
QLabel *lbScreenPos, *lbScreenOff;
QPushButton *btnScreenOffSet, *btnScreenOffGet;
QLabel *lbCameraDis;
QGroupBox *grpHighForBusy;
QRadioButton *fdHighForBusy;
QRadioButton *fdTopLevelLH;
QPushButton *btnHighForBusySet;
QPushButton *btnGetTopLevel;
QPushButton *btnLedSet;
QPushButton *btnReceCardsGet, *btnBindTaxiIc;
QGroupBox *grpMinMaxBrightness;
QLabel *lbMinBright;
QLineEdit *fdMinBright;
QPushButton *btnMinBrightGet;
QPushButton *btnMinBrightSet;
QLabel *label_3;
QLineEdit *fdMaxBright;
QPushButton *btnMaxBrightGet;
QPushButton *btnMaxBrightSet;
QLabel *lbMinBright, *label_3;
QLineEdit *fdMinBright, *fdMaxBright;
QGroupBox *grpBoxHiddenSettings;
QPushButton *btnSysUpd, *btnMcuUpd, *btnMcuGet;
QPushButton *btnRotateSet, *btnRotateGet, *btnChargingStationSet;
QLabel *lbRotate, *lbChargingStation, *lbBaudCfg, *lbBaudModel, *lbUart, *lbBaud;
QPushButton *btnBaudSet, *btnBaudGet;
QCheckBox *fdIsOpenADB;
QLabel *lbCustomJson;
QTextEdit *fdCustomJson;
@ -102,7 +86,8 @@ private:
QLabel *lbTraficProtocol, *lbCardMode, *lbTraficPort;
QComboBox *fdServerType;
QPushButton *btnTraficProtSet, *btnTraficProtGet, *btnTraficSet, *btnTraficGet;
bool isPassed = false;
};
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;
}
} else if(src.type.startsWith("Environ")) {
auto arrayPics = source["arrayPics"];
for(int i=(int)arrayPics.size()-1; i>=0; i--) if(arrayPics[i]["name"].toString() == "previewTmp") {
if(source["bSingleScroll"].toBool()) src.view = new EleScroll(box, dir+"/" + arrayPics[i]["id"].toString(), 'l', source["iScrollSpeed"].toDouble());
else src.view = new EleScroll(box, dir+"/"+arrayPics[i]["id"].toString());
break;
auto previewImg = source["previewImg"].toStr();
if(! previewImg.isEmpty()) {
if(source["bSingleScroll"].toBool()) src.view = new EleScroll(box, dir+"/"+previewImg, 'l', source["iScrollSpeed"].toDouble());
else src.view = new EleScroll(box, dir+"/"+previewImg);
}
} else if(src.type=="MultiPng" || src.type=="SplitText") {
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);
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;
JArray oitems;
@ -60,63 +68,13 @@ JObj EEnviron::genProg(const JValue &json, const QString &dstDir, const QString
oitem["unit"] = url;
}
res["items"] = oitems;
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";
auto srcFile = srcPageDir+"/previewTmp.png";
QFile srcQFile(srcFile);
if(srcQFile.exists()) {
QString id = Tools::fileMd5(srcFile);
auto id = Tools::fileMd5(srcFile);
srcQFile.copy(dstDir+"/"+id);
arrayPic["id"] = id;
res["previewImg"] = id;
}
arrayPics.append(arrayPic);
res["arrayPics"] = arrayPics;
res["旧播放器兼容结束"] = 0;
}
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