调整畸变流程
This commit is contained in:
parent
3f9afc9f0e
commit
ee16d6d5cb
|
@ -38,7 +38,8 @@ std::vector<AnalysisJson::json_node> AnalysisJson::GetNode()
|
|||
obj[key].toObject()["man"].toBool(),
|
||||
obj[key].toObject()["err-level"].toInt(),
|
||||
obj[key].toObject()["desc"].toString(),
|
||||
obj[key].toObject()["station"].toString()});
|
||||
obj[key].toObject()["station"].toString(),
|
||||
obj[key].toObject()["resolution"].toInt()});
|
||||
}
|
||||
return nodes;
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ public:
|
|||
std::int32_t err_level;
|
||||
QString desc;
|
||||
QString station;
|
||||
int resolution;
|
||||
};
|
||||
|
||||
struct json_global{
|
||||
|
|
|
@ -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(testResultImg(void*)), this, SLOT(on_testResultImg(void*)), Qt::QueuedConnection);
|
||||
connect(this, SIGNAL(testDistortion(float)), this, SLOT(on_testDistortion(float)), Qt::QueuedConnection);
|
||||
connect(this, SIGNAL(testDistortion(void*)), this, SLOT(on_testDistortion(void*)), Qt::QueuedConnection);
|
||||
connect(this, SIGNAL(testCorrectInfo(QString)), this, SLOT(on_testCorrectInfo(QString)), Qt::QueuedConnection);
|
||||
|
||||
QString str;
|
||||
|
@ -194,10 +194,13 @@ void Form_mainInterface::on_testResultImg(void *img)
|
|||
HGBase_DestroyImage(image);
|
||||
}
|
||||
|
||||
void Form_mainInterface::on_testDistortion(float value)
|
||||
void Form_mainInterface::on_testDistortion(void *data)
|
||||
{
|
||||
ui->label_destortionInfo->setText(tr("destortion value: ") + QString::number(value, 'f'));
|
||||
updateImgPixelInfo();
|
||||
SANE_DISTORTION_VAL val = *(SANE_DISTORTION_VAL*)data;
|
||||
ui->label_imgInfo->setText(tr("image pixel: ") + QString::number(val.w, 'f') + " * " + QString::number(val.h, 'f'));
|
||||
ui->label_destortionInfo->setText(tr("destortion value: ") + QString::number(val.scaleXY, 'f'));
|
||||
|
||||
// updateImgPixelInfo();
|
||||
|
||||
updateUiEnabled(true);
|
||||
m_isTesting = false;
|
||||
|
@ -586,13 +589,17 @@ void Form_mainInterface::on_pbtn_start_clicked()
|
|||
{
|
||||
QString title = item->text();
|
||||
QString name = m_map_title_name.value(title).name;
|
||||
int dpi = m_map_title_name.value(title).resolution;
|
||||
if (m_hg != nullptr)
|
||||
{
|
||||
updateUiEnabled(false);
|
||||
m_isTesting = true;
|
||||
m_mainwnd->addTestingRef();
|
||||
|
||||
func_test_go(name.toStdWString().c_str(), L"null", m_hg);
|
||||
if (dpi > 0)
|
||||
func_test_go(name.toStdWString().c_str(), (const wchar_t*)&dpi, m_hg);
|
||||
else
|
||||
func_test_go(name.toStdWString().c_str(), L"null", m_hg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,13 +38,13 @@ protected:
|
|||
signals:
|
||||
void testResult(QString text);
|
||||
void testResultImg(void* img);
|
||||
void testDistortion(float value);
|
||||
void testDistortion(void *data);
|
||||
void testCorrectInfo(QString info);
|
||||
|
||||
private slots:
|
||||
void on_testResult(QString text);
|
||||
void on_testResultImg(void* img);
|
||||
void on_testDistortion(float value);
|
||||
void on_testDistortion(void *data);
|
||||
void on_testCorrectInfo(QString info);
|
||||
|
||||
void on_viewerDblClick();
|
||||
|
|
|
@ -98,8 +98,10 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si
|
|||
}
|
||||
else if (ev == TEST_EVENT_DISTORTION_VAL)
|
||||
{
|
||||
float fValue = *(float*)data;
|
||||
emit m_interface->testDistortion(fValue);
|
||||
if (data != nullptr)
|
||||
{
|
||||
emit m_interface->testDistortion(data);
|
||||
}
|
||||
}
|
||||
else if (ev == TEST_EVENT_FALT_INFO)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue