屏蔽烧录模式的sane接口调用
This commit is contained in:
parent
51ee1076aa
commit
01c71678d7
Binary file not shown.
|
@ -614,17 +614,17 @@
|
|||
<translation>关闭设备</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_burnmode.cpp" line="95"/>
|
||||
<location filename="form_burnmode.cpp" line="89"/>
|
||||
<source>ID</source>
|
||||
<translation>序号</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_burnmode.cpp" line="95"/>
|
||||
<location filename="form_burnmode.cpp" line="89"/>
|
||||
<source>selected</source>
|
||||
<translation>选择</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_burnmode.cpp" line="95"/>
|
||||
<location filename="form_burnmode.cpp" line="89"/>
|
||||
<source>device</source>
|
||||
<translation>设备</translation>
|
||||
</message>
|
||||
|
@ -633,14 +633,14 @@
|
|||
<translation type="vanished">序列号</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_burnmode.cpp" line="153"/>
|
||||
<location filename="form_burnmode.cpp" line="339"/>
|
||||
<location filename="form_burnmode.cpp" line="147"/>
|
||||
<location filename="form_burnmode.cpp" line="324"/>
|
||||
<source>tips</source>
|
||||
<translation>提示</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_burnmode.cpp" line="153"/>
|
||||
<location filename="form_burnmode.cpp" line="339"/>
|
||||
<location filename="form_burnmode.cpp" line="147"/>
|
||||
<location filename="form_burnmode.cpp" line="324"/>
|
||||
<source>Please check a devices at least</source>
|
||||
<translation>请至少勾选一台设备</translation>
|
||||
</message>
|
||||
|
@ -741,28 +741,28 @@
|
|||
<translation>下一步</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="55"/>
|
||||
<location filename="form_maininterface.cpp" line="57"/>
|
||||
<source>Device has connected</source>
|
||||
<translation>设备已连接</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="59"/>
|
||||
<location filename="form_maininterface.cpp" line="61"/>
|
||||
<source>Device hasnot connected</source>
|
||||
<translation>设备未连接</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="60"/>
|
||||
<location filename="form_maininterface.cpp" line="62"/>
|
||||
<source>Device type:</source>
|
||||
<translation>设备型号:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="60"/>
|
||||
<location filename="form_maininterface.cpp" line="62"/>
|
||||
<source> SerialNum:</source>
|
||||
<translation> 序列号:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="61"/>
|
||||
<location filename="form_maininterface.cpp" line="146"/>
|
||||
<location filename="form_maininterface.cpp" line="63"/>
|
||||
<location filename="form_maininterface.cpp" line="149"/>
|
||||
<source> connect status:</source>
|
||||
<translation> 设备连接状态:</translation>
|
||||
</message>
|
||||
|
@ -775,23 +775,22 @@
|
|||
<translation type="vanished"> 休眠时间: </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="85"/>
|
||||
<location filename="form_maininterface.cpp" line="87"/>
|
||||
<source>load last image which uploaded last time</source>
|
||||
<translation>加载上一次上传的图片</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="145"/>
|
||||
<location filename="form_maininterface.cpp" line="148"/>
|
||||
<source>Device has disconnected</source>
|
||||
<translation>设备已断开</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="162"/>
|
||||
<location filename="form_maininterface.cpp" line="613"/>
|
||||
<location filename="form_maininterface.cpp" line="165"/>
|
||||
<source>tips</source>
|
||||
<translation>提示</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="196"/>
|
||||
<location filename="form_maininterface.cpp" line="209"/>
|
||||
<source>destortion value: </source>
|
||||
<translation>畸变修正值: </translation>
|
||||
</message>
|
||||
|
@ -804,74 +803,74 @@
|
|||
<translation type="vanished">取消</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="66"/>
|
||||
<location filename="form_maininterface.cpp" line="68"/>
|
||||
<source> speed mode:</source>
|
||||
<translation> 目标配置: 速度模式:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="71"/>
|
||||
<location filename="form_maininterface.cpp" line="73"/>
|
||||
<source> sleep time:</source>
|
||||
<translation> 休眠时间:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="329"/>
|
||||
<location filename="form_maininterface.cpp" line="343"/>
|
||||
<source>ID</source>
|
||||
<translation>序号</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="329"/>
|
||||
<location filename="form_maininterface.cpp" line="343"/>
|
||||
<source>Test items</source>
|
||||
<translation>测试项</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="329"/>
|
||||
<location filename="form_maininterface.cpp" line="343"/>
|
||||
<source>status</source>
|
||||
<translation>测试状态</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="411"/>
|
||||
<location filename="form_maininterface.cpp" line="425"/>
|
||||
<source>not test</source>
|
||||
<translation>未测试</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="411"/>
|
||||
<location filename="form_maininterface.cpp" line="425"/>
|
||||
<source>not pass</source>
|
||||
<translation>不通过</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="411"/>
|
||||
<location filename="form_maininterface.cpp" line="425"/>
|
||||
<source>not support</source>
|
||||
<translation>不支持</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="411"/>
|
||||
<location filename="form_maininterface.cpp" line="425"/>
|
||||
<source>pass</source>
|
||||
<translation>通过</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="466"/>
|
||||
<location filename="form_maininterface.cpp" line="208"/>
|
||||
<location filename="form_maininterface.cpp" line="490"/>
|
||||
<source>image pixel: </source>
|
||||
<translation>标准圆宽高: </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="495"/>
|
||||
<location filename="form_maininterface.cpp" line="519"/>
|
||||
<source> minute</source>
|
||||
<translation> 分钟</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="511"/>
|
||||
<location filename="form_maininterface.cpp" line="535"/>
|
||||
<source> VID:</source>
|
||||
<translation> VID:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="511"/>
|
||||
<location filename="form_maininterface.cpp" line="535"/>
|
||||
<source> PID:</source>
|
||||
<translation> PID:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_maininterface.cpp" line="613"/>
|
||||
<source>no image</source>
|
||||
<translation>无图</translation>
|
||||
<translation type="vanished">无图</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -960,7 +959,6 @@
|
|||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="309"/>
|
||||
<location filename="mainwindow.cpp" line="419"/>
|
||||
<location filename="mainwindow.cpp" line="441"/>
|
||||
<location filename="mainwindow.cpp" line="455"/>
|
||||
<location filename="mainwindow.cpp" line="511"/>
|
||||
|
@ -1000,11 +998,16 @@
|
|||
<source>Is testing, do not close!</source>
|
||||
<translation>测试中,请勿关闭!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="419"/>
|
||||
<source>warning</source>
|
||||
<translation>警告</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="420"/>
|
||||
<source>Confirm whether the device is reset</source>
|
||||
<oldsource>Are you sure to connect the new device</oldsource>
|
||||
<translation>检测到设备,请先确认是否已经复位</translation>
|
||||
<translation>检测到设备,请先确认是否已经复位,否则有可能导致获取序列号失败!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>yes</source>
|
||||
|
|
|
@ -45,12 +45,6 @@ void Form_BurnMode::addDevice(DeviceManager *devManager)
|
|||
item->setData(Qt::UserRole, var);
|
||||
|
||||
updatetablewidget();
|
||||
// for(int i = 0; i < ui->tableWidget->rowCount(); i++)
|
||||
// {
|
||||
// QTableWidgetItem *item = ui->tableWidget->item(i, 3);
|
||||
// if (item != nullptr)
|
||||
// item->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled);
|
||||
// }
|
||||
|
||||
m_curIndex++;
|
||||
}
|
||||
|
@ -209,16 +203,12 @@ void Form_BurnMode::on_pbtn_burn_clicked()
|
|||
// }
|
||||
//}
|
||||
|
||||
DeviceManager::DeviceManager(class MainWindow *mainwnd, HGPdtToolDbUserMgr pdtToolDbuserMgr, class Form_BurnMode *burnMode,
|
||||
SANE_Handle handle, const QString & devName, const QString & sn, const QString &devType)
|
||||
DeviceManager::DeviceManager(class MainWindow *mainwnd, class Form_BurnMode *burnMode, SANE_Handle handle, const QString & devName)
|
||||
{
|
||||
m_mainwnd = mainwnd;
|
||||
m_pdtToolDbuserMgr = pdtToolDbuserMgr;
|
||||
m_burnMode = burnMode;
|
||||
m_handle = handle;
|
||||
m_devName = devName;
|
||||
m_sn = sn;
|
||||
m_devType = devType;
|
||||
|
||||
m_hg = new hgscanner(nullptr, m_burnMode, nullptr, m_handle);
|
||||
}
|
||||
|
@ -236,11 +226,6 @@ QString DeviceManager::getDevName()
|
|||
return m_devName;
|
||||
}
|
||||
|
||||
QString DeviceManager::getSn()
|
||||
{
|
||||
return m_sn;
|
||||
}
|
||||
|
||||
void DeviceManager::setBurnMode()
|
||||
{
|
||||
const wchar_t *p = L"1";
|
||||
|
@ -249,65 +234,65 @@ void DeviceManager::setBurnMode()
|
|||
|
||||
}
|
||||
|
||||
void DeviceManager::setSn(QString sn)
|
||||
{
|
||||
LPWRITECFG p = new WRITECFG;
|
||||
//void DeviceManager::setSn(QString sn)
|
||||
//{
|
||||
// LPWRITECFG p = new WRITECFG;
|
||||
|
||||
std::wstring sn2 = sn.toStdWString();
|
||||
p->cat = WRITE_CAT_SERIALNUM;
|
||||
p->val = (void*)sn2.c_str();
|
||||
m_mainwnd->addTestingRef();
|
||||
func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg);
|
||||
// std::wstring sn2 = sn.toStdWString();
|
||||
// p->cat = WRITE_CAT_SERIALNUM;
|
||||
// p->val = (void*)sn2.c_str();
|
||||
// m_mainwnd->addTestingRef();
|
||||
// func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg);
|
||||
|
||||
setGlobalCfg();
|
||||
// setGlobalCfg();
|
||||
|
||||
delete p;
|
||||
}
|
||||
// delete p;
|
||||
//}
|
||||
|
||||
QString DeviceManager::getUpdatedSn()
|
||||
{
|
||||
return m_mainwnd->getDevSn(m_handle);
|
||||
}
|
||||
//QString DeviceManager::getUpdatedSn()
|
||||
//{
|
||||
// return m_mainwnd->getDevSn(m_handle);
|
||||
//}
|
||||
|
||||
void DeviceManager::setGlobalCfg()
|
||||
{
|
||||
HGChar cfgPath[512] = {0};
|
||||
HGBase_GetConfigPath(cfgPath, 512);
|
||||
HGBase_CreateDir(cfgPath);
|
||||
strcat(cfgPath, m_devType.toStdString().c_str());
|
||||
strcat(cfgPath, ".json");
|
||||
//void DeviceManager::setGlobalCfg()
|
||||
//{
|
||||
// HGChar cfgPath[512] = {0};
|
||||
// HGBase_GetConfigPath(cfgPath, 512);
|
||||
// HGBase_CreateDir(cfgPath);
|
||||
// strcat(cfgPath, m_devType.toStdString().c_str());
|
||||
// strcat(cfgPath, ".json");
|
||||
|
||||
HGPdtToolDb_DownloadFile(m_pdtToolDbuserMgr, m_devType.toStdString().c_str(), cfgPath);
|
||||
// HGPdtToolDb_DownloadFile(m_pdtToolDbuserMgr, m_devType.toStdString().c_str(), cfgPath);
|
||||
|
||||
AnalysisJson analysisJson(QString::fromStdString(cfgPath));
|
||||
// AnalysisJson analysisJson(QString::fromStdString(cfgPath));
|
||||
|
||||
assert(nullptr != m_hg);
|
||||
AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal();
|
||||
LPWRITECFG lp = new WRITECFG;
|
||||
// assert(nullptr != m_hg);
|
||||
// AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal();
|
||||
// LPWRITECFG lp = new WRITECFG;
|
||||
|
||||
VIDPID vidpid;
|
||||
vidpid.VID = jsonGlobal.vid_to;
|
||||
vidpid.PID = jsonGlobal.pid_to;
|
||||
int vidpidValue = vidpid.Value;
|
||||
lp->cat = WRITE_CAT_VID_PID;
|
||||
lp->val = (void*)&vidpidValue;
|
||||
m_mainwnd->addTestingRef();
|
||||
func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg);
|
||||
// VIDPID vidpid;
|
||||
// vidpid.VID = jsonGlobal.vid_to;
|
||||
// vidpid.PID = jsonGlobal.pid_to;
|
||||
// int vidpidValue = vidpid.Value;
|
||||
// lp->cat = WRITE_CAT_VID_PID;
|
||||
// lp->val = (void*)&vidpidValue;
|
||||
// m_mainwnd->addTestingRef();
|
||||
// func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg);
|
||||
|
||||
int speedMode = jsonGlobal.speed_mode ;
|
||||
lp->cat = WRITE_CAT_SPEED;
|
||||
lp->val = (void*)&speedMode;
|
||||
m_mainwnd->addTestingRef();
|
||||
func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg);
|
||||
// int speedMode = jsonGlobal.speed_mode ;
|
||||
// lp->cat = WRITE_CAT_SPEED;
|
||||
// lp->val = (void*)&speedMode;
|
||||
// m_mainwnd->addTestingRef();
|
||||
// func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg);
|
||||
|
||||
int sleepTime = jsonGlobal.sleep_time;
|
||||
lp->cat = WRITE_CAT_SLEEP;
|
||||
lp->val = (void*)&sleepTime;
|
||||
m_mainwnd->addTestingRef();
|
||||
func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg);
|
||||
// int sleepTime = jsonGlobal.sleep_time;
|
||||
// lp->cat = WRITE_CAT_SLEEP;
|
||||
// lp->val = (void*)&sleepTime;
|
||||
// m_mainwnd->addTestingRef();
|
||||
// func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg);
|
||||
|
||||
delete lp;
|
||||
}
|
||||
// delete lp;
|
||||
//}
|
||||
|
||||
void Form_BurnMode::on_tableWidget_itemDoubleClicked(QTableWidgetItem *item)
|
||||
{
|
||||
|
|
|
@ -14,17 +14,15 @@ class Form_BurnMode;
|
|||
class DeviceManager
|
||||
{
|
||||
public:
|
||||
DeviceManager(class MainWindow *mainwnd, HGPdtToolDbUserMgr pdtToolDbuserMgr, class Form_BurnMode *burnMode,
|
||||
SANE_Handle handle, const QString &devName, const QString &sn, const QString &devType);
|
||||
DeviceManager(class MainWindow *mainwnd, class Form_BurnMode *burnMode, SANE_Handle handle, const QString &devName);
|
||||
~DeviceManager();
|
||||
|
||||
QString getDevName();
|
||||
QString getSn();
|
||||
void setBurnMode();
|
||||
void setSn(QString sn);
|
||||
QString getUpdatedSn();
|
||||
// void setSn(QString sn);
|
||||
// QString getUpdatedSn();
|
||||
SANE_Handle m_handle;
|
||||
void setGlobalCfg();
|
||||
// void setGlobalCfg();
|
||||
|
||||
private:
|
||||
union VIDPID
|
||||
|
@ -39,11 +37,8 @@ private:
|
|||
|
||||
private:
|
||||
class MainWindow *m_mainwnd;
|
||||
HGPdtToolDbUserMgr m_pdtToolDbuserMgr;
|
||||
class Form_BurnMode *m_burnMode;
|
||||
QString m_devName;
|
||||
QString m_sn;
|
||||
QString m_devType;
|
||||
hgscanner *m_hg;
|
||||
};
|
||||
|
||||
|
|
|
@ -410,13 +410,13 @@ void MainWindow::on_sane_dev_arrive(QString devName)
|
|||
sane_open(devName.toStdString().c_str(), &devHandle);
|
||||
if (nullptr != devHandle)
|
||||
{
|
||||
DeviceManager *devManager = new DeviceManager(this, m_pdtToolDbuserMgr, m_formBurnMode, devHandle, devName, getDevSn(devHandle), getDevType(devHandle));
|
||||
DeviceManager *devManager = new DeviceManager(this, m_formBurnMode, devHandle, devName);
|
||||
m_formBurnMode->addDevice(devManager);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox msg(QMessageBox::Question, tr("tips"),
|
||||
QMessageBox msg(QMessageBox::Warning, tr("warning"),
|
||||
tr("Confirm whether the device is reset"),
|
||||
QMessageBox::Yes | QMessageBox::No, this);
|
||||
msg.setButtonText(QMessageBox::Yes, tr("confirm"));
|
||||
|
|
Loading…
Reference in New Issue