From dd4c67e144a97f84be6b65cecec378373d844755 Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Thu, 21 Dec 2023 17:23:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=B3=E4=BA=8E=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=EF=BC=8C=E4=B8=BB=E8=A6=81=E6=98=BE=E7=A4=BA=E8=BD=AF?= =?UTF-8?q?=E4=BB=B6=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/HGProductionTool/ProductionTool_zh_CN.qm | Bin 17863 -> 18184 bytes app/HGProductionTool/ProductionTool_zh_CN.ts | 79 ++++++++++++------- app/HGProductionTool/mainwindow.cpp | 67 ++++++++++++++++ app/HGProductionTool/mainwindow.h | 2 + app/HGProductionTool/mainwindow.ui | 12 +++ 5 files changed, 133 insertions(+), 27 deletions(-) diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm index 59cc1a58c3173a5b4f4864d2cb95e76f572d0c06..133c00290cc35c1fd50ec867e4bf227ba58d38e3 100644 GIT binary patch delta 538 zcmX@!&Dhb$I6;KbV54XqBawPX&1_m38$zPe(6~C})CjDe!5UPgIie_v^wxvK-{cOf}Qh;>QWLp+DChPvm ztt{${M<=fZa_mwke`V2QvRyP;l~q$dC*>p1HAS3dH(xO@2RSfESn^Iz^N%fcX3ZP zWlLkSIxu-I+cGIzAKuOYaRvs%YrK07-(p~3y2ksz(UpP0`pD#1_QOne`zAkBm)&g7 zAz)$0z`!8GV8c+rU{~akt`q#7!HPkFL6yM}D5eh*sp&SXPp z5m~OlV!u9!C2)ltiAnjTB|t+#D&!z4^ca8;u7Wc$xg;K}3Z!H+zoQwGB#ZyUgnYOP QuH4kTQizhxhR)NN0Bxd=3;+NC delta 297 zcmeC^V?5r?I6;JwW20ytBa_YZ$x|82glzd3r*JngFfi*fKK~cOz+mxmvMQ4qlXd&# zSSB?livyEefjld#$$OdHIdxc8_cH>O1Wx8dAXE*Z70uX;Y)gTv7PA@ONdeMjlU-Tdn5-60?qyMDEStO) z$g%aA{Fg0NI|IZS7!0rR?m2vmfr057@Bc - + NO - + OK 确定 - + Cancel 取消 @@ -1649,65 +1649,75 @@ 用户 - + + menu_about + 信息 + + + act_newDevice 新建项目 - + act_manage 账户管理 - + act_changePwd 修改密码 - + act_export 导出 - + act_logOut 登出 - + Ctrl+Q - + act_close 退出 - + act_upload 上传配置文件 - + act_refreshDevice 刷新设备列表 - + act_openLog 查看日志 - + Ctrl+L - + act_setLogPath + + + act_about + 关于... + Account login elsewhere 账户在其他地方登录 @@ -1726,40 +1736,55 @@ - - - - + + + + tips 提示 - + production tool-burn station 华高生产工具-烧录工位 - + production tool-init test station 华高生产工具-初检工位 - + production tool-image test station 华高生产工具-图像测试工位 - + production tool-pressure test station 华高生产工具-压力测试工位 - - + + Is testing, do not close! 测试中,请勿关闭! + + + about %1 + 关于 %1 + + + + Production tool + 华高生产工具 + + + + <p>DriverVer: %1</p> + <p>版本号: %1</p> + warning 警告 @@ -1778,8 +1803,8 @@ 取消 - - + + cannot create more table 不能创建更多项目 diff --git a/app/HGProductionTool/mainwindow.cpp b/app/HGProductionTool/mainwindow.cpp index 4c044c8..4a243ce 100644 --- a/app/HGProductionTool/mainwindow.cpp +++ b/app/HGProductionTool/mainwindow.cpp @@ -3,6 +3,7 @@ #include #include #include "base/HGBase.h" +#include "huagao/brand.h" #include "HGUIGlobal.h" #include "app_cfg.h" #include "dialog_login.h" @@ -741,3 +742,69 @@ void MainWindow::on_act_openLog_triggered() QString strFilePath = "file:///" + pathDir; QDesktopServices::openUrl(QUrl(strFilePath)); } + +static bool isLeap(int year) +{ + if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0)) + return true; + return false; +} + +static int getDays(int year, int month) +{ + if (2 == month) + { + if (isLeap(year)) + return 29; + else + return 28; + } + + if (4 == month || 6 == month || 9 == month || 11 == month) + { + return 30; + } + + return 31; +} + +static int getPatchVersion() +{ + const char *buildDate = __DATE__; + HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "buildDate: %s", buildDate); + QDate date = QLocale(QLocale::English).toDate(QString(buildDate).replace(" ", " 0"), "MMM dd yyyy"); + int year = date.year(); + int day = date.day(); + int month = date.month(); + HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "buildDate: %d %d %d", year, month, day); + + int ret = year % 100; + ret *= 1000; + + for (int i = 1; i < month; ++i) + { + ret += getDays(year, i); + } + + ret += day; + return ret; +} + +void MainWindow::on_act_about_triggered() +{ + int mainVersion = VERSION_MAIN; + int subVersion = VERSION_SUB; + int buildVersion = 10000; + int patchVersion = 0; + + patchVersion = getPatchVersion(); + + HGChar version[32] = { 0 }; + sprintf(version, "%d.%d.%d.%d", mainVersion, subVersion, buildVersion, patchVersion); + + QString title = tr("about %1").arg(tr("Production tool")); + QString content; + content += tr("

DriverVer: %1

").arg(QString::fromLocal8Bit(version)); + + QMessageBox::about(this, title, content); +} diff --git a/app/HGProductionTool/mainwindow.h b/app/HGProductionTool/mainwindow.h index 09f4298..5b82bb4 100644 --- a/app/HGProductionTool/mainwindow.h +++ b/app/HGProductionTool/mainwindow.h @@ -85,6 +85,8 @@ private slots: void on_act_openLog_triggered(); + void on_act_about_triggered(); + private: QSplitter *m_top_splitter; QSplitter *m_bot_splitter; diff --git a/app/HGProductionTool/mainwindow.ui b/app/HGProductionTool/mainwindow.ui index 5bd2765..198b069 100644 --- a/app/HGProductionTool/mainwindow.ui +++ b/app/HGProductionTool/mainwindow.ui @@ -46,8 +46,15 @@ + + + menu_about + + + + @@ -106,6 +113,11 @@ act_setLogPath + + + act_about + +