diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm index e4436ec..7c33111 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 ca61f36..154911b 100644 --- a/app/HGProductionTool/ProductionTool_zh_CN.ts +++ b/app/HGProductionTool/ProductionTool_zh_CN.ts @@ -614,17 +614,17 @@ 关闭设备 - + ID 序号 - + selected 选择 - + device 设备 @@ -633,14 +633,14 @@ 序列号 - - + + tips 提示 - - + + Please check a devices at least 请至少勾选一台设备 @@ -741,28 +741,28 @@ 下一步 - + Device has connected 设备已连接 - + Device hasnot connected 设备未连接 - + Device type: 设备型号: - + SerialNum: 序列号: - - + + connect status: 设备连接状态: @@ -775,23 +775,22 @@ 休眠时间: - + load last image which uploaded last time 加载上一次上传的图片 - + Device has disconnected 设备已断开 - - + tips 提示 - + destortion value: 畸变修正值: @@ -804,74 +803,74 @@ 取消 - + speed mode: 目标配置: 速度模式: - + sleep time: 休眠时间: - + ID 序号 - + Test items 测试项 - + status 测试状态 - + not test 未测试 - + not pass 不通过 - + not support 不支持 - + pass 通过 - + + image pixel: 标准圆宽高: - + minute 分钟 - + VID: VID: - + PID: PID: - no image - 无图 + 无图 @@ -960,7 +959,6 @@ - @@ -1000,11 +998,16 @@ Is testing, do not close! 测试中,请勿关闭! + + + warning + 警告 + Confirm whether the device is reset Are you sure to connect the new device - 检测到设备,请先确认是否已经复位 + 检测到设备,请先确认是否已经复位,否则有可能导致获取序列号失败! yes diff --git a/app/HGProductionTool/form_burnmode.cpp b/app/HGProductionTool/form_burnmode.cpp index 98be149..e6502aa 100644 --- a/app/HGProductionTool/form_burnmode.cpp +++ b/app/HGProductionTool/form_burnmode.cpp @@ -45,12 +45,6 @@ void Form_BurnMode::addDevice(DeviceManager *devManager) item->setData(Qt::UserRole, var); updatetablewidget(); -// for(int i = 0; i < ui->tableWidget->rowCount(); i++) -// { -// QTableWidgetItem *item = ui->tableWidget->item(i, 3); -// if (item != nullptr) -// item->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled); -// } m_curIndex++; } @@ -209,16 +203,12 @@ void Form_BurnMode::on_pbtn_burn_clicked() // } //} -DeviceManager::DeviceManager(class MainWindow *mainwnd, HGPdtToolDbUserMgr pdtToolDbuserMgr, class Form_BurnMode *burnMode, - SANE_Handle handle, const QString & devName, const QString & sn, const QString &devType) +DeviceManager::DeviceManager(class MainWindow *mainwnd, class Form_BurnMode *burnMode, SANE_Handle handle, const QString & devName) { m_mainwnd = mainwnd; - m_pdtToolDbuserMgr = pdtToolDbuserMgr; m_burnMode = burnMode; m_handle = handle; m_devName = devName; - m_sn = sn; - m_devType = devType; m_hg = new hgscanner(nullptr, m_burnMode, nullptr, m_handle); } @@ -236,11 +226,6 @@ QString DeviceManager::getDevName() return m_devName; } -QString DeviceManager::getSn() -{ - return m_sn; -} - void DeviceManager::setBurnMode() { const wchar_t *p = L"1"; @@ -249,65 +234,65 @@ void DeviceManager::setBurnMode() } -void DeviceManager::setSn(QString sn) -{ - LPWRITECFG p = new WRITECFG; +//void DeviceManager::setSn(QString sn) +//{ +// LPWRITECFG p = new WRITECFG; - std::wstring sn2 = sn.toStdWString(); - p->cat = WRITE_CAT_SERIALNUM; - p->val = (void*)sn2.c_str(); - m_mainwnd->addTestingRef(); - func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg); +// std::wstring sn2 = sn.toStdWString(); +// p->cat = WRITE_CAT_SERIALNUM; +// p->val = (void*)sn2.c_str(); +// m_mainwnd->addTestingRef(); +// func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg); - setGlobalCfg(); +// setGlobalCfg(); - delete p; -} +// delete p; +//} -QString DeviceManager::getUpdatedSn() -{ - return m_mainwnd->getDevSn(m_handle); -} +//QString DeviceManager::getUpdatedSn() +//{ +// return m_mainwnd->getDevSn(m_handle); +//} -void DeviceManager::setGlobalCfg() -{ - HGChar cfgPath[512] = {0}; - HGBase_GetConfigPath(cfgPath, 512); - HGBase_CreateDir(cfgPath); - strcat(cfgPath, m_devType.toStdString().c_str()); - strcat(cfgPath, ".json"); +//void DeviceManager::setGlobalCfg() +//{ +// HGChar cfgPath[512] = {0}; +// HGBase_GetConfigPath(cfgPath, 512); +// HGBase_CreateDir(cfgPath); +// strcat(cfgPath, m_devType.toStdString().c_str()); +// strcat(cfgPath, ".json"); - HGPdtToolDb_DownloadFile(m_pdtToolDbuserMgr, m_devType.toStdString().c_str(), cfgPath); +// HGPdtToolDb_DownloadFile(m_pdtToolDbuserMgr, m_devType.toStdString().c_str(), cfgPath); - AnalysisJson analysisJson(QString::fromStdString(cfgPath)); +// AnalysisJson analysisJson(QString::fromStdString(cfgPath)); - assert(nullptr != m_hg); - AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal(); - LPWRITECFG lp = new WRITECFG; +// assert(nullptr != m_hg); +// AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal(); +// LPWRITECFG lp = new WRITECFG; - VIDPID vidpid; - vidpid.VID = jsonGlobal.vid_to; - vidpid.PID = jsonGlobal.pid_to; - int vidpidValue = vidpid.Value; - lp->cat = WRITE_CAT_VID_PID; - lp->val = (void*)&vidpidValue; - m_mainwnd->addTestingRef(); - func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg); +// VIDPID vidpid; +// vidpid.VID = jsonGlobal.vid_to; +// vidpid.PID = jsonGlobal.pid_to; +// int vidpidValue = vidpid.Value; +// lp->cat = WRITE_CAT_VID_PID; +// lp->val = (void*)&vidpidValue; +// m_mainwnd->addTestingRef(); +// func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg); - int speedMode = jsonGlobal.speed_mode ; - lp->cat = WRITE_CAT_SPEED; - lp->val = (void*)&speedMode; - m_mainwnd->addTestingRef(); - func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg); +// int speedMode = jsonGlobal.speed_mode ; +// lp->cat = WRITE_CAT_SPEED; +// lp->val = (void*)&speedMode; +// m_mainwnd->addTestingRef(); +// func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg); - int sleepTime = jsonGlobal.sleep_time; - lp->cat = WRITE_CAT_SLEEP; - lp->val = (void*)&sleepTime; - m_mainwnd->addTestingRef(); - func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg); +// int sleepTime = jsonGlobal.sleep_time; +// lp->cat = WRITE_CAT_SLEEP; +// lp->val = (void*)&sleepTime; +// m_mainwnd->addTestingRef(); +// func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg); - delete lp; -} +// delete lp; +//} void Form_BurnMode::on_tableWidget_itemDoubleClicked(QTableWidgetItem *item) { diff --git a/app/HGProductionTool/form_burnmode.h b/app/HGProductionTool/form_burnmode.h index 6a6fb57..2fc5f61 100644 --- a/app/HGProductionTool/form_burnmode.h +++ b/app/HGProductionTool/form_burnmode.h @@ -14,17 +14,15 @@ class Form_BurnMode; class DeviceManager { public: - DeviceManager(class MainWindow *mainwnd, HGPdtToolDbUserMgr pdtToolDbuserMgr, class Form_BurnMode *burnMode, - SANE_Handle handle, const QString &devName, const QString &sn, const QString &devType); + DeviceManager(class MainWindow *mainwnd, class Form_BurnMode *burnMode, SANE_Handle handle, const QString &devName); ~DeviceManager(); QString getDevName(); - QString getSn(); void setBurnMode(); - void setSn(QString sn); - QString getUpdatedSn(); +// void setSn(QString sn); +// QString getUpdatedSn(); SANE_Handle m_handle; - void setGlobalCfg(); +// void setGlobalCfg(); private: union VIDPID @@ -39,11 +37,8 @@ private: private: class MainWindow *m_mainwnd; - HGPdtToolDbUserMgr m_pdtToolDbuserMgr; class Form_BurnMode *m_burnMode; QString m_devName; - QString m_sn; - QString m_devType; hgscanner *m_hg; }; diff --git a/app/HGProductionTool/mainwindow.cpp b/app/HGProductionTool/mainwindow.cpp index b9f88ea..f4cbb7f 100644 --- a/app/HGProductionTool/mainwindow.cpp +++ b/app/HGProductionTool/mainwindow.cpp @@ -410,13 +410,13 @@ void MainWindow::on_sane_dev_arrive(QString devName) sane_open(devName.toStdString().c_str(), &devHandle); if (nullptr != devHandle) { - DeviceManager *devManager = new DeviceManager(this, m_pdtToolDbuserMgr, m_formBurnMode, devHandle, devName, getDevSn(devHandle), getDevType(devHandle)); + DeviceManager *devManager = new DeviceManager(this, m_formBurnMode, devHandle, devName); m_formBurnMode->addDevice(devManager); } } else { - QMessageBox msg(QMessageBox::Question, tr("tips"), + QMessageBox msg(QMessageBox::Warning, tr("warning"), tr("Confirm whether the device is reset"), QMessageBox::Yes | QMessageBox::No, this); msg.setButtonText(QMessageBox::Yes, tr("confirm"));