Merge branch 'master' of http://192.168.10.5:8099/sane/code_production
This commit is contained in:
commit
db5fcf1337
|
@ -38,7 +38,8 @@ std::vector<AnalysisJson::json_node> AnalysisJson::GetNode()
|
||||||
obj[key].toObject()["man"].toBool(),
|
obj[key].toObject()["man"].toBool(),
|
||||||
obj[key].toObject()["err-level"].toInt(),
|
obj[key].toObject()["err-level"].toInt(),
|
||||||
obj[key].toObject()["desc"].toString(),
|
obj[key].toObject()["desc"].toString(),
|
||||||
obj[key].toObject()["station"].toString()});
|
obj[key].toObject()["station"].toString(),
|
||||||
|
obj[key].toObject()["resolution"].toInt()});
|
||||||
}
|
}
|
||||||
return nodes;
|
return nodes;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ public:
|
||||||
std::int32_t err_level;
|
std::int32_t err_level;
|
||||||
QString desc;
|
QString desc;
|
||||||
QString station;
|
QString station;
|
||||||
|
int resolution;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct json_global{
|
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(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(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);
|
connect(this, SIGNAL(testCorrectInfo(QString)), this, SLOT(on_testCorrectInfo(QString)), Qt::QueuedConnection);
|
||||||
|
|
||||||
QString str;
|
QString str;
|
||||||
|
@ -194,10 +194,13 @@ void Form_mainInterface::on_testResultImg(void *img)
|
||||||
HGBase_DestroyImage(image);
|
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'));
|
SANE_DISTORTION_VAL val = *(SANE_DISTORTION_VAL*)data;
|
||||||
updateImgPixelInfo();
|
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);
|
updateUiEnabled(true);
|
||||||
m_isTesting = false;
|
m_isTesting = false;
|
||||||
|
@ -586,12 +589,16 @@ 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;
|
||||||
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)
|
||||||
|
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);
|
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(float value);
|
void testDistortion(void *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(float value);
|
void on_testDistortion(void *data);
|
||||||
void on_testCorrectInfo(QString info);
|
void on_testCorrectInfo(QString info);
|
||||||
|
|
||||||
void on_viewerDblClick();
|
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)
|
else if (ev == TEST_EVENT_DISTORTION_VAL)
|
||||||
{
|
{
|
||||||
float fValue = *(float*)data;
|
if (data != nullptr)
|
||||||
emit m_interface->testDistortion(fValue);
|
{
|
||||||
|
emit m_interface->testDistortion(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (ev == TEST_EVENT_FALT_INFO)
|
else if (ev == TEST_EVENT_FALT_INFO)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue