Skip to content

Commit

Permalink
增加GetTotalRst接口
Browse files Browse the repository at this point in the history
1、增加__ate对象的GetTotalRst接口,支持获取总测试结果状态值;
2、增加TreeATE界面只有admin用户才有选择测试套和测试项的权限;
  • Loading branch information
WilliamYinwei committed Jun 9, 2019
1 parent eb79841 commit c90f8dc
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 11 deletions.
5 changes: 5 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
2、登录TreeATE的默认用户名/密码: admin/123
3、加载Example中的测试工程,点击Play(测试)

V1.1.3
-------------------
1、增加__ate对象的GetTotalRst接口,支持获取总测试结果状态值;
2、增加TreeATE界面只有admin用户才有选择测试套和测试项的权限;

V1.1.2
-------------------
1、分离加载测试项目时提交历史测试结果
Expand Down
4 changes: 2 additions & 2 deletions Src/TestEngine/ate_te.rc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#endif

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,1,2,1
PRODUCTVERSION 1,1,2,1
FILEVERSION 1,1,3,1
PRODUCTVERSION 1,1,3,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
Expand Down
5 changes: 5 additions & 0 deletions Src/TestEngine/resultmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,8 @@ QString ResultMgr::GetUserName()
{
return m_rstPrj.m_strUser;
}

int ResultMgr::GetTotalRst()
{
return (int)m_rstPrj.m_eRst;
}
1 change: 1 addition & 0 deletions Src/TestEngine/resultmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public slots:
QString GetWorkLine();
QString GetWorkStation();
QString GetUserName();
int GetTotalRst();

protected:
TestResult::TypeTestRst updateRst(const QString &strPath,
Expand Down
4 changes: 2 additions & 2 deletions Src/TreeATE/ate.rc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ IDI_ICON1 ICON DISCARDABLE "ATE.ico"
#endif

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,1,2,1
PRODUCTVERSION 1,1,2,1
FILEVERSION 1,1,3,1
PRODUCTVERSION 1,1,3,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
Expand Down
2 changes: 1 addition & 1 deletion Src/TreeATE/login.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void login::on_pushButton_Login_clicked()
bOk = true;
}
}
else if(m_pLogin->InitLogin(strHost)) {
else if(m_pLogin && m_pLogin->InitLogin(strHost)) {
if(m_pLogin->VerifyLogin(strUser, strPwd, strErr))
{
m_strUser = strUser;
Expand Down
7 changes: 7 additions & 0 deletions Src/TreeATE/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ void MainWindow::loadUnits(const QString& strPrjName)
{
ui->textBrowser_Log->append(m_pPluginsMgr->GetLastError());
}

if(m_strUser != "admin") {
m_pTestMgr->SetCheckboxEnable(true);
}
else {
m_pTestMgr->SetCheckboxEnable(false);
}
}
}

Expand Down
18 changes: 12 additions & 6 deletions Src/TreeATE/testmanger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ TestManger::TestManger(QTreeWidget *pWidget, QTextBrowser *pBrower, QObject *par
m_bIsLoaded = false;
m_dockLoopProgress = NULL;
m_pUploadRst = NULL;
SetCheckboxEnable(false);

connect(this, SIGNAL(startTesting(QString)), this, SLOT(on_startTesting(QString)), Qt::QueuedConnection);
}
Expand Down Expand Up @@ -250,7 +251,7 @@ int TestManger::StartTest(const QString &strWorkLine, const QString &strStation,
QTreeWidgetItem* item = *itorItem;

// path of test unit with selected
if(item->checkState(0) != Qt::Unchecked) {
if(m_bCheckboxEnable || item->checkState(0) != Qt::Unchecked) {
QString line = item->text(TA_COLUMN_UNIT_PATH) + "\r\n";
in << line;
nSelectedCnt++;
Expand Down Expand Up @@ -352,11 +353,11 @@ void TestManger::on_updateTestItemStatus(const QString& who,

QString status = objData["type"].toString();
if(status == "commit") {
emit startLoading(objData["count"].toInt());
//emit startLoading(objData["count"].toInt());
}
else if(status == "progress") {
m_rstLevel = Loading;
emit updateTotalStatus(Loading, objData["count"].toInt());
//m_rstLevel = Loading;
//emit updateTotalStatus(Loading, objData["count"].toInt());
}
else if(status == "list") {
addUnitItems(who, objData);
Expand Down Expand Up @@ -420,12 +421,12 @@ void TestManger::on_testEngineFinished(const QString& who, int nCode)
}
else if(nCode == TA_UPLOAD_OK) {
emit statusHisRst(Pass);
emit updateTotalStatus(Ready, 0);
//emit updateTotalStatus(Ready, 0);
return;
}
else if(nCode == TA_ERR_UPLOAD_HRST) {
emit statusHisRst(Failed);
emit updateTotalStatus(Ready, 0);
//emit updateTotalStatus(Ready, 0);
return;
}

Expand Down Expand Up @@ -468,6 +469,11 @@ void TestManger::on_testEngineFinished(const QString& who, int nCode)
}
}

void TestManger::SetCheckboxEnable(bool bEnable)
{
m_bCheckboxEnable = bEnable;
}


void TestManger::addUnitItems(const QString &who, const QJsonObject &objData)
{
Expand Down
2 changes: 2 additions & 0 deletions Src/TreeATE/testmanger.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class TestManger : public QObject
bool LoadTestUnits(const QString& strPrjFile, QString &strTitle);
void UnloadUnits();
bool IsLoaded();
void SetCheckboxEnable(bool bEnable);

QStringList SeletedPrj();
int StartTest(const QString& strWorkLine, const QString& strStation,
Expand Down Expand Up @@ -124,6 +125,7 @@ private slots:
QMap<QString, quint32> m_mapLoopCount;
QDockWidget* m_dockLoopProgress;
QMap<QString, QProgressBar*> m_mapLoopProgress;
bool m_bCheckboxEnable;
};

#endif // TESTMANGER_H

0 comments on commit c90f8dc

Please sign in to comment.