调整畸变流程
This commit is contained in:
parent
081fa9dbec
commit
ee68af887d
Binary file not shown.
|
@ -851,7 +851,7 @@
|
||||||
<message>
|
<message>
|
||||||
<location filename="form_maininterface.cpp" line="466"/>
|
<location filename="form_maininterface.cpp" line="466"/>
|
||||||
<source>image pixel: </source>
|
<source>image pixel: </source>
|
||||||
<translation>图像像素: </translation>
|
<translation>标准圆宽高: </translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="form_maininterface.cpp" line="495"/>
|
<location filename="form_maininterface.cpp" line="495"/>
|
||||||
|
@ -1004,7 +1004,7 @@
|
||||||
<location filename="mainwindow.cpp" line="420"/>
|
<location filename="mainwindow.cpp" line="420"/>
|
||||||
<source>Confirm whether the device is reset</source>
|
<source>Confirm whether the device is reset</source>
|
||||||
<oldsource>Are you sure to connect the new device</oldsource>
|
<oldsource>Are you sure to connect the new device</oldsource>
|
||||||
<translation type="unfinished">检测到设备,请先确认是否已经复位</translation>
|
<translation>检测到设备,请先确认是否已经复位</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>yes</source>
|
<source>yes</source>
|
||||||
|
|
|
@ -48,7 +48,7 @@ Form_mainInterface::Form_mainInterface(class MainWindow *mainwnd, Dialog_logIn::
|
||||||
|
|
||||||
connect(this, SIGNAL(testResult(QString)), this, SLOT(on_testResult(QString)), Qt::QueuedConnection);
|
connect(this, SIGNAL(testResult(QString)), this, SLOT(on_testResult(QString)), Qt::QueuedConnection);
|
||||||
connect(this, SIGNAL(testResultImg(void*)), this, SLOT(on_testResultImg(void*)), Qt::QueuedConnection);
|
connect(this, SIGNAL(testResultImg(void*)), this, SLOT(on_testResultImg(void*)), Qt::QueuedConnection);
|
||||||
connect(this, SIGNAL(testDistortion(void*)), this, SLOT(on_testDistortion(void*)), Qt::QueuedConnection);
|
connect(this, &Form_mainInterface::testDistortion, this, &Form_mainInterface::on_testDistortion);
|
||||||
connect(this, SIGNAL(testCorrectInfo(QString)), this, SLOT(on_testCorrectInfo(QString)), Qt::QueuedConnection);
|
connect(this, SIGNAL(testCorrectInfo(QString)), this, SLOT(on_testCorrectInfo(QString)), Qt::QueuedConnection);
|
||||||
|
|
||||||
QString str;
|
QString str;
|
||||||
|
@ -194,11 +194,19 @@ void Form_mainInterface::on_testResultImg(void *img)
|
||||||
HGBase_DestroyImage(image);
|
HGBase_DestroyImage(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Form_mainInterface::on_testDistortion(void *data)
|
void Form_mainInterface::on_testDistortion(SANE_DISTORTION_VAL data)
|
||||||
{
|
{
|
||||||
SANE_DISTORTION_VAL val = *(SANE_DISTORTION_VAL*)data;
|
ui->label_imgInfo->setVisible(true);
|
||||||
ui->label_imgInfo->setText(tr("image pixel: ") + QString::number(val.w, 'f') + " * " + QString::number(val.h, 'f'));
|
ui->label_destortionInfo->setVisible(true);
|
||||||
ui->label_destortionInfo->setText(tr("destortion value: ") + QString::number(val.scaleXY, 'f'));
|
|
||||||
|
// 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'));
|
||||||
|
|
||||||
// updateImgPixelInfo();
|
// updateImgPixelInfo();
|
||||||
|
|
||||||
|
@ -590,14 +598,20 @@ void Form_mainInterface::on_pbtn_start_clicked()
|
||||||
QString title = item->text();
|
QString title = item->text();
|
||||||
QString name = m_map_title_name.value(title).name;
|
QString name = m_map_title_name.value(title).name;
|
||||||
int dpi = m_map_title_name.value(title).resolution;
|
int dpi = m_map_title_name.value(title).resolution;
|
||||||
|
wchar_t buf[5] = {0};
|
||||||
|
if (dpi > 0)
|
||||||
|
{
|
||||||
|
swprintf(buf, L"%d", dpi);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_hg != nullptr)
|
if (m_hg != nullptr)
|
||||||
{
|
{
|
||||||
updateUiEnabled(false);
|
updateUiEnabled(false);
|
||||||
m_isTesting = true;
|
m_isTesting = true;
|
||||||
m_mainwnd->addTestingRef();
|
m_mainwnd->addTestingRef();
|
||||||
|
|
||||||
if (dpi > 0)
|
if (buf != nullptr && dpi > 0)
|
||||||
func_test_go(name.toStdWString().c_str(), (const wchar_t*)&dpi, m_hg);
|
func_test_go(name.toStdWString().c_str(), (const wchar_t*)buf, m_hg);
|
||||||
else
|
else
|
||||||
func_test_go(name.toStdWString().c_str(), L"null", m_hg);
|
func_test_go(name.toStdWString().c_str(), L"null", m_hg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,13 +38,13 @@ protected:
|
||||||
signals:
|
signals:
|
||||||
void testResult(QString text);
|
void testResult(QString text);
|
||||||
void testResultImg(void* img);
|
void testResultImg(void* img);
|
||||||
void testDistortion(void *data);
|
void testDistortion(SANE_DISTORTION_VAL data);
|
||||||
void testCorrectInfo(QString info);
|
void testCorrectInfo(QString info);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_testResult(QString text);
|
void on_testResult(QString text);
|
||||||
void on_testResultImg(void* img);
|
void on_testResultImg(void* img);
|
||||||
void on_testDistortion(void *data);
|
void on_testDistortion(SANE_DISTORTION_VAL data);
|
||||||
void on_testCorrectInfo(QString info);
|
void on_testCorrectInfo(QString info);
|
||||||
|
|
||||||
void on_viewerDblClick();
|
void on_viewerDblClick();
|
||||||
|
|
|
@ -100,7 +100,14 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si
|
||||||
{
|
{
|
||||||
if (data != nullptr)
|
if (data != nullptr)
|
||||||
{
|
{
|
||||||
emit m_interface->testDistortion(data);
|
// 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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ev == TEST_EVENT_FALT_INFO)
|
else if (ev == TEST_EVENT_FALT_INFO)
|
||||||
|
|
Loading…
Reference in New Issue