生产工具在序列号确认项里增加读取电机版本号

This commit is contained in:
yangjiaxuan 2024-08-23 16:58:41 +08:00
parent c231cc8913
commit bea6dff192
4 changed files with 48 additions and 30 deletions

View File

@ -707,68 +707,67 @@ Pid: %2</translation>
<context> <context>
<name>Dialog_logIn</name> <name>Dialog_logIn</name>
<message> <message>
<location filename="dialog_login.ui" line="26"/> <location filename="dialog_login.ui" line="14"/>
<source>Dialog</source> <source>Dialog</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="dialog_login.ui" line="36"/>
<source>Login</source> <source>Login</source>
<translation></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="dialog_login.ui" line="48"/> <location filename="dialog_login.ui" line="170"/>
<source>station1</source> <source>station1</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="dialog_login.ui" line="64"/> <location filename="dialog_login.ui" line="108"/>
<source>station2</source> <source>station2</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="dialog_login.ui" line="77"/> <location filename="dialog_login.ui" line="36"/>
<source>station3</source> <source>station3</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="dialog_login.ui" line="158"/> <location filename="dialog_login.ui" line="131"/>
<source>account:</source> <source>account:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="dialog_login.ui" line="181"/> <location filename="dialog_login.ui" line="157"/>
<source>password:</source> <source>password:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="dialog_login.ui" line="194"/> <location filename="dialog_login.ui" line="144"/>
<source>device type:</source> <source>device type:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="dialog_login.ui" line="217"/> <location filename="dialog_login.ui" line="82"/>
<source>device config:</source> <source>device config:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="dialog_login.ui" line="240"/> <location filename="dialog_login.ui" line="186"/>
<source>view directory</source> <source>view directory</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="dialog_login.ui" line="253"/> <location filename="dialog_login.ui" line="212"/>
<source>update connfig</source> <source>update connfig</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="dialog_login.ui" line="145"/> <location filename="dialog_login.ui" line="199"/>
<source>remember password</source> <source>remember password</source>
<oldsource>Show password</oldsource> <oldsource>Show password</oldsource>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="dialog_login.ui" line="122"/> <location filename="dialog_login.ui" line="49"/>
<source>show password</source> <source>show password</source>
<translation></translation> <translation></translation>
</message> </message>
@ -817,7 +816,7 @@ Pid: %2</translation>
<translation type="vanished"></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="dialog_login.ui" line="109"/> <location filename="dialog_login.ui" line="95"/>
<source>Register</source> <source>Register</source>
<translation></translation> <translation></translation>
</message> </message>
@ -838,7 +837,7 @@ Pid: %2</translation>
<translation type="vanished"></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="dialog_login.ui" line="90"/> <location filename="dialog_login.ui" line="225"/>
<source>LOG IN</source> <source>LOG IN</source>
<translation></translation> <translation></translation>
</message> </message>
@ -1509,10 +1508,15 @@ Pid: %2</translation>
<translation>%1</translation> <translation>%1</translation>
</message> </message>
<message> <message>
<location filename="form_maininterface.cpp" line="1035"/> <location filename="form_maininterface.cpp" line="948"/>
<source>device serial number:</source> <source>device serial number:</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<location filename="form_maininterface.cpp" line="951"/>
<source>Motor version:</source>
<translation></translation>
</message>
<message> <message>
<source>Serial number: %1, Test item: %2, Test result: Failed! Reason: %3</source> <source>Serial number: %1, Test item: %2, Test result: Failed! Reason: %3</source>
<oldsource>Serial number: %1, Test item: %2, Test result: Failed! Reason: %3</oldsource> <oldsource>Serial number: %1, Test item: %2, Test result: Failed! Reason: %3</oldsource>
@ -1524,16 +1528,16 @@ Pid: %2</translation>
<translation type="vanished">: %1, : %2, 测试结果: 通过!</translation> <translation type="vanished">: %1, : %2, 测试结果: 通过!</translation>
</message> </message>
<message> <message>
<location filename="form_maininterface.cpp" line="913"/> <location filename="form_maininterface.cpp" line="925"/>
<location filename="form_maininterface.cpp" line="1029"/> <location filename="form_maininterface.cpp" line="1049"/>
<source>device history scan count:</source> <source>device history scan count:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="form_maininterface.cpp" line="789"/>
<location filename="form_maininterface.cpp" line="793"/>
<location filename="form_maininterface.cpp" line="797"/>
<location filename="form_maininterface.cpp" line="801"/> <location filename="form_maininterface.cpp" line="801"/>
<location filename="form_maininterface.cpp" line="805"/>
<location filename="form_maininterface.cpp" line="809"/>
<location filename="form_maininterface.cpp" line="813"/>
<source>Prompt</source> <source>Prompt</source>
<translation></translation> <translation></translation>
</message> </message>
@ -1565,22 +1569,22 @@ Pid: %2</translation>
<translation>: %1, : %2, 测试结果: 通过!</translation> <translation>: %1, : %2, 测试结果: 通过!</translation>
</message> </message>
<message> <message>
<location filename="form_maininterface.cpp" line="789"/> <location filename="form_maininterface.cpp" line="801"/>
<source>No paper</source> <source>No paper</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="form_maininterface.cpp" line="793"/> <location filename="form_maininterface.cpp" line="805"/>
<source>Device is sleeping</source> <source>Device is sleeping</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="form_maininterface.cpp" line="797"/> <location filename="form_maininterface.cpp" line="809"/>
<source>Counting mode</source> <source>Counting mode</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="form_maininterface.cpp" line="801"/> <location filename="form_maininterface.cpp" line="813"/>
<source>Other error</source> <source>Other error</source>
<translation></translation> <translation></translation>
</message> </message>
@ -1689,8 +1693,8 @@ Pid: %2</translation>
<translation type="vanished">Pid</translation> <translation type="vanished">Pid</translation>
</message> </message>
<message> <message>
<location filename="form_maininterface.cpp" line="907"/> <location filename="form_maininterface.cpp" line="919"/>
<location filename="form_maininterface.cpp" line="1023"/> <location filename="form_maininterface.cpp" line="1043"/>
<source>device roller count:</source> <source>device roller count:</source>
<translation></translation> <translation></translation>
</message> </message>

View File

@ -760,6 +760,18 @@ QString Form_mainInterface::getDevSn()
return QString::fromStdString(serialNum.c_str()); return QString::fromStdString(serialNum.c_str());
} }
QString Form_mainInterface::getDevMotorVersion()
{
std::string motorNum;
unsigned int motorNumLen = 0;
if(SANE_STATUS_NO_MEM == sane_io_control(m_handle, IO_CTRL_CODE_GET_MOTOR_VERSION, nullptr, &motorNumLen) && motorNumLen)
{
motorNum.resize(motorNumLen);
sane_io_control(m_handle, IO_CTRL_CODE_GET_MOTOR_VERSION, &motorNum[0], &motorNumLen);
}
return QString::fromStdString(motorNum.c_str());
}
int Form_mainInterface::getRollerNum() int Form_mainInterface::getRollerNum()
{ {
SANE_Int rollCount = 0; SANE_Int rollCount = 0;
@ -933,8 +945,9 @@ void Form_mainInterface::on_tableWidget_currentItemChanged(QTableWidgetItem *cur
} }
if (name.toStdWString() == HGPDTTOOLDB_NAME_GET_SN) if (name.toStdWString() == HGPDTTOOLDB_NAME_GET_SN)
{ {
QString str(tr("device serial number:") + getDevSn()); QString snStr(tr("device serial number:") + getDevSn());
m_textTips->setViewContent(str); QString motorStr =(tr("Motor version:") + getDevMotorVersion());
m_textTips->setViewContent(snStr + "\n\n" + motorStr);
} }
} }
} }

View File

@ -98,6 +98,7 @@ private:
QString getDevVid(); QString getDevVid();
QString getDevPid(); QString getDevPid();
QString getDevSn(); QString getDevSn();
QString getDevMotorVersion();
int getRollerNum(); int getRollerNum();
int getHistoryCount(); int getHistoryCount();
void getLogInfo(int ret); void getLogInfo(int ret);