Skip to content

Commit

Permalink
增加重复条码测试提示
Browse files Browse the repository at this point in the history
增加重复条码测试提示
  • Loading branch information
WilliamYinwei committed Jun 25, 2019
1 parent 58e66fb commit b6541e3
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 548 deletions.
1 change: 1 addition & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ V1.1.3
1、增加__ate对象的GetTotalRst接口,支持获取总测试结果状态值;
2、增加TreeATE界面只有admin用户才有选择测试套和测试项的权限;
3、修复提交历史测试结果状态问题
4、增加重复条码测试提示

V1.1.2
-------------------
Expand Down
2 changes: 1 addition & 1 deletion Setup/setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "TreeATE"
#define MyAppVersion "1.1.2"
#define MyAppVersion "1.1.3"
#define MyAppPublisher "David Yin"
#define MyAppURL "https://blog.csdn.net/vivasoft/column/info/31202"
#define MyAppExeName "TreeATE.exe"
Expand Down
65 changes: 38 additions & 27 deletions Src/TreeATE/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,100 +258,111 @@
<translation type="vanished">&amp;English</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="59"/>
<location filename="../mainwindow.cpp" line="61"/>
<source>Path of test project</source>
<translation>Path of test project</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="60"/>
<location filename="../mainwindow.cpp" line="62"/>
<source>User name</source>
<translation>User name</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="61"/>
<location filename="../mainwindow.cpp" line="63"/>
<source>Current Time</source>
<translation>Current Time</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="84"/>
<location filename="../mainwindow.cpp" line="88"/>
<source>Please scan the barcode to load or play.</source>
<translation>Please scan the barcode to load or play.</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="92"/>
<location filename="../mainwindow.cpp" line="96"/>
<source>Line and station name.</source>
<translation>Line and station name.</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="205"/>
<location filename="../mainwindow.cpp" line="730"/>
<location filename="../mainwindow.cpp" line="215"/>
<location filename="../mainwindow.cpp" line="763"/>
<source>Critical</source>
<translation>Critical</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="206"/>
<location filename="../mainwindow.cpp" line="216"/>
<source>Please scan the barcode for the correct rules, refer the project option.</source>
<translation>Please scan the barcode for the correct rules, refer the project option.</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="214"/>
<location filename="../mainwindow.cpp" line="221"/>
<location filename="../mainwindow.cpp" line="225"/>
<location filename="../mainwindow.cpp" line="244"/>
<source>Warning</source>
<translation>Warning</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="214"/>
<location filename="../mainwindow.cpp" line="225"/>
<source>Please scan the product&apos;s barcode to play.</source>
<translation>Please scan the product&apos;s barcode to play.</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="221"/>
<location filename="../mainwindow.cpp" line="231"/>
<source>Question</source>
<translatorcomment>Question</translatorcomment>
<translation>Question</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="232"/>
<source>The same barcode to play, are you sure?</source>
<translation>The same barcode to play, are you sure?</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="244"/>
<source>Please selected the test item to play.</source>
<translation>Please selected the test item to play.</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="306"/>
<location filename="../mainwindow.cpp" line="320"/>
<location filename="../mainwindow.cpp" line="339"/>
<location filename="../mainwindow.cpp" line="353"/>
<source>Unload</source>
<translation>Unload</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="324"/>
<location filename="../mainwindow.cpp" line="357"/>
<source>Loading...</source>
<translation>Loading...</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="329"/>
<location filename="../mainwindow.cpp" line="362"/>
<source>Ready</source>
<translation>Ready</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="333"/>
<location filename="../mainwindow.cpp" line="366"/>
<source>GO...</source>
<translation>GO...</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="343"/>
<location filename="../mainwindow.cpp" line="376"/>
<source>ERROR</source>
<translation>ERROR</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="640"/>
<location filename="../mainwindow.cpp" line="673"/>
<source>Error</source>
<translation>Error</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="720"/>
<location filename="../mainwindow.cpp" line="753"/>
<source>Info</source>
<translation>Info</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="720"/>
<location filename="../mainwindow.cpp" line="753"/>
<source>No matching loadable test project, refer the System options.</source>
<translation>No matching loadable test project, refer the System options.</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="731"/>
<location filename="../mainwindow.cpp" line="764"/>
<source>Please scan the SN for the correct rules, refer the project option.</source>
<translation>Please scan the barcode for the correct rules, refer the project option.</translation>
</message>
Expand Down Expand Up @@ -498,7 +509,7 @@
<translation>TreeATE is running now.</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="182"/>
<location filename="../mainwindow.cpp" line="193"/>
<source>Open Test Project</source>
<translation>Open the Test Project</translation>
</message>
Expand Down Expand Up @@ -559,22 +570,22 @@
<context>
<name>TestManger</name>
<message>
<location filename="../testmanger.cpp" line="207"/>
<location filename="../testmanger.cpp" line="220"/>
<source>Question</source>
<translation>Question</translation>
</message>
<message>
<location filename="../testmanger.cpp" line="208"/>
<location filename="../testmanger.cpp" line="221"/>
<source>It&apos;s loop test, are you sure?</source>
<translation>It&apos;s loop test, are you sure?</translation>
</message>
<message>
<location filename="../testmanger.cpp" line="601"/>
<location filename="../testmanger.cpp" line="634"/>
<source>Warning</source>
<translation>Warning</translation>
</message>
<message>
<location filename="../testmanger.cpp" line="602"/>
<location filename="../testmanger.cpp" line="635"/>
<source>Warning: Testing now, an error may occur when quit. Are you quit?</source>
<translation>Warning: Testing now, an error may occur when quit. Are you quit?</translation>
</message>
Expand Down
65 changes: 38 additions & 27 deletions Src/TreeATE/i18n/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,100 +258,111 @@
<translation type="vanished">英语(&amp;E)</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="59"/>
<location filename="../mainwindow.cpp" line="61"/>
<source>Path of test project</source>
<translation>测试工程路径</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="60"/>
<location filename="../mainwindow.cpp" line="62"/>
<source>User name</source>
<translation>用户名</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="61"/>
<location filename="../mainwindow.cpp" line="63"/>
<source>Current Time</source>
<translation>当前时间</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="84"/>
<location filename="../mainwindow.cpp" line="88"/>
<source>Please scan the barcode to load or play.</source>
<translation>请扫码加载测试工程或开始测试.</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="92"/>
<location filename="../mainwindow.cpp" line="96"/>
<source>Line and station name.</source>
<translation>产线和工位名称.</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="205"/>
<location filename="../mainwindow.cpp" line="730"/>
<location filename="../mainwindow.cpp" line="215"/>
<location filename="../mainwindow.cpp" line="763"/>
<source>Critical</source>
<translation>错误</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="206"/>
<location filename="../mainwindow.cpp" line="216"/>
<source>Please scan the barcode for the correct rules, refer the project option.</source>
<translation>请根据工程选项中的条码规则扫描正确的条码.</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="214"/>
<location filename="../mainwindow.cpp" line="221"/>
<location filename="../mainwindow.cpp" line="225"/>
<location filename="../mainwindow.cpp" line="244"/>
<source>Warning</source>
<translation>错误</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="214"/>
<location filename="../mainwindow.cpp" line="225"/>
<source>Please scan the product&apos;s barcode to play.</source>
<translation>请扫产品条码开始测试.</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="221"/>
<location filename="../mainwindow.cpp" line="231"/>
<source>Question</source>
<translatorcomment>询问</translatorcomment>
<translation>询问</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="232"/>
<source>The same barcode to play, are you sure?</source>
<translation>当前条码与上次相同,确定需要测试吗?</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="244"/>
<source>Please selected the test item to play.</source>
<translation>请选择测试项开始测试.</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="306"/>
<location filename="../mainwindow.cpp" line="320"/>
<location filename="../mainwindow.cpp" line="339"/>
<location filename="../mainwindow.cpp" line="353"/>
<source>Unload</source>
<translation>未加载</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="324"/>
<location filename="../mainwindow.cpp" line="357"/>
<source>Loading...</source>
<translation>加载中...</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="329"/>
<location filename="../mainwindow.cpp" line="362"/>
<source>Ready</source>
<translation>就绪</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="333"/>
<location filename="../mainwindow.cpp" line="366"/>
<source>GO...</source>
<translation>测试中...</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="343"/>
<location filename="../mainwindow.cpp" line="376"/>
<source>ERROR</source>
<translation>错误</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="640"/>
<location filename="../mainwindow.cpp" line="673"/>
<source>Error</source>
<translation>错误</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="720"/>
<location filename="../mainwindow.cpp" line="753"/>
<source>Info</source>
<translation>提示</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="720"/>
<location filename="../mainwindow.cpp" line="753"/>
<source>No matching loadable test project, refer the System options.</source>
<translation>没有匹配可加载的测试工程,请参考系统选项.</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="731"/>
<location filename="../mainwindow.cpp" line="764"/>
<source>Please scan the SN for the correct rules, refer the project option.</source>
<translation>请根据工程选项中的条码规则扫描正确的条码.</translation>
</message>
Expand Down Expand Up @@ -498,7 +509,7 @@
<translation>TreeATE正在运行.</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="182"/>
<location filename="../mainwindow.cpp" line="193"/>
<source>Open Test Project</source>
<translation>打开测试工程</translation>
</message>
Expand Down Expand Up @@ -559,22 +570,22 @@
<context>
<name>TestManger</name>
<message>
<location filename="../testmanger.cpp" line="207"/>
<location filename="../testmanger.cpp" line="220"/>
<source>Question</source>
<translation>询问</translation>
</message>
<message>
<location filename="../testmanger.cpp" line="208"/>
<location filename="../testmanger.cpp" line="221"/>
<source>It&apos;s loop test, are you sure?</source>
<translation>循环测试,确定开始吗?</translation>
</message>
<message>
<location filename="../testmanger.cpp" line="601"/>
<location filename="../testmanger.cpp" line="634"/>
<source>Warning</source>
<translation>警告</translation>
</message>
<message>
<location filename="../testmanger.cpp" line="602"/>
<location filename="../testmanger.cpp" line="635"/>
<source>Warning: Testing now, an error may occur when quit. Are you quit?</source>
<translation>警告:测试中,退出将引发未知错误,是否退出?</translation>
</message>
Expand Down
16 changes: 15 additions & 1 deletion Src/TreeATE/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ MainWindow::MainWindow(QWidget *parent) :
ui(new Ui::MainWindow)
{
m_strAppDir = qApp->applicationDirPath();
m_strPreSN = "";

ui->setupUi(this);
ui->textBrowser_Log->document()->setMaximumBlockCount(1000);
Expand Down Expand Up @@ -219,11 +220,24 @@ void MainWindow::on_actionPlay_triggered()
m_leTotalSN->setText(rx.cap(0));
}

if(strSN.trimmed().isEmpty()) {
strSN = m_leTotalSN->text().trimmed();
if(strSN.isEmpty()) {
QMessageBox::warning(this, tr("Warning"), tr("Please scan the product's barcode to play."));
m_leTotalSN->setFocus();
return;
}

if(m_strPreSN == strSN){
if(QMessageBox::No == QMessageBox::question(this, tr("Question"),
tr("The same barcode to play, are you sure?"),
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No)) {
m_leTotalSN->setFocus();
return;
}
}

m_strPreSN = strSN;
mapSN.insert(lstSelPrj.at(0), strSN);
}
else if(nCnt <= 0) {
Expand Down
1 change: 1 addition & 0 deletions Src/TreeATE/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ private slots:
QProcess* m_pResultsWin;
QProcess* m_pEditWin;
QStringList m_lstLangFiles;
QString m_strPreSN;
};

#endif // MAINWINDOW_H
Loading

0 comments on commit b6541e3

Please sign in to comment.