diff --git a/app/twaintest/TwainTest_zh_CN.qm b/app/twaintest/TwainTest_zh_CN.qm
index 22a7bf43..4ed6ad93 100644
Binary files a/app/twaintest/TwainTest_zh_CN.qm and b/app/twaintest/TwainTest_zh_CN.qm differ
diff --git a/app/twaintest/TwainTest_zh_CN.ts b/app/twaintest/TwainTest_zh_CN.ts
index 6917aba9..fb1c41ae 100644
--- a/app/twaintest/TwainTest_zh_CN.ts
+++ b/app/twaintest/TwainTest_zh_CN.ts
@@ -6,7 +6,7 @@
- Twain测试工具
+ 华高Twain测试工具
@@ -54,47 +54,58 @@
获取测试项当前值:
-
+
+
+ 设置界面
+
+
+
act_scan
扫描
-
+
选择设备源...
-
-
+
+
当前无设备连接
-
+
设备 %1 已连接
-
-
-
+
+
+
+
提示
-
+
未找到设备源!
-
+
+
+ 输入不能为空!
+
+
+
设置成功
-
+
设置失败
@@ -104,707 +115,937 @@
获取失败
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
(背景填充)
-
+
(背面旋转180度)
-
+
(歪斜检测)
-
+
(颜色增强)
-
+
(深色样张)
-
+
(穿孔移除)
-
+
(歪斜容忍度)
-
+
(锐化与模糊)
-
+
(硬件版本)
-
+
(多流输出除红)
-
+
(对折)
-
+
(装订检测)
-
+
(跳过空白发票)
-
+
(穿孔搜索范围)
-
+
(交换正反面)
-
+
(答题卡除红)
-
+
(折角检测)
-
+
(背景填充方式)
-
+
(边缘缩进)
-
+
(背景抗噪等级)
-
+
(阈值)
-
+
(黑白图像噪点优化)
-
+
(噪点优化尺寸)
-
+
(尺寸检测)
-
+
(节能模式)
-
+
(编码)
-
+
(裁切方式)
-
+
(折角大小)
-
+
(图像拆分)
-
+
(是否除背景色)
-
+
(背景色范围)
-
+
(待纸扫描)
-
+
(是否开启多流输出)
-
+
(多流输出类型)
-
+
(是否开启带孔扫描)
-
+
(获取设备IP)
-
+
(多流输出)
-
+
(多流输出类型)
-
+
(颜色模式)
-
+
(除色或增强)
-
+
(多流输出除红)
-
+
(试卷除红)
-
+
(背景移除)
-
+
(背景色彩范围)
-
+
(锐化与模糊)
-
+
(除摩尔纹)
-
+
(除网纹)
-
+
(错误扩散)
-
+
(噪点优化)
-
+
(噪点优化尺寸)
-
+
(纸张尺寸)
-
+
(自定义扫描区域)
-
+
(自定义扫描区域 左)
-
+
(自定义扫描区域 右)
-
+
(自定义扫描区域 上)
-
+
(自定义扫描区域 下)
-
+
(尺寸检测)
-
+
(扫描页面)
-
+
(跳过空白页灵敏度)
-
+
(分辨率)
-
+
(图像质量)
-
+
(交换正反面)
-
+
(图像拆分)
-
+
(自动纠偏)
-
+
(自定义gamma)
-
+
(亮度)
-
+
(对比度)
-
+
(gamma)
-
+
(消除黑框)
-
+
(深色样张)
-
+
(阈值)
-
+
(背景抗噪等级)
-
+
(边缘缩进)
-
+
(背景填充方式)
-
+
(防止渗透)
-
+
(防止渗透等级)
-
+
(色彩填充)
-
+
(超声波检测)
-
+
(装订检测)
-
+
(扫描张数)
-
+
(扫描数量)
-
+
(文稿方向)
-
+
(背面旋转180度)
-
+
(折角检测)
-
+
(折角检测大小)
-
+
(歪斜检测)
-
+
(歪斜容忍度)
-
+
(转为黑白图像时的阈值)
-
+
(照片模式)
-
+
(双张图片处理方式)
-
+
(待纸扫描)
-
+
(分纸强度)
-
+
(休眠时间)
-
+
(是否自动调节搓纸强度)
-
+
(搓纸阈值)
-
+
(黑白图像是否反色输出)
-
+
(穿孔移除—左侧)
-
+
(左侧穿孔搜索范围)
-
+
(穿孔移除—右侧)
-
+
(右侧穿孔搜索范围)
-
+
(穿孔移除—上侧)
-
+
(上侧穿孔搜索范围)
-
+
(穿孔移除—下侧)
-
+
(下侧穿孔搜索范围)
-
+
(对折模式)
-
+
(色偏校正)
-
+
(历史张数-Get)
-
+
(驱动版本-Get)
-
+
(制造商/开发商-Get)
-
+
(版权信息-Get)
-
+
(公司网址-Get)
-
+
(公司电话-Get)
-
+
(公司地址-Get)
-
+
(公司地图定位-Get)
-
+
(显示帮助文档-Get)
-
+
(获取设备VID-Get)
-
+
(获取设备PID-Get)
-
+
(获取设备名称-Get)
-
+
(获取设备型号-Get)
-
+
(获取设备序列号-Get)
-
+
(获取设备固件版本-Get)
-
+
(获取设备IP-Get)
-
+
(获取设备MAC-Get)
-
+
(自定义GAMMA)
-
+
(滚轴寿命)
-
+
(语言环境)
-
+
(电机固件版本)
-
+
(是否有纸张)
-
+
(自定义GAMMA,灰度分量)
-
+
(自定义GAMMA,彩色分量)
-
+
(自定义GAMMA,红色分量)
-
+
(自定义GAMMA,绿色分量)
-
+
(自定义GAMMA,蓝色分量)
-
+
(获取初始开机时间)
-
+
(跳过空白页)
-
+
(设备镜头脏污检测)
-
+
(用户登录-Set)
-
+
(用户登出-Set)
-
+
(滚轴计数-Get/Reset)
-
+
(驱动日志-Get/Reset)
-
+
(设备日志-Get/Reset)
diff --git a/app/twaintest/mainwindow.cpp b/app/twaintest/mainwindow.cpp
index 05e9ec07..3c97efaf 100644
--- a/app/twaintest/mainwindow.cpp
+++ b/app/twaintest/mainwindow.cpp
@@ -16,7 +16,6 @@ MainWindow::MainWindow(QWidget *parent)
, m_cacheUuid("")
{
ui->setupUi(this);
- this->setWindowIcon(QIcon(":images/image_rsc/logo/logo.ico"));
HGChar cacheUuid[256] = { 0 };
HGBase_GetUuid(cacheUuid, 256);
@@ -26,12 +25,10 @@ MainWindow::MainWindow(QWidget *parent)
initCapbility();
QStringList capTypes = { "TWTY_INT8", "TWTY_UINT8", "TWTY_INT16", "TWTY_UINT16", "TWTY_INT32", "TWTY_UINT32", "TWTY_BOOL","TWTY_FIX32",
- "TWTY_STR32", "TWTY_STR64", "TWTY_STR128", "TWTY_STR255" };
+ "TWTY_STR32", "TWTY_STR64", "TWTY_STR128", "TWTY_STR255", "UNSUPPORTED" };
ui->comboBox_capType->addItems(capTypes);
ui->comboBox_capType->setCurrentIndex(0);
- ui->comboBox_capType->setEditable(true);
- ui->comboBox_setCap->setEditable(true);
ui->label_deviceStatus->setText(tr("No device connected"));
HGTwain_CreateDSM((HWND)this->winId(), &m_twainDSM);
@@ -97,6 +94,12 @@ void MainWindow::on_act_selectDevice_triggered()
void MainWindow::on_pushButton_setCap_clicked()
{
+ if (ui->lineEdit_setCapContent->text().isEmpty())
+ {
+ QMessageBox::information(this, tr("Prompt"), tr("Input cannot be empty!"));
+ return;
+ }
+
QString capCode = ui->comboBox_setCap->currentText();
bool ok = false;
HGUShort cap = capCode.left(6).toInt(&ok, 16);
@@ -178,11 +181,127 @@ void MainWindow::on_pushButton_getCap_clicked()
}
}
+void MainWindow::on_pushButton_showUI_clicked()
+{
+ HGTwain_EnableDSUIOnly(m_twainDS, (HWND)this->winId(), DSEventFunc, this);
+}
+
void MainWindow::on_pushButton_scan_clicked()
{
HGTwain_EnableDS(m_twainDS, HGFALSE, (HWND)this->winId(), DSEventFunc, this, DSImageFunc, this);
}
+void MainWindow::on_comboBox_setCap_currentTextChanged(const QString &arg1)
+{
+ bool ok = false;
+ HGUShort cap = arg1.left(6).toInt(&ok, 16);
+
+ HGCapValue value;
+ HGResult ret = HGTwain_GetCapbility(m_twainDS, cap, &value);
+ if (ret != HGBASE_ERR_OK)
+ {
+ return;
+ }
+
+ if (value.type == HGCAPVALUE_TYPE_CHAR)
+ {
+ for (int i = 0; i < ui->comboBox_capType->count(); i++)
+ {
+ if (ui->comboBox_capType->itemText(i) == "TWTY_INT8")
+ ui->comboBox_capType->setCurrentIndex(i);
+ } }
+ else if (value.type == HGCAPVALUE_TYPE_BYTE)
+ {
+ for (int i = 0; i < ui->comboBox_capType->count(); i++)
+ {
+ if (ui->comboBox_capType->itemText(i) == "TWTY_UINT8")
+ ui->comboBox_capType->setCurrentIndex(i);
+ } }
+ else if (value.type == HGCAPVALUE_TYPE_SHORT)
+ {
+ for (int i = 0; i < ui->comboBox_capType->count(); i++)
+ {
+ if (ui->comboBox_capType->itemText(i) == "TWTY_INT16")
+ ui->comboBox_capType->setCurrentIndex(i);
+ } }
+ else if (value.type == HGCAPVALUE_TYPE_USHORT)
+ {
+ for (int i = 0; i < ui->comboBox_capType->count(); i++)
+ {
+ if (ui->comboBox_capType->itemText(i) == "TWTY_UINT16")
+ ui->comboBox_capType->setCurrentIndex(i);
+ } }
+ else if (value.type == HGCAPVALUE_TYPE_INT)
+ {
+ for (int i = 0; i < ui->comboBox_capType->count(); i++)
+ {
+ if (ui->comboBox_capType->itemText(i) == "TWTY_INT32")
+ ui->comboBox_capType->setCurrentIndex(i);
+ } }
+ else if (value.type == HGCAPVALUE_TYPE_UINT)
+ {
+ for (int i = 0; i < ui->comboBox_capType->count(); i++)
+ {
+ if (ui->comboBox_capType->itemText(i) == "TWTY_UINT32")
+ ui->comboBox_capType->setCurrentIndex(i);
+ } }
+ else if (value.type == HGCAPVALUE_TYPE_BOOL)
+ {
+ for (int i = 0; i < ui->comboBox_capType->count(); i++)
+ {
+ if (ui->comboBox_capType->itemText(i) == "TWTY_BOOL")
+ ui->comboBox_capType->setCurrentIndex(i);
+ } }
+ else if (value.type == HGCAPVALUE_TYPE_FLOAT)
+ {
+ for (int i = 0; i < ui->comboBox_capType->count(); i++)
+ {
+ if (ui->comboBox_capType->itemText(i) == "TWTY_FIX32")
+ ui->comboBox_capType->setCurrentIndex(i);
+ }
+ }
+ else if (value.type == HGCAPVALUE_TYPE_STR32)
+ {
+ for (int i = 0; i < ui->comboBox_capType->count(); i++)
+ {
+ if (ui->comboBox_capType->itemText(i) == "TWTY_STR32")
+ ui->comboBox_capType->setCurrentIndex(i);
+ }
+ }
+ else if (value.type == HGCAPVALUE_TYPE_STR64)
+ {
+ for (int i = 0; i < ui->comboBox_capType->count(); i++)
+ {
+ if (ui->comboBox_capType->itemText(i) == "TWTY_STR64")
+ ui->comboBox_capType->setCurrentIndex(i);
+ }
+ }
+ else if (value.type == HGCAPVALUE_TYPE_STR128)
+ {
+ for (int i = 0; i < ui->comboBox_capType->count(); i++)
+ {
+ if (ui->comboBox_capType->itemText(i) == "TWTY_STR128")
+ ui->comboBox_capType->setCurrentIndex(i);
+ }
+ }
+ else if (value.type == HGCAPVALUE_TYPE_STR255)
+ {
+ for (int i = 0; i < ui->comboBox_capType->count(); i++)
+ {
+ if (ui->comboBox_capType->itemText(i) == "TWTY_STR255")
+ ui->comboBox_capType->setCurrentIndex(i);
+ }
+ }
+ else
+ {
+ for (int i = 0; i < ui->comboBox_capType->count(); i++)
+ {
+ if (ui->comboBox_capType->itemText(i) == "UNSOPPORTED")
+ ui->comboBox_capType->setCurrentIndex(i);
+ }
+ }
+}
+
void MainWindow::on_newImage(void *image)
{
HGImage img = nullptr;
@@ -498,6 +617,7 @@ void MainWindow::updateUiEnable(bool enable)
ui->pushButton_setCap->setEnabled(enable);
ui->pushButton_getCap->setEnabled(enable);
ui->pushButton_scan->setEnabled(enable);
+ ui->pushButton_showUI->setEnabled(enable);
}
QString MainWindow::getDeviceName()
diff --git a/app/twaintest/mainwindow.h b/app/twaintest/mainwindow.h
index 5a9fc4cd..c336c57b 100644
--- a/app/twaintest/mainwindow.h
+++ b/app/twaintest/mainwindow.h
@@ -24,8 +24,12 @@ private slots:
void on_pushButton_getCap_clicked();
+ void on_pushButton_showUI_clicked();
+
void on_pushButton_scan_clicked();
+ void on_comboBox_setCap_currentTextChanged(const QString &arg1);
+
signals:
void newImage(void *image);
void clearRes();
diff --git a/app/twaintest/mainwindow.ui b/app/twaintest/mainwindow.ui
index 9967b621..dfc74e21 100644
--- a/app/twaintest/mainwindow.ui
+++ b/app/twaintest/mainwindow.ui
@@ -171,6 +171,19 @@
+
+
+
+ 160
+ 400
+ 101
+ 41
+
+
+
+ ShowUI
+
+