维护工具增加恢复出厂设置功能

This commit is contained in:
yangjiaxuan 2023-10-27 09:16:40 +08:00
parent 5851064373
commit 0a802db95e
5 changed files with 144 additions and 79 deletions

Binary file not shown.

View File

@ -98,7 +98,7 @@
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="423"/>
<location filename="mainwindow.ui" line="436"/>
<source>update firmware</source>
<translation></translation>
</message>
@ -113,42 +113,42 @@
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="435"/>
<location filename="mainwindow.ui" line="448"/>
<source>online upgrade</source>
<translation>线</translation>
</message>
<message>
<location filename="mainwindow.ui" line="457"/>
<location filename="mainwindow.ui" line="470"/>
<source>get version list</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="470"/>
<location filename="mainwindow.ui" line="483"/>
<source>download and upgrade</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="483"/>
<location filename="mainwindow.ui" line="496"/>
<source>version list</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="497"/>
<location filename="mainwindow.ui" line="510"/>
<source>local upgrade</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="509"/>
<location filename="mainwindow.ui" line="522"/>
<source>file path</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="532"/>
<location filename="mainwindow.ui" line="545"/>
<source>open file path</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="545"/>
<location filename="mainwindow.ui" line="558"/>
<source>upgrade</source>
<translation></translation>
</message>
@ -196,120 +196,125 @@
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="186"/>
<location filename="mainwindow.ui" line="193"/>
<source>Restore settings</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="199"/>
<source>flat correct</source>
<oldsource>correction</oldsource>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="234"/>
<location filename="mainwindow.ui" line="247"/>
<source>Color correct(Hualing)</source>
<oldsource>Color correct(Hualin)</oldsource>
<translation>()</translation>
</message>
<message>
<location filename="mainwindow.ui" line="240"/>
<location filename="mainwindow.ui" line="253"/>
<source>distortion correct</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="253"/>
<location filename="mainwindow.ui" line="266"/>
<source>Color</source>
<translation>24</translation>
</message>
<message>
<location filename="mainwindow.ui" line="258"/>
<location filename="mainwindow.ui" line="271"/>
<source>Gray</source>
<translation>256</translation>
</message>
<message>
<location filename="mainwindow.ui" line="273"/>
<location filename="mainwindow.ui" line="286"/>
<source>200</source>
<translation>200</translation>
</message>
<message>
<location filename="mainwindow.ui" line="278"/>
<location filename="mainwindow.ui" line="291"/>
<source>300</source>
<translation>300</translation>
</message>
<message>
<location filename="mainwindow.ui" line="283"/>
<location filename="mainwindow.ui" line="296"/>
<source>600</source>
<translation>600</translation>
</message>
<message>
<location filename="mainwindow.ui" line="297"/>
<location filename="mainwindow.ui" line="310"/>
<source>Color mode:</source>
<translation>:</translation>
</message>
<message>
<location filename="mainwindow.ui" line="310"/>
<location filename="mainwindow.ui" line="323"/>
<source>Dpi:</source>
<translation>:</translation>
</message>
<message>
<location filename="mainwindow.ui" line="336"/>
<location filename="mainwindow.ui" line="349"/>
<source>Get distortion</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="349"/>
<location filename="mainwindow.ui" line="362"/>
<source>Set distortion</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="391"/>
<location filename="mainwindow.ui" line="404"/>
<source>Start scan</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="198"/>
<location filename="mainwindow.ui" line="211"/>
<source>Correct</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="211"/>
<location filename="mainwindow.ui" line="224"/>
<location filename="mainwindow.cpp" line="491"/>
<source>Have not corrected</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="378"/>
<location filename="mainwindow.ui" line="391"/>
<source>Export test paper</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="404"/>
<location filename="mainwindow.ui" line="417"/>
<source>Count distortion:</source>
<translation>:</translation>
</message>
<message>
<location filename="mainwindow.ui" line="565"/>
<location filename="mainwindow.ui" line="578"/>
<source>password change</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="577"/>
<location filename="mainwindow.ui" line="590"/>
<source>old password</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="590"/>
<location filename="mainwindow.ui" line="603"/>
<source>new password</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="623"/>
<location filename="mainwindow.ui" line="636"/>
<source>modify password</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="646"/>
<location filename="mainwindow.ui" line="659"/>
<source>confirm new password</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="670"/>
<location filename="mainwindow.ui" line="683"/>
<source>exit</source>
<translation></translation>
</message>
@ -333,12 +338,13 @@
<location filename="mainwindow.cpp" line="562"/>
<location filename="mainwindow.cpp" line="574"/>
<location filename="mainwindow.cpp" line="580"/>
<location filename="mainwindow.cpp" line="913"/>
<location filename="mainwindow.cpp" line="914"/>
<location filename="mainwindow.cpp" line="946"/>
<location filename="mainwindow.cpp" line="947"/>
<location filename="mainwindow.cpp" line="982"/>
<location filename="mainwindow.cpp" line="983"/>
<location filename="mainwindow.cpp" line="915"/>
<location filename="mainwindow.cpp" line="916"/>
<location filename="mainwindow.cpp" line="948"/>
<location filename="mainwindow.cpp" line="949"/>
<location filename="mainwindow.cpp" line="984"/>
<location filename="mainwindow.cpp" line="985"/>
<location filename="mainwindow.cpp" line="1031"/>
<source>do not support</source>
<translation></translation>
</message>
@ -357,12 +363,12 @@
<location filename="mainwindow.cpp" line="711"/>
<location filename="mainwindow.cpp" line="734"/>
<location filename="mainwindow.cpp" line="786"/>
<location filename="mainwindow.cpp" line="850"/>
<location filename="mainwindow.cpp" line="866"/>
<location filename="mainwindow.cpp" line="873"/>
<location filename="mainwindow.cpp" line="880"/>
<location filename="mainwindow.cpp" line="887"/>
<location filename="mainwindow.cpp" line="896"/>
<location filename="mainwindow.cpp" line="852"/>
<location filename="mainwindow.cpp" line="868"/>
<location filename="mainwindow.cpp" line="875"/>
<location filename="mainwindow.cpp" line="882"/>
<location filename="mainwindow.cpp" line="889"/>
<location filename="mainwindow.cpp" line="898"/>
<source>tips</source>
<translation></translation>
</message>
@ -387,7 +393,7 @@
<message>
<location filename="mainwindow.cpp" line="776"/>
<location filename="mainwindow.cpp" line="797"/>
<location filename="mainwindow.cpp" line="818"/>
<location filename="mainwindow.cpp" line="819"/>
<source>device: %1 upgrade firmware success</source>
<translation>%1 </translation>
</message>
@ -470,7 +476,6 @@
</message>
<message>
<location filename="mainwindow.cpp" line="801"/>
<location filename="mainwindow.cpp" line="822"/>
<source>device: %1 upgrade firmware failed, io error</source>
<translation>%1 IO错误</translation>
</message>
@ -480,57 +485,57 @@
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="841"/>
<location filename="mainwindow.cpp" line="843"/>
<source>Roller scanned count has been set to 0.</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="845"/>
<location filename="mainwindow.cpp" line="847"/>
<source>Do not supported</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="848"/>
<location filename="mainwindow.cpp" line="850"/>
<source>Roller scanned count reset failed.</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="866"/>
<location filename="mainwindow.cpp" line="868"/>
<source>old password is wrong</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="873"/>
<location filename="mainwindow.cpp" line="875"/>
<source>new password can not be empty</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="880"/>
<location filename="mainwindow.cpp" line="882"/>
<source>new password is inconsistent</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="887"/>
<location filename="mainwindow.cpp" line="889"/>
<source>modify password fail</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="896"/>
<location filename="mainwindow.cpp" line="898"/>
<source>modify password success</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="978"/>
<location filename="mainwindow.cpp" line="980"/>
<source>correcting...</source>
<translation>...</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="998"/>
<location filename="mainwindow.cpp" line="1000"/>
<source>Export special test paper</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="998"/>
<location filename="mainwindow.cpp" line="1000"/>
<source>jpg(*.jpg)</source>
<translation>jpg(*.jpg)</translation>
</message>
@ -543,19 +548,25 @@
<location filename="mainwindow.cpp" line="331"/>
<location filename="mainwindow.cpp" line="776"/>
<location filename="mainwindow.cpp" line="780"/>
<location filename="mainwindow.cpp" line="914"/>
<location filename="mainwindow.cpp" line="920"/>
<location filename="mainwindow.cpp" line="947"/>
<location filename="mainwindow.cpp" line="953"/>
<location filename="mainwindow.cpp" line="960"/>
<location filename="mainwindow.cpp" line="982"/>
<location filename="mainwindow.cpp" line="989"/>
<location filename="mainwindow.cpp" line="819"/>
<location filename="mainwindow.cpp" line="823"/>
<location filename="mainwindow.cpp" line="916"/>
<location filename="mainwindow.cpp" line="922"/>
<location filename="mainwindow.cpp" line="949"/>
<location filename="mainwindow.cpp" line="955"/>
<location filename="mainwindow.cpp" line="962"/>
<location filename="mainwindow.cpp" line="984"/>
<location filename="mainwindow.cpp" line="991"/>
<location filename="mainwindow.cpp" line="1027"/>
<location filename="mainwindow.cpp" line="1031"/>
<location filename="mainwindow.cpp" line="1035"/>
<location filename="mainwindow.cpp" line="1039"/>
<source>Prompt</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="63"/>
<location filename="mainwindow.cpp" line="960"/>
<location filename="mainwindow.cpp" line="962"/>
<source>Please confirm that the device has correctly placed the calibration paper!</source>
<translation></translation>
</message>
@ -594,7 +605,7 @@
<message>
<location filename="mainwindow.cpp" line="487"/>
<location filename="mainwindow.cpp" line="558"/>
<location filename="mainwindow.cpp" line="840"/>
<location filename="mainwindow.cpp" line="842"/>
<source>roll count: %1</source>
<translation> %1</translation>
</message>
@ -606,42 +617,58 @@
</message>
<message>
<location filename="mainwindow.cpp" line="781"/>
<location filename="mainwindow.cpp" line="824"/>
<source>device: %1 upgrade firmware failed: %2</source>
<translation>%1 : %2</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="919"/>
<location filename="mainwindow.cpp" line="921"/>
<source>Get distortion failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="920"/>
<location filename="mainwindow.cpp" line="922"/>
<source>Get failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="925"/>
<location filename="mainwindow.cpp" line="927"/>
<source>Get distortion succeed: %1</source>
<translation>: %1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1005"/>
<location filename="mainwindow.cpp" line="1007"/>
<source>Color mode: %1, Dpi: %2</source>
<translation>: %1, :%2</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="952"/>
<location filename="mainwindow.cpp" line="953"/>
<location filename="mainwindow.cpp" line="1027"/>
<source>Restore succeed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1035"/>
<source>Restore failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1039"/>
<source>Other error:%1</source>
<translation>%1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="954"/>
<location filename="mainwindow.cpp" line="955"/>
<source>Set failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="942"/>
<location filename="mainwindow.cpp" line="944"/>
<source>Set succeed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="989"/>
<location filename="mainwindow.cpp" line="991"/>
<source>Correct failed</source>
<translation></translation>
</message>

View File

@ -559,7 +559,7 @@ void MainWindow::on_comboDevList_currentIndexChanged(int index)
}
else
{
ui->label_rollerCout->setText(tr("do not support"));
ui->label_rollerCout->setText(QString(tr("roll count: %1")).arg(tr("do not support")));
}
SANE_Int scanCount = 0;
@ -571,7 +571,7 @@ void MainWindow::on_comboDevList_currentIndexChanged(int index)
}
else
{
ui->label_scanCount->setText(tr("do not support"));
ui->label_scanCount->setText(QString(tr("scan count: %1")).arg(tr("do not support")));
}
char motorVersion[256] = {0};
@ -1016,3 +1016,26 @@ void MainWindow::on_pushButton_countDistortion_clicked()
SANE_Status ret = sane_io_control(m_curDevHandle, IO_CTRL_CODE_SET_DISTORTION_DEVS_CHECK_VAL, &distortion, &len);
ret = sane_io_control(m_curDevHandle, IO_CTRL_CODE_SET_DISTORTION_IMAGE, &type, &len);
}
void MainWindow::on_pushButton_restoreSettings_clicked()
{
int data = 0;
unsigned int len = 0;
SANE_Status ret = sane_io_control(m_curDevHandle, IO_CTRL_CODE_SET_RESTORE, &data, &len);
if (SANE_STATUS_GOOD == ret)
{
QMessageBox::information(this, tr("Prompt"), tr("Restore succeed"));
}
else if (ret == SANE_STATUS_UNSUPPORTED)
{
QMessageBox::information(this, tr("Prompt"), tr("do not support"));
}
else if (ret == SANE_STATUS_ACCESS_DENIED)
{
QMessageBox::information(this, tr("Prompt"), tr("Restore failed"));
}
else
{
QMessageBox::information(this, tr("Prompt"), tr("Other error:%1").arg(QString::number(ret)));
}
}

View File

@ -86,6 +86,8 @@ private slots:
void on_pushButton_countDistortion_clicked();
void on_pushButton_restoreSettings_clicked();
private:
static int sane_ex_callback(SANE_Handle hdev, int code, void *data, unsigned int* len, void *param);

View File

@ -118,9 +118,9 @@
<widget class="QPushButton" name="btnClearRollCount">
<property name="geometry">
<rect>
<x>240</x>
<y>280</y>
<width>111</width>
<x>180</x>
<y>270</y>
<width>121</width>
<height>31</height>
</rect>
</property>
@ -180,6 +180,19 @@
<string>motor version:</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_restoreSettings">
<property name="geometry">
<rect>
<x>340</x>
<y>270</y>
<width>121</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Restore settings</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="tab_5">
<attribute name="title">