diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm index f9ca486..f979071 100644 Binary files a/app/HGProductionTool/ProductionTool_zh_CN.qm and b/app/HGProductionTool/ProductionTool_zh_CN.qm differ diff --git a/app/HGProductionTool/ProductionTool_zh_CN.ts b/app/HGProductionTool/ProductionTool_zh_CN.ts index 20dcf57..3924045 100644 --- a/app/HGProductionTool/ProductionTool_zh_CN.ts +++ b/app/HGProductionTool/ProductionTool_zh_CN.ts @@ -746,7 +746,7 @@ - + tips 提示 @@ -796,7 +796,7 @@ 通过 - + no image 无图 @@ -822,45 +822,50 @@ 设备 - + menu_user 用户 - + act_newDevice 新建项目 - + act_manage 账户管理 - + act_changePwd 修改密码 - + act_export 导出 - + act_logOut 登出 - + act_close 关闭 - + act_upload 上传配置文件 + + + act_refreshDevice + 刷新设备列表 + Account login elsewhere @@ -891,6 +896,7 @@ + tips 提示 @@ -919,6 +925,7 @@ + cannot create more table 不能创建更多项目 diff --git a/app/HGProductionTool/form_burnmode.cpp b/app/HGProductionTool/form_burnmode.cpp index b27170c..7967ddd 100644 --- a/app/HGProductionTool/form_burnmode.cpp +++ b/app/HGProductionTool/form_burnmode.cpp @@ -341,8 +341,8 @@ void Form_BurnMode::on_pbtn_close_clicked() return; } - int i = 0; - while(ui->tableWidget->rowCount() > i) + int rowCount = ui->tableWidget->rowCount(); + for (int i = rowCount - 1; i >= 0; --i) { QTableWidgetItem *item = ui->tableWidget->item(i, 1); if (item != nullptr && Qt::Checked == item->checkState()) diff --git a/app/HGProductionTool/mainwindow.cpp b/app/HGProductionTool/mainwindow.cpp index fce1e9a..05c41a7 100644 --- a/app/HGProductionTool/mainwindow.cpp +++ b/app/HGProductionTool/mainwindow.cpp @@ -596,3 +596,35 @@ void MainWindow::on_act_upload_triggered() Dialog_uploadCfgFile dlg(m_pdtToolDbuserMgr, this); dlg.exec(); } + +void MainWindow::on_act_refreshDevice_triggered() +{ + std::vector name; + name = getDevices(); + for (int i = 0; i < name.size(); ++i) + { + SANE_Handle devHandle = nullptr; + sane_open(name[i].c_str(), &devHandle); + if (nullptr != devHandle) + { + Dialog_InputSerialNum dlg(this, devHandle, getDevSn(devHandle), getDevType(devHandle)); + if (dlg.exec()) + { + HGPdtToolDbDevice pdtToolDbDevice = nullptr; + HGPdtToolDb_OpenDevice(m_pdtToolDbuserMgr, dlg.GetSn().toStdString().c_str(), &pdtToolDbDevice); + + Form_mainInterface *mainInterface = new Form_mainInterface(this, m_loginType, devHandle, m_pdtToolDbuserMgr, pdtToolDbDevice, + dlg.GetSn(), dlg.GetDevType(), name[i].c_str(), getDevFwNum(devHandle)); + if (!AddInterface(mainInterface)) + { + QMessageBox::information(this, tr("tips"), tr("cannot create more table")); + delete mainInterface; + } + } + else + { + sane_close(devHandle); + } + } + } +} diff --git a/app/HGProductionTool/mainwindow.h b/app/HGProductionTool/mainwindow.h index c20349f..0da4b33 100644 --- a/app/HGProductionTool/mainwindow.h +++ b/app/HGProductionTool/mainwindow.h @@ -70,6 +70,8 @@ private slots: void on_act_upload_triggered(); + void on_act_refreshDevice_triggered(); + private: QSplitter *m_top_splitter; QSplitter *m_bot_splitter; diff --git a/app/HGProductionTool/mainwindow.ui b/app/HGProductionTool/mainwindow.ui index fb37090..2488f48 100644 --- a/app/HGProductionTool/mainwindow.ui +++ b/app/HGProductionTool/mainwindow.ui @@ -28,6 +28,9 @@ menu_device + + + @@ -81,6 +84,11 @@ act_upload + + + act_refreshDevice + +