diff --git a/LedOK/LedOK Express.pro b/LedOK/LedOK Express.pro index 642e213..ac2a81e 100644 --- a/LedOK/LedOK Express.pro +++ b/LedOK/LedOK Express.pro @@ -125,7 +125,6 @@ SOURCES += \ gutil/qwaitingdlg.cpp \ basedlg.cpp \ basewin.cpp \ - cfg.cpp \ device/ctrlhdmipanel.cpp \ device/ctrlnetworkpanel.cpp \ device/ctrlpowerpanel.cpp \ @@ -135,7 +134,6 @@ SOURCES += \ deviceitem.cpp \ devicepanel.cpp \ ffplayer.cpp \ - globaldefine.cpp \ gutil/cpp.cpp \ gutil/qgui.cpp \ gutil/qjson.cpp \ @@ -154,6 +152,7 @@ SOURCES += \ player/posdlg.cpp \ player/srccopy.cpp \ progpanel.cpp \ + program/etimer2.cpp \ synctimer.cpp \ tools.cpp \ device/ctrladvancedpanel.cpp \ @@ -194,7 +193,6 @@ HEADERS += \ gutil/qwaitingdlg.h \ basedlg.h \ basewin.h \ - cfg.h \ device/ctrlhdmipanel.h \ device/ctrlnetworkpanel.h \ device/ctrlpowerpanel.h \ @@ -204,11 +202,11 @@ HEADERS += \ deviceitem.h \ devicepanel.h \ ffplayer.h \ - globaldefine.h \ gutil/cpp.h \ gutil/qgui.h \ gutil/qjson.h \ gutil/qnetwork.h \ + main.h \ mainwindow.h \ mguangyingpinwidget.h \ player/eleanaclock.h \ @@ -222,6 +220,7 @@ HEADERS += \ player/posdlg.h \ player/srccopy.h \ progpanel.h \ + program/etimer2.h \ synctimer.h \ tools.h \ device/ctrladvancedpanel.h \ diff --git a/LedOK/basewin.cpp b/LedOK/basewin.cpp index 6ee8e1c..c1b04d4 100644 --- a/LedOK/basewin.cpp +++ b/LedOK/basewin.cpp @@ -40,7 +40,7 @@ void BaseWin::paintEvent(QPaintEvent *e) { void BaseWin::mousePressEvent(QMouseEvent *e) { if(e->button() != Qt::LeftButton) return; setFrmSec(e->pos()); - if(mFrmSec==Qt::TitleBarArea || mFrmSec==Qt::TopSection || mFrmSec==Qt::LeftSection || mFrmSec==Qt::TopLeftSection) mPressRel = pos() - e->globalPos(); + if(mFrmSec==Qt::TitleBarArea || mFrmSec==Qt::TopSection || mFrmSec==Qt::LeftSection || mFrmSec==Qt::TopLeftSection) mPressRel = -e->pos(); else if(mFrmSec==Qt::BottomRightSection) mPressRel = QPoint(width() - e->globalX(), height() - e->globalY()); else if(mFrmSec==Qt::RightSection ) mPressRel = QPoint(width() - e->globalX(), height() ); else if(mFrmSec==Qt::BottomSection ) mPressRel = QPoint(width() , height() - e->globalY()); diff --git a/LedOK/basewin.h b/LedOK/basewin.h index 629813c..991ca46 100644 --- a/LedOK/basewin.h +++ b/LedOK/basewin.h @@ -36,8 +36,8 @@ protected: void setFrmSecIfNeed(Qt::WindowFrameSection frmSec, Qt::CursorShape cursor); QPoint mPressRel{INT_MAX, INT_MAX}; - Qt::WindowFrameSection mFrmSec{Qt::NoSection}; - bool isActive{false}; + Qt::WindowFrameSection mFrmSec = Qt::NoSection; + bool isActive = false; }; #endif // BASEWIN_H diff --git a/LedOK/cfg.cpp b/LedOK/cfg.cpp deleted file mode 100644 index 73d5a86..0000000 --- a/LedOK/cfg.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "cfg.h" -#include -#include - -const QString UpdVerUrl = "https://www.ledok.cn/download/LedOK Express Updates.json"; - -QString programsDir() { - static auto rtn = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/programs"; - return rtn; -} diff --git a/LedOK/cfg.h b/LedOK/cfg.h deleted file mode 100644 index 72c5151..0000000 --- a/LedOK/cfg.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef CFG_H -#define CFG_H - -#include - -#define PAGEDEL_SUFFIX "@D$E$L&20111005&" -#define RECTF_INVALID QRectF(-9999, -9999, 0, 0) - -extern const QString UpdVerUrl; - -QString programsDir(); - -#endif // CFG_H diff --git a/LedOK/device/ctrladvancedpanel.cpp b/LedOK/device/ctrladvancedpanel.cpp index 088af35..d94ffbc 100644 --- a/LedOK/device/ctrladvancedpanel.cpp +++ b/LedOK/device/ctrladvancedpanel.cpp @@ -1,6 +1,6 @@ #include "ctrladvancedpanel.h" #include "device/progressesdlg.h" -#include "globaldefine.h" +#include "main.h" #include "gutil/qwaitingdlg.h" #include "base/changepasswordform.h" #include "tools.h" @@ -218,6 +218,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() { fdRealtimeServer = new QComboBox; fdRealtimeServer->addItem("www.ledokcloud.com/realtime"); + fdRealtimeServer->addItem("192.168.8.:10010"); fdRealtimeServer->setMinimumWidth(260); fdRealtimeServer->setEditable(true); hBox->addWidget(fdRealtimeServer); @@ -632,36 +633,90 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() { }); hBox->addWidget(btnGetLog); - hBox->addStretch(); - hBox = new HBox(vBox); + auto btnLogOn = new QPushButton("Log On"); + btnLogOn->setProperty("ssType", "progManageTool"); + connect(btnLogOn, &QPushButton::clicked, this, [this] { + if(gSelCards.isEmpty()) { + QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); + return; + } + JObj json; + json.insert("_id", "SetLogSwitch"); + json.insert("_type", "SetLogSwitch"); + json.insert("isOn", true); + if(gSelCards.count() == 1) { + auto waitingDlg = new WaitingDlg(this, tr("SetRealtimeServer")+" ..."); + Def_CtrlReqPre + connect(reply, &QNetworkReply::finished, this, [=] { + Def_CtrlSetReqAfter + }); + } else { + for(auto &card : gSelCards) { + Def_CtrlSetMulti(tr("SetRealtimeServer")) + } + } + }); + hBox->addWidget(btnLogOn); - auto btnViewProg = new QPushButton("View Prog JSON"); + auto btnLogOff = new QPushButton("Log Off"); + btnLogOff->setProperty("ssType", "progManageTool"); + connect(btnLogOff, &QPushButton::clicked, this, [this] { + if(gSelCards.isEmpty()) { + QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); + return; + } + JObj json; + json.insert("_id", "SetLogSwitch"); + json.insert("_type", "SetLogSwitch"); + json.insert("isOn", false); + if(gSelCards.count() == 1) { + auto waitingDlg = new WaitingDlg(this, tr("SetRealtimeServer")+" ..."); + Def_CtrlReqPre + connect(reply, &QNetworkReply::finished, this, [=] { + Def_CtrlSetReqAfter + }); + } else { + for(auto &card : gSelCards) { + Def_CtrlSetMulti(tr("SetRealtimeServer")) + } + } + }); + hBox->addWidget(btnLogOff); + + hBox->addStretch(); + + grpPlayer = new QGroupBox; + vBox->addWidget(grpPlayer); + hBox = new HBox(grpPlayer); + hBox->setContentsMargins(6,0,6,6); + + auto btnViewProg = new QPushButton("View JSON"); btnViewProg->setProperty("ssType", "progManageTool"); connect(btnViewProg, &QPushButton::clicked, this, [this] { if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } - JObj json{{"_type", "GetFile"}, {"name", "program"}}; - auto fd = new QTextEdit; + JObj json{{"_type", "GetJsonWithFileInfo"}}; + auto edit = new QTextEdit; LocalObj lll; - connect(fd, &QTextEdit::destroyed, &lll, &LocalObj::reset); - fd->setAttribute(Qt::WA_DeleteOnClose); - fd->setTabStopDistance(26); - auto ft = fd->font(); + connect(edit, &QTextEdit::destroyed, &lll, &LocalObj::reset); + edit->setAttribute(Qt::WA_DeleteOnClose); + edit->setTabStopDistance(26); + auto ft = edit->font(); ft.setFamily("Consolas"); - fd->setFont(ft); - fd->setWindowTitle("program"); - fd->resize(600, 900); - fd->show(); + edit->setFont(ft); + edit->setWindowTitle("program"); + edit->resize(600, 900); + edit->show(); for(auto &card : gSelCards) { - fd->append(card.id+" Prog JSON"); + edit->append(card.id+" Prog JSON"); TcpSocket tcp; tcp.connectToHost(card.ip, 3333); if(! tcp.waitForConnected(10000)) { tcp.close(); if(lll.cnt==0) return; - fd->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at WaitConnected\n"); + edit->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at WaitConnected\n"); continue; } auto resNum = tcp.write(JToBytes(json)); @@ -669,84 +724,29 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() { if(resNum == -1 || ! tcp.waitForBytesWritten()) { tcp.close(); if(lll.cnt==0) return; - fd->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at write\n"); + edit->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at write\n"); continue; } if(! tcp.waitForReadyRead()) { tcp.close(); if(lll.cnt==0) return; - fd->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at WaitRead\n"); + edit->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at WaitRead\n"); continue; } - fd->insertPlainText(tcp.readAll()); + edit->append(tcp.readAll()); while(tcp.waitForReadyRead(1000)) { if(lll.cnt==0) return; - fd->insertPlainText(tcp.readAll()); + edit->insertPlainText(tcp.readAll()); } tcp.close(); if(lll.cnt==0) return; - if(tcp.error()!=QAbstractSocket::SocketTimeoutError) fd->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at WaitRead2\n"); - fd->append(""); + if(tcp.error()!=QAbstractSocket::SocketTimeoutError) edit->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at WaitRead2\n"); + edit->append("END"); } }); hBox->addWidget(btnViewProg); - auto btnListFiles = new QPushButton("List Prog Files"); - btnListFiles->setProperty("ssType", "progManageTool"); - connect(btnListFiles, &QPushButton::clicked, this, [this] { - if(gSelCards.isEmpty()) { - QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); - return; - } - JObj json{{"_type", "ListProgFiles"}}; - auto fd = new QTextEdit; - LocalObj lll; - connect(fd, &QTextEdit::destroyed, &lll, &LocalObj::reset); - fd->setAttribute(Qt::WA_DeleteOnClose); - auto ft = fd->font(); - ft.setFamily("Consolas"); - fd->setFont(ft); - fd->setWindowTitle("List Prog Files"); - fd->resize(600, 900); - fd->show(); - for(auto &card : gSelCards) { - fd->append(card.id+" Prog Files"); - TcpSocket tcp; - tcp.connectToHost(card.ip, 3333); - if(! tcp.waitForConnected(10000)) { - tcp.close(); - if(lll.cnt==0) return; - fd->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at WaitConnected\n"); - continue; - } - auto resNum = tcp.write(JToBytes(json)); - tcp.flush(); - if(resNum == -1 || ! tcp.waitForBytesWritten()) { - tcp.close(); - if(lll.cnt==0) return; - fd->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at write\n"); - continue; - } - if(! tcp.waitForReadyRead()) { - tcp.close(); - if(lll.cnt==0) return; - fd->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at WaitRead\n"); - continue; - } - fd->insertPlainText(tcp.readAll()); - while(tcp.waitForReadyRead(1000)) { - if(lll.cnt==0) return; - fd->insertPlainText(tcp.readAll()); - } - tcp.close(); - if(lll.cnt==0) return; - if(tcp.error()!=QAbstractSocket::SocketTimeoutError) fd->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at WaitRead2\n"); - fd->append(""); - } - }); - hBox->addWidget(btnListFiles); - - auto btnGetPlayerInfo = new QPushButton("Get Player Info"); + auto btnGetPlayerInfo = new QPushButton("Get Info"); btnGetPlayerInfo->setProperty("ssType", "progManageTool"); connect(btnGetPlayerInfo, &QPushButton::clicked, this, [this] { if(gSelCards.isEmpty()) { @@ -788,7 +788,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() { fd->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at WaitRead\n"); continue; } - fd->insertPlainText(tcp.readAll()); + fd->append(tcp.readAll()); while(tcp.waitForReadyRead(1000)) { if(lll.cnt==0) return; fd->insertPlainText(tcp.readAll()); @@ -796,12 +796,12 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() { tcp.close(); if(lll.cnt==0) return; if(tcp.error()!=QAbstractSocket::SocketTimeoutError) fd->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at WaitRead2\n"); - fd->append(""); + fd->append("END"); } }); hBox->addWidget(btnGetPlayerInfo); - auto GetBuf = new QPushButton("Get Player Log"); + auto GetBuf = new QPushButton("Get Log"); GetBuf->setProperty("ssType", "progManageTool"); connect(GetBuf, &QPushButton::clicked, this, [this] { if(gSelCards.isEmpty()) { @@ -843,7 +843,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() { fd->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at WaitRead\n"); continue; } - fd->insertPlainText(tcp.readAll()); + fd->append(tcp.readAll()); while(tcp.waitForReadyRead(1000)) { if(lll.cnt==0) return; fd->insertPlainText(tcp.readAll()); @@ -851,11 +851,66 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() { tcp.close(); if(lll.cnt==0) return; if(tcp.error()!=QAbstractSocket::SocketTimeoutError) fd->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at WaitRead2\n"); - fd->append(""); + fd->append("END"); } }); hBox->addWidget(GetBuf); + auto btnListFiles = new QPushButton("List Files"); + btnListFiles->setProperty("ssType", "progManageTool"); + connect(btnListFiles, &QPushButton::clicked, this, [this] { + if(gSelCards.isEmpty()) { + QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); + return; + } + JObj json{{"_type", "ListProgFiles"}}; + auto fd = new QTextEdit; + LocalObj lll; + connect(fd, &QTextEdit::destroyed, &lll, &LocalObj::reset); + fd->setAttribute(Qt::WA_DeleteOnClose); + auto ft = fd->font(); + ft.setFamily("Consolas"); + fd->setFont(ft); + fd->setWindowTitle("List Prog Files"); + fd->resize(600, 900); + fd->show(); + for(auto &card : gSelCards) { + fd->append(card.id+" Prog Files"); + TcpSocket tcp; + tcp.connectToHost(card.ip, 3333); + if(! tcp.waitForConnected(10000)) { + tcp.close(); + if(lll.cnt==0) return; + fd->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at WaitConnected\n"); + continue; + } + auto resNum = tcp.write(JToBytes(json)); + tcp.flush(); + if(resNum == -1 || ! tcp.waitForBytesWritten()) { + tcp.close(); + if(lll.cnt==0) return; + fd->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at write\n"); + continue; + } + if(! tcp.waitForReadyRead()) { + tcp.close(); + if(lll.cnt==0) return; + fd->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at WaitRead\n"); + continue; + } + fd->append(tcp.readAll()); + while(tcp.waitForReadyRead(1000)) { + if(lll.cnt==0) return; + fd->insertPlainText(tcp.readAll()); + } + tcp.close(); + if(lll.cnt==0) return; + if(tcp.error()!=QAbstractSocket::SocketTimeoutError) fd->append(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" at WaitRead2\n"); + fd->append("END"); + } + }); + hBox->addWidget(btnListFiles); + auto btnDownFile = new QPushButton("Down File"); btnDownFile->setProperty("ssType", "progManageTool"); connect(btnDownFile, &QPushButton::clicked, this, [this] { @@ -2054,7 +2109,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() { }); hBox->addWidget(btnM80Set); - btnM80Refresh = new QPushButton(); + btnM80Refresh = new QPushButton; btnM80Refresh->setProperty("ssType", "progManageTool"); connect(btnM80Refresh, &QPushButton::clicked, this, [this] { if(gSelCards.isEmpty()) { @@ -2760,7 +2815,9 @@ void CtrlAdvancedPanel::init() { || card.id.startsWith("m5s", Qt::CaseInsensitive) || card.id.startsWith("m6s", Qt::CaseInsensitive) || card.id.startsWith("m7", Qt::CaseInsensitive) + || card.id.startsWith("y0", Qt::CaseInsensitive) || card.id.startsWith("y1", Qt::CaseInsensitive) + || card.id.startsWith("y3", Qt::CaseInsensitive) || card.id.startsWith("y4", Qt::CaseInsensitive) || card.id.startsWith("y5", Qt::CaseInsensitive); grpY50->setVisible(isY50); @@ -2801,12 +2858,13 @@ void CtrlAdvancedPanel::transUi() { btnLedSet->setText(tr("Start LedSet4")); btnReceCardsGet->setText(tr("Get Receive Card Num")); + grpPlayer->setTitle(tr("Player Debug")); grpM80->setTitle("M80 "+tr("Config")); btnM80Refresh->setText(tr("Refresh")); btnM80Restore->setText(tr("Restore to default")); btnM80Set->setText(tr("Set")); - grpY50->setTitle("M50S / M60S / M70S / M5H / M7L / ST50 / Y1G / Y1C / Y4A / Y5A "+tr("Resolution Config")); + grpY50->setTitle("M50S / M60S / M70S / M5H / M7L / ST50 / Y1G / Y1C / Y4A / Y5A / Y08 / Y35 / Y37 "+tr("Resolution Config")); fdDisMode->setItemText(0, tr("Full screen")); fdDisMode->setItemText(1, tr("Part")); btnY50Set->setText(tr("Set")); @@ -2911,15 +2969,11 @@ void PlayerBackSendThread::run() { return; } QFileInfo info(file); - auto baseName = info.baseName(); auto remain = info.size(); - - auto req = QJsonObject(); + JObj req; req.insert("_type", "imgFileStart"); - req.insert("id", baseName); req.insert("size", remain); - req.insert("zVer","xixun1"); - auto resNum = tcp.write(QJsonDocument(req).toJson(QJsonDocument::Compact)); + auto resNum = tcp.write(JToBytes(req)); if(resNum == -1 || ! tcp.waitForBytesWritten()) { emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when write 'imgFileStart'"); tcp.close(); @@ -2955,27 +3009,6 @@ void PlayerBackSendThread::run() { remain -= resNum; } file->close(); - req = QJsonObject(); - req.insert("_type", "imgFileEnd"); - req.insert("id", baseName); - req.insert("zVer","xixun1"); - resNum = tcp.write(QJsonDocument(req).toJson(QJsonDocument::Compact)); - if(resNum == -1 || ! tcp.waitForBytesWritten()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when write 'imgFileEnd'"); - tcp.close(); - return; - } - if(! tcp.waitForReadyRead()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when waitForRead 'imgFileEnd'"); - tcp.close(); - return; - } - auto resp = tcp.readAll(); - if(resp.isEmpty()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when read 'imgFileEnd'"); - tcp.close(); - return; - } tcp.close(); emit emErr(""); } diff --git a/LedOK/device/ctrladvancedpanel.h b/LedOK/device/ctrladvancedpanel.h index 23f1dfa..3aeb840 100644 --- a/LedOK/device/ctrladvancedpanel.h +++ b/LedOK/device/ctrladvancedpanel.h @@ -55,7 +55,7 @@ private: QLabel *lbTimingReboot; - QGroupBox *grpM80, *grpY50; + QGroupBox *grpPlayer, *grpM80, *grpY50; QComboBox *fdM80Resolu, *fdDisMode; QPushButton *btnM80Set, *btnY50Set; QPushButton *btnM80Refresh; diff --git a/LedOK/device/ctrlbrightpanel.cpp b/LedOK/device/ctrlbrightpanel.cpp index 327e4f8..873c51a 100644 --- a/LedOK/device/ctrlbrightpanel.cpp +++ b/LedOK/device/ctrlbrightpanel.cpp @@ -1,7 +1,7 @@ #include "ctrlbrightpanel.h" #include "gutil/qwaitingdlg.h" #include "gutil/qnetwork.h" -#include "globaldefine.h" +#include "main.h" #include "tools.h" #include "deviceitem.h" #include "xlsxdocument.h" diff --git a/LedOK/device/ctrlhdmipanel.cpp b/LedOK/device/ctrlhdmipanel.cpp index ec630db..655316a 100644 --- a/LedOK/device/ctrlhdmipanel.cpp +++ b/LedOK/device/ctrlhdmipanel.cpp @@ -2,7 +2,7 @@ #include "gutil/qgui.h" #include "gutil/qnetwork.h" #include "tools.h" -#include "globaldefine.h" +#include "main.h" #include "gutil/qwaitingdlg.h" #include #include diff --git a/LedOK/device/ctrlnetworkpanel.cpp b/LedOK/device/ctrlnetworkpanel.cpp index 1ffd5ae..6a31fc5 100644 --- a/LedOK/device/ctrlnetworkpanel.cpp +++ b/LedOK/device/ctrlnetworkpanel.cpp @@ -1,6 +1,6 @@ #include "ctrlnetworkpanel.h" #include "gutil/qwaitingdlg.h" -#include "globaldefine.h" +#include "main.h" #include "tools.h" #include "devicepanel.h" #include "gutil/qgui.h" diff --git a/LedOK/device/ctrlpowerpanel.cpp b/LedOK/device/ctrlpowerpanel.cpp index 41dfb05..d726c01 100644 --- a/LedOK/device/ctrlpowerpanel.cpp +++ b/LedOK/device/ctrlpowerpanel.cpp @@ -1,5 +1,5 @@ #include "ctrlpowerpanel.h" -#include "globaldefine.h" +#include "main.h" #include "deviceitem.h" #include "devicepanel.h" #include "gutil/qwaitingdlg.h" diff --git a/LedOK/device/ctrlpwdpanel.cpp b/LedOK/device/ctrlpwdpanel.cpp index 509c3a1..14ba538 100644 --- a/LedOK/device/ctrlpwdpanel.cpp +++ b/LedOK/device/ctrlpwdpanel.cpp @@ -5,7 +5,7 @@ #include "QFileDialog" #include #include -#include "globaldefine.h" +#include "main.h" #include "tools.h" #include "deviceitem.h" #include "devicepanel.h" diff --git a/LedOK/device/ctrltestpanel.cpp b/LedOK/device/ctrltestpanel.cpp index 95a57b3..62f3bfc 100644 --- a/LedOK/device/ctrltestpanel.cpp +++ b/LedOK/device/ctrltestpanel.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "globaldefine.h" +#include "main.h" #include #include #include diff --git a/LedOK/device/ctrlverifyclockpanel.cpp b/LedOK/device/ctrlverifyclockpanel.cpp index d1153af..f79c328 100644 --- a/LedOK/device/ctrlverifyclockpanel.cpp +++ b/LedOK/device/ctrlverifyclockpanel.cpp @@ -1,7 +1,7 @@ #include "ctrlverifyclockpanel.h" #include "gutil/qwaitingdlg.h" #include "gutil/qnetwork.h" -#include "globaldefine.h" +#include "main.h" #include "gutil/qgui.h" #include "tools.h" #include diff --git a/LedOK/device/ctrlvolumepanel.cpp b/LedOK/device/ctrlvolumepanel.cpp index 60f3813..7f86e68 100644 --- a/LedOK/device/ctrlvolumepanel.cpp +++ b/LedOK/device/ctrlvolumepanel.cpp @@ -1,5 +1,5 @@ #include "ctrlvolumepanel.h" -#include "globaldefine.h" +#include "main.h" #include "gutil/qwaitingdlg.h" #include "gutil/qnetwork.h" #include "tools.h" diff --git a/LedOK/device/progressesdlg.cpp b/LedOK/device/progressesdlg.cpp index f846133..ce3f717 100644 --- a/LedOK/device/progressesdlg.cpp +++ b/LedOK/device/progressesdlg.cpp @@ -2,7 +2,7 @@ #include "gutil/qcore.h" #include "gutil/qgui.h" #include "gutil/qnetwork.h" -#include "globaldefine.h" +#include "main.h" #include #include #include diff --git a/LedOK/device/upgradeapkdialog.cpp b/LedOK/device/upgradeapkdialog.cpp index 14bedee..26aa97d 100644 --- a/LedOK/device/upgradeapkdialog.cpp +++ b/LedOK/device/upgradeapkdialog.cpp @@ -353,6 +353,7 @@ UpgradeApkDialog::UpgradeApkDialog(QWidget *parent) : QDialog(parent) { end: item->setText("ip", card.ip); item->setText("alias", card.alias); + item->setText("firmware", card.firmwareVer); item->fdOnline->setPixmap({card.isOnline ? ":/res/online.png" : ":/res/offline.png"}); item->OnCheckSoftVersions(); item->OnCheckFpgaVersions(); @@ -448,7 +449,7 @@ UpgradeApkDialog::UpgradeApkDialog(QWidget *parent) : QDialog(parent) { table->addCol("alias", tr("Alias"), 80); table->addCol("encrypt", tr("Security"), 40); table->addCol("progress", tr("Progress"), 100); - table->addCol("remarks", tr("State"), 200, QHeaderView::Stretch); + table->addCol("remarks", tr("State"), 200); table->addCol("playerVer", "XixunPlayer", 70); table->addCol("cardsystem", "cardsystem", 70); table->addCol("starter", "starter", 70); @@ -457,6 +458,7 @@ UpgradeApkDialog::UpgradeApkDialog(QWidget *parent) : QDialog(parent) { table->addCol("fpga", "FPGA", 70); table->addCol("connection", "connection", 70); table->addCol("update", "update", 40); + table->addCol("firmware", "Firmware", 100); table->setDefs()->setHeaderAlignC(); table->addFd(); table->setSelectionMode(QAbstractItemView::NoSelection); @@ -472,18 +474,18 @@ UpgradeApkDialog::UpgradeApkDialog(QWidget *parent) : QDialog(parent) { show(); emit btnRefresh->clicked(); - int ccs[]{"taxiapp"**table, "fpga"**table}; - for(auto cc : ccs) { - auto size = table->sizeHintForColumn(cc); - if(size==0) { - int cnt = 8; - do { - wait(50); - size = table->sizeHintForColumn(cc); - } while(size==0 && --cnt); - } - if(size>table->header()->sectionSize(cc)) table->header()->resizeSection(cc, size); - } + // int ccs[]{"playerVer"**table, "firmware"**table}; + // for(auto cc : ccs) { + // auto size = table->sizeHintForColumn(cc); + // if(size==0) { + // int cnt = 8; + // do { + // wait(50); + // size = table->sizeHintForColumn(cc); + // } while(size==0 && --cnt); + // } + // if(size>table->header()->sectionSize(cc)) table->header()->resizeSection(cc, size); + // } } void UpgradeApkDialog::sendProgress(UpdateApkItem *item) { diff --git a/LedOK/deviceitem.cpp b/LedOK/deviceitem.cpp index 9208017..6501223 100644 --- a/LedOK/deviceitem.cpp +++ b/LedOK/deviceitem.cpp @@ -1,6 +1,6 @@ #include "deviceitem.h" #include "devicepanel.h" -#include "globaldefine.h" +#include "main.h" #include "gutil/qwaitingdlg.h" #include "gutil/qgui.h" #include "gutil/qnetwork.h" diff --git a/LedOK/deviceitem.h b/LedOK/deviceitem.h index 28b027b..80a5a7b 100644 --- a/LedOK/deviceitem.h +++ b/LedOK/deviceitem.h @@ -2,7 +2,7 @@ #define DEVICEITEM_H #include "base/loqtreewidget.h" -#include "globaldefine.h" +#include "main.h" #include #include diff --git a/LedOK/devicepanel.cpp b/LedOK/devicepanel.cpp index 5db747e..7734036 100644 --- a/LedOK/devicepanel.cpp +++ b/LedOK/devicepanel.cpp @@ -1,5 +1,5 @@ #include "devicepanel.h" -#include "globaldefine.h" +#include "main.h" #include "gutil/qgui.h" #include "gutil/qnetwork.h" #include "deviceitem.h" @@ -139,7 +139,7 @@ QPushButton:hover {background-color: #08b;} hBox->addWidget(areaFlash); - mHBox = new HBox(vBox); + vBox->addWidget(splitter = new QSplitter, 1); auto table = new LoQTreeWidget; table->addCol("#", "", 20); @@ -169,7 +169,7 @@ QPushButton:hover {background-color: #08b;} for(int i=0; iitem(i)->checkState("check") == Qt::Checked) gSelCards.append(static_cast(table->topLevelItem(i))->mCard); emit sigSelectedDeviceList(); }); - mHBox->addWidget(mDeviceTable = table); + splitter->addWidget(mDeviceTable = table); connect(&mUdpTimer, &QTimer::timeout, this, &DevicePanel::sendGetInfo); connect(&mUdpSocket, &QUdpSocket::readyRead, this, [this] { @@ -228,7 +228,7 @@ QPushButton:hover {background-color: #08b;} msgpre.append(tr("Android OS Resolution")).append(": ").append(item->mCard.ScreenResolution).append("\n"); msgpre.append(tr("Android Version")).append(": ").append(item->mCard.androidVersion).append("\n"); msgpre.append(tr("FPGA Version")).append(": ").append(item->mCard.HardVersion).append("\n"); - msgpre.append(tr("Firmware Version")).append(": ").append(item->mCard.FirmwareVersion).append("\n"); + msgpre.append(tr("Firmware Version")).append(": ").append(item->mCard.firmwareVer).append("\n"); msgpre.append("IMEI: ").append(item->mCard.IMEI).append("\n"); QMessageBox msgBox(QMessageBox::Information, item->mCard.id+" "+tr("Detail Info"), msgpre + tr("Player Version")+": "+tr("Getting")+" ..."); QJsonObject json; @@ -392,7 +392,7 @@ void DevicePanel::transCtrl() { } } void DevicePanel::newCtrl() { - mHBox->addWidget(mDeviceCtrlPanel = new QWidget); + splitter->addWidget(mDeviceCtrlPanel = new QWidget); auto vBox = new QVBoxLayout(mDeviceCtrlPanel); vBox->setContentsMargins(0,0,0,0); vBox->setSpacing(0); @@ -494,6 +494,10 @@ void DevicePanel::newCtrl() { mBtnGrp->button(0)->setChecked(true); + splitter->setStretchFactor(0, 0); + splitter->setStretchFactor(1, 1); + splitter->setSizes({300, 1}); + transCtrl(); } @@ -507,7 +511,7 @@ void DevicePanel::init(DeviceItem *item) { auto err = errStrWithJson(reply, &json); if(! err.isEmpty()) return; item->mCard.BrightnessLevel = json["BrightnessLevel"].toInt(); - item->mCard.FirmwareVersion = json["FirmwareVersion"].toStr(); + item->mCard.firmwareVer = json["FirmwareVersion"].toStr(); item->mCard.HardVersion = json["HardVersion"].toStr(); item->mCard.ScreenResolution = json["ScreenResolution"].toStr(); item->mCard.IMEI = json["IMEI"].toStr(); diff --git a/LedOK/devicepanel.h b/LedOK/devicepanel.h index 152ebcd..cd8225f 100644 --- a/LedOK/devicepanel.h +++ b/LedOK/devicepanel.h @@ -2,7 +2,7 @@ #define DEVICEPANEL_H #include "base/loqtreewidget.h" -#include "globaldefine.h" +#include "main.h" #include "gutil/qgui.h" #include #include @@ -34,7 +34,7 @@ public: QLabel *label_3, *nDeviceNum; QComboBox *bnSpecifyIP; QPushButton *btnRefresh; - HBox *mHBox{0}; + QSplitter *splitter; QTextEdit *fdInfo; QButtonGroup *mBtnGrp; diff --git a/LedOK/globaldefine.cpp b/LedOK/globaldefine.cpp deleted file mode 100644 index 218c3fe..0000000 --- a/LedOK/globaldefine.cpp +++ /dev/null @@ -1,145 +0,0 @@ -#include "globaldefine.h" -#include "devicepanel.h" -#include "deviceitem.h" -#include "gutil/qnetwork.h" -#include -#include -#include -#include -#include - -QString gFileHome; -QString gApkHome; -QList gSelCards; -bool gVideoCompress = false; -bool gVideoTranscoding = false; -bool gTextAntialiasing = false; -bool gWidthSplit = false; -int gSendBatch = 5; -bool gHideDetect = false; -bool gShowAlias = false; -bool gShowLora = false; - -DeviceItem *findItem(QString id) { - int cnt = gDevicePanel->mDeviceTable->topLevelItemCount(); - for(int i=0; imDeviceTable->topLevelItem(i); - if(item==0) continue; - if(item->mCard.id==id) return item; - } - return 0; -} - -QString checkReply(QNetworkReply *reply, QJsonDocument *outJson) { - auto err = errStr(reply); - if(! err.isEmpty()) { - auto data = reply->readAll(); - if(! data.isEmpty()) err = err+"\n"+QCoreApplication::translate("Def","Device replied")+": "+data; - return err; - } - if(outJson) { - auto data = reply->readAll(); - QJsonParseError jsonErr; - *outJson = QJsonDocument::fromJson(data, &jsonErr); - if(jsonErr.error != QJsonParseError::NoError) return "Json error: "+jsonErr.errorString()+"\n"+QCoreApplication::translate("Def","Device replied")+": "+data; - } - return ""; -} -QString errStrWithJson(QNetworkReply *reply, JValue *outJson, QByteArray *outData) { - auto err = errStr(reply); - auto data = reply->readAll(); - if(outData) *outData = data; - if(! err.isEmpty()) { - if(! data.isEmpty()) err = err+"\n"+QCoreApplication::translate("Def","Device replied")+": "+data; - return err; - } - QString error; - auto json = JFrom(data, &error); - if(! error.isEmpty()) return "JSON Error: "+error+"\n"+QCoreApplication::translate("Def","Device replied")+": "+data; - if(! json["success"].toBool()) return QCoreApplication::translate("Def","Fail")+". "+QCoreApplication::translate("Def","Device replied")+": "+data; - if(outJson) *outJson = json; - return ""; -} -QString checkReplyForJson(QNetworkReply *reply, QJsonDocument *outJson, QByteArray *outData) { - auto err = errStr(reply); - auto data = reply->readAll(); - if(outData) *outData = data; - if(! err.isEmpty()) { - if(! data.isEmpty()) err = err+"\n"+QCoreApplication::translate("Def","Device replied")+": "+data; - return err; - } - QJsonParseError jsonErr; - QJsonDocument json = QJsonDocument::fromJson(data, &jsonErr); - if(jsonErr.error != QJsonParseError::NoError) return "Json error: "+jsonErr.errorString()+"\n"+QCoreApplication::translate("Def","Device replied")+": "+data; - if(! json["success"].toBool()) return QCoreApplication::translate("Def","Fail")+". "+QCoreApplication::translate("Def","Device replied")+": "+data; - if(outJson) outJson->swap(json); - return ""; -} -QString checkReplyForJson(QNetworkReply *reply, QString errField) { - auto err = errStr(reply); - auto data = reply->readAll(); - if(! err.isEmpty()) { - if(! data.isEmpty()) err = err+"\n"+QCoreApplication::translate("Def","Device replied")+": "+data; - return err; - } - QJsonParseError jsonErr; - QJsonDocument json = QJsonDocument::fromJson(data, &jsonErr); - if(jsonErr.error != QJsonParseError::NoError) return "Json error: "+jsonErr.errorString()+"\n"+QCoreApplication::translate("Def","Device replied")+": "+data; - if(! json["success"].toBool()) { - auto errStr = json[errField].toString(); - return QCoreApplication::translate("Def","Fail")+". "+QCoreApplication::translate("Def","Device replied")+": "+(errStr.isEmpty() ? data : errStr); - } - return ""; -} - -quint64 dirFileSize(const QString &path) { - QDir dir(path); - quint64 size = 0; - auto infos = dir.entryInfoList(QDir::Files); - foreach(QFileInfo fileInfo, infos) size += fileInfo.size(); - auto subDirs = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); - foreach(QString subDir, subDirs) size += dirFileSize(path + QDir::separator() + subDir); - return size; -} - -bool copyDir(const QString &source, const QString &destination, bool override) { - QDir directory(source); - if(!directory.exists()) return false; - QString srcPath = QDir::toNativeSeparators(source); - if(!srcPath.endsWith(QDir::separator())) srcPath += QDir::separator(); - QString dstPath = QDir::toNativeSeparators(destination); - if (!dstPath.endsWith(QDir::separator())) dstPath += QDir::separator(); - - bool error = false; - QStringList fileNames = directory.entryList(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden); - for (QStringList::size_type i=0; i != fileNames.size(); ++i) - { - QString fileName = fileNames.at(i); - QString srcFilePath = srcPath + fileName; - QString dstFilePath = dstPath + fileName; - QFileInfo fileInfo(srcFilePath); - if (fileInfo.isFile() || fileInfo.isSymLink()) - { - if (override) - { - QFile::setPermissions(dstFilePath, QFile::WriteOwner); - } - QFile::copy(srcFilePath, dstFilePath); - } - else if (fileInfo.isDir()) - { - QDir dstDir(dstFilePath); - dstDir.mkpath(dstFilePath); - if (!copyDir(srcFilePath, dstFilePath, override)) - { - error = true; - } - } - } - return !error; -} -unsigned char GetCheckCodeIn8(unsigned char *str, unsigned int size) { - unsigned char checkCode = 0; - for(int i=0; i #include +#include #include #include +#include #include + #if(QT_VERSION_MAJOR > 5) #include #endif +const QString UpdVerUrl = "https://www.ledok.cn/download/LedOK Express Updates.json"; + +QString programsDir() { + static auto rtn = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/programs"; + return rtn; +} + #ifdef _MSC_VER //MSVC编译器 #include #include @@ -76,3 +89,152 @@ int main(int argc, char *argv[]) { return a.exec(); } + + +QString gFileHome; +QList gSelCards; + +DeviceItem *findItem(QString id) { + int cnt = gDevicePanel->mDeviceTable->topLevelItemCount(); + for(int i=0; imDeviceTable->topLevelItem(i); + if(item==0) continue; + if(item->mCard.id==id) return item; + } + return 0; +} + +QString checkReply(QNetworkReply *reply, QJsonDocument *outJson) { + auto err = errStr(reply); + if(! err.isEmpty()) { + auto data = reply->readAll(); + if(! data.isEmpty()) err = err+"\n"+QCoreApplication::translate("Def","Device replied")+": "+data; + return err; + } + if(outJson) { + auto data = reply->readAll(); + QJsonParseError jsonErr; + *outJson = QJsonDocument::fromJson(data, &jsonErr); + if(jsonErr.error != QJsonParseError::NoError) return "Json error: "+jsonErr.errorString()+"\n"+QCoreApplication::translate("Def","Device replied")+": "+data; + } + return ""; +} +QString errStrWithJson(QNetworkReply *reply, JValue *outJson, QByteArray *outData) { + auto err = errStr(reply); + auto data = reply->readAll(); + if(outData) *outData = data; + if(! err.isEmpty()) { + if(! data.isEmpty()) err = err+"\n"+QCoreApplication::translate("Def","Device replied")+": "+data; + return err; + } + QString error; + auto json = JFrom(data, &error); + if(! error.isEmpty()) return "JSON Error: "+error+"\n"+QCoreApplication::translate("Def","Device replied")+": "+data; + if(! json["success"].toBool()) return QCoreApplication::translate("Def","Fail")+". "+QCoreApplication::translate("Def","Device replied")+": "+data; + if(outJson) *outJson = json; + return ""; +} +QString checkReplyForJson(QNetworkReply *reply, QJsonDocument *outJson, QByteArray *outData) { + auto err = errStr(reply); + auto data = reply->readAll(); + if(outData) *outData = data; + if(! err.isEmpty()) { + if(! data.isEmpty()) err = err+"\n"+QCoreApplication::translate("Def","Device replied")+": "+data; + return err; + } + QJsonParseError jsonErr; + QJsonDocument json = QJsonDocument::fromJson(data, &jsonErr); + if(jsonErr.error != QJsonParseError::NoError) return "Json error: "+jsonErr.errorString()+"\n"+QCoreApplication::translate("Def","Device replied")+": "+data; + if(! json["success"].toBool()) return QCoreApplication::translate("Def","Fail")+". "+QCoreApplication::translate("Def","Device replied")+": "+data; + if(outJson) outJson->swap(json); + return ""; +} +QString checkReplyForJson(QNetworkReply *reply, QString errField) { + auto err = errStr(reply); + auto data = reply->readAll(); + if(! err.isEmpty()) { + if(! data.isEmpty()) err = err+"\n"+QCoreApplication::translate("Def","Device replied")+": "+data; + return err; + } + QJsonParseError jsonErr; + QJsonDocument json = QJsonDocument::fromJson(data, &jsonErr); + if(jsonErr.error != QJsonParseError::NoError) return "Json error: "+jsonErr.errorString()+"\n"+QCoreApplication::translate("Def","Device replied")+": "+data; + if(! json["success"].toBool()) { + auto errStr = json[errField].toString(); + return QCoreApplication::translate("Def","Fail")+". "+QCoreApplication::translate("Def","Device replied")+": "+(errStr.isEmpty() ? data : errStr); + } + return ""; +} + +quint64 dirFileSize(const QString &path) { + QDir dir(path); + quint64 size = 0; + auto infos = dir.entryInfoList(QDir::Files); + foreach(QFileInfo fileInfo, infos) size += fileInfo.size(); + auto subDirs = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); + foreach(QString subDir, subDirs) size += dirFileSize(path + QDir::separator() + subDir); + return size; +} + +bool copyDir(const QString &source, const QString &destination, bool override) { + QDir directory(source); + if(!directory.exists()) return false; + QString srcPath = QDir::toNativeSeparators(source); + if(!srcPath.endsWith(QDir::separator())) srcPath += QDir::separator(); + QString dstPath = QDir::toNativeSeparators(destination); + if (!dstPath.endsWith(QDir::separator())) dstPath += QDir::separator(); + + bool error = false; + QStringList fileNames = directory.entryList(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden); + for (QStringList::size_type i=0; i != fileNames.size(); ++i) + { + QString fileName = fileNames.at(i); + QString srcFilePath = srcPath + fileName; + QString dstFilePath = dstPath + fileName; + QFileInfo fileInfo(srcFilePath); + if (fileInfo.isFile() || fileInfo.isSymLink()) + { + if (override) + { + QFile::setPermissions(dstFilePath, QFile::WriteOwner); + } + QFile::copy(srcFilePath, dstFilePath); + } + else if (fileInfo.isDir()) + { + QDir dstDir(dstFilePath); + dstDir.mkpath(dstFilePath); + if (!copyDir(srcFilePath, dstFilePath, override)) + { + error = true; + } + } + } + return !error; +} +unsigned char GetCheckCodeIn8(unsigned char *str, unsigned int size) { + unsigned char checkCode = 0; + for(int i=0; itextCursor(); + if(! cursor.hasSelection()) cursor.select(QTextCursor::WordUnderCursor); + cursor.mergeCharFormat(fmt); +} + +Tick::Tick(QWidget *parent) : QOpenGLWidget(parent) { + setGeometry(0, 0, 1, 1); + connect(this, &QOpenGLWidget::frameSwapped, this, &Tick::doFrame); +} + +void Tick::doFrame() { + auto cur = QDateTime::currentDateTime(); + auto secs = cur.toSecsSinceEpoch(); + if(secs != Sec) { + Sec = secs; + emit secChanged(cur); + } + update(); +} diff --git a/LedOK/globaldefine.h b/LedOK/main.h similarity index 84% rename from LedOK/globaldefine.h rename to LedOK/main.h index 15cb5aa..2671db7 100644 --- a/LedOK/globaldefine.h +++ b/LedOK/main.h @@ -1,135 +1,157 @@ -#ifndef GLOBALDEFINE_H -#define GLOBALDEFINE_H - -#include "gutil/qjson.h" -#include -#include - -struct LedCard { - QString id; - QString ip; - int mWidth = 0; - int mHeight = 0; - int bright = 100; - int BrightnessLevel = 255; - QString FirmwareVersion; - QString HardVersion = "0000"; - QString ScreenResolution; - QString androidVersion; - QString playerVer; - QString alias; - QString IMEI; - bool hasPassword{false}; - bool isLocked{true}; - bool isScreenOn{true}; - bool isOnline{true}; -}; - -enum { - MainPage_DeviceManager = 0, - MainPage_ProgManager, - MainPage_Setting, - MainPage_LoraScreen, - MainPage_End, -}; - - -struct ST_ANSY_PROGRAM_PACKET { - unsigned char SyncHead[3]{0x7e, 0x7e, 0x55}; - unsigned char ucCommType; - int iBaoLiu; - unsigned int iLength; - unsigned char pDataBuffer[20]; -}; - -extern QString gFileHome; -extern QString gApkHome; -class DevicePanel; -extern DevicePanel *gDevicePanel; -extern QList gSelCards; -extern bool gVideoCompress; -extern bool gVideoTranscoding; -extern bool gTextAntialiasing; -extern bool gWidthSplit; -extern int gSendBatch; -extern bool gHideDetect; -extern bool gShowAlias; -extern bool gShowLora; - -extern quint64 dirFileSize(const QString &path); -extern bool copyDir(const QString &source, const QString &destination, bool override); -extern unsigned char GetCheckCodeIn8(unsigned char * pBuffer,unsigned int uiSize); - -enum _ENUM_CONTRL_WIDGET { - Setting_Bright=0, - Setting_PowerControl, - Setting_NetCfg, - Setting_VerifyClock, - Setting_Encrypt, - Setting_HDMI, - Setting_Volume, - Setting_Advanced, - Setting_Test, - Setting_End, -}; -class DeviceItem; -extern DeviceItem *findItem(QString id); - -inline int verCompare(const QString& a, const QString& b) { - auto aparts = a.split("."); - auto bparts = b.split("."); - int cnt = qMin(aparts.count(), bparts.count()); - for(int i=0; i bparts.count() ? aparts[cnt].toInt() : bparts[cnt].toInt(); -} - -QString checkReply(QNetworkReply *, QJsonDocument * = 0); -QString errStrWithJson(QNetworkReply *, JValue * = 0, QByteArray * = 0); -QString checkReplyForJson(QNetworkReply *, QJsonDocument * = 0, QByteArray * = 0); -QString checkReplyForJson(QNetworkReply *, QString errField); - -#define Def_CtrlReqPre \ - waitingDlg->show();\ - auto card = gSelCards[0];\ - auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json);\ - connect(waitingDlg, &WaitingDlg::rejected, reply, &QNetworkReply::deleteLater); - -#define Def_CtrlSetReqAfter \ - QString err = checkReplyForJson(reply);\ - if(! err.isEmpty()) {\ - waitingDlg->close();\ - QMessageBox::critical(this, tr("Error"), err);\ - return;\ - }\ - waitingDlg->success(); - -#define Def_CtrlSingleGetReply \ - QJsonDocument json;\ - QString err = checkReplyForJson(reply, &json);\ - if(! err.isEmpty()) {\ - waitingDlg->close();\ - QMessageBox::critical(this, tr("Error"), err);\ - return;\ - } - -#define Def_CtrlSetMulti(tip) \ - auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json);\ - connect(reply, &QNetworkReply::finished, gFdResInfo, [=] {\ - QString err = checkReplyForJson(reply);\ - gFdResInfo->append(card.id+" "+tip+" "+(err.isEmpty()?QCoreApplication::translate("Def","Success"):err));\ - }); - -class LocalObj : public QObject { -public : - int cnt = 1; - void reset() { - cnt = 0; - } -}; - -#endif // GLOBALDEFINE_H +#ifndef MAIN_H +#define MAIN_H + +#include "gutil/qjson.h" +#include +#include +#include +#include + +#define PAGEDEL_SUFFIX "@D$E$L&20111005&" +#define RECTF_INVALID QRectF(-9999, -9999, 0, 0) + +struct LedCard { + QString id; + QString ip; + int mWidth = 0; + int mHeight = 0; + int bright = 100; + int BrightnessLevel = 255; + QString firmwareVer; + QString HardVersion = "0000"; + QString ScreenResolution; + QString androidVersion; + QString playerVer; + QString alias; + QString IMEI; + bool hasPassword = false; + bool isLocked = true; + bool isScreenOn = true; + bool isOnline = true; +}; +class Tick : public QOpenGLWidget { + Q_OBJECT +public: + Tick(QWidget *parent = 0); + + void doFrame(); + + qint64 Sec; +signals: + void secChanged(const QDateTime &); +}; +enum { + MainPage_DeviceManager = 0, + MainPage_ProgManager, + MainPage_Setting, + MainPage_LoraScreen, + MainPage_End, +}; + + +struct ST_ANSY_PROGRAM_PACKET { + unsigned char SyncHead[3]{0x7e, 0x7e, 0x55}; + unsigned char ucCommType; + int iBaoLiu; + unsigned int iLength; + unsigned char pDataBuffer[20]; +}; + +extern const QString UpdVerUrl; +QString programsDir(); + +extern Tick *gTick; +extern QString gFileHome; +extern QString gApkHome; +class DevicePanel; +extern DevicePanel *gDevicePanel; +extern QList gSelCards; +extern bool gVideoCompress; +extern bool gVideoTranscoding; +extern bool gTextAntialiasing; +extern bool gWidthSplit; +extern int gSendBatch; +extern bool gHideDetect; +extern bool gShowIP; +extern bool gShowAlias; +extern bool gShowLora; + +extern quint64 dirFileSize(const QString &path); +extern bool copyDir(const QString &source, const QString &destination, bool override); +extern unsigned char GetCheckCodeIn8(unsigned char * pBuffer,unsigned int uiSize); + +enum _ENUM_CONTRL_WIDGET { + Setting_Bright=0, + Setting_PowerControl, + Setting_NetCfg, + Setting_VerifyClock, + Setting_Encrypt, + Setting_HDMI, + Setting_Volume, + Setting_Advanced, + Setting_Test, + Setting_End, +}; +class DeviceItem; +extern DeviceItem *findItem(QString id); + +inline int verCompare(const QString& a, const QString& b) { + auto aparts = a.split("."); + auto bparts = b.split("."); + int cnt = qMin(aparts.count(), bparts.count()); + for(int i=0; i bparts.count() ? aparts[cnt].toInt() : bparts[cnt].toInt(); +} + +QString checkReply(QNetworkReply *, QJsonDocument * = 0); +QString errStrWithJson(QNetworkReply *, JValue * = 0, QByteArray * = 0); +QString checkReplyForJson(QNetworkReply *, QJsonDocument * = 0, QByteArray * = 0); +QString checkReplyForJson(QNetworkReply *, QString errField); + +void MergeFmt(QTextEdit *textEdit, const QTextCharFormat &fmt); + +#define Def_CtrlReqPre \ + waitingDlg->show();\ + auto card = gSelCards[0];\ + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json);\ + connect(waitingDlg, &WaitingDlg::rejected, reply, &QNetworkReply::deleteLater); + +#define Def_CtrlSetReqAfter \ + QString err = checkReplyForJson(reply);\ + if(! err.isEmpty()) {\ + waitingDlg->close();\ + QMessageBox::critical(this, tr("Error"), err);\ + return;\ + }\ + waitingDlg->success(); + +#define Def_CtrlSingleGetReply \ + QJsonDocument json;\ + QString err = checkReplyForJson(reply, &json);\ + if(! err.isEmpty()) {\ + waitingDlg->close();\ + QMessageBox::critical(this, tr("Error"), err);\ + return;\ + } + +#define Def_CtrlSetMulti(tip) \ + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json);\ + connect(reply, &QNetworkReply::finished, gFdResInfo, [=] {\ + QString err = checkReplyForJson(reply);\ + gFdResInfo->append(card.id+" "+tip+" "+(err.isEmpty()?QCoreApplication::translate("Def","Success"):err));\ + }); + +class LocalObj : public QObject { +public : + int cnt = 1; + void reset() { + cnt = 0; + } +}; + +#endif // MAIN_H diff --git a/LedOK/mainwindow.cpp b/LedOK/mainwindow.cpp index a5c7fd0..b4657b8 100644 --- a/LedOK/mainwindow.cpp +++ b/LedOK/mainwindow.cpp @@ -1,7 +1,6 @@ #include "mainwindow.h" #include "gutil/qgui.h" -#include "cfg.h" -#include "globaldefine.h" +#include "main.h" #include "devicepanel.h" #include "gutil/qnetwork.h" #include "device/upgradeapkdialog.h" @@ -18,9 +17,22 @@ #include #include #include +#include extern QPoint gPlayPos; +QString gApkHome; +bool gVideoCompress = false; +bool gVideoTranscoding = false; +bool gTextAntialiasing = false; +bool gWidthSplit = false; +int gSendBatch = 5; +bool gHideDetect = false; +bool gShowIP = true; +bool gShowAlias = false; +bool gShowLora = false; +Tick *gTick; + class ImgBtn : public QToolButton { public: ImgBtn() { @@ -213,9 +225,6 @@ MainWindow::MainWindow(QWidget *parent) : BaseWin(parent) { pLayout->addWidget(m_wTitle->bn_Close); auto menu_setting = new QMenu; - act_lang = new QAction; - act_lang->setMenu(menuLang); - menu_setting->addAction(act_lang); actFirmware = new QAction(tr("firmware manager")); connect(actFirmware, &QAction::triggered, this, [this] { @@ -267,6 +276,10 @@ MainWindow::MainWindow(QWidget *parent) : BaseWin(parent) { fdHideDetect->setChecked(gHideDetect); vBox->addWidget(fdHideDetect); + auto fdShowIP = new QCheckBox(tr("Show IP in Terminal Control")); + fdShowIP->setChecked(gShowIP); + vBox->addWidget(fdShowIP); + auto fdShowAlias = new QCheckBox(tr("Show Alias in Terminal Control")); fdShowAlias->setChecked(gShowAlias); vBox->addWidget(fdShowAlias); @@ -286,6 +299,7 @@ MainWindow::MainWindow(QWidget *parent) : BaseWin(parent) { settings.setValue("WidthSplit", gWidthSplit = fdWidthSplit->isChecked()); settings.setValue("SendBatch", gSendBatch = fdSendBatch->value()); settings.setValue("HideDetect", gHideDetect = fdHideDetect->isChecked()); + settings.setValue("ShowIP", gShowIP = fdShowIP->isChecked()); settings.setValue("ShowAlias", gShowAlias = fdShowAlias->isChecked()); settings.setValue("GuangYingPin", gShowLora = fdShowLora->isChecked()); dlg.accept(); @@ -295,19 +309,18 @@ MainWindow::MainWindow(QWidget *parent) : BaseWin(parent) { dlg.exec(); fdDetectCard->setVisible(! gHideDetect); if(mDevicePanel->mDeviceTable->isColumnHidden(mDevicePanel->mDeviceTable->columnCount()-1)) { - if(gShowAlias) { - mDevicePanel->mDeviceTable->showColumn("alias"); - mDevicePanel->mDeviceTable->hideColumn("ip"); - } else { - mDevicePanel->mDeviceTable->hideColumn("alias"); - mDevicePanel->mDeviceTable->showColumn("ip"); - } + mDevicePanel->mDeviceTable->setColumnHidden("ip", ! gShowIP); + mDevicePanel->mDeviceTable->setColumnHidden("alias", ! gShowAlias); mDevicePanel->mDeviceTable->adjSections(-1, 0); } mBtnGrp->button(MainPage_LoraScreen)->setVisible(gShowLora); }); menu_setting->addAction(actPreferences); + act_lang = new QAction; + act_lang->setMenu(menuLang); + menu_setting->addAction(act_lang); + #if !defined leyide && !defined citta act_upd = new QAction(tr("Check for updates")); connect(act_upd, &QAction::triggered, this, [this] { @@ -428,7 +441,7 @@ MainWindow::MainWindow(QWidget *parent) : BaseWin(parent) { }); #endif - act_help = new QAction(); + act_help = new QAction; connect(act_help, &QAction::triggered, this, [this] { auto act = langGrp->checkedAction(); if(act==0) return; @@ -436,14 +449,11 @@ MainWindow::MainWindow(QWidget *parent) : BaseWin(parent) { }); menu_setting->addAction(act_help); - actInfo = new QAction; - connect(actInfo, &QAction::triggered, this, [this] { - QMessageBox::information(this, tr("Info"), QFileInfo("aaa.file").absoluteFilePath() - .append("\nSupportsSsl: ").append(QSslSocket::supportsSsl()?"true":"false") - .append("\nSslLibraryBuildVersion: ").append(QSslSocket::sslLibraryBuildVersionString().append(" (").append(QString::number(QSslSocket::sslLibraryBuildVersionNumber())).append(")")) - .append("\nSslLibraryVersion: ").append(QSslSocket::sslLibraryVersionString()).append(" (").append(QString::number(QSslSocket::sslLibraryVersionNumber())).append(")")); - }); - menu_setting->addAction(actInfo); + // QMessageBox::information(this, tr("Info"), QFileInfo("aaa.file").absoluteFilePath() + // .append("\nSupportsSsl: ").append(QSslSocket::supportsSsl()?"true":"false") + // .append("\nSslLibraryBuildVersion: ").append(QSslSocket::sslLibraryBuildVersionString().append(" (").append(QString::number(QSslSocket::sslLibraryBuildVersionNumber())).append(")")) + // .append("\nSslLibraryVersion: ").append(QSslSocket::sslLibraryVersionString()).append(" (").append(QString::number(QSslSocket::sslLibraryVersionNumber())).append(")")); + #if !defined leyide && !defined citta act_about = new QAction(tr("About")); @@ -544,11 +554,11 @@ MainWindow::MainWindow(QWidget *parent) : BaseWin(parent) { mDevicePanel->mDeviceTable->showColumn("check"); mDevicePanel->mDeviceTable->fdCheckAll->show(); mDevicePanel->fdCardNumInfo->show(); - auto specialIdx = (gShowAlias ? "alias" : "ip")**mDevicePanel->mDeviceTable; - for(int j="id"**mDevicePanel->mDeviceTable+1; jmDeviceTable->columnCount(); j++) if(j!=specialIdx) mDevicePanel->mDeviceTable->hideColumn(j); + auto idxIP = ! gShowIP ? -1 : "ip"**mDevicePanel->mDeviceTable; + auto idxAlias = ! gShowAlias ? -1 : "alias"**mDevicePanel->mDeviceTable; + for(int j="id"**mDevicePanel->mDeviceTable+1; jmDeviceTable->columnCount(); j++) if(j!=idxIP && j!=idxAlias) mDevicePanel->mDeviceTable->hideColumn(j); if(mDevicePanel->mDeviceCtrlPanel) mDevicePanel->mDeviceCtrlPanel->show(); else mDevicePanel->newCtrl(); - mDevicePanel->mDeviceTable->setMaximumWidth(300); } }); @@ -614,6 +624,7 @@ MainWindow::MainWindow(QWidget *parent) : BaseWin(parent) { gSendBatch = settings.value("SendBatch", 5).toInt(); gHideDetect = settings.value("HideDetect").toBool(); gShowAlias = settings.value("ShowAlias").toBool(); + gShowIP = settings.value("ShowIP", ! gShowAlias).toBool(); gShowLora = settings.value("GuangYingPin").toBool(); if(gHideDetect) fdDetectCard->hide(); @@ -658,6 +669,8 @@ MainWindow::MainWindow(QWidget *parent) : BaseWin(parent) { QColorDialog::setStandardColor(ci++, QColor(lows[i], mids[i], higs[i])); QColorDialog::setStandardColor(ci++, QColor(mids[i], lows[i], higs[i])); } + + gTick = new Tick(this); } MainWindow::~MainWindow() { QSettings settings; @@ -691,7 +704,6 @@ void MainWindow::transUi() { fdDetectCard->setText(tr("Check card")); act_lang->setText(tr("Language")); act_help->setText(tr("Help")); - actInfo->setText(tr("Info")); if(act_about) act_about->setText(tr("About")); if(act_upd) act_upd->setText(tr("Check for updates")); actFirmware->setText(tr("firmware manager")); diff --git a/LedOK/mainwindow.h b/LedOK/mainwindow.h index 05368d4..4a488d3 100644 --- a/LedOK/mainwindow.h +++ b/LedOK/mainwindow.h @@ -4,7 +4,7 @@ #include "base/loqtitlebar.h" #include "basewin.h" #include "devicepanel.h" -#include "globaldefine.h" +#include "main.h" #include "mguangyingpinwidget.h" #include "progpanel.h" #include @@ -25,7 +25,7 @@ private: LoQTitleBar *m_wTitle; QActionGroup *langGrp; QAction *act_lang; - QAction *act_help, *actInfo; + QAction *act_help; QAction *act_upd = 0; QAction *actFirmware; QAction *actPreferences; diff --git a/LedOK/mguangyingpinwidget.cpp b/LedOK/mguangyingpinwidget.cpp index 736f53f..141fe98 100644 --- a/LedOK/mguangyingpinwidget.cpp +++ b/LedOK/mguangyingpinwidget.cpp @@ -1,6 +1,6 @@ #include "mguangyingpinwidget.h" #include "gutil/qgui.h" -#include "globaldefine.h" +#include "main.h" #include #include #include diff --git a/LedOK/player/eletimer.cpp b/LedOK/player/eletimer.cpp index fcb9197..ce70b73 100644 --- a/LedOK/player/eletimer.cpp +++ b/LedOK/player/eletimer.cpp @@ -1,6 +1,5 @@ #include "eletimer.h" -#include "tools.h" -#include "globaldefine.h" +#include "main.h" #include EleTimer::EleTimer(const JValue &json, QWidget *parent) : QWidget{parent} { @@ -22,11 +21,11 @@ EleTimer::EleTimer(const JValue &json, QWidget *parent) : QWidget{parent} { textColor = json["textColor"].toString(); auto color = json["backColor"].toString(); backColor = color.isEmpty() ? QColor(0,0,0,0) : color; - connect(Tools::getInstance(), &Tools::sTick, this, [this]() { - QDateTime cDateTime = QDateTime::currentDateTime(); - qint64 ofs = isDown ? cDateTime.secsTo(targetTime) : targetTime.secsTo(cDateTime); - if(ofs < 0) ofs = 0; - secs = ofs; + connect(gTick, &Tick::secChanged, this, [this](const QDateTime &cur) { + auto sss = isDown ? cur.secsTo(targetTime) : targetTime.secsTo(cur); + if(sss < 0) sss = 0; + if(secs==sss) return; + secs = sss; update(); }); } diff --git a/LedOK/progpanel.cpp b/LedOK/progpanel.cpp index 5d3bc38..fe44448 100644 --- a/LedOK/progpanel.cpp +++ b/LedOK/progpanel.cpp @@ -1,6 +1,6 @@ #include "progpanel.h" #include "program/progitem.h" -#include "globaldefine.h" +#include "main.h" #include "gutil/qgui.h" #include "cfg.h" #include "player/playwin.h" diff --git a/LedOK/program/eaclock.cpp b/LedOK/program/eaclock.cpp index b6581f5..e3a25bb 100644 --- a/LedOK/program/eaclock.cpp +++ b/LedOK/program/eaclock.cpp @@ -1,7 +1,7 @@ #include "eaclock.h" #include "QtWidgets/qgraphicsscene.h" #include "cfg.h" -#include "globaldefine.h" +#include "main.h" #include "gutil/qgui.h" #include "tools.h" #include "base/locolorselector.h" diff --git a/LedOK/program/ebase.cpp b/LedOK/program/ebase.cpp index 296e069..f72c237 100644 --- a/LedOK/program/ebase.cpp +++ b/LedOK/program/ebase.cpp @@ -53,8 +53,10 @@ void EBase::setBaseAttr(const JObj &json) { mEntryDur = json["entryDur"].toInt(); mExitDur = json["exitDur"].toInt(); _rotate = json["rotate"].toInt(); - _blink = json["blink"].toDouble(1.0); + _opacity = json["opacity"].toDouble(1); + _blink = json["blink"].toDouble(1); _hasBlink = json["hasBlink"].toBool(); + _hasBreathe = json["hasBreathe"].toBool(); auto geometry = json["geometry"]; setPos(geometry["x"].toInt(), geometry["y"].toInt()); setSize(geometry["w"].toInt(), geometry["h"].toInt()); @@ -87,8 +89,10 @@ void EBase::addBaseAttr(JObj &obj) const { obj.insert("entryDur", mEntryDur); obj.insert("exitDur", mExitDur); obj["rotate"] = _rotate; + obj["opacity"] = _opacity; obj["blink"] = _blink; obj["hasBlink"] = _hasBlink; + obj["hasBreathe"] = _hasBreathe; if(bdImgIdx>-1) { obj["border"] = borderImgs[bdImgIdx].name; obj["borderSize"] = JArray{borderImgs[bdImgIdx].img.width(), borderImgs[bdImgIdx].img.height()}; @@ -660,15 +664,31 @@ void EBase::addBaseAttrWgt(QBoxLayout *vBox) { hBox->addLabel(tr("Rotate")+": "); auto fdRotate = new QSpinBox; - fdRotate->setRange(0, 359); + fdRotate->setRange(-180, 360); fdRotate->setValue(_rotate); - fdRotate->setToolTip("Need Player 2.1.4"); + fdRotate->setToolTip("Need Player 2.1.9"); connect(fdRotate, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, [this](int value) { _rotate = value; + //setRotation(value); }); hBox->addWidget(fdRotate); hBox->addSpacing(-spacing+2); hBox->addLabel("°"); + hBox->addSpacing(10); + + hBox->addLabel(tr("Opacity")+": "); + + auto fdOpacity = new QDoubleSpinBox; + fdOpacity->setDecimals(2); + fdOpacity->setSingleStep(0.1); + fdOpacity->setRange(0, 1); + fdOpacity->setValue(_opacity); + fdOpacity->setToolTip("Need Player 2.1.9"); + connect(fdOpacity, (void(QDoubleSpinBox::*)(double))&QDoubleSpinBox::valueChanged, this, [this](double value) { + _opacity = value; + setOpacity(value); + }); + hBox->addWidget(fdOpacity); hBox->addStretch(); vBox->addSpacing(-spacing); @@ -898,15 +918,28 @@ void EBase::addBaseAttrWgt(QBoxLayout *vBox) { } }); - - ccc = 2; + hBox = new HBox; auto fdBlink = new QCheckBox(tr("Blink")); fdBlink->setChecked(_hasBlink); - fdBlink->setToolTip("Need Player 2.1.4"); + fdBlink->setToolTip("Need Player 2.1.9"); + hBox->addWidget(fdBlink); + + auto fdBreathe = new QCheckBox(tr("Breathe")); + fdBreathe->setChecked(_hasBreathe); + fdBreathe->setToolTip("Need Player 2.1.9"); + hBox->addWidget(fdBreathe); + connect(fdBlink, &QCheckBox::stateChanged, this, [=](int state) { _hasBlink = state==Qt::Checked; + if(_hasBlink) fdBreathe->setChecked(false); }); - grid->addWidget(fdBlink, 2, ccc++); + connect(fdBreathe, &QCheckBox::stateChanged, this, [=](int state) { + _hasBreathe = state==Qt::Checked; + if(_hasBreathe) fdBlink->setChecked(false); + }); + + ccc = 2; + grid->addLayout(hBox, 2, ccc++); ccc++; grid->addLabel(tr("Freq"), 2, ccc++, Qt::AlignRight|Qt::AlignVCenter); diff --git a/LedOK/program/ebase.h b/LedOK/program/ebase.h index c6aeecc..8d1e03b 100644 --- a/LedOK/program/ebase.h +++ b/LedOK/program/ebase.h @@ -15,7 +15,7 @@ public: enum ElementType { Text = QGraphicsItem::UserType + 1, Image, Video, Gif, Audio, - DClock, AClock, Timer, Environ, Window, Web + DClock, AClock, Timer, Timer2, Environ, Window, Web }; Q_ENUM(ElementType) @@ -52,8 +52,8 @@ public: int mStartTime = 0, mDuration = 10; QString mEntryEffect, mExitEffect; int mEntryDur = 1, mExitDur = 1; - double _blink = 1.0; - bool _hasBlink = 0; + double _opacity = 1, _blink = 1; + bool _hasBlink = false, _hasBreathe = false; signals: void sizeChanged(); diff --git a/LedOK/program/edclock.cpp b/LedOK/program/edclock.cpp index f5a55b6..483151e 100644 --- a/LedOK/program/edclock.cpp +++ b/LedOK/program/edclock.cpp @@ -1,6 +1,6 @@ #include "edclock.h" #include "base/locolorselector.h" -#include "globaldefine.h" +#include "main.h" #include "tools.h" #include "gutil/qgui.h" #include @@ -57,8 +57,8 @@ EDClock::EDClock(const JObj &json, EBase *multiWin) : EBase(multiWin) { } void EDClock::init() { - connect(Tools::getInstance(), &Tools::sTick, this, [this]() { - datetime = QDateTime::currentDateTime().toTimeZone(QTimeZone(m_attr.timeZoneId)); + connect(gTick, &Tick::secChanged, this, [this](const QDateTime &cur) { + datetime = cur.toTimeZone(QTimeZone(m_attr.timeZoneId)); update(); }); } diff --git a/LedOK/program/eenviron.cpp b/LedOK/program/eenviron.cpp index 7f4ebc3..73226f1 100644 --- a/LedOK/program/eenviron.cpp +++ b/LedOK/program/eenviron.cpp @@ -1,6 +1,6 @@ #include "eenviron.h" #include "base/locolorselector.h" -#include "globaldefine.h" +#include "main.h" #include "tools.h" #include #include @@ -40,7 +40,7 @@ JObj EEnviron::genProg(const JValue &json, const QString &dstDir, const QString auto title = json["title"].toString(); if(! title.isEmpty()) Tools::saveImg(dstDir, metric, font, color, res, title, "title"); JObj values; - for(auto &str : str0_9) Tools::saveImg(dstDir, metric, font, color, values, str, str); + for(int i=0; i<=9; i++) Tools::saveImg(dstDir, metric, font, color, values, QString::number(i), QString::number(i)); Tools::saveImg(dstDir, metric, font, color, values, ".", "."); Tools::saveImg(dstDir, metric, font, color, values, "-", "-"); Tools::saveImg(dstDir, metric, font, color, values, tr("N"), "N"); diff --git a/LedOK/program/egif.cpp b/LedOK/program/egif.cpp index e2957d9..f4eda32 100644 --- a/LedOK/program/egif.cpp +++ b/LedOK/program/egif.cpp @@ -1,7 +1,7 @@ #include "egif.h" #include "cfg.h" #include "tools.h" -#include "globaldefine.h" +#include "main.h" #include #include #include diff --git a/LedOK/program/emultiwin.cpp b/LedOK/program/emultiwin.cpp index 61206e6..5061da5 100644 --- a/LedOK/program/emultiwin.cpp +++ b/LedOK/program/emultiwin.cpp @@ -1,5 +1,5 @@ #include "emultiwin.h" -#include "globaldefine.h" +#include "main.h" #include "base/extendedgroupbox.h" #include "ebase.h" #include "etext.h" diff --git a/LedOK/program/ephoto.cpp b/LedOK/program/ephoto.cpp index 4c29db5..59df031 100644 --- a/LedOK/program/ephoto.cpp +++ b/LedOK/program/ephoto.cpp @@ -1,7 +1,7 @@ #include "ephoto.h" #include "cfg.h" #include "tools.h" -#include "globaldefine.h" +#include "main.h" #include #include #include diff --git a/LedOK/program/etext.cpp b/LedOK/program/etext.cpp index 0129da8..2e80cb4 100644 --- a/LedOK/program/etext.cpp +++ b/LedOK/program/etext.cpp @@ -1,14 +1,13 @@ -#include "base/locolorselector.h" -#include "etext.h" -#include "globaldefine.h" -#include "tools.h" -#include +#include "etext.h" +#include "base/locolorselector.h" +#include "main.h" +#include "gutil/qgui.h" #include #include -#include #include #include #include +#include #include #include #if(QT_VERSION_MAJOR > 5) @@ -19,7 +18,6 @@ #include #include #include -#include static QColor charColors[]{"#fff","#f00","#f00","#f0f","#c0c","#ff0","#f80","#0f0","#0f0","#0a0","#0a0","#7b0","#00f","#00f","#0af","#0ef"}; QString playModes[]{"Flip", "Scroll", "Static"}; @@ -80,17 +78,15 @@ QWidget* EText::attrWgt() { addBaseAttrWgt(vBox); - auto hBox = new QHBoxLayout; - hBox->addWidget(new QLabel(tr("Basic Properties"))); + auto hBox = new HBox(vBox); + hBox->addLabel(tr("Basic Properties")); auto line = new QFrame; line->setFrameShape(QFrame::HLine); line->setFrameShadow(QFrame::Sunken); hBox->addWidget(line, 1); - vBox->addLayout(hBox); - - hBox = new QHBoxLayout; + hBox = new HBox(vBox); auto fdText = new TTextEdit(""); @@ -121,9 +117,7 @@ QWidget* EText::attrWgt() { }); hBox->addWidget(fdFontSize); - vBox->addLayout(hBox); - - hBox = new QHBoxLayout; + hBox = new HBox(vBox); hBox->setSpacing(3); auto wTextAlignHL = new QPushButton(QIcon(":/res/program/TextAlignHL.png"), ""); @@ -157,7 +151,7 @@ QWidget* EText::attrWgt() { connect(fdFontBold, &QToolButton::toggled, fdText, [fdText](bool checked) { QTextCharFormat fmt; fmt.setFontWeight(checked ? QFont::Bold : QFont::Normal); - Tools::mergeFormat(fdText, fmt); + MergeFmt(fdText, fmt); }); hBox->addWidget(fdFontBold); @@ -168,7 +162,7 @@ QWidget* EText::attrWgt() { connect(fdFontItalic, &QToolButton::toggled, fdText, [fdText](bool checked) { QTextCharFormat fmt; fmt.setFontItalic(checked); - Tools::mergeFormat(fdText, fmt); + MergeFmt(fdText, fmt); }); hBox->addWidget(fdFontItalic); @@ -179,7 +173,7 @@ QWidget* EText::attrWgt() { connect(fdFontUnderline, &QToolButton::toggled, fdText, [fdText](bool checked) { QTextCharFormat fmt; fmt.setFontUnderline(checked); - Tools::mergeFormat(fdText, fmt); + MergeFmt(fdText, fmt); }); hBox->addWidget(fdFontUnderline); @@ -192,7 +186,7 @@ QWidget* EText::attrWgt() { if(! color.isValid()) return; QTextCharFormat fmt; fmt.setForeground(color); - Tools::mergeFormat(fdText, fmt); + MergeFmt(fdText, fmt); }); hBox->addWidget(fdTextColor); @@ -226,9 +220,7 @@ QWidget* EText::attrWgt() { }); hBox->addWidget(fdRandomColor); - vBox->addLayout(hBox); - - hBox = new QHBoxLayout; + hBox = new HBox(vBox); hBox->setSpacing(3); auto wTextAlignVT = new QPushButton(QIcon(":/res/program/TextAlignVT.png"), ""); @@ -258,35 +250,38 @@ QWidget* EText::attrWgt() { lb->setToolTip(lb->text()); hBox->addWidget(lb); - auto fdLetterSpacing = new QSpinBox(); - fdLetterSpacing->setMaximum(999); - connect(fdLetterSpacing, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, [this, fdText](int value) { + auto edLetterSpacing = new QSpinBox; + edLetterSpacing->setMaximum(9999); + edLetterSpacing->setValue(100); + connect(edLetterSpacing, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, [this, fdText](int value) { QTextCharFormat fmt; fmt.setFontLetterSpacing(value); - QTextCursor cursor = fdText->textCursor(); + auto cursor = fdText->textCursor(); if(! cursor.hasSelection()) cursor.select(QTextCursor::WordUnderCursor); cursor.mergeCharFormat(fmt); updImg(); }); - hBox->addWidget(fdLetterSpacing); + hBox->addWidget(edLetterSpacing); - lb = new QLabel(tr("Line Spacing")); + lb = new QLabel(tr("Line Height")); lb->setToolTip(lb->text()); hBox->addWidget(lb); - auto fdLineSpacing = new QSpinBox; - fdLineSpacing->setRange(-99, 999); - connect(fdLineSpacing, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, [this, fdText](int value) { + auto edLineHeight = new QSpinBox; + edLineHeight->setRange(-999, 9999); + edLineHeight->setValue(100); + connect(edLineHeight, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, [this, fdText](int value) { QTextBlockFormat fmt; - fmt.setLineHeight(value, QTextBlockFormat::LineDistanceHeight); + fmt.setLineHeight(value, QTextBlockFormat::ProportionalHeight); auto cursor = fdText->textCursor(); if(! cursor.hasSelection()) cursor.select(QTextCursor::WordUnderCursor); cursor.mergeBlockFormat(fmt); updImg(); }); - hBox->addWidget(fdLineSpacing); + hBox->addWidget(edLineHeight); + hBox->addSpacing(-2); + hBox->addLabel("%"); - vBox->addLayout(hBox); auto fdAlignH = new QButtonGroup(wgtAttr); fdAlignH->addButton(wTextAlignHL, Qt::AlignLeft); @@ -342,22 +337,23 @@ QWidget* EText::attrWgt() { fdTextColor->setColor(foreground.style()==Qt::NoBrush ? Qt::white : foreground.color()); fdTextColor->blockSignals(false); - fdLetterSpacing->blockSignals(true); - fdLetterSpacing->setValue(format.fontLetterSpacing()); - fdLetterSpacing->blockSignals(false); + auto spa = format.fontLetterSpacing(); + edLetterSpacing->blockSignals(true); + edLetterSpacing->setValue(spa==0 ? 100 : spa); + edLetterSpacing->blockSignals(false); auto cursor = fdText->textCursor(); auto blockFormat = cursor.blockFormat(); auto btn = fdAlignH->button(blockFormat.alignment() & Qt::AlignHorizontal_Mask); if(btn) btn->setChecked(true); - fdLineSpacing->blockSignals(true); - fdLineSpacing->setValue(blockFormat.lineHeightType()==QTextBlockFormat::LineDistanceHeight ? blockFormat.lineHeight() : 0); - fdLineSpacing->blockSignals(false); + edLineHeight->blockSignals(true); + edLineHeight->setValue(blockFormat.lineHeightType()==QTextBlockFormat::ProportionalHeight ? blockFormat.lineHeight() : 100); + edLineHeight->blockSignals(false); }); vBox->addWidget(fdText); - hBox = new QHBoxLayout; + hBox = new HBox(vBox); hBox->addStretch(); auto pageInfoWgt = new QWidget; @@ -409,9 +405,7 @@ QWidget* EText::attrWgt() { }); hBox->addWidget(btnImport); - vBox->addLayout(hBox); - - hBox = new QHBoxLayout; + hBox = new HBox(vBox); hBox->addWidget(new QLabel(tr("Play Properties"))); line = new QFrame(); @@ -419,9 +413,8 @@ QWidget* EText::attrWgt() { line->setFrameShadow(QFrame::Sunken); hBox->addWidget(line, 1); - vBox->addLayout(hBox); - hBox = new QHBoxLayout; + hBox = new HBox(vBox); hBox->addStretch(); auto fdFlip = new QRadioButton(tr("Flip")); @@ -436,7 +429,6 @@ QWidget* EText::attrWgt() { hBox->addWidget(fdStatic); hBox->addStretch(); - vBox->addLayout(hBox); auto fdPlayStyle = new QButtonGroup(wgtAttr); fdPlayStyle->addButton(fdFlip, 0); diff --git a/LedOK/program/etext.h b/LedOK/program/etext.h index 6f980ff..eef14f5 100644 --- a/LedOK/program/etext.h +++ b/LedOK/program/etext.h @@ -6,8 +6,8 @@ class EText : public EBase { Q_OBJECT public: - explicit EText(EBase *multiWin = nullptr); - explicit EText(const JObj &json, EBase *multiWin = nullptr); + explicit EText(EBase *multiWin = 0); + explicit EText(const JObj &json, EBase *multiWin = 0); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override; int type() const override { return EBase::Text; } @@ -17,11 +17,11 @@ public: QString text; Qt::Alignment align; - QColor backColor{Qt::transparent}; + QColor backColor = Qt::transparent; QString playMode = "Flip"; QString direction = "left"; int speed = 60; - int headTailSpacing{10}; + int headTailSpacing = 10; public slots: void updImg(); diff --git a/LedOK/program/etimer.cpp b/LedOK/program/etimer.cpp index 0d2287e..63250f1 100644 --- a/LedOK/program/etimer.cpp +++ b/LedOK/program/etimer.cpp @@ -1,10 +1,9 @@ #include "etimer.h" #include "tools.h" -#include "globaldefine.h" +#include "main.h" #include "base/lodateselector.h" #include "base/locolorselector.h" #include "gutil/qgui.h" -#include #include #include #include @@ -18,74 +17,74 @@ ETimer::ETimer(EBase *multiWin) : EBase(multiWin) { mType = EBase::Timer; - attr.isDown = true; - attr.targetTime = QDateTime::currentDateTime(); - attr.hasDay = true; - attr.hasHour = true; - attr.hasMin = true; - attr.hasSec = true; - attr.isMultiline = true; - attr.font = qfont("Arial", 12); - attr.textColor = Qt::red; - attr.backColor = Qt::transparent; + isDown = true; + targetTime = QDateTime::currentDateTime(); + hasDay = true; + hasHour = true; + hasMin = true; + hasSec = true; + isMultiline = true; + font = qfont("Arial", 12); + textColor = Qt::red; + backColor = Qt::transparent; init(); } ETimer::ETimer(const JObj &json, EBase *multiWin) : EBase(multiWin){ mType = EBase::Timer; setBaseAttr(json); - attr.isDown = json["isDown"].toBool(); - attr.targetTime = QDateTime::fromString(json["targetTime"].toString(), "yyyy-MM-dd HH:mm:ss"); - attr.hasDay = json["hasDay"].toBool(); - attr.hasHour = json["hasHour"].toBool(); - attr.hasMin = json["hasMin"].toBool(); - attr.hasSec = json["hasSec"].toBool(); - attr.text = json["text"].toString(); - attr.isMultiline = json["isMultiline"].toBool(); - attr.font = qfont(json["font"].toString(), json["fontSize"].toInt(), json["fontBold"].toBool(), json["fontItalic"].toBool()); - attr.font.setUnderline(json["fontUnderline"].toBool()); - attr.textColor = json["textColor"].toString(); + isDown = json["isDown"].toBool(); + targetTime = QDateTime::fromString(json["targetTime"].toString(), "yyyy-MM-dd HH:mm:ss"); + hasDay = json["hasDay"].toBool(); + hasHour = json["hasHour"].toBool(); + hasMin = json["hasMin"].toBool(); + hasSec = json["hasSec"].toBool(); + text = json["text"].toString(); + isMultiline = json["isMultiline"].toBool(); + font = qfont(json["font"].toString(), json["fontSize"].toInt(), json["fontBold"].toBool(), json["fontItalic"].toBool()); + font.setUnderline(json["fontUnderline"].toBool()); + textColor = json["textColor"].toString(); auto color = json["backColor"].toString(); - attr.backColor = color.isEmpty() ? QColor(0,0,0,0) : color; + backColor = color.isEmpty() ? QColor(0,0,0,0) : color; init(); } void ETimer::init() { - connect(Tools::getInstance(), &Tools::sTick, this, [this]() { - QDateTime cDateTime = QDateTime::currentDateTime(); - qint64 ofs = attr.isDown ? cDateTime.secsTo(attr.targetTime) : attr.targetTime.secsTo(cDateTime); - if(ofs < 0) ofs = 0; - secs = ofs; + connect(gTick, &Tick::secChanged, this, [this](const QDateTime &cur) { + auto sss = isDown ? cur.secsTo(targetTime) : targetTime.secsTo(cur); + if(sss < 0) sss = 0; + if(secs==sss) return; + secs = sss; update(); }); } void ETimer::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { QString text; - if(!attr.text.isEmpty()) { - text += attr.text; - if(attr.isMultiline) text += '\n'; + if(!this->text.isEmpty()) { + text += this->text; + if(this->isMultiline) text += '\n'; else text += " "; } int secs = this->secs; - if(attr.hasDay) { + if(this->hasDay) { text.append(QString::number(secs/86400)).append(" ").append(tr("day")).append(" "); secs %= 86400; } - if(attr.hasHour) { + if(this->hasHour) { text.append(QString::asprintf("%02d ", secs/3600)).append(tr("hour")).append(" "); secs %= 3600; } - if(attr.hasMin) { + if(this->hasMin) { text.append(QString::asprintf("%02d ", secs/60)).append(tr("min")).append(" "); secs %= 60; } - if(attr.hasSec) text.append(QString::asprintf("%02d ", secs)).append(tr("sec")).append(" "); + if(this->hasSec) text.append(QString::asprintf("%02d ", secs)).append(tr("sec")).append(" "); text = text.trimmed(); - attr.font.setStyleStrategy(gTextAntialiasing ? QFont::PreferAntialias : QFont::NoAntialias); - if(attr.backColor.alpha() != 0) painter->fillRect(0, 0, mWidth, mHeight, attr.backColor); - painter->setFont(attr.font); - painter->setPen(attr.textColor); + this->font.setStyleStrategy(gTextAntialiasing ? QFont::PreferAntialias : QFont::NoAntialias); + if(this->backColor.alpha() != 0) painter->fillRect(0, 0, mWidth, mHeight, this->backColor); + painter->setFont(this->font); + painter->setPen(this->textColor); painter->drawText(innerRect(), text, QTextOption(Qt::AlignCenter)); EBase::paint(painter, option, widget); } @@ -112,13 +111,13 @@ QWidget* ETimer::attrWgt() { hBox->addStretch(); auto fdCntDown = new QRadioButton(tr("Count Down")); auto fdCntUp = new QRadioButton(tr("Count Up")); - if(attr.isDown) fdCntDown->setChecked(true); + if(this->isDown) fdCntDown->setChecked(true); else fdCntUp->setChecked(true); auto cntGroup = new QButtonGroup(wgtAttr); cntGroup->addButton(fdCntDown); cntGroup->addButton(fdCntUp); connect(fdCntDown, &QRadioButton::toggled, this, [this](bool checked) { - attr.isDown = checked; + this->isDown = checked; update(); }); hBox->addWidget(fdCntDown); @@ -132,10 +131,10 @@ QWidget* ETimer::attrWgt() { hBox->addSpacing(6); hBox->addWidget(new QLabel(tr("Time"))); - auto fdTime = new QDateTimeEdit(attr.targetTime); + auto fdTime = new QDateTimeEdit(this->targetTime); fdTime->setDisplayFormat("yyyy-MM-dd HH:mm:ss"); connect(fdTime, &QTimeEdit::dateTimeChanged, this, [this](const QDateTime &dateTime) { - attr.targetTime = dateTime; + this->targetTime = dateTime; update(); }); hBox->addWidget(fdTime); @@ -151,42 +150,42 @@ QWidget* ETimer::attrWgt() { hBox->addSpacing(6); auto fdHasDay = new QCheckBox(tr("Day")); - fdHasDay->setChecked(attr.hasDay); + fdHasDay->setChecked(this->hasDay); connect(fdHasDay, &QCheckBox::toggled, this, [this](bool checked) { - attr.hasDay = checked; + this->hasDay = checked; update(); }); hBox->addWidget(fdHasDay); auto fdHasHour = new QCheckBox(tr("Hour")); - fdHasHour->setChecked(attr.hasHour); + fdHasHour->setChecked(this->hasHour); connect(fdHasHour, &QCheckBox::toggled, this, [this](bool checked) { - attr.hasHour = checked; + this->hasHour = checked; update(); }); hBox->addWidget(fdHasHour); auto fdHasMin = new QCheckBox(tr("Min")); - fdHasMin->setChecked(attr.hasMin); + fdHasMin->setChecked(this->hasMin); connect(fdHasMin, &QCheckBox::toggled, this, [this](bool checked) { - attr.hasMin = checked; + this->hasMin = checked; update(); }); hBox->addWidget(fdHasMin); auto fdHasSec = new QCheckBox(tr("Sec")); - fdHasSec->setChecked(attr.hasSec); + fdHasSec->setChecked(this->hasSec); connect(fdHasSec, &QCheckBox::toggled, this, [this](bool checked) { - attr.hasSec = checked; + this->hasSec = checked; update(); }); hBox->addWidget(fdHasSec); hBox->addStretch(); auto fdIsMultiline = new QCheckBox(tr("Multiline")); - fdIsMultiline->setChecked(attr.isMultiline); + fdIsMultiline->setChecked(this->isMultiline); connect(fdIsMultiline, &QCheckBox::toggled, this, [this](bool checked) { - attr.isMultiline = checked; + this->isMultiline = checked; update(); }); hBox->addWidget(fdIsMultiline); @@ -197,10 +196,10 @@ QWidget* ETimer::attrWgt() { hBox->addSpacing(6); hBox->addWidget(new QLabel(tr("Text"))); - auto fdText = new QTextEdit(attr.text); + auto fdText = new QTextEdit(this->text); fdText->setMaximumHeight(50); connect(fdText, &QTextEdit::textChanged, this, [this, fdText]() { - attr.text = fdText->toPlainText(); + this->text = fdText->toPlainText(); update(); }); hBox->addWidget(fdText); @@ -211,24 +210,24 @@ QWidget* ETimer::attrWgt() { hBox->addSpacing(6); auto fdFont = new QFontComboBox(); - fdFont->setCurrentText(attr.font.family()); + fdFont->setCurrentText(this->font.family()); fdFont->setEditable(false); connect(fdFont, &QFontComboBox::currentFontChanged, this, [this](const QFont &f) { QFont font(f.family()); - font.setPixelSize(attr.font.pixelSize()); - font.setBold(attr.font.bold()); - font.setItalic(attr.font.italic()); - font.setUnderline(attr.font.underline()); - attr.font = font; + font.setPixelSize(this->font.pixelSize()); + font.setBold(this->font.bold()); + font.setItalic(this->font.italic()); + font.setUnderline(this->font.underline()); + this->font = font; update(); }); hBox->addWidget(fdFont); auto fdFontSize = new QSpinBox(); fdFontSize->setRange(4, 9999); - fdFontSize->setValue(attr.font.pixelSize()); + fdFontSize->setValue(this->font.pixelSize()); connect(fdFontSize, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, [this](int value) { - attr.font.setPixelSize(value); + this->font.setPixelSize(value); update(); }); hBox->addWidget(fdFontSize); @@ -243,9 +242,9 @@ QWidget* ETimer::attrWgt() { fdFontBold->setStyleSheet("QPushButton{background: #bbb; color: #888; font-size: 20px; font-weight: bold;} QPushButton:checked{background: #29c; color: #fff;}"); fdFontBold->setFixedSize(30, 30); fdFontBold->setCheckable(true); - fdFontBold->setChecked(attr.font.bold()); + fdFontBold->setChecked(this->font.bold()); connect(fdFontBold, &QCheckBox::toggled, this, [this](bool checked) { - attr.font.setBold(checked); + this->font.setBold(checked); update(); }); hBox->addWidget(fdFontBold); @@ -254,9 +253,9 @@ QWidget* ETimer::attrWgt() { fdFontItalic->setStyleSheet("QPushButton{background: #bbb; color: #888; font-size: 20px; font-style: italic;} QPushButton:checked{background: #29c; color: #fff;}"); fdFontItalic->setFixedSize(30, 30); fdFontItalic->setCheckable(true); - fdFontItalic->setChecked(attr.font.italic()); + fdFontItalic->setChecked(this->font.italic()); connect(fdFontItalic, &QCheckBox::toggled, this, [this](bool checked) { - attr.font.setItalic(checked); + this->font.setItalic(checked); update(); }); hBox->addWidget(fdFontItalic); @@ -265,28 +264,28 @@ QWidget* ETimer::attrWgt() { fdFontUnderline->setStyleSheet("QPushButton{background: #bbb; color: #888; font-size: 20px; text-decoration: underline;} QPushButton:checked{background: #29c; color: #fff;}"); fdFontUnderline->setFixedSize(30, 30); fdFontUnderline->setCheckable(true); - fdFontUnderline->setChecked(attr.font.underline()); + fdFontUnderline->setChecked(this->font.underline()); connect(fdFontUnderline, &QCheckBox::toggled, this, [this](bool checked) { - attr.font.setUnderline(checked); + this->font.setUnderline(checked); update(); }); hBox->addWidget(fdFontUnderline); hBox->addStretch(); - auto fdTextColor = new LoColorSelector("T", attr.textColor); + auto fdTextColor = new LoColorSelector("T", this->textColor); fdTextColor->setFixedSize(30, 30); fdTextColor->setFlat(true); connect(fdTextColor, &LoColorSelector::sColorChanged, this, [this](const QColor &color) { - attr.textColor = color; + this->textColor = color; update(); }); hBox->addWidget(fdTextColor); - auto fdBackColor = new LoColorSelector("B", attr.backColor); + auto fdBackColor = new LoColorSelector("B", this->backColor); fdBackColor->setFixedSize(30, 30); fdBackColor->setFlat(true); connect(fdBackColor, &LoColorSelector::sColorChanged, this, [this](const QColor &color) { - attr.backColor = color; + this->backColor = color; update(); }); hBox->addWidget(fdBackColor); @@ -300,20 +299,20 @@ JObj ETimer::attrJson() const { JObj obj; addBaseAttr(obj); obj["elementType"] = "Timer"; - obj["isDown"] = attr.isDown; - obj["targetTime"] = attr.targetTime.toString("yyyy-MM-dd HH:mm:ss"); - obj["hasDay"] = attr.hasDay; - obj["hasHour"] = attr.hasHour; - obj["hasMin"] = attr.hasMin; - obj["hasSec"] = attr.hasSec; - obj["text"] = attr.text; - obj["isMultiline"] = attr.isMultiline; - obj["font"] = attr.font.family(); - obj["fontSize"] = attr.font.pixelSize(); - obj["fontBold"] = attr.font.bold(); - obj["fontItalic"] = attr.font.italic(); - obj["fontUnderline"] = attr.font.underline(); - obj["textColor"] = attr.textColor.name(); - obj["backColor"] = attr.backColor.alpha()==0 ? "" : attr.backColor.name(); + obj["isDown"] = this->isDown; + obj["targetTime"] = this->targetTime.toString("yyyy-MM-dd HH:mm:ss"); + obj["hasDay"] = this->hasDay; + obj["hasHour"] = this->hasHour; + obj["hasMin"] = this->hasMin; + obj["hasSec"] = this->hasSec; + obj["text"] = this->text; + obj["isMultiline"] = this->isMultiline; + obj["font"] = this->font.family(); + obj["fontSize"] = this->font.pixelSize(); + obj["fontBold"] = this->font.bold(); + obj["fontItalic"] = this->font.italic(); + obj["fontUnderline"] = this->font.underline(); + obj["textColor"] = this->textColor.name(); + obj["backColor"] = this->backColor.alpha()==0 ? "" : this->backColor.name(); return obj; } diff --git a/LedOK/program/etimer.h b/LedOK/program/etimer.h index ba435c1..d6b332a 100644 --- a/LedOK/program/etimer.h +++ b/LedOK/program/etimer.h @@ -10,33 +10,28 @@ class ETimer : public EBase { Q_OBJECT public: - struct Data { - QDateTime targetTime; - QFont font; - QString text; - QColor textColor; - QColor backColor; - bool isDown; - bool isMultiline; - bool hasDay; - bool hasHour; - bool hasMin; - bool hasSec; - }; - explicit ETimer(EBase *multiWin = nullptr); explicit ETimer(const JObj &json, EBase *multiWin = nullptr); + void init(); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override; int type() const override { return EBase::Timer; } QWidget* attrWgt() override; JObj attrJson() const override; - Data attr; int secs = 0; -private: - void init(); + QDateTime targetTime; + QFont font; + QString text; + QColor textColor; + QColor backColor; + bool isDown; + bool isMultiline; + bool hasDay; + bool hasHour; + bool hasMin; + bool hasSec; }; #endif // ETIMER_H diff --git a/LedOK/program/etimer2.cpp b/LedOK/program/etimer2.cpp new file mode 100644 index 0000000..ef767bd --- /dev/null +++ b/LedOK/program/etimer2.cpp @@ -0,0 +1,404 @@ +#include "etimer2.h" +#include "main.h" +#include "gutil/qgui.h" +#include "base/locolorselector.h" +#include "base/lodateselector.h" +#include +#include +#include +#include +#include +#include +#include +#if(QT_VERSION_MAJOR > 5) +#include +#else +#include +#endif +#include +#include +#include +#include + + +ETimer2::ETimer2(EBase *multiWin) : EBase(multiWin) { + isUp = false; + targetTime = QDateTime::currentDateTime(); + html = ""+tr("There are")+" %d "+tr("Days")+" %h "+tr("Hours")+" %m "+tr("Mins")+" %s "+tr("Secs")+""; + init(); +} +ETimer2::ETimer2(const JObj &json, EBase *multiWin) : EBase(multiWin) { + setBaseAttr(json); + isUp = json["isUp"].toBool(); + targetTime = QDateTime::fromString(json["targetTime"].toString(), "yyyy-MM-dd HH:mm:ss"); + html = json["html"].toString(); + backColor = json["backColor"].toString("#00000000"); + init(); +} + +void ETimer2::init() { + mType = EBase::Timer2; + doc.setDocumentMargin(0); + QFont font; + font.setFamily("Arial"); + font.setFamilies({"Arial","黑体"}); + font.setPixelSize(16); + doc.setDefaultFont(font); + doc.setDefaultStyleSheet("body {color: #fff; line-height:1}"); + + connect(this, &ETimer2::sizeChanged, this, &ETimer2::updImg); + connect(gTick, &Tick::secChanged, this, [this](const QDateTime &cur) { + auto sss = isUp ? targetTime.secsTo(cur) : cur.secsTo(targetTime); + if(sss < 0) sss = 0; + if(secs==sss) return; + secs = sss; + updImg(); + }, Qt::UniqueConnection); + updImg(); +} + +class TTextEdit : public QTextEdit { +public: + TTextEdit() {} + explicit TTextEdit(const QString &text) : QTextEdit(text){} + QSize minimumSizeHint() const override { + return sizeHint(); + }; + QSize sizeHint() const override { + auto size = QTextEdit::sizeHint(); + auto minH = minimumHeight(); + if(minH > 0) size.setHeight(minH+0xfff); + return size; + }; +}; +QWidget* ETimer2::attrWgt() { + auto wgtAttr = new QWidget; + auto vBox = new VBox(wgtAttr); + vBox->setContentsMargins(4, 0, 4, 0); + vBox->setSpacing(3); + + addBaseAttrWgt(vBox); + + auto hBox = new HBox(vBox); + hBox->addLabel(tr("Basic Properties")); + + auto line = new QFrame; + line->setFrameShape(QFrame::HLine); + line->setFrameShadow(QFrame::Sunken); + hBox->addWidget(line, 1); + + + hBox = new HBox(vBox); + hBox->addStretch(); + auto fdCntDown = new QRadioButton(tr("Count Down")); + auto fdCntUp = new QRadioButton(tr("Count Up")); + (isUp ? fdCntUp : fdCntDown)->setChecked(true); + + auto cntGroup = new QButtonGroup(wgtAttr); + cntGroup->addButton(fdCntDown); + cntGroup->addButton(fdCntUp); + connect(fdCntUp, &QRadioButton::toggled, this, [this](bool checked) { + isUp = checked; + update(); + }); + hBox->addWidget(fdCntDown); + hBox->addStretch(); + hBox->addWidget(fdCntUp); + hBox->addStretch(); + + hBox = new HBox(vBox); + hBox->addSpacing(6); + hBox->addLabel(tr("Time")); + + auto fdTime = new QDateTimeEdit(targetTime); + fdTime->setDisplayFormat("yyyy-MM-dd HH:mm:ss"); + connect(fdTime, &QTimeEdit::dateTimeChanged, this, [this](const QDateTime &dateTime) { + targetTime = dateTime; + update(); + }); + hBox->addWidget(fdTime); + + auto wDateSelector = new LoDateSelector; + connect(wDateSelector, &LoDateSelector::sDateSelected, fdTime, &QDateTimeEdit::setDate); + hBox->addWidget(wDateSelector); + hBox->addStretch(); + + + auto fdText = new TTextEdit(""); + + hBox = new HBox(vBox); + hBox->setSpacing(3); + + hBox->addLabel(tr("Font Size")+":"); + auto fdFontSize = new QSpinBox; + fdFontSize->setRange(4, 9999); + fdFontSize->setValue(16); + connect(fdFontSize, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, fdText, [fdText](int value) { + if(value <= 0) return; + QTextCharFormat fmt; + fmt.setProperty(QTextFormat::FontPixelSize, value); + auto cursor = fdText->textCursor(); + if(! cursor.hasSelection()) cursor.select(QTextCursor::WordUnderCursor); + cursor.mergeCharFormat(fmt); + }); + hBox->addWidget(fdFontSize); + + + + hBox->addLabel(tr("Line Height")); + + auto edLineHeight = new QDoubleSpinBox; + edLineHeight->setDecimals(1); + edLineHeight->setRange(-999, 999); + edLineHeight->setValue(1); + connect(edLineHeight, (void(QDoubleSpinBox::*)(double))&QDoubleSpinBox::valueChanged, this, [this, fdText](double value) { + QTextBlockFormat fmt; + fmt.setLineHeight(value*100, QTextBlockFormat::ProportionalHeight); + auto cursor = fdText->textCursor(); + if(! cursor.hasSelection()) cursor.select(QTextCursor::WordUnderCursor); + cursor.mergeBlockFormat(fmt); + updImg(); + }); + hBox->addWidget(edLineHeight); + hBox->addStretch(); + + + hBox = new HBox(vBox); + hBox->setSpacing(3); + + auto wTextAlignHL = new QPushButton(QIcon(":/res/program/TextAlignHL.png"), ""); + wTextAlignHL->setStyleSheet("QPushButton{border: none; background: #bbb;} QPushButton:checked{background: #29c;}"); + wTextAlignHL->setFixedSize(30, 30); + wTextAlignHL->setIconSize(QSize(30, 30)); + wTextAlignHL->setCheckable(true); + wTextAlignHL->setChecked(true); + hBox->addWidget(wTextAlignHL); + + auto wTextAlignHC = new QPushButton(QIcon(":/res/program/TextAlignHC.png"), ""); + wTextAlignHC->setStyleSheet("QPushButton{border: none; background: #bbb;} QPushButton:checked{background: #29c;}"); + wTextAlignHC->setFixedSize(30, 30); + wTextAlignHC->setIconSize(QSize(30, 30)); + wTextAlignHC->setCheckable(true); + hBox->addWidget(wTextAlignHC); + + auto wTextAlignHR = new QPushButton(QIcon(":/res/program/TextAlignHR.png"), ""); + wTextAlignHR->setStyleSheet("QPushButton{border: none; background: #bbb;} QPushButton:checked{background: #29c;}"); + wTextAlignHR->setFixedSize(30, 30); + wTextAlignHR->setIconSize(QSize(30, 30)); + wTextAlignHR->setCheckable(true); + hBox->addWidget(wTextAlignHR); + + hBox->addStretch(); + + auto fdFontBold = new QPushButton("B"); + fdFontBold->setStyleSheet("QPushButton{background: #bbb; color: #888; font-size: 20px; font-weight: bold;} QPushButton:checked{background: #29c; color: #fff;}"); + fdFontBold->setFixedSize(30, 30); + fdFontBold->setCheckable(true); + connect(fdFontBold, &QToolButton::toggled, fdText, [fdText](bool checked) { + QTextCharFormat fmt; + fmt.setFontWeight(checked ? QFont::Bold : QFont::Normal); + MergeFmt(fdText, fmt); + }); + hBox->addWidget(fdFontBold); + + auto fdFontItalic = new QPushButton("I"); + fdFontItalic->setStyleSheet("QPushButton{background: #bbb; color: #888; font-size: 20px; font-style: italic;} QPushButton:checked{background: #29c; color: #fff;}"); + fdFontItalic->setFixedSize(30, 30); + fdFontItalic->setCheckable(true); + connect(fdFontItalic, &QToolButton::toggled, fdText, [fdText](bool checked) { + QTextCharFormat fmt; + fmt.setFontItalic(checked); + MergeFmt(fdText, fmt); + }); + hBox->addWidget(fdFontItalic); + + auto fdFontUnderline = new QPushButton("U"); + fdFontUnderline->setStyleSheet("QPushButton{background: #bbb; color: #888; font-size: 20px; text-decoration: underline;} QPushButton:checked{background: #29c; color: #fff;}"); + fdFontUnderline->setFixedSize(30, 30); + fdFontUnderline->setCheckable(true); + connect(fdFontUnderline, &QToolButton::toggled, fdText, [fdText](bool checked) { + QTextCharFormat fmt; + fmt.setFontUnderline(checked); + MergeFmt(fdText, fmt); + }); + hBox->addWidget(fdFontUnderline); + + hBox->addStretch(); + + auto edTextColor = new LoColorSelector("F", Qt::white); + edTextColor->setToolTip(tr("Foreground Color")); + edTextColor->setFixedSize(30, 30); + connect(edTextColor, &LoColorSelector::sColorChanged, fdText, [fdText](const QColor &color) { + if(! color.isValid()) return; + QTextCharFormat fmt; + fmt.setForeground(color); + MergeFmt(fdText, fmt); + }); + hBox->addWidget(edTextColor); + + auto edBack = new LoColorSelector("LB", Qt::white); + edBack->setToolTip(tr("Line Background")); + edBack->setFixedSize(34, 30); + connect(edBack, &LoColorSelector::sColorChanged, fdText, [fdText](const QColor &color) { + if(! color.isValid()) return; + QTextCharFormat fmt; + fmt.setBackground(color); + MergeFmt(fdText, fmt); + }); + hBox->addWidget(edBack); + + auto edBackColor = new LoColorSelector("B", backColor); + edBackColor->setToolTip(tr("Background Color")); + edBackColor->setFixedSize(30, 30); + connect(edBackColor, &LoColorSelector::sColorChanged, this, [this](const QColor &color) { + if(! color.isValid()) return; + backColor = color; + updImg(); + }); + hBox->addWidget(edBackColor); + + + auto fdAlignH = new QButtonGroup(wgtAttr); + fdAlignH->addButton(wTextAlignHL, Qt::AlignLeft); + fdAlignH->addButton(wTextAlignHC, Qt::AlignHCenter); + fdAlignH->addButton(wTextAlignHR, Qt::AlignRight); + connect(fdAlignH, &QButtonGroup::idClicked, this, [this, fdText](int value) { + QTextBlockFormat fmt; + fmt.setAlignment((Qt::Alignment) value); + QTextCursor cursor = fdText->textCursor(); + cursor.mergeBlockFormat(fmt); + updImg(); + }); + + auto ll = vBox->addLabel("%d: "+tr("Days")+", %h: "+tr("Hours")+", %m: "+tr("Mins")+", %s: "+tr("Secs")); + gFont(ll, 16); + + fdText->setMinimumHeight(160); + auto doc = fdText->document(); + if(doc) doc->setDocumentMargin(2); + auto font = fdText->font(); + font.setFamily("Arial"); + font.setFamilies({"Arial","黑体"}); + font.setPixelSize(16); + fdText->setFont(font); + auto pal = fdText->palette(); + pal.setColor(QPalette::Base, Qt::black); + pal.setColor(QPalette::Text, Qt::white); + fdText->setPalette(pal); + fdText->document()->setDefaultStyleSheet("body {color: #fff; line-height:1}"); + fdText->setFrameShape(QFrame::NoFrame); + fdText->setAcceptRichText(false); + fdText->setHtml(html); + connect(fdText, &QTextEdit::textChanged, this, [this, fdText] { + html = fdText->toHtml(); + updImg(); + }); + connect(fdText, &QTextEdit::currentCharFormatChanged, this, [=](const QTextCharFormat &format) { + fdFontSize->blockSignals(true); + fdFontSize->setValue(format.font().pixelSize()); + fdFontSize->blockSignals(false); + auto foreground = format.foreground(); + edTextColor->blockSignals(true); + edTextColor->setColor(foreground.style()==Qt::NoBrush ? Qt::white : foreground.color()); + edTextColor->blockSignals(false); + + auto background = format.background(); + edBack->blockSignals(true); + edBack->setColor(background.style()==Qt::NoBrush ? Qt::transparent : background.color()); + edBack->blockSignals(false); + + auto cursor = fdText->textCursor(); + auto blockFormat = cursor.blockFormat(); + auto btn = fdAlignH->button(blockFormat.alignment() & Qt::AlignHorizontal_Mask); + if(btn) btn->setChecked(true); + + edLineHeight->blockSignals(true); + edLineHeight->setValue(blockFormat.lineHeightType()==QTextBlockFormat::ProportionalHeight ? blockFormat.lineHeight()*0.01 : 1.0); + edLineHeight->blockSignals(false); + }); + vBox->addWidget(fdText); + + return wgtAttr; +} +void repLineHeight(QString &html) { + QString pre; + int last = 0, idx; + while((idx = html.indexOf("line-height:", last)) > -1) { + idx += 12; + auto end = idx; + QChar ch; + while((ch = html[end])<='9' && ch>='-' && ch!='/') if(++end >= html.size()) goto end; + if(ch!='%') last = end; + else { + pre += html.mid(last, idx-last) + QString::number(html.mid(idx, end-idx).toDouble() / 100); + last = end + 1; + } + } + end: + if(! pre.isEmpty()) html = pre + html.mid(last); +} +JObj ETimer2::attrJson() const { + JObj ele{{"elementType", "Timer2"}}; + addBaseAttr(ele); + ele["isUp"] = isUp; + auto hhhh = html; + auto idx = hhhh.indexOf(" -1) hhhh = hhhh.mid(idx); + idx = hhhh.indexOf(" -1 && ! hhhh.mid(idx+13, 8).contains("color:")) hhhh = hhhh.insert(idx+13, "color:#fff;"); + hhhh.replace("", ""); + hhhh.replace(" -qt-block-indent:0; text-indent:0px;", ""); + repLineHeight(hhhh); + ele["html"] = hhhh.replace("margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;", "margin:0;"); + ele["targetTime"] = targetTime.toString("yyyy-MM-dd HH:mm:ss"); + ele["backColor"] = backColor.name(QColor::HexArgb); + return ele; +} + +void ETimer2::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget){ + painter->save(); + auto rect = innerRect(); + painter->drawImage(rect, img); + painter->restore(); + EBase::paint(painter, option, widget); +} + +void ETimer2::updImg() { + auto innerRect = this->innerRect(); + int width = innerRect.width(); + int height = innerRect.height(); + if(width<1 || height<1) return; + + auto hasDay = html.contains("%d"); + auto hasHour = html.contains("%h"); + auto hasMin = html.contains("%m"); + auto hasSec = html.contains("%s"); + + auto htm = html; + if(hasDay) { + htm = htm.replace("%d", QString::number(secs/86400)); + secs %= 86400; + } + if(hasHour) { + htm = htm.replace("%h", QString::asprintf("%02d", secs/3600)); + secs %= 3600; + } + if(hasMin) { + htm = htm.replace("%m", QString::asprintf("%02d", secs/60)); + secs %= 60; + } + if(hasSec) htm = htm.replace("%s", QString::asprintf("%02d", secs)); + + doc.setHtml(htm); + doc.setTextWidth(width); + width<<=1; + height<<=1; + if(img.width()!=width || img.height()!=height) img = QImage(width, height, QImage::Format_ARGB32); + img.fill(backColor); + { + QPainter painter(&img); + painter.scale(2,2); + doc.drawContents(&painter); + } + update(); +} diff --git a/LedOK/program/etimer2.h b/LedOK/program/etimer2.h new file mode 100644 index 0000000..88686fa --- /dev/null +++ b/LedOK/program/etimer2.h @@ -0,0 +1,34 @@ +#ifndef ETIMER2_H +#define ETIMER2_H + +#include "ebase.h" +#include +#include + +class ETimer2 : public EBase { + Q_OBJECT +public: + explicit ETimer2(EBase *multiWin = 0); + explicit ETimer2(const JObj &json, EBase *multiWin = 0); + void init(); + + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override; + int type() const override { return EBase::Timer2; } + QWidget* attrWgt() override; + JObj attrJson() const override; + + QDateTime targetTime; + QString html; + QColor backColor = Qt::transparent; + bool isUp; + + QImage img; + + int secs = 0; + QTextDocument doc; + +public slots: + void updImg(); +}; + +#endif // ETIMER2_H diff --git a/LedOK/program/evideo.cpp b/LedOK/program/evideo.cpp index af27153..a29e526 100644 --- a/LedOK/program/evideo.cpp +++ b/LedOK/program/evideo.cpp @@ -1,7 +1,6 @@ #include "evideo.h" -#include "cfg.h" #include "tools.h" -#include "globaldefine.h" +#include "main.h" #include "base/ffutil.h" #include #include @@ -21,8 +20,8 @@ EVideo *EVideo::create(const QString &file, PageListItem *pageItem, EBase *multi return 0; } QFileInfo rawInfo(file); - QString rawName = rawInfo.fileName(); - QString outFile = transcoding(pageItem->listWidget(), file, rawName, pageItem->mPageDir, img.width(), img.height(), codecId); + auto rawName = rawInfo.fileName(); + auto outFile = transcoding(pageItem->listWidget(), file, rawName, pageItem->mPageDir, img.width(), img.height(), codecId); if(outFile.isEmpty()) return 0; QFileInfo outInfo(outFile); if(! outInfo.isFile() || outInfo.size()==0) return 0; @@ -36,7 +35,7 @@ EVideo *EVideo::create(const JObj &ele, PageListItem *pageItem, EBase *multiWin) auto dir = widget["path"].toString(); auto name = widget["file"].toString(); if(! QFileInfo::exists(dir)) dir = pageItem->mPageDir; - QString file = dir + "/" + name; + auto file = dir + "/" + name; if(QFileInfo::exists(file)) ; else if(QFileInfo::exists(file = pageItem->mPageDir + "/" + name)) dir = pageItem->mPageDir; else return 0; @@ -52,27 +51,6 @@ EVideo *EVideo::create(const JObj &ele, PageListItem *pageItem, EBase *multiWin) ins->playTimes = (play.isNull() ? ele : play)["playTimes"].toInt(1); return ins; } -JObj EVideo::genProg(const JValue &ele, const QString &dstDir, ProgItem *progItem) { - auto widget = ele["widget"]; - if(widget.isNull()) widget = ele; - auto path = widget["path"].toString(); - auto name = widget["file"].toString(); - //if(progItem->maxLen) name += "-square.mp4"; - QString srcFile = path + "/" + name; - QFileInfo srcInfo(srcFile); - if(! srcInfo.isFile()) return JObj(); - QString id = Tools::fileMd5(srcFile); - if(id.isEmpty()) return JObj(); - QFile::copy(srcFile, dstDir+"/"+id); - JObj oRes; - oRes["_type"] = "Video"; - oRes["id"] = id; - oRes["md5"] = id; - oRes["name"] = name; - auto play = ele["play"]; - oRes["timeSpan"] = play.isNull() ? ele["duration"].toInt() * ele["playTimes"].toInt() : play["playDuration"].toInt() * play["playTimes"].toInt(); - return oRes; -} EVideo::EVideo(const QString &dir, const QString &name, const QString &rawDir, const QString &rawName, QImage &coverImg, PageListItem *pageItem, EBase *multiWin) : EBase(multiWin), mDir(dir), mName(name), mRawDir(rawDir), mRawName(rawName), mCoverImg(coverImg), mPageItem(pageItem) { diff --git a/LedOK/program/evideo.h b/LedOK/program/evideo.h index d1fbf42..ed4ada5 100644 --- a/LedOK/program/evideo.h +++ b/LedOK/program/evideo.h @@ -21,7 +21,6 @@ public: static QString transcoding(QWidget *parent, QString rawFile, QString rawName, QString dir, int rawW, int rawH, AVCodecID codec_id); static EVideo *create(const QString &file, PageListItem *pageItem, EBase *multiWin = nullptr); static EVideo *create(const JObj &, PageListItem *pageItem, EBase *multiWin = nullptr); - static JObj genProg(const JValue &, const QString &, ProgItem *mProgItem); explicit EVideo(const QString &, const QString &, const QString &, const QString &, QImage &img, PageListItem *pageItem, EBase *multiWin = nullptr); diff --git a/LedOK/program/eweb.cpp b/LedOK/program/eweb.cpp index f5160dc..58fe1ac 100644 --- a/LedOK/program/eweb.cpp +++ b/LedOK/program/eweb.cpp @@ -12,8 +12,9 @@ EWeb::EWeb(const JObj &json, EBase *multiWin) : EBase(multiWin) { setBaseAttr(json); url = json["url"].toString(); zoom = json["zoom"].toInt(100); - _x = json["offX"].toInt(0); - _y = json["offY"].toInt(0); + refresh = json["refreshSec"].toInt(); + _x = json["offX"].toInt(); + _y = json["offY"].toInt(); scaleX = json["scaleX"].toInt(100); scaleY = json["scaleY"].toInt(100); } @@ -73,6 +74,21 @@ QWidget* EWeb::attrWgt() { hBox->addLabel("%"); hBox->addStretch(); + hBox = new HBox(vBox); + lb = hBox->addLabel(tr("Refresh every")+":"); + lb->setMinimumWidth(70); + lb->setAlignment(Qt::AlignVCenter|Qt::AlignRight); + + auto edRefresh = new QSpinBox; + edRefresh->setRange(0, 99999); + edRefresh->setValue(refresh); + connect(edRefresh, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, [=](int value) { + refresh = value; + }); + hBox->addWidget(edRefresh); + hBox->addSpacing(-3); + hBox->addLabel("s"); + hBox->addStretch(); hBox = new HBox(vBox); lb = hBox->addLabel(tr("Offset")+" X:"); @@ -137,6 +153,7 @@ JObj EWeb::attrJson() const { obj["elementType"] = "Web"; obj["url"] = url; obj["zoom"] = zoom; + obj["refreshSec"] = refresh; obj["offX"] = _x; obj["offY"] = _y; obj["scaleX"] = scaleX; diff --git a/LedOK/program/eweb.h b/LedOK/program/eweb.h index 2d373a3..e0704ab 100644 --- a/LedOK/program/eweb.h +++ b/LedOK/program/eweb.h @@ -21,7 +21,7 @@ public: JObj attrJson() const override; QString url; - int zoom = 100, _x = 0, _y = 0, scaleX = 100, scaleY = 100; + int zoom = 100, refresh = 0, _x = 0, _y = 0, scaleX = 100, scaleY = 100; }; #endif // EWEB_H diff --git a/LedOK/program/gentmpthread.cpp b/LedOK/program/gentmpthread.cpp index 3574e12..55c8824 100644 --- a/LedOK/program/gentmpthread.cpp +++ b/LedOK/program/gentmpthread.cpp @@ -1,6 +1,5 @@ #include "gentmpthread.h" -#include "cfg.h" -#include "globaldefine.h" +#include "main.h" #include "tools.h" #include "program/eenviron.h" #include "program/evideo.h" @@ -147,6 +146,7 @@ JObj GenTmpThread::cvtPage(const JObj &pageJson) { source["width"] = geometry["w"]; source["height"] = geometry["h"]; source["rotate"] = ele["rotate"]; + source["opacity"] = ele["opacity"].toDouble(1); source["playTime"] = startTime; startTime += source["timeSpan"].toInt(); } @@ -167,7 +167,8 @@ JObj GenTmpThread::cvtPage(const JObj &pageJson) { {"eff", ele["borderEff"]}, {"speed", ele["borderSpeed"]}, {"img_size", borderSize}, - {"geometry", JArray{geometry["x"], geometry["y"], geometry["w"], geometry["h"]}} + {"geometry", JArray{geometry["x"], geometry["y"], geometry["w"], geometry["h"]}}, + {"rotate", isWin ? 0 : ele["rotate"]} }; } layers.append(layer); @@ -223,13 +224,36 @@ JArray GenTmpThread::genSources(QString type, const JArray &eles) { if(needType) type = ele["elementType"].toString(); if(type=="Text") source = genText(ele, sources); else if(type=="Image"||type=="Photo") source = genImage(ele); - else if(type=="Video"||type=="Movie") source = EVideo::genProg(ele, dstDir, mProgItem); - else if(type=="Gif") source = convertGif(ele); + else if(type=="Video"||type=="Movie") { + //genProg(ele, dstDir, mProgItem); + auto widget = ele["widget"]; + if(widget.isNull()) widget = ele; + auto path = widget["path"].toString(); + auto name = widget["file"].toString(); + auto srcFile = path + "/" + name; + if(! QFileInfo(srcFile).isFile() && ! QFileInfo(srcFile = srcPageDir + "/" + name).isFile()) continue; + auto id = Tools::fileMd5(srcFile); + if(id.isEmpty()) continue; + QFile::copy(srcFile, dstDir+"/"+id); + source["_type"] = "Video"; + source["id"] = id; + source["md5"] = id; + source["name"] = name; + auto play = ele["play"]; + source["timeSpan"] = play.isNull() ? ele["duration"].toInt() * ele["playTimes"].toInt() : play["playDuration"].toInt() * play["playTimes"].toInt(); + } else if(type=="Gif") source = convertGif(ele); else if(type=="DClock") source = convertDClock(ele); else if(type=="AClock") source = convertAClock(ele); else if(type=="Temp") source = EEnviron::genProg(ele, dstDir, srcPageDir); else if(type=="Web") source = convertWeb(ele); else if(type=="Timer") source = convertTimer(ele); + else if(type=="Timer2") { + source["_type"] = "Countdown"; + source["time"] = ele["targetTime"]; + source["isUp"] = ele["isUp"]; + source["html"] = ele["html"]; + source["backColor"] = ele["backColor"]; + } if(! source.empty()) { if(source["timeSpan"].isNull()) source["timeSpan"] = ele["duration"]; source["entryEffect"] = ele["entryEffect"]; @@ -237,6 +261,7 @@ JArray GenTmpThread::genSources(QString type, const JArray &eles) { source["entryEffectTimeSpan"] = ele["entryDur"]; source["exitEffectTimeSpan"] = ele["exitDur"]; if(ele["hasBlink"].toBool()) source["blink"] = ele["blink"]; + else if(ele["hasBreathe"].toBool()) source["breathe"] = ele["blink"]; sources.append(source); } } @@ -306,16 +331,16 @@ JObj GenTmpThread::genText(const JValue &ele, JArray &sources) { source["timeSpan"] = duration; source["entryEffect"] = ele["entryEffect"]; source["exitEffect"] = ele["exitEffect"]; - if(source["entryEffect"].toStr().isEmpty()) source["entryEffect"] = "None"; //兼容旧播放器 - if(source["exitEffect"].toStr().isEmpty()) source["exitEffect"] = "None"; //兼容旧播放器 source["entryEffectTimeSpan"] = ele["entryDur"]; source["exitEffectTimeSpan"] = ele["exitDur"]; + if(ele["hasBlink"].toBool()) source["blink"] = ele["blink"]; + else if(ele["hasBreathe"].toBool()) source["breathe"] = ele["blink"]; sources.append(source); } return JObj(); } } -//转换图片 + JObj GenTmpThread::genImage(const JValue &ele) { auto widget = ele["widget"]; auto name = widget.isNull() ? ele["name"].toString() : widget["file"].toString(); @@ -439,7 +464,7 @@ JObj GenTmpThread::convertDClock(const JValue &json){ oRes["spaceWidth"] = metric.horizontalAdvance(" "); QColor color(textColor); JArray imgs; - for(auto &str : str0_9) Tools::saveImg2(dstDir, metric, font, color, imgs, str, str); + for(int i=0; i<=9; i++) Tools::saveImg2(dstDir, metric, font, color, imgs, QString::number(i), QString::number(i)); Tools::saveImg2(dstDir, metric, font, color, imgs, tr("MON"), "MON"); Tools::saveImg2(dstDir, metric, font, color, imgs, tr("TUE"), "TUE"); Tools::saveImg2(dstDir, metric, font, color, imgs, tr("WED"), "WED"); @@ -508,6 +533,7 @@ JObj GenTmpThread::convertWeb(const JValue &res) { dst["name"] = "WebURL"; dst["url"] = res["url"]; dst["zoom"] = res["zoom"]; + dst["refreshSec"] = res["refreshSec"]; dst["offX"] = res["offX"]; dst["offY"] = res["offY"]; dst["scaleX"] = res["scaleX"].toDouble(100)/100; @@ -515,38 +541,38 @@ JObj GenTmpThread::convertWeb(const JValue &res) { return dst; } JObj GenTmpThread::convertTimer(const JValue &json) { - JObj oRes; - oRes["_type"] = "Timer"; - oRes["name"] = "Timer"; - oRes["targetTime"] = json["targetTime"]; - oRes["isDown"] = json["isDown"]; - oRes["hasDay"] = json["hasDay"]; - oRes["hasHour"] = json["hasHour"]; - oRes["hasMin"] = json["hasMin"]; - oRes["hasSec"] = json["hasSec"]; + JObj src; + src["_type"] = "Timer"; + src["name"] = "Timer"; + src["targetTime"] = json["targetTime"]; + src["isDown"] = json["isDown"]; + src["hasDay"] = json["hasDay"]; + src["hasHour"] = json["hasHour"]; + src["hasMin"] = json["hasMin"]; + src["hasSec"] = json["hasSec"]; auto isMultiline = json["isMultiline"].toBool(); - oRes["isMultiline"] = isMultiline; + src["isMultiline"] = isMultiline; auto text = json["text"].toString(); - oRes["text"] = text; + src["text"] = text; QFont font(json["font"].toString()); font.setPixelSize(json["fontSize"].toInt()); font.setBold(json["fontBold"].toBool()); font.setItalic(json["fontItalic"].toBool()); font.setUnderline(json["fontUnderline"].toBool()); - oRes["font"] = font.family(); - oRes["fontSize"] = font.pixelSize(); - oRes["fontBold"] = font.bold(); - oRes["fontItalic"] = font.italic(); - oRes["fontUnderline"] = font.underline(); + src["font"] = font.family(); + src["fontSize"] = font.pixelSize(); + src["fontBold"] = font.bold(); + src["fontItalic"] = font.italic(); + src["fontUnderline"] = font.underline(); auto textColor = json["textColor"].toString(); - oRes["textColor"] = textColor; - oRes["backColor"] = json["backColor"]; + src["textColor"] = textColor; + src["backColor"] = json["backColor"]; font.setStyleStrategy(gTextAntialiasing ? QFont::PreferAntialias : QFont::NoAntialias); QFontMetrics metric(font); - oRes["spaceWidth"] = metric.horizontalAdvance(" "); + src["spaceWidth"] = metric.horizontalAdvance(" "); QColor color(textColor); JObj imgs; - for(auto &str : str0_9) Tools::saveImg(dstDir, metric, font, color, imgs, str, str); + for(int i=0; i<=9; i++) Tools::saveImg(dstDir, metric, font, color, imgs, QString::number(i), QString::number(i)); Tools::saveImg(dstDir, metric, font, color, imgs, tr("day"), "day"); Tools::saveImg(dstDir, metric, font, color, imgs, tr("hour"), "hour"); Tools::saveImg(dstDir, metric, font, color, imgs, tr("min"), "min"); @@ -582,6 +608,6 @@ JObj GenTmpThread::convertTimer(const JValue &json) { } else emit onErr("convertTimer file.open false"); } else emit onErr("convertTimer img.save false"); } - oRes["imgs"] = imgs; - return oRes; + src["imgs"] = imgs; + return src; } diff --git a/LedOK/program/pagelistitem.cpp b/LedOK/program/pagelistitem.cpp index dd30694..655d54d 100644 --- a/LedOK/program/pagelistitem.cpp +++ b/LedOK/program/pagelistitem.cpp @@ -1,5 +1,5 @@ #include "pagelistitem.h" -#include "globaldefine.h" +#include "main.h" #include "gutil/qgui.h" #include "base/ffutil.h" #include "base/lodateselector.h" @@ -13,6 +13,7 @@ #include "program/ephoto.h" #include "program/etext.h" #include "program/etimer.h" +#include "program/etimer2.h" #include "program/evideo.h" #include "program/eweb.h" #include "tools.h" @@ -51,6 +52,7 @@ PageListItem::PageListItem(const JObj &attr, const QString &pageDir) : mAttr(att else if(type=="Temp") element = new EEnviron(ele.toObj()); else if(type=="Web") element = new EWeb(ele.toObj()); else if(type=="Timer") element = new ETimer(ele.toObj()); + else if(type=="Timer2") element = new ETimer2(ele.toObj()); else if(type=="Window") element = new EMultiWin(ele.toObj(), this); if(element) mScene->addItem(element); } diff --git a/LedOK/program/progeditorwin.cpp b/LedOK/program/progeditorwin.cpp index dfb615b..5f44576 100644 --- a/LedOK/program/progeditorwin.cpp +++ b/LedOK/program/progeditorwin.cpp @@ -4,7 +4,7 @@ #include "pagelistitem.h" #include "player/playwin.h" #include "tools.h" -#include "globaldefine.h" +#include "main.h" #include "gutil/qwaitingdlg.h" #include "program/ebase.h" #include "program/etext.h" @@ -16,6 +16,7 @@ #include "program/eenviron.h" #include "program/eweb.h" #include "program/etimer.h" +#include "program/etimer2.h" #include "program/emultiwin.h" #include "program/gentmpthread.h" #include "program/sendprogramdialog.h" @@ -190,6 +191,9 @@ ProgEditorWin::ProgEditorWin(ProgItem *progItem, QWidget *parent) : QWidget(pare action = new QAction(QIcon(":/res/program/Timer.png"), tr("Timer")); action->setData(EBase::Timer); toolBar->addAction(action); + action = new QAction(QIcon(":/res/program/Timer.png"), tr("Timer")+"2"); + action->setData(EBase::Timer2); + toolBar->addAction(action); action = new QAction(QIcon(":/res/program/demo-video.png"), tr("Demos")); connect(action, &QAction::triggered, this, [this] { auto file = QFileDialog::getOpenFileName(this, tr("Open Demo"), "Demos"); @@ -335,19 +339,20 @@ ProgEditorWin::ProgEditorWin(ProgItem *progItem, QWidget *parent) : QWidget(pare element = eVideo; } else if(type==EBase::Text) { if(iNewHeight > 80 && (mProgItem->mWidth >= mProgItem->mHeight)) iNewHeight = 80; - element = new EText(); + element = new EText; } else if(type==EBase::DClock) { if(iNewHeight>80 && (mProgItem->mWidth>=mProgItem->mHeight)) iNewHeight=80; - element = new EDClock(); + element = new EDClock; } else if(type==EBase::AClock) { if(iNewWidth > 120) iNewWidth = 120; if(iNewHeight > 120) iNewHeight = 120; - element = new EAClock(); - } else if(type==EBase::Environ) element = new EEnviron(); + element = new EAClock; + } else if(type==EBase::Environ) element = new EEnviron; else if(type==EBase::Web) { - element = new EWeb(); + element = new EWeb; element->setSize(mProgItem->mWidth, mProgItem->mHeight); - } else if(type==EBase::Timer) element = new ETimer(); + } else if(type==EBase::Timer) element = new ETimer; + else if(type==EBase::Timer2) element = new ETimer2; else if(type==EBase::Window) element = new EMultiWin(mPageItem); if(element) { if(element->mWidth==0) { diff --git a/LedOK/program/progitem.cpp b/LedOK/program/progitem.cpp index 0508ca4..5fe7135 100644 --- a/LedOK/program/progitem.cpp +++ b/LedOK/program/progitem.cpp @@ -6,7 +6,7 @@ #include "gutil/qwaitingdlg.h" #include "gutil/qwaitingdlg.h" #include "gentmpthread.h" -#include +#include #include "sendprogramdialog.h" #include "program/progeditorwin.h" #include diff --git a/LedOK/tools.cpp b/LedOK/tools.cpp index aa4f40d..3c56c70 100644 --- a/LedOK/tools.cpp +++ b/LedOK/tools.cpp @@ -3,15 +3,6 @@ #include #include -void Tools::timerEvent(QTimerEvent *event) { - if(timer_id==event->timerId()) emit sTick(); -} - -Tools* Tools::getInstance() { - static const auto ins = new Tools(qApp); - return ins; -} - QRect Tools::centerRect(qreal width, qreal height, int maxW, int maxH) { if(maxW < width || maxH < height) { auto rate = qMin(maxW / width, maxH / height); @@ -53,11 +44,6 @@ QString Tools::fileMd5(QString filePath) { file.close(); return QString::fromLatin1(cryptoHash.result().toHex()); } -void Tools::mergeFormat(QTextEdit *textEdit, const QTextCharFormat &fmt) { - QTextCursor cursor = textEdit->textCursor(); - if(! cursor.hasSelection()) cursor.select(QTextCursor::WordUnderCursor); - cursor.mergeCharFormat(fmt); -} QString Tools::saveImg(const QString& dir, const QFontMetrics& metric, const QFont& font, const QColor& color, const QString& str) { if(str.isEmpty()) return QString(); QImage img(metric.horizontalAdvance(str), metric.lineSpacing(), QImage::Format_ARGB32); diff --git a/LedOK/tools.h b/LedOK/tools.h index 3411881..88af649 100644 --- a/LedOK/tools.h +++ b/LedOK/tools.h @@ -13,21 +13,18 @@ #include #include -const QString str0_9[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}; extern QTextEdit *gFdResInfo; extern ProgItem *gProgItem; class Tools : public QObject { Q_OBJECT public: - static Tools* getInstance(); static QNetworkAccessManager &netManager() { static QNetworkAccessManager manager; return manager; }; static QRect centerRect(qreal, qreal, int, int); static QString addSufix(QString); - static void mergeFormat(QTextEdit *textEdit, const QTextCharFormat &format); static QString readErrStr(QImageReader::ImageReaderError); static QString fileMd5(QString); static QString saveImg(const QString&, const QFontMetrics&, const QFont&, const QColor&, const QString&); @@ -37,18 +34,6 @@ public: static int color2Int(const QColor& color); static QBrush getBrush(const QColor& color); static QString selectStr(bool f, const QString &s0, const QString &s1 = ""); - ~Tools() { - killTimer(timer_id); - } -signals: - void sTick(); -protected: - virtual void timerEvent(QTimerEvent *event); -private: - Tools(QObject *parent = 0) : QObject(parent) { - timer_id = startTimer(500, Qt::PreciseTimer); - }; - int timer_id; }; #endif // TOOLS_H diff --git a/LedOK/ts/app_en.ts b/LedOK/ts/app_en.ts index 50ec85d..ad6621d 100644 --- a/LedOK/ts/app_en.ts +++ b/LedOK/ts/app_en.ts @@ -56,209 +56,221 @@ CtrlAdvancedPanel - + Advanced Advanced - + Screen Width(pixel) Screen Width(pixel) - + Width Width - - + + Height Height - - - - + + + + Set Set - + Alias Alias - + Web Server Address: Web Server Address: - + + Setting Camera Range + + + + + + + Set Camera Range + + + + Setting - + Traffic screen settings - + Setting protocol ... - + Set protocol - + Getting protocol ... - + Get protocol - - + + Port - + Realtime Address: - + Firmware Management - + update or uninstall - + Clear Clear - + Check Apk Check Apk - + Uninstall Uninstall - + Running check Running check - + Restart Restart - + Check Log Check Log - + Start LedSet4 Start LedSet4.0 (Apk Display2.0 and higher) - + Open ADB Open ADB debugging function - + Post Custom JSON Post Custom JSON - - + - - + + + Clear Program Clear Program - + Config Config - + Refresh Refresh - + Restore to default Restore to default - + Taxi top screen configuration Taxi top screen configuration - - + + Service:High Out of service:Low Service:High Out of service:Low - - + + Service:Low Out of service:High Service:Low Out of service:High - + Binding *.ic account indentity voucher Binding *.ic account indentity voucher - + Rotate Rotate - + Min brightness Min brightness - + Readback Readback - + Send Send - + Max brightness Max brightness @@ -269,20 +281,21 @@ Set Screen Size - - - - + + + + + Success Success - + Compant ID: Company ID - + Compant ID Company ID @@ -293,451 +306,452 @@ Set Web server address - - + + ClearRealtimeServer Clear - - + + + + + + SetRealtimeServer Set realtimer address - - + + RestartAndroid Restart - - + + running running - - + + no running no running - + Check Apk Version Check Apk Version - - + + UninstallSoftware Uninstall - - + + Check apk running status - - + + OpenAdb Open ADB debugging function - + indentity voucher (*.ic) indentity voucher (*.ic) - - - - - + + + + + InvokeTaxiAppFunction Binding certificate - - + + AliIotSetting - + Software Version Info - + Package - + Version - - + + Package name is null - + Clearing Program - - + + Timeout Timeout - - - - + + + + Failed - + Getting Log - - - - - - - - - - + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + Error Error - + Setting Timing Reboot - + Set Timing Reboot - + Getting Timing Reboot - + Get Timing Reboot - + totalResolution FPGA total resoltuion - + strCurDisplayResolution Cur display resolution - - + + File not exist - + Getting Player State - - - + + + Get Player State - - + + Player State - - + + Cannot Open File - + Uploading - + Update Update - - + + Set Display Mode - - + + Get Display Mode - - + + Set Screen Offset - - + + Get Screen Offset - - - Set Camera Distance - - - - + Open file Failed Open file Failed - + Setting Wallpaper - - + + Set Wallpaper - + System Updating - - + + System Update - + Upload error - + Upgrading - + Getting MCU Version - - + + MCU Version - + Select File Select File - + Setting player background - - + + Set player background - + Clearing player background - - - - - - - - + + + + + + + + Clear player background - - + + GetScreenRotation Get Screen Rotation - - - + + + Charging Station - + Setting Baud Rate - + Set Baud Rate - + Getting Baud Rate - + Get Baud Rate - - + + Text is empty - - + + Json Parse Error - - + + Json isn't an Object - + Info - + Setting card work mode ... - + Set card work mode - + Getting card work mode ... - + Get card work mode - + Input password Input password - + Change Password Change Password - + Get Receive Card Num - + Resolution Config - + Full screen - + Part - + Display Mode - + Screen Position - + Offset - + Camera Distance @@ -746,129 +760,129 @@ Min - + Hidden Settings - + Click right button to hide - + Get MCU Version - + Baud Config - + Model - + Uart - + Baud - - + + Get - + Timing Reboot - + Protocol - + Server - + Client - - + + SetScreenRotation Set screen rotation - - + + SetMinBrightness Set min brightness value - - + + SetMaxBrightness Set maximum brightness value - - + + GetMinBrightness Get min brightness - - + + GetMaxBrightness Get maximum brightness - - + + Card work mode - - + + SetSpecialResolution Set Special Resolution - - + + GetSpecialResolution Get Special Resolution - - + + CleanDisplayScreenSize Restore to default relolution - - + + SetHighForBusy Set level for busy - - + + GetStateForBusy Get level of busy @@ -884,82 +898,84 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + Tip Tip @@ -967,58 +983,60 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + NoSelectedController Please select screen first @@ -1033,7 +1051,7 @@ Please enter the correct height pixel value - + Password is error Password is error @@ -3060,34 +3078,34 @@ Def - - - - - - - - - - - + + + + + + + + + + + Device replied - + - + Success Success - - - + + + Fail Fail @@ -3236,13 +3254,13 @@ - + On ON - + Off OFF @@ -3459,260 +3477,270 @@ EBase - + Area Area(px) - + X X - + Y Y - + W W - + H H - + Border Border - - - - + + + + None None - - + + Effect Effect - - + + Rotate Rotate - - + + Opacity + + + + + Blink Blink - + Speed Speed - + Slow Slow - + Moderate Moderate - + Fast Fast - + Play Time - + Start - - - - + + + + s - + Duration - + Entry - - + + Random - - + + Expand horizontal - - + + Expand vertical - - + + Expand to left - - + + Expand to top - - + + Expand to right - - - - Expand to bottom - - - - - Zoom in - - - - - Zoom in from left-top - - - - - Zoom in from right-top - - - - - Zoom in from right-bottom - - - - - Zoom in from left-bottom - - - - - - Rotate zoom - - - - - - Rotate zoom reverse - - - - - Fade in - - - - - - Move to left - - - - - - Move to top - - - - - - Move to right - - - - - - Move to bottom - - + Expand to bottom + + + + + Zoom in + + + + + Zoom in from left-top + + + + + Zoom in from right-top + + + + + Zoom in from right-bottom + + + + + Zoom in from left-bottom + + + + + + Rotate zoom + + + + + + Rotate zoom reverse + + + + + Fade in + + + + + + Move to left + + + + + + Move to top + + + + + + Move to right + + + + + + Move to bottom + + + + + Dur - + Exit - + Zoom out - + Zoom out to left-top - + Zoom out to right-top - + Zoom out to right-bottom - + Zoom out to left-bottom - + Fade out - + + Breathe + + + + Freq @@ -3890,103 +3918,87 @@ - - - + N - - - + NE - - - + E - - - + SE - - - + S - - - + SW - - - + W W - - - + NW - + Basic Properties Basic properties - + Title Title - + Compensation Compensation - + Left Left - + Center Center - + Right Right - + Single scroll Single scroll - + Speed Speed - + Back Color Back Color @@ -4114,122 +4126,122 @@ EText - + Enter your text Enter your text - + Basic Properties Basic properties - + Back Color Back Color - + Kerning Kerning - - Line Spacing - Line Spacing + + Line Height + - + PageCount: PageCount: - + page Page - + Import txt File - + Select File Select File - + Fail Fail - + Cannot Open File - + Play Properties - + Flip Flip - + Scroll Scroll - + Static Static - + Text Color - + Colorful Text - + Head-Tail Spacing Spacing - + Scroll Style Direction - + Right -> Left From right to left - + Bottom -> Top From bottom to top - + Left -> Right From left to right - + Top -> Bottom Frome top to bottom - + Scroll Speed Scrolling speed @@ -4237,117 +4249,194 @@ ETimer - + day Days - + hour Hours - + min Mins - + sec Secs - + Basic Properties Basic properties - + Count Down Count Down - + Count Up Count Up - + Time Target Time - + Day Day - + Hour Hour - + Min Min - + Sec Sec - + Multiline Multiline - + Text Text + + ETimer2 + + + There are + + + + + + Days + + + + + + Hours + + + + + + Mins + + + + + + Secs + + + + + Basic Properties + Basic properties + + + + Count Down + Count Down + + + + Count Up + Count Up + + + + Time + Target Time + + + + Font Size + + + + + Line Height + + + + + Foreground Color + + + + + Line Background + + + + + Background Color + + + EVideo - + Basic Properties Basic properties - + File File - + Play Properties - + Select File Select File - + Play Times Play Times - + Video Transcoding - - + + Video Transcoding Progress - - + + Error Error @@ -4365,22 +4454,27 @@ EWeb - + Basic Properties - + Zoom + Refresh every + + + + Offset - + Scale @@ -4388,22 +4482,22 @@ EleTimer - + day Days - + hour Hours - + min Mins - + sec Secs @@ -4411,67 +4505,67 @@ GenTmpThread - + MON MON - + TUE TUE - + WED WED - + THU THU - + FRI FRI - + SAT SAT - + SUN SUN - + AM AM - + PM PM - + day Days - + hour Hours - + min Mins - + sec Secs @@ -4479,7 +4573,7 @@ ImgDlg - + Screenshot @@ -4530,182 +4624,187 @@ MainWindow - + Language Language - + Help Help - - + + Check for updates Check for updates - - + + firmware manager Firmware management - - - + + + Preferences - - + + Info - - - + + + About About - - + + Setting Setting - + Software Update Software Update - + CurVersion CurVersion - + Latest Version - + Update Log - + The current version is already the latest version The current version is already the latest version - + Video compress to - + Video transcoding to - + Text antialiasing - + TextAntilaTip (Note: this option is suitable for screens with small spacing and large size. If this option is selected, the shadow on the edge of the text will be smooth; it is not recommended for small size screens and single and double color screens.) - + Ultra-Long Screen Split - + Program Send Batch - + Hide Detect Button - + + Show IP in Terminal Control + + + + Show Alias in Terminal Control - + Show Lora Screen - + Download - + Fail Fail - + Cannot Save File - - - + + + Downloading updates Downloading updates - + Error Error - + Device Terminals - + Program Solutions - + Control Terminal Control - + Lora Screen - + Check card Detect - + Tip Info Tip Info - + RestoreLedCardIpByUdpTip This operation will fix all the control cards in the LAN that are not in the same network segment as the computer IP. Please be careful! @@ -4830,84 +4929,84 @@ PageListItem - + times Times - + Page name Program name - + New New - + Play times Play times - + Sources Repeat - + Audios - + Total Dur - - + + s s - + Select File Select File - + Duration - + Vol - + Valid Date Valid date - - + + Warning Warning - + Start Time can't be later than End Time - + End Time can't be earlier than Start Time - + Plan Plan @@ -4915,37 +5014,37 @@ PlanItemWgt - + M M - + Tu Tu - + W W - + Th Th - + F F - + Sa Sa - + Su Su @@ -4953,17 +5052,17 @@ PlayWin - + Move to Top Left Move to Top Left - + Set Position - + Close Close @@ -4971,12 +5070,12 @@ PlayerBackSendThread - + Open file failed Open file failed - + Read file failed Read file failed @@ -4997,52 +5096,52 @@ ProgCreateDlg - + Resolution Resolution - + Solution Information Solution Information - + Solution Name Solution Name - + Width Width - + Height Height - + Remarks Remarks - + Ultra-Long Screen Split - + Horizontal Horizontal - + Vertical Vertical - + Lengths of Parts @@ -5050,197 +5149,198 @@ ProgEditorWin - + Save Save - + Setting Setting - + Text Text - + Photo Photo - + Video Video - + Gif Gif - + Clock Clock - + Analog Clock Analog Clock - + Environment Environmental Monitoring - + Web Web page - + MuliContentWindow Multi material window - + In this window, a plurality of different program materials can be added and played according to the order of joining the list; In this window, a plurality of different program materials can be added and played according to the order of joining the list - + + Timer Timer - + Play - + Stop Stop - + Publish Publish - - - + + + Select File Select File - + program Program - + Add page Add page - + Copy page Copy page - + Delete page Delete page - - + + Tip Info Tip Info - + Are you sure you want to delete this program page? Are you sure you want to delete this program page? - + Move up Move up - + Move down Move down - + widget properties Widget properties - + Page properties Program properties - + Do you want to save the modifications? Do you want to save the modifications? - + Create Dir failed - + Saving... Saving... - + Success Success - + Convertering Convertering - + Demos - + Open Demo - + Generate preview data Generate preview data - - - + + + Error Error - + Rename fail when saving - + Remove Recursively fail when saving @@ -5440,7 +5540,7 @@ QObject - + Setting up the LedOK Express... Setting up the LedOK Express... @@ -5648,32 +5748,32 @@ Refresh - + Alias - + Online Online - + Security encryption - + Progress Progress - + State State - + All ALL @@ -5740,8 +5840,8 @@ - - + + Error Error @@ -5777,7 +5877,7 @@ - + Install Success @@ -5832,37 +5932,37 @@ - + Input password Input password - + VerifyPassword Verify Password - + Tip Info Tip Info - + password is wrong password is wrong - + Same version, needn't update - + Install Failed - + The encrypted control card can be upgraded directly The encrypted control card can be upgraded directly diff --git a/LedOK/ts/app_ja.ts b/LedOK/ts/app_ja.ts index 51223ff..50e4d66 100644 --- a/LedOK/ts/app_ja.ts +++ b/LedOK/ts/app_ja.ts @@ -56,209 +56,221 @@ CtrlAdvancedPanel - + Advanced 上級パラメータ - + Screen Width(pixel) 画面幅(ピクセル) - + Width - - + + Height 高さ - - - - + + + + Set セット - + Alias 別名 - + Web Server Address: Webサーバのアドレス: - + + Setting Camera Range + + + + + + + Set Camera Range + + + + Setting - + Traffic screen settings - + Setting protocol ... - + Set protocol - + Getting protocol ... - + Get protocol - - + + Port ポート - + Firmware Management ファームウェア管理 - + update or uninstall 更新またはアンインストール - + Clear クリア - + Check Apk APKを検出 - + Uninstall アンマウント - + Running check 運転状態モニタ - + Restart 再起動 - + Check Log ログを見る - + Start LedSet4 - + Open ADB ADBデバッグ機能を開く - + Post Custom JSON Post Custom JSON - - + - - + + + Clear Program 番組をクリア - + Config の設定 - + Refresh 更新 - + Restore to default 標準の値を復元 - + Taxi top screen configuration タクシートップ画面の設定 - - + + Service:High Out of service:Low 客がいます:高 客がいません:低 - - + + Service:Low Out of service:High 客がいます:低 客がいません:高 - + Binding *.ic account indentity voucher テーピングtaxihubプラットフォームのユーザーID証明書 - + Rotate 回転 - + Realtime Address: - + Min brightness 最低輝度 - + Readback 読み戻し - + Send 送信 - + Max brightness 最高輝度 @@ -269,20 +281,21 @@ スクリーンのピクセルサイズを設定 - - - - + + + + + Success 成功 - + Compant ID: 会社ID: - + Compant ID 会社ID @@ -293,451 +306,452 @@ ウェブサーバのアドレスを設定 - - + + ClearRealtimeServer クリア - - + + + + + + SetRealtimeServer RealTimerアドレスを設定 - - + + RestartAndroid 再起動 - - + + running 実行中 - - + + no running 実行されていません - + Check Apk Version チェック APK バージョン - - + + UninstallSoftware アンマウント - - + + Check apk running status APK運転状態監視 - - + + OpenAdb ADBデバッグ機能を開く - + indentity voucher (*.ic) 身分証明書(*.ic) - - - - - + + + + + InvokeTaxiAppFunction 証明書をバインド - - + + AliIotSetting - + Software Version Info - + Package - + Version バージョン - - + + Package name is null パッケージ名は空です - + Clearing Program プログラムクリア - - + + Timeout タイムアウト - - - - + + + + Failed 失敗 - + Getting Log ログを取得中 - - - - - - - - - - + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + Error エラー - + Setting Timing Reboot スケジュール再起動を設定中 - + Set Timing Reboot スケジュール再起動の設定 - + Getting Timing Reboot スケジュール再起動を取得中 - + Get Timing Reboot スケジュール再起動の取得 - + totalResolution トータル解像度 - + strCurDisplayResolution 表示解像度 - - + + File not exist ファイルが存在しません - + Getting Player State プレーヤーの状態を取得しています - - - + + + Get Player State プレーヤーの状態の取得 - - + + Player State プレーヤーの状態 - - + + Cannot Open File ファイルのオープンに失敗しました - + Uploading アップロード中 - + Update 更新 - - + + Set Display Mode - - + + Get Display Mode - - + + Set Screen Offset - - + + Get Screen Offset - - - Set Camera Distance - - - - + Open file Failed ファイルのオープンに失敗しました - + Setting Wallpaper - - + + Set Wallpaper - + System Updating - - + + System Update - + Upload error アップロード エラー - + Upgrading アップグレード中 - + Getting MCU Version - - + + MCU Version - + Select File ファイルを選択 - + Setting player background - - + + Set player background - + Clearing player background - - - - - - - - + + + + + + + + Clear player background - - + + GetScreenRotation 画面回転の取得 - - - + + + Charging Station じゅうでんぐい - + Setting Baud Rate - + Set Baud Rate - + Getting Baud Rate - + Get Baud Rate - - + + Text is empty - - + + Json Parse Error - - + + Json isn't an Object - + Info 情報 - + Setting card work mode ... - + Set card work mode - + Getting card work mode ... - + Get card work mode - + Input password パスワードを入力 - + Change Password パスワード変更 - + Get Receive Card Num 受信カード数の取得 - + Resolution Config 解像度設定 - + Full screen フルスクリーン - + Part セクション - + Display Mode 表示モード - + Screen Position - + Offset - + Camera Distance @@ -746,129 +760,129 @@ - + Hidden Settings - + Click right button to hide - + Get MCU Version - + Baud Config - + Model - + Uart - + Baud - - + + Get 得る - + Timing Reboot スケジュール再起動 - + Protocol プロトコル - + Server サービス - + Client クライアント - - + + SetScreenRotation 画面の回転を設定する - - + + SetMinBrightness 最小輝度値を設定します - - + + SetMaxBrightness 輝度最大値を設定 - - + + GetMinBrightness 輝度最小値を取得 - - + + GetMaxBrightness 輝度最大値を取得 - - + + Card work mode - - + + SetSpecialResolution 解像度を設定 - - + + GetSpecialResolution 読み込み解像度 - - + + CleanDisplayScreenSize デフォルトの解像度を復元 - - + + SetHighForBusy 客レベルの設定 - - + + GetStateForBusy ゲストレベルを取得 @@ -884,82 +898,84 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + Tip 提示 @@ -967,58 +983,60 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + NoSelectedController 先に大きいスクリーンを選んでください @@ -1033,7 +1051,7 @@ 正しい高さのピクセル値を入力してください - + Password is error パスワード @@ -3060,34 +3078,34 @@ Def - - - - - - - - - - - + + + + + + + + + + + Device replied デバイス応答 - + - + Success 成功 - - - + + + Fail 失敗 @@ -3235,13 +3253,13 @@ - + On オン - + Off オフ @@ -3458,260 +3476,270 @@ EBase - + Area 領域(px) - + X X - + Y Y - + W W - + H H - + Border ボーダー - - - - + + + + None なし - - + + Effect 特効 - - + + Rotate 回転 - - + + Opacity + + + + + Blink きらめき - + Speed スピード - + Slow 遅い - + Moderate - + Fast 速い - + Play Time 再生時間 - + Start スタート - - - - + + + + s - + Duration 期間 - + Entry 入場する - - + + Random ランダム - - + + Expand horizontal 水平展開 - - + + Expand vertical 垂直展開 - - + + Expand to left 左に展開 - - + + Expand to top 上へ展開 - - + + Expand to right 右に展開 - - + + Expand to bottom 下へ展開 - + Zoom in 拡大 - + Zoom in from left-top 左上から拡大 - + Zoom in from right-top 右上から拡大 - + Zoom in from right-bottom 右下から拡大 - + Zoom in from left-bottom 左下から拡大 - - + + Rotate zoom 回転拡大 - - + + Rotate zoom reverse 逆回転拡大 - + Fade in フェードイン - - + + Move to left 左に移動 - - + + Move to top 上へ移動 - - + + Move to right 右に移動 - - + + Move to bottom 下へ移動 - - + + Dur 時間 - + Exit 出場する - + Zoom out 縮小 - + Zoom out to left-top 左上に縮小 - + Zoom out to right-top 右上に縮小 - + Zoom out to right-bottom 右下に縮小 - + Zoom out to left-bottom 左下に縮小 - + Fade out フェードアウト - + + Breathe + + + + Freq @@ -3889,103 +3917,87 @@ ひかりのつよさ - - - + N - - - + NE - - - + E - - - + SE - - - + S - - - + SW - - - + W - - - + NW - + Basic Properties 基本的な属性 - + Title タイトル - + Compensation 補償 - + Left 左に寄る - + Center 中央にある - + Right 右に寄る - + Single scroll 1行スクロール - + Speed スピード - + Back Color 背景色 @@ -4113,122 +4125,122 @@ EText - + Enter your text 内容を入力してください - + Basic Properties 基本的な属性 - + Back Color 背景色 - + Kerning 字の間隔 - - Line Spacing - 間隔 + + Line Height + 行の高さ - + PageCount: 総ページ数: - + page ページ - + Import txt File インポート txt ファイル - + Select File ファイルを選択 - + Fail 失敗 - + Cannot Open File ファイルのオープンに失敗しました - + Play Properties 再生方法 - + Flip 次頁 - + Scroll スクロール - + Static スタティック - + Text Color テキスト色 - + Colorful Text まばゆい文字 - + Head-Tail Spacing 首尾間隔 - + Scroll Style スクロール方向 - + Right -> Left 左へ - + Bottom -> Top 上へ - + Left -> Right 右へ - + Top -> Bottom 下へ - + Scroll Speed スクロールスピード @@ -4236,117 +4248,194 @@ ETimer - + day - + hour - + min - + sec - + Basic Properties 基本的な属性 - + Count Down カウントダウン - + Count Up カウントアップ - + Time 目標時間 - + Day - + Hour - + Min - + Sec - + Multiline 複数行表示 - + Text テキスト + + ETimer2 + + + There are + + + + + + Days + + + + + + Hours + + + + + + Mins + + + + + + Secs + + + + + Basic Properties + 基本的な属性 + + + + Count Down + カウントダウン + + + + Count Up + カウントアップ + + + + Time + 目標時間 + + + + Font Size + + + + + Line Height + 行の高さ + + + + Foreground Color + + + + + Line Background + + + + + Background Color + + + EVideo - + Basic Properties 基本的な属性 - + File ファイル - + Play Properties 再生方法 - + Select File ファイルを選択 - + Play Times 再生回数 - + Video Transcoding - - + + Video Transcoding Progress ビデオ変換の進歩 - - + + Error エラー @@ -4364,22 +4453,27 @@ EWeb - + Basic Properties 基本的な属性 - + Zoom + Refresh every + + + + Offset - + Scale @@ -4387,22 +4481,22 @@ EleTimer - + day - + hour - + min - + sec @@ -4410,67 +4504,67 @@ GenTmpThread - + MON 月曜日 - + TUE 火曜日 - + WED 水曜日 - + THU 木曜日 - + FRI 金曜日 - + SAT 土曜日 - + SUN 日曜日 - + AM 午前 - + PM 午後 - + day - + hour - + min - + sec @@ -4478,7 +4572,7 @@ ImgDlg - + Screenshot スクリーンショット @@ -4529,182 +4623,187 @@ MainWindow - + Language 言語 - + Help ヘルプ - - + + Check for updates アップデートをチェック - - + + firmware manager ファームウェア管理 - - - + + + Preferences プリファレンス設定 - - + + Info 情報 - - - + + + About 当ソフトウェアについて - - + + Setting 設置 - + Software Update ソフトウェアの更新 - + CurVersion 現在のバージョン - + Latest Version 最新バージョン - + Update Log 更新ログ - + The current version is already the latest version すでに最新バージョンです。 - + Video compress to ビデオ圧縮 to - + Video transcoding to トランスコード to - + Text antialiasing 文字のアンチエイリアス - + TextAntilaTip (ヒント:小さい間隔の大きい画面に適しています。このオプションを有効にすると、文字の端に影がフォントのエッジの滑らかさに達します。小さいサイズのスクリーンと単色のスクリーンは使用を推奨しません) - + Ultra-Long Screen Split 超ロングスクリーン分割 - + Program Send Batch - + Hide Detect Button - + + Show IP in Terminal Control + + + + Show Alias in Terminal Control 端末制御に別名を表示 - + Show Lora Screen - + Download ダウンロード - + Fail 失敗 - + Cannot Save File ファイルの保存に失敗しました - - - + + + Downloading updates 更新をダウンロード - + Error エラー - + Device 端末管理 - + Program コンテンツ管理 - + Control ターミナルコントロール - + Lora Screen - + Check card ワンタッチ修復 - + Tip Info ヒント - + RestoreLedCardIpByUdpTip この操作はLAN内のすべてのコンピュータIPと同じセグメントにないコントロールカードを固定IPに修正します。慎重に操作してください。 @@ -4829,84 +4928,84 @@ PageListItem - + times - + Page name プログラム名 - + New 新規 - + Play times 再生回数 - + Sources Repeat ソースの繰り返し - + Audios オーディオ - + Total Dur 全期間 - - + + s - + Select File ファイルを選択 - + Duration 期間 - + Vol 音量 - + Valid Date 有効期間 - - + + Warning 警告 - + Start Time can't be later than End Time 開始時間は終了時間より後にようにしてください - + End Time can't be earlier than Start Time 終了時間は開始時間より遅いようにしてください - + Plan タイムスケジュール @@ -4914,37 +5013,37 @@ PlanItemWgt - + M - + Tu - + W - + Th - + F - + Sa - + Su @@ -4952,17 +5051,17 @@ PlayWin - + Move to Top Left 左上隅に移動 - + Set Position 設定位置 - + Close 閉じる @@ -4970,12 +5069,12 @@ PlayerBackSendThread - + Open file failed ファイルのオープンに失敗しました - + Read file failed ファイルの読み込みに失敗しました @@ -4996,52 +5095,52 @@ ProgCreateDlg - + Resolution 解像度 - + Solution Information スケジュール情報 - + Solution Name リスト名 - + Width - + Height 高さ - + Remarks 備考 - + Ultra-Long Screen Split 超ロングスクリーン分割 - + Horizontal 水平 - + Vertical 垂直 - + Lengths of Parts 部分の長さ @@ -5049,197 +5148,198 @@ ProgEditorWin - + Save 保存 - + Setting 設置 - + Text テキスト - + Photo 写真 - + Video ビデオ - + Gif アニメーション - + Clock デジタル時計 - + Analog Clock アナログ時計 - + Environment 環境モニタリング - + Web ウェブページ - + MuliContentWindow マルチ素材ウィンドウ - + In this window, a plurality of different program materials can be added and played according to the order of joining the list; このウィンドウには、複数の異なる番組素材を追加して、リストに追加した順に再生することができます - + + Timer タイマー - + Play 再生 - + Stop 停止 - + Publish 転送 - - - + + + Select File ファイルを選択 - + program 番組リスト - + Add page ページを追加 - + Copy page コピーページ - + Delete page ページを削除 - - + + Tip Info ヒント - + Are you sure you want to delete this program page? 本当にこの番組ページを削除しますか? - + Move up 前へ - + Move down 次頁 - + widget properties パッケージプロパティ - + Page properties プログラムのプロパティ - + Do you want to save the modifications? 変更された内容を保存してもよろしいですか? - + Create Dir failed ディレクトリの作成に失敗しました - + Saving... 保存中、少々お待ちください... - + Success 成功 - + Convertering データを整理する - + Demos テスト素材 - + Open Demo テスト素材を開く - + Generate preview data プレビューデータの生成 - - - + + + Error エラー - + Rename fail when saving - + Remove Recursively fail when saving @@ -5439,7 +5539,7 @@ QObject - + Setting up the LedOK Express... 初期化LedOK Express… @@ -5647,32 +5747,32 @@ 更新 - + Alias 別名 - + Online オンライン中 - + Security 暗号化 - + Progress 程度 - + State 状態 - + All トータル @@ -5739,8 +5839,8 @@ - - + + Error エラー @@ -5776,7 +5876,7 @@ - + Install Success インストールに成功しました @@ -5831,37 +5931,37 @@ 実行されていません - + Input password パスワードを入力 - + VerifyPassword パスワードの検証 - + Tip Info ヒント - + password is wrong パスワードエラー - + Same version, needn't update 同じバージョン、更新不要 - + Install Failed インストールに失敗しました - + The encrypted control card can be upgraded directly 暗号化されたコントロールカードを直接アップグレードすることができます diff --git a/LedOK/ts/app_pt.ts b/LedOK/ts/app_pt.ts index 8f7fbb1..03374be 100644 --- a/LedOK/ts/app_pt.ts +++ b/LedOK/ts/app_pt.ts @@ -56,214 +56,226 @@ CtrlAdvancedPanel - + Advanced Avançado - + Screen Width(pixel) Largura do display(pixel) - + Width Largura - - + + Height Altura - - - - + + + + Set Config - + Alias Apelido - + Web Server Address: Endereço do Web Server: - + + Setting Camera Range + + + + + + + Set Camera Range + + + + Setting - + Getting Baud Rate - + Traffic screen settings - + Setting protocol ... - + Set protocol - + Getting protocol ... - + Get protocol - - + + Port - + Model - + Realtime Address: Servidor de Realtime: - + update or uninstall - + Clear Limpar - + Check Apk Conferi Apk - + Uninstall Desinstalar - + Running check Conferir - + Restart Reiniciar - + Check Log Conferir Log - + Start LedSet4 Iniciar LedSet4.0 (Apk Display2.0 and higher) - + Open ADB Abri ADB debug - + Post Custom JSON Publicar JSON - - + - - + + + Clear Program Limpar Programa - + Config Config - + Refresh Atualizar - + Restore to default Restaurar padrão - + Taxi top screen configuration Taxi top screen configuration - - + + Service:High Out of service:Low Service:Altura fora do pardão:Diminuir - - + + Service:Low Out of service:High Service:Altura fora do padrão:Aumentar - + Binding *.ic account indentity voucher Vincular *.identificação da conta - + Rotate Rotacionar - + Min brightness Brilho minimo - + Readback Ler - + Send Enviar - + Max brightness Brilho Maximo @@ -274,20 +286,21 @@ Conf. tamanho do painel - - - - + + + + + Success Successo - + Compant ID: ID da empresa - + Compant ID ID da empresa @@ -298,577 +311,574 @@ Config o webserver - - + + ClearRealtimeServer Limpar - - + + + + + + SetRealtimeServer Config o server de realtimer - - + + RestartAndroid Reiniciar - - + + running Rodar - - + + no running não rodar - + Check Apk Version Checar a versão da APK - - + + UninstallSoftware Desistalar - - + + Check apk running status Checar status do APK - - + + OpenAdb Abrir o debug - + indentity voucher (*.ic) Comprovante de ID (*.ic) - - - - - + + + + + InvokeTaxiAppFunction Vincular certificado - - + + AliIotSetting - + Software Version Info - + Package - + Version - - + + Package name is null - + Clearing Program - - + + Timeout Tempo esgotado - - - - + + + + Failed Falhou - + Getting Log Obtendo log - - - - - - - - - - + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + Error Erro - + Getting Player State - - + + Player State - - - + + + Get Player State - + Setting Timing Reboot Config tempo de reiniciar - + Set Timing Reboot Config tempo de reiniciar - + Getting Timing Reboot Config tempo de reiniciar - + Get Timing Reboot Obtendo tempo de reinicialização - - + + Get Display Mode - - + + Set Screen Offset - + totalResolution Resolução total de FPGA - + strCurDisplayResolution Resolução do display - - + + File not exist Arquivo não encontrado - - + + Cannot Open File Não pode abrir arquivo - + Uploading Atualizando - + Update Atualizar - - + + Set Display Mode Config Display - - + + Get Screen Offset Obter display Offset - - - Set Camera Distance - - - - + Open file Failed Falaha em abrir - + Setting Wallpaper Config plano fundo - - + + Set Wallpaper Config plano fundo - + System Updating Atualizando - - + + System Update Sistema atualizado - + Upload error Erro ao atualizar - + Upgrading Actualização - + Getting MCU Version Obtendo versão - - + + MCU Version Verão de MCU - + Select File Arquivo selecionado - + Setting player background Config plano de fundo - - + + Set player background Config plano de fundo - + Clearing player background Apagar plano de fundo - - - - - - - - + + + + + + + + Clear player background Apagar plano de fundo - - + + GetScreenRotation Rotação do display - - - + + + Charging Station - + Setting Baud Rate Config Baud Rate - + Set Baud Rate Config Baud Rate - + Get Baud Rate Config Baud Rate - - + + Text is empty Testo em branco - - + + Json Parse Error Erro Json - - + + Json isn't an Object - + Info Info - + Setting card work mode ... - + Set card work mode - + Getting card work mode ... - + Get card work mode - + Input password Entre com a senha - + Change Password Troque a senha - + Get Receive Card Num Obter o número de cartões receptores - + Resolution Config Config de resolução - + Full screen Full screen - + Part Parte - + Display Mode Modo do display - + Screen Position Posição da tela - + Offset Offset - + Camera Distance - Min - Min - - - + Hidden Settings Esconder Config - + Click right button to hide Clique com o botão direito para esconder - + Get MCU Version Versão de MCU - + Baud Config Config Baudrate - + Uart Uart - + Baud Baud - - + + Get Obter - + Firmware Management - + Timing Reboot Reiniciando - + Protocol Protocolo - + Server Servidor - + Client Cliente - - + + SetScreenRotation Config a rotação do display - - + + SetMinBrightness Config brilho minimo - - + + SetMaxBrightness Config brilho maximo - - + + GetMinBrightness Obter bilho - - + + GetMaxBrightness Obter brilho - - + + Card work mode - - + + SetSpecialResolution Config resolução especial - - + + GetSpecialResolution Ler resolução especial - - + + CleanDisplayScreenSize Restaurar resolução - - + + SetHighForBusy Set level for busy - - + + GetStateForBusy Get level of busy @@ -884,82 +894,84 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + Tip Dica @@ -967,58 +979,60 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + NoSelectedController Selecionar o display @@ -1033,7 +1047,7 @@ Entre com a correta altura - + Password is error Senha esta errada @@ -3060,34 +3074,34 @@ Def - - - - - - - - - - - + + + + + + + + + + + Device replied Equipamento replicado - + - + Success Successo - - - + + + Fail Falhou @@ -3231,13 +3245,13 @@ - + On Ligado - + Off Desligado @@ -3459,260 +3473,270 @@ EBase - + Area Area(px) - + X X - + Y Y - + W L - + H A - + Border Borda - - - - + + + + None None - - + + Effect Efeito - - + + Rotate Rotacionar - - + + Opacity + + + + + Blink Piscar - + Speed Velocidade - + Slow Devagar - + Moderate Moderado - + Fast Rapido - + Play Time - + Start - - - - + + + + s s - + Duration Duração - + Entry - - + + Random - - + + Expand horizontal - - + + Expand vertical - - + + Expand to left - - + + Expand to top - - + + Expand to right - - + + Expand to bottom - + Zoom in - + Zoom in from left-top - + Zoom in from right-top - + Zoom in from right-bottom - + Zoom in from left-bottom - - + + Rotate zoom - - + + Rotate zoom reverse - + Fade in - - + + Move to left - - + + Move to top - - + + Move to right - - + + Move to bottom Mover para baixo - - + + Dur - + Exit - + Zoom out - + Zoom out to left-top - + Zoom out to right-top - + Zoom out to right-bottom - + Zoom out to left-bottom - + Fade out - + + Breathe + + + + Freq @@ -3890,103 +3914,87 @@ Luminosa - - - + N - - - + NE - - - + E - - - + SE - - - + S - - - + SW - - - + W - - - + NW - + Basic Properties Basic properties - + Title Titulo - + Compensation Compensação - + Left Esquerda - + Center Centro - + Right Direita - + Single scroll Rolar simples - + Speed Velocidade - + Back Color Cor fundo @@ -4114,122 +4122,122 @@ EText - + Enter your text Entre com o texto - + Basic Properties Propriedades - + Back Color Cor de fundo - + Kerning Kerning - - Line Spacing - Espaços + + Line Height + Altura da Linha - + PageCount: Paginas: - + page Pagina - + Import txt File Importar arquivo - + Select File Selecionar arquivo - + Fail Falhou - + Cannot Open File Não pode abrir - + Play Properties Propriedades - + Flip Virar - + Scroll Rodar - + Static Estático - + Text Color Cor do texto - + Colorful Text Texto colorido - + Head-Tail Spacing Espaçado - + Scroll Style Direção - + Right -> Left Da direita para esquerda - + Bottom -> Top de baixo para cima - + Left -> Right Da esquerda para direita - + Top -> Bottom De cima para baixo - + Scroll Speed Velocidade de rotação @@ -4237,117 +4245,194 @@ ETimer - + day Dias - + hour Horas - + min Min - + sec Seg - + Basic Properties Propriedades - + Count Down Contador regressivo - + Count Up Contador progressivo - + Time Target Time - + Day Dia - + Hour Hora - + Min Min - + Sec Seg - + Multiline Multilinha - + Text Texto + + ETimer2 + + + There are + + + + + + Days + + + + + + Hours + + + + + + Mins + + + + + + Secs + + + + + Basic Properties + + + + + Count Down + Contador regressivo + + + + Count Up + Contador progressivo + + + + Time + Target Time + + + + Font Size + + + + + Line Height + Altura da Linha + + + + Foreground Color + + + + + Line Background + + + + + Background Color + + + EVideo - + Basic Properties Propriedades - + File Arquivo - + Play Properties - + Select File Selecionar arquivo - + Play Times Repetições - + Video Transcoding Transcodificação de video - - + + Video Transcoding Progress Processando - - + + Error Erro @@ -4365,22 +4450,27 @@ EWeb - + Basic Properties Propriedades - + Zoom + Refresh every + + + + Offset Offset - + Scale @@ -4388,22 +4478,22 @@ EleTimer - + day Dias - + hour Horas - + min Mins - + sec Segs @@ -4411,67 +4501,67 @@ GenTmpThread - + MON Seg - + TUE Ter - + WED Qua - + THU Qui - + FRI Sex - + SAT Sab - + SUN Dom - + AM AM - + PM PM - + day Dias - + hour Horas - + min Mins - + sec Segs @@ -4479,7 +4569,7 @@ ImgDlg - + Screenshot Captura da tela @@ -4530,182 +4620,187 @@ MainWindow - + Language Idioma - + Help Ajuda - - + + Check for updates Checar atualizações - - + + firmware manager Gerenciador Firmware - - - + + + Preferences Preferencias - - + + Info Info - - - + + + About Sobre - - + + Setting Config - + Software Update Atualização deSoftware - + CurVersion Versão atual - + Latest Version Ultima versão - + Update Log Atualização de log - + The current version is already the latest version The current version is already the latest version - + Video compress to - + Video transcoding to - + Text antialiasing - + TextAntilaTip (Info:Não indicado para pequenos displays - + Ultra-Long Screen Split Dividir o Ecrã Ultralongo - + Program Send Batch - + Hide Detect Button - + + Show IP in Terminal Control + + + + Show Alias in Terminal Control Mostrar os aliases no controlo do terminal - + Show Lora Screen - + Download - + Fail Falhou - + Cannot Save File Não pode salvar - - - + + + Downloading updates Atualizando - + Error Erro - + Device Painéis - + Program Editor - + Control Config - + Lora Screen Display LORA - + Check card Detectar - + Tip Info Info - + RestoreLedCardIpByUdpTip Esta operação irá fixar todos os painéis na LAN que não estão na mesma faixa de IP do seu PC. Atenção! @@ -4830,84 +4925,84 @@ PageListItem - + times Repetições - + Page name Nome programa - + New Novo - + Play times Repetições - + Sources Repeat - + Audios Audios - + Total Dur Duração total - - + + s s - + Select File Selecionar arquivos - + Duration Duração - + Vol Vol - + Valid Date Data de validade - - + + Warning Aviso - + Start Time can't be later than End Time Tempo de inicio não pode ser maior que o tempo final - + End Time can't be earlier than Start Time Tempo final não pode ser anter do tempo inicial - + Plan Plan @@ -4915,37 +5010,37 @@ PlanItemWgt - + M Seg - + Tu Ter - + W Qua - + Th Qui - + F Sex - + Sa Sab - + Su Dom @@ -4953,17 +5048,17 @@ PlayWin - + Move to Top Left Mover superior esquerdo - + Set Position Config posição - + Close Fechar @@ -4971,12 +5066,12 @@ PlayerBackSendThread - + Open file failed Abrir aqrquivo - + Read file failed Ler arquivo @@ -4997,52 +5092,52 @@ ProgCreateDlg - + Resolution Resolução - + Solution Information ID - + Solution Name Nome - + Width Largura - + Height Altura - + Remarks Observações - + Ultra-Long Screen Split Dividir o Ecrã Ultralongo - + Horizontal - + Vertical - + Lengths of Parts Comprimento das peças @@ -5050,197 +5145,198 @@ ProgEditorWin - + Save Salvar - + Setting Configuração - + Text Texto - + Photo Foto - + Video Video - + Gif Gif - + Clock Relógio - + Analog Clock Relógio analogico - + Environment Monitoramento ambiente - + Web Web page - + MuliContentWindow Janela para varias midias - + In this window, a plurality of different program materials can be added and played according to the order of joining the list; Nesta janela, podem ser adicionados varios tipos de midia, sendo apresentados de acordo com a ordem da lista - + + Timer Timer - + Play Tocar - + Stop Parar - + Publish Publicar - - - + + + Select File Selecionar arquivo - + program Programa - + Add page Adicionar pag - + Copy page Copiar pag - + Delete page Deletar pag - - + + Tip Info Info - + Are you sure you want to delete this program page? Você quer deletar esta pagina? - + Move up Mover para cima - + Move down Mover para baixo - + widget properties Propriedade - + Page properties Propriedades do programa - + Do you want to save the modifications? Você quer salvar esta modificação? - + Create Dir failed Criação falhou - + Saving... Salvando... - + Success Successo - + Convertering Convertendo - + Demos - + Open Demo - + Generate preview data Gerar dados de visualização - - - + + + Error Erro - + Rename fail when saving Falha em renomear - + Remove Recursively fail when saving Falha ao remover @@ -5440,7 +5536,7 @@ QObject - + Setting up the LedOK Express... Configurando... @@ -5648,27 +5744,27 @@ Atualizar - + Online Online - + Security Encriptação - + Progress Progresso - + State Estado - + All Todos @@ -5735,8 +5831,8 @@ - - + + Error Erro @@ -5772,7 +5868,7 @@ - + Install Success Sucesso @@ -5827,42 +5923,42 @@ Parado - + Input password Introduzir a senha - + VerifyPassword Verifique a senha - + Tip Info Dica - + password is wrong A senha esta errada - + Alias Apelido - + Same version, needn't update A mesma versão, não é necessária actualização - + Install Failed A instalação falhou - + The encrypted control card can be upgraded directly O upograde pode ser realizado automaticamente diff --git a/LedOK/ts/app_zh_CN.ts b/LedOK/ts/app_zh_CN.ts index 399cc8f..7faf662 100644 --- a/LedOK/ts/app_zh_CN.ts +++ b/LedOK/ts/app_zh_CN.ts @@ -56,209 +56,221 @@ CtrlAdvancedPanel - + Advanced 高级设置 - + Screen Width(pixel) 屏幕宽(像素) - + Width - - + + Height - - - - + + + + Set 设置 - + Alias 别名 - + Web Server Address: Web服务器地址: - + + Setting Camera Range + + + + + + + Set Camera Range + + + + Setting 正在设置 - + Traffic screen settings 交通屏设置 - + Setting protocol ... 正在设置协议 ... - + Set protocol 设置协议 - + Getting protocol ... 正在回读协议 ... - + Get protocol 回读协议 - - + + Port 端口 - + Realtime Address: Realtime 地址: - + Firmware Management 固件管理 - + update or uninstall 更新或卸载 - + Clear 清空 - + Check Apk 检查Apk - + Uninstall 卸载 - + Running check 运行状态监测 - + Restart 重启 - + Check Log 查看日志 - + Start LedSet4 使用 LedSet4.0 配置LED模组(Apk Display2.0以上版本) - + Open ADB 打开ADB调试功能 - + Post Custom JSON Post Custom JSON - - + - - + + + Clear Program 清除节目 - + Config 配置 - + Refresh 刷新 - + Restore to default 恢复默认值 - + Taxi top screen configuration 车顶有无客电平配置 - - + + Service:High Out of service:Low 有客:高电平 无客:低电平 - - + + Service:Low Out of service:High 有客:低电平 无客:高电平 - + Binding *.ic account indentity voucher 绑定taxihub平台用户身份凭证 - + Rotate 旋转 - + Min brightness 最低亮度 - + Readback 回读 - + Send 发送 - + Max brightness 最高亮度 @@ -269,20 +281,21 @@ 设置屏幕像素尺寸 - - - - + + + + + Success 成功 - + Compant ID: 公司ID: - + Compant ID 公司ID @@ -293,578 +306,579 @@ 设置web服务器地址 - - + + ClearRealtimeServer 清除 - - + + + + + + SetRealtimeServer 设置RealTimer地址 - - + + RestartAndroid 重启 - - + + running 正在运行 - - + + no running 没有运行 - + Check Apk Version 查询已安装apk版本 - - + + UninstallSoftware 卸载 - - + + Check apk running status 监测APK运行状态 - - + + OpenAdb 打开ADB调试功能 - + indentity voucher (*.ic) 身份凭证(*.ic) - - - - - + + + + + InvokeTaxiAppFunction 绑定证书 - - + + AliIotSetting - + Software Version Info 软件版本信息 - + Package 包名 - + Version 版本 - - + + Package name is null 包名为空 - + Clearing Program 正在清除节目 - - + + Timeout 超时 - - - - + + + + Failed 失败 - + Getting Log 正在获取日志 - - - - - - - - - - + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + Error 错误 - + Setting Timing Reboot 正在设置定时重启 - + Set Timing Reboot 设置定时重启 - + Getting Timing Reboot 正在获取定时重启 - + Get Timing Reboot 获取定时重启 - + totalResolution 包括行场数的分辨率 - + strCurDisplayResolution 当前显示屏分辨率 - - + + File not exist 文件不存在 - + Getting Player State 正在获取播放器状态 - - - + + + Get Player State 获取播放器状态 - - + + Player State 播放器状态 - - + + Cannot Open File 文件打开失败 - + Uploading 正在上传 - + Update 更新 - - + + Set Display Mode 设置显示模式 - - + + Get Display Mode 获取显示模式 - - + + Set Screen Offset 设置屏幕偏移 - - + + Get Screen Offset 获取屏幕偏移 - - - Set Camera Distance - 设置摄像头距离 - - - + Open file Failed 文件打开失败 - + Setting Wallpaper 正在设置系统桌面背景 - - + + Set Wallpaper 设置系统桌面背景 - + System Updating 系统升级中 - - + + System Update 系统升级 - + Upload error 上传错误 - + Upgrading 升级中 - + Getting MCU Version 正在获取单片机版本 - - + + MCU Version 单片机版本 - + Select File 选择文件 - + Setting player background 正在设置播放器背景 - - + + Set player background 设置播放器背景 - + Clearing player background 正在清除播放器背景 - - - - - - - - + + + + + + + + Clear player background 清除播放器背景 - - + + GetScreenRotation 获取屏幕旋转 - - - + + + Charging Station 充电桩 - + Setting Baud Rate 正在设置波特率 - + Set Baud Rate 设置波特率 - + Getting Baud Rate 正在获取波特率 - + Get Baud Rate 获取波特率 - - + + Text is empty 文本为空 - - + + Json Parse Error - - + + Json isn't an Object - + Info 信息 - + Setting card work mode ... 正在设置控制卡工作模式 ... - + Set card work mode 设置控制卡工作模式 - + Getting card work mode ... 正在回读控制卡工作模式 ... - + Get card work mode 回读控制卡工作模式 - + Input password 输入密码 - + Change Password 修改密码 - + Get Receive Card Num 获取接收卡数量 - + Resolution Config 分辨率配置 - + Full screen 全屏 - + Part 局部 - + Display Mode 显示模式 - + Screen Position 屏幕位置 - + Offset 偏移 - + Camera Distance 摄像头距离 - + Hidden Settings 隐藏的设置 - + Click right button to hide 点击右键隐藏 - + Get MCU Version 获取单片机版本 - + Baud Config 波特率配置 - + Model 设备型号 - + Uart 串口节点 - + Baud 波特率 - - + + Get 获取 - + Timing Reboot 定时重启 - + Protocol 协议 - + Server 服务端 - + Client 客户端 - - + + SetScreenRotation 设置屏幕旋转 - - + + SetMinBrightness 设置最小的亮度值 - - + + SetMaxBrightness 设置亮度最大值 - - + + GetMinBrightness 获取亮度最小值 - - + + GetMaxBrightness 获取亮度最大值 - - + + Card work mode 控制卡工作模式 - - + + SetSpecialResolution 设置分辨率 - - + + GetSpecialResolution 读取分辨率 - - + + CleanDisplayScreenSize 恢复默认分辨率 - - + + SetHighForBusy 设置有无客电平 - - + + GetStateForBusy 获取有无客电平 @@ -880,82 +894,84 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + Tip 提示 @@ -963,58 +979,60 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + NoSelectedController 请先选择大屏幕 @@ -1029,7 +1047,7 @@ 请输入正确的高度像素值 - + Password is error 密码错误 @@ -3056,34 +3074,34 @@ Def - - - - - - - - - - - + + + + + + + + + + + Device replied 设备回复 - + - + Success 成功 - - - + + + Fail 失败 @@ -3232,13 +3250,13 @@ - + On - + Off @@ -3455,260 +3473,270 @@ EBase - + Area 区域(px) - + X - + Y - + W - + H - + Border 边框 - - - - + + + + None - - + + Effect 特效 - - + + Rotate 旋转 - - + + Opacity + 不透明度 + + + + Blink 闪烁 - + Speed 速度 - + Slow - + Moderate - + Fast - + Play Time 播放时间 - + Start 开始 - - - - + + + + s - + Duration 时长 - + Entry 入场 - - + + Random 随机 - - + + Expand horizontal 水平展开 - - + + Expand vertical 垂直展开 - - + + Expand to left 向左展开 - - + + Expand to top 向上展开 - - + + Expand to right 向右展开 - - + + Expand to bottom 向下展开 - + Zoom in 放大 - + Zoom in from left-top 从左上角放大 - + Zoom in from right-top 从右上角放大 - + Zoom in from right-bottom 从右下角放大 - + Zoom in from left-bottom 从左下角放大 - - + + Rotate zoom 旋转放大 - - + + Rotate zoom reverse 反向旋转放大 - + Fade in 淡入 - - + + Move to left 向左移动 - - + + Move to top 向上移动 - - + + Move to right 向右移动 - - + + Move to bottom 向下移动 - - + + Dur 时长 - + Exit 出场 - + Zoom out 缩小 - + Zoom out to left-top 向左上角缩小 - + Zoom out to right-top 向右上角缩小 - + Zoom out to right-bottom 向右下角缩小 - + Zoom out to left-bottom 向左下角缩小 - + Fade out 淡出 - + + Breathe + 呼吸 + + + Freq 频率 @@ -3886,103 +3914,87 @@ 光照强度 - - - + N - - - + NE 东北 - - - + E - - - + SE 东南 - - - + S - - - + SW 西南 - - - + W 西 - - - + NW 西北 - + Basic Properties 基本属性 - + Title 标题 - + Compensation 补偿 - + Left 靠左 - + Center 居中 - + Right 靠右 - + Single scroll 单行滚动 - + Speed 速度 - + Back Color 背景色 @@ -4110,122 +4122,122 @@ EText - + Enter your text 请输入内容 - + Basic Properties 基本属性 - + Back Color 背景色 - + Kerning - 字间距 + 字距 - - Line Spacing - 行距 + + Line Height + 行高 - + PageCount: 总页数: - + page - + Import txt File 导入 txt 文件 - + Select File 选择文件 - + Fail 失败 - + Cannot Open File 文件打开失败 - + Play Properties 播放方式 - + Flip 翻页 - + Scroll 滚动 - + Static 静态 - + Text Color 文字颜色 - + Colorful Text 炫彩文字 - + Head-Tail Spacing 首尾间隔 - + Scroll Style 滚动方向 - + Right -> Left 向左 - + Bottom -> Top 向上 - + Left -> Right 向右 - + Top -> Bottom 向下 - + Scroll Speed 滚动速度 @@ -4233,117 +4245,194 @@ ETimer - + day - + hour - + min - + sec - + Basic Properties 基本属性 - + Count Down 倒计时 - + Count Up 正计时 - + Time 目标时间 - + Day - + Hour - + Min - + Sec - + Multiline 多行显示 - + Text 文本 - EVideo + ETimer2 - + + There are + 还有 + + + + + Days + + + + + + Hours + 小时 + + + + + Mins + + + + + + Secs + + + + Basic Properties 基本属性 - + + Count Down + 倒计时 + + + + Count Up + 正计时 + + + + Time + 目标时间 + + + + Font Size + 字号 + + + + Line Height + 行高 + + + + Foreground Color + 前景色 + + + + Line Background + 行背景 + + + + Background Color + 背景色 + + + + EVideo + + + Basic Properties + 基本属性 + + + File 文件 - + Play Properties 播放方式 - + Select File 选择文件 - + Play Times 播放次数 - + Video Transcoding 视频转码 - - + + Video Transcoding Progress 视频转码进度 - - + + Error 错误 @@ -4361,22 +4450,27 @@ EWeb - + Basic Properties 基本属性 - + Zoom 缩放 + Refresh every + 刷新间隔 + + + Offset 偏移 - + Scale 拉伸 @@ -4384,22 +4478,22 @@ EleTimer - + day - + hour - + min - + sec @@ -4407,67 +4501,67 @@ GenTmpThread - + MON 星期一 - + TUE 星期二 - + WED 星期三 - + THU 星期四 - + FRI 星期五 - + SAT 星期六 - + SUN 星期日 - + AM 上午 - + PM 下午 - + day - + hour - + min - + sec @@ -4475,7 +4569,7 @@ ImgDlg - + Screenshot 屏幕截图 @@ -4526,182 +4620,187 @@ MainWindow - + Language 语言 - + Help 帮助 - - + + Check for updates 检查更新 - - + + firmware manager 固件管理 - - - + + + Preferences 偏好设置 - - + + Info 信息 - - - + + + About 关于 - - + + Setting 设置 - + Software Update 软件更新 - + CurVersion 当前版本 - + Latest Version 最新版本 - + Update Log 更新日志 - + The current version is already the latest version 已经是最新的版本 - + Video compress to 视频压缩成 - + Video transcoding to 视频转码成 - + Text antialiasing 文字反锯齿 - + TextAntilaTip (提示:该选项适合小间距大尺寸的屏幕,选中此项,文字边缘会有暗影已达到字体边缘光滑的效果;小尺寸屏幕和单双色屏幕不建议使用) - + Ultra-Long Screen Split 超长屏打折 - + Program Send Batch 同时发送节目数量 - + Hide Detect Button 隐藏一键找卡 - + + Show IP in Terminal Control + 在终端控制显示IP + + + Show Alias in Terminal Control 在终端控制显示别名 - + Show Lora Screen 显示光影屏 - + Download 下载 - + Fail 失败 - + Cannot Save File 保存文件失败 - - - + + + Downloading updates 正在下载更新 - + Error 错误 - + Device 设备管理 - + Program 节目管理 - + Control 终端控制 - + Lora Screen 光影屏 - + Check card 一键找卡 - + Tip Info 提示 - + RestoreLedCardIpByUdpTip 该操作会把局域网内的所有与计算机IP不在同一网段的控制卡修复成固定IP,请谨慎操作! @@ -4826,84 +4925,84 @@ PageListItem - + times - + Page name 节目名称 - + New 新建 - + Play times 播放次数 - + Sources Repeat 素材循环 - + Audios 音频 - + Total Dur 总时长 - - + + s - + Select File 选择文件 - + Duration 时长 - + Vol 音量 - + Valid Date 有效日期 - - + + Warning 警告 - + Start Time can't be later than End Time 开始时间不能晚于结束时间 - + End Time can't be earlier than Start Time 结束时间不能早于开始时间 - + Plan 时间计划表 @@ -4911,37 +5010,37 @@ PlanItemWgt - + M - + Tu - + W - + Th - + F - + Sa - + Su @@ -4949,17 +5048,17 @@ PlayWin - + Move to Top Left 移动到左上角 - + Set Position 设置位置 - + Close 关闭 @@ -4967,12 +5066,12 @@ PlayerBackSendThread - + Open file failed 文件读取失败 - + Read file failed 文件读取失败 @@ -4993,52 +5092,52 @@ ProgCreateDlg - + Resolution 分辨率 - + Solution Information 节目信息 - + Solution Name 节目名称 - + Width - + Height - + Remarks 备注 - + Ultra-Long Screen Split 超长屏打折 - + Horizontal 水平 - + Vertical 垂直 - + Lengths of Parts 每段长度 @@ -5046,197 +5145,198 @@ ProgEditorWin - + Save 保存 - + Setting 设置 - + Text 文本 - + Photo 图片 - + Video 视频 - + Gif 动画 - + Clock 数字时钟 - + Analog Clock 模拟时钟 - + Environment 环境监测 - + Web 网页 - + MuliContentWindow 多素材窗口 - + In this window, a plurality of different program materials can be added and played according to the order of joining the list; 该窗口中可以加入多个不同是节目素材,并按照加入列表的先后顺序播放 - + + Timer 计时器 - + Play 播放 - + Stop 停止 - + Publish 发布 - - - + + + Select File 选择文件 - + program 节目列表 - + Add page 添加页面 - + Copy page 复制页面 - + Delete page 删除页面 - - + + Tip Info 提示 - + Are you sure you want to delete this program page? 确定要删除该节目页吗? - + Move up 向上移动一个页面 - + Move down 向下移动一个页面 - + widget properties 组件属性 - + Page properties 节目属性 - + Do you want to save the modifications? 是否保存修改? - + Create Dir failed 创建目录失败 - + Saving... 正在保存... - + Success 成功 - + Convertering 整理数据中 - + Demos 测试素材 - + Open Demo 打开测试素材 - + Generate preview data 生成预览数据 - - - + + + Error 错误 - + Rename fail when saving 重命名文件夹失败 - + Remove Recursively fail when saving @@ -5436,7 +5536,7 @@ QObject - + Setting up the LedOK Express... 初始化LedOK Express... @@ -5644,32 +5744,32 @@ 刷新 - + Alias 别名 - + Online 在线 - + Security 加密 - + Progress 进度 - + State 状态 - + All 总数 @@ -5736,8 +5836,8 @@ - - + + Error 错误 @@ -5773,7 +5873,7 @@ - + Install Success 安装成功 @@ -5828,37 +5928,37 @@ 没有运行 - + Input password 输入密码 - + VerifyPassword 验证密码 - + Tip Info 提示 - + password is wrong 密码错误 - + Same version, needn't update 相同版本, 不需要更新 - + Install Failed 安装失败 - + The encrypted control card can be upgraded directly 加密控制卡可以直接升级 diff --git a/LedOK/ts/app_zh_TW.ts b/LedOK/ts/app_zh_TW.ts index 9c20867..cc15f28 100644 --- a/LedOK/ts/app_zh_TW.ts +++ b/LedOK/ts/app_zh_TW.ts @@ -56,209 +56,221 @@ CtrlAdvancedPanel - + Advanced 高級設定 - + Screen Width(pixel) 螢幕寬(點數) - + Width - - + + Height - - - - + + + + Set 設定 - + Alias 別名 - + Web Server Address: Web伺服器地址: - + + Setting Camera Range + + + + + + + Set Camera Range + + + + Setting 正在設定 - + Traffic screen settings 交通屏設定 - + Setting protocol ... 正在設定協定 - + Set protocol 設定協定 - + Getting protocol ... 正在回讀協定 ... - + Get protocol 回讀協定 - - + + Port - + Realtime Address: Realtime 地址: - + Firmware Management 固件管理 - + update or uninstall 更新或卸載 - + Clear 清空 - + Check Apk 檢查Apk - + Uninstall 卸載 - + Running check 運行狀態監測 - + Restart 重啓 - + Check Log 查看日誌 - + Start LedSet4 - + Open ADB 打開ADB調試功能 - + Post Custom JSON Post Custom JSON - - + - - + + + Clear Program 清除節目 - + Config 配寘 - + Refresh 檢測 - + Restore to default 恢復預設值 - + Taxi top screen configuration 車頂有無客電平配寘 - - + + Service:High Out of service:Low 有客:高電平無客:低電平 - - + + Service:Low Out of service:High 有客:低電平 無客:高電平 - + Binding *.ic account indentity voucher 綁定taxihub平臺用戶身份憑證 - + Rotate 旋轉 - + Min brightness 最低亮度 - + Readback 回讀 - + Send 發送 - + Max brightness 最高亮度 @@ -269,20 +281,21 @@ 設定螢幕點數尺寸 - - - - + + + + + Success 成功 - + Compant ID: 公司ID: - + Compant ID 公司ID @@ -290,58 +303,60 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + NoSelectedController 請先選擇大螢幕 @@ -352,578 +367,579 @@ 設定web伺服器地址 - - + + ClearRealtimeServer 清除 - - + + + + + + SetRealtimeServer 設定RealTimer地址 - - + + RestartAndroid 重啓 - - + + running 正在運行 - - + + no running 沒有運行 - + Check Apk Version 査詢已安裝apk版本 - - + + UninstallSoftware 卸載 - - + + Check apk running status 監測APK運行狀態 - - + + OpenAdb 打開ADB調試功能 - + indentity voucher (*.ic) 身份憑證(*.ic) - - - - - + + + + + InvokeTaxiAppFunction 綁定證書 - - + + AliIotSetting - + Software Version Info 軟體版本資訊 - + Package 包名 - + Version 版本 - - + + Package name is null 包名為空 - + Clearing Program 正在清除節目 - - + + Timeout 超時 - - - - + + + + Failed 失敗 - + Getting Log 讀取日誌 - - - - - - - - - - + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + Error 錯誤 - + Setting Timing Reboot 正在設定定時重啓 - + Set Timing Reboot 設定定時重啓 - + Getting Timing Reboot 正在獲取定時重啓 - + Get Timing Reboot 獲取定時重啓 - + totalResolution 行数を含む解像度 - + strCurDisplayResolution 當前顯示分辯率 - - + + File not exist 檔案不存在 - + Getting Player State 正在獲取播放機狀態 - - - + + + Get Player State 獲取播放機狀態 - - + + Player State 播放機狀態 - - + + Cannot Open File 檔案打開失敗 - + Uploading 正在上傳 - + Update 更新 - - + + Set Display Mode 設定顯示模式 - - + + Get Display Mode 獲取顯示模式 - - + + Set Screen Offset 設定螢幕偏移 - - + + Get Screen Offset 獲取螢幕偏移 - - - Set Camera Distance - 設定監視器距離 - - - + Open file Failed 檔案打開失敗 - + Setting Wallpaper 正在設定系統桌面背景 - - + + Set Wallpaper 設定系統桌面背景 - + System Updating 系統升級中 - - + + System Update 系統升級 - + Upload error 上傳錯誤 - + Upgrading 陞級中 - + Getting MCU Version 正在獲取單片機版本 - - + + MCU Version 單片機版本 - + Select File 選擇檔案 - + Setting player background 正在設定播放機背景 - - + + Set player background 設定播放機背景 - + Clearing player background 正在清除播放機背景 - - - - - - - - + + + + + + + + Clear player background 清除播放機背景 - - + + GetScreenRotation 獲取荧幕旋轉 - - - + + + Charging Station 充電樁 - + Setting Baud Rate 正在設定串列傳輸速率 - + Set Baud Rate 設定串列傳輸速率 - + Getting Baud Rate 正在讀取串列傳輸速率 - + Get Baud Rate 讀取串列傳輸速率 - - + + Text is empty - - + + Json Parse Error - - + + Json isn't an Object - + Info 資訊 - + Setting card work mode ... 正在設定控制卡工作模式 ... - + Set card work mode 設定控制卡工作模式 - + Getting card work mode ... 正在回讀控制卡工作模式 ... - + Get card work mode 回讀控制卡工作模式 - + Input password 輸入密碼 - + Change Password 修改密碼 - + Get Receive Card Num 獲取接收卡數量 - + Resolution Config 分辯率配寘 - + Full screen 全屏 - + Part 局部 - + Display Mode 顯示模式 - + Screen Position 螢幕位置 - + Offset 偏移 - + Camera Distance 監視器距離 - + Hidden Settings 隱藏的設定 - + Click right button to hide 點擊右鍵隱藏 - + Get MCU Version 獲取單片機版本 - + Baud Config 串列傳輸速率配寘 - + Model 設備型號 - + Uart 串口節點 - + Baud 串列傳輸速率 - - + + Get 讀取 - + Timing Reboot 定時重啓 - + Protocol 協定 - + Server 服務端 - + Client 用戶端 - - + + SetScreenRotation 設定螢幕旋轉 - - + + SetMinBrightness 設定最小的亮度值 - - + + SetMaxBrightness 設定亮度最大值 - - + + GetMinBrightness 獲取亮度最小值 - - + + GetMaxBrightness 獲取亮度最大值 - - + + Card work mode 控制卡工作模式 - - + + SetSpecialResolution 設定分辯率 - - + + GetSpecialResolution 讀取分辯率 - - + + CleanDisplayScreenSize 恢復默認分辯率 - - + + SetHighForBusy 設定有無客電平 - - + + GetStateForBusy 獲取有無客電平 @@ -939,82 +955,84 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + Tip 提示 @@ -1029,7 +1047,7 @@ 請輸入正確的高度點數值 - + Password is error 密碼錯誤 @@ -3061,34 +3079,34 @@ Def - - - - - - - - - - - + + + + + + + + + + + Device replied 設備回復 - + - + Success 成功 - - - + + + Fail 失敗 @@ -3235,13 +3253,13 @@ - + On - + Off @@ -3458,260 +3476,270 @@ EBase - + Area 區域(px) - + X - + Y - + W - + H - + Border 邊框 - - - - + + + + None - - + + Effect 特效 - - + + Rotate 旋轉 - - + + Opacity + 不透明度 + + + + Blink 閃爍 - + Speed 速度 - + Slow - + Moderate - + Fast - + Play Time 播放時間 - + Start 開始 - - - - + + + + s - + Duration 時長 - + Entry 入場 - - + + Random 隨機 - - + + Expand horizontal 水平展開 - - + + Expand vertical 垂直展開 - - + + Expand to left 向左展開 - - + + Expand to top 向上展開 - - + + Expand to right 向右展開 - - + + Expand to bottom 向下展開 - + Zoom in 放大 - + Zoom in from left-top 從左上角放大 - + Zoom in from right-top 從右上角放大 - + Zoom in from right-bottom 從右下角放大 - + Zoom in from left-bottom 從左下角放大 - - + + Rotate zoom 旋轉放大 - - + + Rotate zoom reverse 反向旋轉放大 - + Fade in 淡入 - - + + Move to left 向左移動 - - + + Move to top 向上移動 - - + + Move to right 向右移動 - - + + Move to bottom 向下移動 - - + + Dur 時長 - + Exit 出場 - + Zoom out 縮小 - + Zoom out to left-top 向左上角縮小 - + Zoom out to right-top 向右上角縮小 - + Zoom out to right-bottom 向右下角縮小 - + Zoom out to left-bottom 向左下角縮小 - + Fade out 淡出 - + + Breathe + 呼吸 + + + Freq 頻率 @@ -3889,103 +3917,87 @@ 光照強度 - - - + N - - - + NE 東北 - - - + E - - - + SE 東南 - - - + S - - - + SW 西南 - - - + W 西 - - - + NW 西北 - + Basic Properties 基本屬性 - + Title 標題 - + Compensation 補償 - + Left 靠左 - + Center 居中 - + Right 靠右 - + Single scroll 單行滾動 - + Speed 速度 - + Back Color 背景色 @@ -4113,122 +4125,122 @@ EText - + Enter your text 請輸入內容 - + Basic Properties 基本屬性 - + Back Color 背景色 - + Kerning - 字間距 + 字距 - - Line Spacing - 行距 + + Line Height + 行高 - + PageCount: 總頁數: - + page - + Import txt File 導入 txt 檔案 - + Select File 選擇檔案 - + Fail 失敗 - + Cannot Open File 檔案打開失敗 - + Play Properties 播放管道 - + Flip 翻頁 - + Scroll 滾動 - + Static 靜態 - + Text Color 文字顏色 - + Colorful Text 炫彩文字 - + Head-Tail Spacing 首尾間隔 - + Scroll Style 滾動方向 - + Right -> Left 向左 - + Bottom -> Top 向上 - + Left -> Right 向右 - + Top -> Bottom 向下 - + Scroll Speed 滾動速度 @@ -4236,117 +4248,194 @@ ETimer - + day - + hour - + min - + sec - + Basic Properties 基本屬性 - + Count Down 倒數計時 - + Count Up 正計時 - + Time 目標時間 - + Day - + Hour - + Min - + Sec - + Multiline 多行顯示 - + Text 文字 - EVideo + ETimer2 - + + There are + 還有 + + + + + Days + + + + + + Hours + 小時 + + + + + Mins + + + + + + Secs + + + + Basic Properties 基本屬性 - + + Count Down + 倒數計時 + + + + Count Up + 正計時 + + + + Time + 目標時間 + + + + Font Size + 字號 + + + + Line Height + 行高 + + + + Foreground Color + 前景色 + + + + Line Background + 行背景 + + + + Background Color + 背景色 + + + + EVideo + + + Basic Properties + 基本屬性 + + + File 檔案 - + Play Properties 播放管道 - + Select File 選擇檔案 - + Play Times 播放次數 - + Video Transcoding - - + + Video Transcoding Progress 視頻轉碼進度 - - + + Error 錯誤 @@ -4364,22 +4453,27 @@ EWeb - + Basic Properties 基本屬性 - + Zoom 縮放 + Refresh every + 重繪間隔 + + + Offset 偏移 - + Scale 拉伸 @@ -4387,22 +4481,22 @@ EleTimer - + day - + hour - + min - + sec @@ -4410,67 +4504,67 @@ GenTmpThread - + MON 星期一 - + TUE 星期二 - + WED 星期三 - + THU 星期四 - + FRI 星期五 - + SAT 星期六 - + SUN 星期日 - + AM 上午 - + PM 下午 - + day - + hour - + min - + sec @@ -4478,7 +4572,7 @@ ImgDlg - + Screenshot 螢幕截圖 @@ -4529,182 +4623,187 @@ MainWindow - + Language 語言 - + Help 幫助 - - + + Check for updates 檢查更新 - - + + firmware manager 固件管理 - - - + + + Preferences 偏好設定 - - + + Info 資訊 - - - + + + About 關於 - - + + Setting 設定 - + Software Update 軟體更新 - + CurVersion 當前版本 - + Latest Version 最新版本 - + Update Log 更新日誌 - + The current version is already the latest version 已經是最新的版本 - + Video compress to 視頻壓縮成 - + Video transcoding to 視頻轉碼成 - + Text antialiasing 文字反鋸齒 - + TextAntilaTip (提示:該選項適合小間距大尺寸的螢幕,選中此項,文字邊緣會有暗影已達到字體邊緣光滑的效果;小尺寸螢幕和單雙色螢幕不建議使用) - + Ultra-Long Screen Split 超長屏打折 - + Program Send Batch 同時發送節目數量 - + Hide Detect Button 隱藏一鍵找卡 - + + Show IP in Terminal Control + 在終端控制顯示IP + + + Show Alias in Terminal Control 在終端控制顯示別名 - + Show Lora Screen 顯示光影屏 - + Download 下載 - + Fail 失敗 - + Cannot Save File 保存檔案失敗 - - - + + + Downloading updates 下載更新 - + Error 錯誤 - + Device 設備管理 - + Program 節目管理 - + Control 終端控制 - + Lora Screen 光影屏 - + Check card 一鍵找卡 - + Tip Info 提示 - + RestoreLedCardIpByUdpTip 該操作會把局域網內的所有與電腦IP不在同一網段的控制卡修復成固定IP,請謹慎操作! @@ -4829,84 +4928,84 @@ PageListItem - + times - + Page name 節目名稱 - + New 新建 - + Play times 播放次數 - + Sources Repeat 素材迴圈 - + Audios 音訊 - + Total Dur 總時長 - - + + s - + Select File 選擇檔案 - + Duration 時長 - + Vol 音量 - + Valid Date 有效日期 - - + + Warning 警告 - + Start Time can't be later than End Time 開始時間不能晚於結束時間 - + End Time can't be earlier than Start Time 結束時間不能早於開始時間 - + Plan 時間計畫表 @@ -4914,37 +5013,37 @@ PlanItemWgt - + M - + Tu - + W - + Th - + F - + Sa - + Su @@ -4952,17 +5051,17 @@ PlayWin - + Move to Top Left 移動到左上角 - + Set Position 設定位置 - + Close 關閉 @@ -4970,12 +5069,12 @@ PlayerBackSendThread - + Open file failed 檔案打開失敗 - + Read file failed 檔案讀取失敗 @@ -4996,52 +5095,52 @@ ProgCreateDlg - + Resolution 分辯率 - + Solution Information 節目資訊 - + Solution Name 節目名稱 - + Width - + Height - + Remarks 備註 - + Ultra-Long Screen Split 超長屏打折 - + Horizontal 水平 - + Vertical 垂直 - + Lengths of Parts 每段長度 @@ -5049,197 +5148,198 @@ ProgEditorWin - + Save 保存 - + Setting 設定 - + Text 文字 - + Photo 圖片 - + Video 視頻 - + Gif 動畫 - + Clock 數位時鐘 - + Analog Clock 圓形時鐘 - + Environment 環境監測 - + Web 網頁 - + MuliContentWindow 多素材視窗 - + In this window, a plurality of different program materials can be added and played according to the order of joining the list; 該視窗中可以加入多個不同是節目素材,並按照加入列表的先後順序播放 - + + Timer 計時器 - + Play 播放 - + Stop 停止 - + Publish 發佈 - - - + + + Select File 選擇檔案 - + program 節目清單 - + Add page 添加頁面 - + Copy page 複製頁面 - + Delete page 删除頁面 - - + + Tip Info 提示 - + Are you sure you want to delete this program page? 確定要删除該節目頁嗎? - + Move up 向上移動一個頁面 - + Move down 向下移動一個頁面 - + widget properties 組件内容 - + Page properties 節目内容 - + Do you want to save the modifications? 是否保存修改? - + Create Dir failed 創建目錄失敗 - + Saving... 正在保存… - + Success 成功 - + Convertering 整理數據中 - + Demos 測試素材 - + Open Demo 打開測試素材 - + Generate preview data 生成預覽數據 - - - + + + Error 錯誤 - + Rename fail when saving - + Remove Recursively fail when saving @@ -5439,7 +5539,7 @@ QObject - + Setting up the LedOK Express... 初始化LedOK Express… @@ -5647,32 +5747,32 @@ 檢測 - + Alias 別名 - + Online 線上 - + Security 加密 - + Progress 進度 - + State 陳述 - + All 總數 @@ -5739,8 +5839,8 @@ - - + + Error 錯誤 @@ -5776,7 +5876,7 @@ - + Install Success 安裝成功 @@ -5831,37 +5931,37 @@ 沒有運行 - + Input password 輸入密碼 - + VerifyPassword 驗證密碼 - + Tip Info 提示 - + password is wrong 密碼錯誤 - + Same version, needn't update 相同版本,不需要更新 - + Install Failed 安裝失敗 - + The encrypted control card can be upgraded directly 加密控制卡可以直接陞級