diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm index eb80005..d4a8e6c 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 c0a5753..3f8b438 100644 --- a/app/HGProductionTool/ProductionTool_zh_CN.ts +++ b/app/HGProductionTool/ProductionTool_zh_CN.ts @@ -219,12 +219,12 @@ 取消 - + tips 提示 - + please input valid contents 请输入有效内容 @@ -656,14 +656,14 @@ 序列号 - - + + tips 提示 - - + + Please check a devices at least 请至少勾选一台设备 @@ -764,28 +764,28 @@ 下一步 - + Device has connected 设备已连接 - + Device hasnot connected 设备未连接 - + Device type: 设备型号: - + SerialNum: 序列号: - - + + connect status: 设备连接状态: @@ -798,22 +798,23 @@ 休眠时间: - + load last image which uploaded last time 加载上一次上传的图片 - + Device has disconnected 设备已断开 - + tips 提示 - + + destortion value: 畸变修正值: @@ -831,63 +832,90 @@ 目标配置: 速度模式: - + sleep time: 休眠时间: - + ID 序号 - + Test items 测试项 - + status 测试状态 - + not test 未测试 - + not pass 不通过 - + not support 不支持 - + pass 通过 - - + target configuration: + + 目标配置:\n\t + + + speed mode: + 速度模式: + + + sleep time: + 休眠时间: + + + Vid: + Vid: + + + Pid: + Pid: + + + + + device roller count: + 设备滚轴张数: + + + + image pixel: 标准圆:宽 * 高: - + minute 分钟 - + VID: VID: - + PID: PID: @@ -962,7 +990,7 @@ 刷新设备列表 - + Account login elsewhere 账户在其他地方登录 @@ -971,53 +999,51 @@ 网络连接断开 - + You have been forced offline by the administrator account 你已被管理员账户强制下线 - + Data base error 数据库错误 - - - - - - - - - - + + + + + + + + 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! 测试中,请勿关闭! @@ -1026,10 +1052,9 @@ 警告 - Confirm whether the device is reset Are you sure to connect the new device - 检测到设备,请先确认是否已经复位,否则有可能导致获取序列号失败! + 检测到设备,请先确认是否已经复位,否则有可能导致获取序列号失败! yes @@ -1040,9 +1065,8 @@ 取消 - - - + + cannot create more table 不能创建更多项目 @@ -1055,52 +1079,51 @@ 已复位 - Open device failed - 打开设备失败 + 打开设备失败 - + save 保存 - + xls(*.xls) xls表格(*.xls) - + export succeed 导出成功 - + export failed 导出失败 - + Illegal user 非法的用户 - + Wrong password 密码错误 - + Database error 数据库错误 - + connect error 连接错误 - + Failed 错误 @@ -1108,19 +1131,19 @@ QObject - + success: success 成功: - - + + failed: 失败: - + Not find test item 没有找到该测试项 diff --git a/app/HGProductionTool/form_maininterface.cpp b/app/HGProductionTool/form_maininterface.cpp index 7653b95..64de719 100644 --- a/app/HGProductionTool/form_maininterface.cpp +++ b/app/HGProductionTool/form_maininterface.cpp @@ -33,6 +33,9 @@ Form_mainInterface::Form_mainInterface(class MainWindow *mainwnd, Dialog_logIn:: , m_isTesting(false) , m_multiIndex(-1) , m_curNameIndex(1) + , m_curDpi(0) + , m_distortion_200dpi(0.0) + , m_distortion_300dpi(0.0) { ui->setupUi(this); @@ -62,20 +65,14 @@ Form_mainInterface::Form_mainInterface(class MainWindow *mainwnd, Dialog_logIn:: ui->label_sn->setText(tr("Device type:") + m_devType + tr(" SerialNum:") + m_serialNum); ui->label_devStatus->setText(tr(" connect status:") + str); - SANE_Int speedMode = 0; - unsigned int len = sizeof(SANE_Int); - sane_io_control(m_handle, IO_CTRL_CODE_GET_SPEED_MODE, &speedMode, &len); - ui->label_speedMode->setText(tr(" speed mode:") + getSpeedMode(speedMode)); + ui->label_speedMode->setText(tr(" speed mode:") + getSpeedMode()); + ui->label_sleepTime->setText(tr(" sleep time:") + getSleepTime()); - int sleepTime = SANE_POWER_FIRST; - unsigned int len2 = sizeof(int); - sane_io_control(m_handle, IO_CTRL_CODE_GET_POWER_LEVEL, &sleepTime, &len2); - ui->label_sleepTime->setText(tr(" sleep time:") + getSleepTime(sleepTime)); - - getVidPid(); + ui->label_vidpid->setText(tr(" VID:") + getDevVid() + tr(" PID:") + getDevPid()); ui->label_imgInfo->setVisible(false); - ui->label_destortionInfo->setVisible(false); + ui->label_destortionInfo_200dpi->setVisible(false); + ui->label_destortionInfo_300dpi->setVisible(false); setMinimumWidth(500); ui->tableWidget->setMinimumWidth(450); @@ -197,20 +194,29 @@ void Form_mainInterface::on_testResultImg(void *img) void Form_mainInterface::on_testDistortion(SANE_DISTORTION_VAL data) { ui->label_imgInfo->setVisible(true); - ui->label_destortionInfo->setVisible(true); + ui->label_destortionInfo_200dpi->setVisible(true); + ui->label_destortionInfo_300dpi->setVisible(true); -// SANE_DISTORTION_VAL* val = (SANE_DISTORTION_VAL*)data; - -// double width = val->w; -// double height = val->h; -// double scaleXY = val->scaleXY; - - ui->label_imgInfo->setText(tr("image pixel: ") + QString::number(data.w, 'f') + " * " + QString::number(data.h, 'f')); - ui->label_destortionInfo->setText(tr("destortion value: ") + QString::number(data.scaleXY, 'f')); - - if (m_hg != nullptr) + ui->label_imgInfo->setText(tr("image pixel: ") + QString::number(data.w > 0 ? data.w : 0.0, 'f') + " * " + QString::number(data.h > 0 ? data.h : 0.0, 'f')); + if (200 == m_curDpi) { - m_hg->setDistortValue(data.scaleXY); + m_distortion_200dpi = data.scaleXY > 0 ? data.scaleXY : 0; + ui->label_destortionInfo_200dpi->setText(" 200dpi" + tr("destortion value: ") + QString::number(m_distortion_200dpi, 'f')); + + if (m_hg != nullptr) + { + m_hg->setDistortValue(m_distortion_200dpi); + } + } + else if (300 == m_curDpi) + { + m_distortion_300dpi = data.scaleXY > 0 ? data.scaleXY : 0; + ui->label_destortionInfo_300dpi->setText(" 300dpi" + tr("destortion value: ") + QString::number(m_distortion_300dpi, 'f')); + + if (m_hg != nullptr) + { + m_hg->setDistortValue(m_distortion_300dpi); + } } // updateImgPixelInfo(); @@ -481,7 +487,8 @@ void Form_mainInterface::updateUiEnabled(bool enable) void Form_mainInterface::updateImgPixelInfo() { ui->label_imgInfo->setVisible(true); - ui->label_destortionInfo->setVisible(true); + ui->label_destortionInfo_200dpi->setVisible(true); + ui->label_destortionInfo_300dpi->setVisible(true); HGImage image = NULL; m_view->getImage(&image); @@ -495,8 +502,12 @@ void Form_mainInterface::updateImgPixelInfo() ui->label_imgInfo->setText(tr("image pixel: ") + QString::number(imgWidth) + " * " + QString::number(imgHeight) + " "); } -QString Form_mainInterface::getSpeedMode(SANE_Int speedMode) +QString Form_mainInterface::getSpeedMode() { + SANE_Int speedMode = 0; + unsigned int len = sizeof(SANE_Int); + sane_io_control(m_handle, IO_CTRL_CODE_GET_SPEED_MODE, &speedMode, &len); + const wchar_t G100[6] = { 70,80,90,110 }; const wchar_t G200[6] = { 100,110,120,130 }; const wchar_t G300[6] = { 40,50,60,70 }; @@ -516,15 +527,19 @@ QString Form_mainInterface::getSpeedMode(SANE_Int speedMode) return QString::number(speed) + "PPM"; } -QString Form_mainInterface::getSleepTime(int sleepTime) +QString Form_mainInterface::getSleepTime() { + int sleepTime = SANE_POWER_FIRST; + unsigned int len2 = sizeof(int); + sane_io_control(m_handle, IO_CTRL_CODE_GET_POWER_LEVEL, &sleepTime, &len2); + if (sleepTime > 99999 || sleepTime == -1) return QString::number(0); return QString::number(sleepTime / 60) + tr(" minute"); } -void Form_mainInterface::getVidPid() +QString Form_mainInterface::getDevVid() { VIDPID vidpid; int vidpid_val; @@ -532,12 +547,35 @@ void Form_mainInterface::getVidPid() sane_io_control(m_handle, IO_CTRL_CODE_GET_VIDPID, &vidpid_val, &len); vidpid.Value = vidpid_val; int vid = vidpid.VID; + char buf[10]; + sprintf(buf, "%x", vid); + + return QString::fromStdString(buf); +} + +QString Form_mainInterface::getDevPid() +{ + VIDPID vidpid; + int vidpid_val; + unsigned int len = sizeof(int); + sane_io_control(m_handle, IO_CTRL_CODE_GET_VIDPID, &vidpid_val, &len); + vidpid.Value = vidpid_val; int pid = vidpid.PID; char buf[10]; - char buf2[10]; - sprintf(buf, "%x", vid); - sprintf(buf2, "%x", pid); - ui->label_vidpid->setText(tr(" VID:") + QString::fromStdString(buf) + tr(" PID:") + QString::fromStdString(buf2)); + sprintf(buf, "%x", pid); + + return QString::fromStdString(buf); +} + +int Form_mainInterface::getRollerNum() +{ + SANE_Int rollCount = 0; + unsigned int rollCountSize = sizeof(SANE_Int); + SANE_Status ret = sane_io_control(m_handle, IO_CTRL_CODE_GET_ROLLER_NUM, &rollCount, &rollCountSize); + if (ret == SANE_STATUS_GOOD) + return rollCount >= 0 ? rollCount : -1; + else + return -1; } void Form_mainInterface::on_tableWidget_currentItemChanged(QTableWidgetItem *current, QTableWidgetItem *previous) @@ -587,6 +625,12 @@ void Form_mainInterface::on_tableWidget_currentItemChanged(QTableWidgetItem *cur // QDir dir(getCachePath()); // if (dir.exists()) // dir.removeRecursively(); + + if (name == "CLEAR_ROLLER_COUNT") + { + QString str(tr("device roller count:") + QString::number(getRollerNum())); + m_textTips->setViewContent(str); + } } } @@ -615,6 +659,7 @@ void Form_mainInterface::on_pbtn_start_clicked() wchar_t buf[5] = {0}; if (dpi > 0) { + m_curDpi = dpi; swprintf(buf, L"%d", dpi); } @@ -629,6 +674,12 @@ void Form_mainInterface::on_pbtn_start_clicked() else func_test_go(name.toStdWString().c_str(), L"null", m_hg); } + + if (name == "CLEAR_ROLLER_COUNT") + { + QString str(tr("device roller count:") + QString::number(getRollerNum())); + m_textTips->setViewContent(str); + } } } diff --git a/app/HGProductionTool/form_maininterface.h b/app/HGProductionTool/form_maininterface.h index 61681ee..0be5e50 100644 --- a/app/HGProductionTool/form_maininterface.h +++ b/app/HGProductionTool/form_maininterface.h @@ -82,9 +82,11 @@ private: QString getCurItemName(); void updateUiEnabled(bool enable); void updateImgPixelInfo(); - QString getSpeedMode(SANE_Int speedMode); - QString getSleepTime(int sleepTime); - void getVidPid(); + QString getSpeedMode(); + QString getSleepTime(); + QString getDevVid(); + QString getDevPid(); + int getRollerNum(); private: union VIDPID @@ -119,6 +121,9 @@ private: bool m_isTesting; int m_multiIndex; int m_curNameIndex; + int m_curDpi; + double m_distortion_200dpi; + double m_distortion_300dpi; QStringList m_list_images; QMap m_map_title_name; diff --git a/app/HGProductionTool/form_maininterface.ui b/app/HGProductionTool/form_maininterface.ui index 83f0c4f..160133b 100644 --- a/app/HGProductionTool/form_maininterface.ui +++ b/app/HGProductionTool/form_maininterface.ui @@ -197,7 +197,14 @@ - + + + + + + + + diff --git a/app/HGProductionTool/hgscanner.cpp b/app/HGProductionTool/hgscanner.cpp index 7e07c20..0188140 100644 --- a/app/HGProductionTool/hgscanner.cpp +++ b/app/HGProductionTool/hgscanner.cpp @@ -105,10 +105,6 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si { if (data != nullptr) { -// qDebug() << ((SANE_DISTORTION_VAL*)data)->w; -// qDebug() << ((SANE_DISTORTION_VAL*)data)->h; -// qDebug() << ((SANE_DISTORTION_VAL*)data)->scaleXY; - if (m_interface != nullptr) { emit m_interface->testDistortion(*((SANE_DISTORTION_VAL*)data));