Merge branch 'master' of http://192.168.10.5:8099/sane/code_production
This commit is contained in:
commit
3f9afc9f0e
Binary file not shown.
|
@ -614,34 +614,33 @@
|
|||
<translation>关闭设备</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_burnmode.cpp" line="97"/>
|
||||
<location filename="form_burnmode.cpp" line="95"/>
|
||||
<source>ID</source>
|
||||
<translation>序号</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_burnmode.cpp" line="97"/>
|
||||
<location filename="form_burnmode.cpp" line="95"/>
|
||||
<source>selected</source>
|
||||
<translation>选择</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_burnmode.cpp" line="97"/>
|
||||
<location filename="form_burnmode.cpp" line="95"/>
|
||||
<source>device</source>
|
||||
<translation>设备</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_burnmode.cpp" line="97"/>
|
||||
<source>serialNum</source>
|
||||
<translation>序列号</translation>
|
||||
<translation type="vanished">序列号</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_burnmode.cpp" line="155"/>
|
||||
<location filename="form_burnmode.cpp" line="341"/>
|
||||
<location filename="form_burnmode.cpp" line="153"/>
|
||||
<location filename="form_burnmode.cpp" line="339"/>
|
||||
<source>tips</source>
|
||||
<translation>提示</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="form_burnmode.cpp" line="155"/>
|
||||
<location filename="form_burnmode.cpp" line="341"/>
|
||||
<location filename="form_burnmode.cpp" line="153"/>
|
||||
<location filename="form_burnmode.cpp" line="339"/>
|
||||
<source>Please check a devices at least</source>
|
||||
<translation>请至少勾选一台设备</translation>
|
||||
</message>
|
||||
|
@ -1003,13 +1002,13 @@
|
|||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="420"/>
|
||||
<source>Are you sure to connect the new device</source>
|
||||
<translation>检测到设备连接,是否启动测试?</translation>
|
||||
<source>Confirm whether the device is reset</source>
|
||||
<oldsource>Are you sure to connect the new device</oldsource>
|
||||
<translation type="unfinished">检测到设备,请先确认是否已经复位</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="422"/>
|
||||
<source>yes</source>
|
||||
<translation>确定</translation>
|
||||
<translation type="vanished">确定</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="423"/>
|
||||
|
@ -1027,6 +1026,11 @@
|
|||
<source>The device has disconnected</source>
|
||||
<translation type="vanished">设备已断开连接</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="422"/>
|
||||
<source>confirm</source>
|
||||
<translation>已复位</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="455"/>
|
||||
<source>Open device failed</source>
|
||||
|
|
|
@ -39,8 +39,6 @@ void Form_BurnMode::addDevice(DeviceManager *devManager)
|
|||
ui->tableWidget->item(m_curIndex, 1)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
ui->tableWidget->setItem(m_curIndex, 2, new QTableWidgetItem(devManager->getDevName()));
|
||||
ui->tableWidget->item(m_curIndex, 2)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
ui->tableWidget->setItem(m_curIndex, 3, new QTableWidgetItem(devManager->getSn()));
|
||||
ui->tableWidget->item(m_curIndex, 3)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
|
||||
QTableWidgetItem *item = ui->tableWidget->item(m_curIndex, 1);
|
||||
QVariant var = QVariant::fromValue((void*)devManager);
|
||||
|
@ -87,14 +85,14 @@ void Form_BurnMode::on_testResult(bool setStatus)
|
|||
void Form_BurnMode::initTableWidget()
|
||||
{
|
||||
ui->tableWidget->resizeRowsToContents();
|
||||
ui->tableWidget->setColumnCount(4);
|
||||
ui->tableWidget->setColumnCount(3);
|
||||
ui->tableWidget->horizontalHeader()->setDefaultSectionSize(200);
|
||||
// ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
ui->tableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
|
||||
ui->tableWidget->horizontalHeader()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
|
||||
|
||||
QStringList header;
|
||||
header<< tr("ID") << tr("selected") << tr("device") << tr("serialNum");
|
||||
header<< tr("ID") << tr("selected") << tr("device");
|
||||
ui->tableWidget->setHorizontalHeaderLabels(header);
|
||||
|
||||
QFont font = ui->tableWidget->horizontalHeader()->font();
|
||||
|
|
|
@ -29,8 +29,10 @@ Form_mainInterface::Form_mainInterface(class MainWindow *mainwnd, Dialog_logIn::
|
|||
, m_devType(devType)
|
||||
, m_devName(devName)
|
||||
, m_devFwNum(devFwNum)
|
||||
, m_curItemName("")
|
||||
, m_isTesting(false)
|
||||
, m_multiIndex(-1)
|
||||
, m_curNameIndex(1)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
|
@ -99,6 +101,7 @@ Form_mainInterface::Form_mainInterface(class MainWindow *mainwnd, Dialog_logIn::
|
|||
Form_mainInterface::~Form_mainInterface()
|
||||
{
|
||||
m_multiIndex = -1;
|
||||
m_curNameIndex = 1;
|
||||
m_list_images.clear();
|
||||
QDir dir(getCachePath());
|
||||
if (dir.exists())
|
||||
|
@ -175,10 +178,10 @@ void Form_mainInterface::on_testResultImg(void *img)
|
|||
{
|
||||
HGImage image = (HGImage)img;
|
||||
|
||||
std::string filename = getStdString(getCacheFileName());
|
||||
HGImgFmt_SaveImage(image, 0, 0, filename.c_str());
|
||||
QString filename = getCacheFileName();
|
||||
HGImgFmt_SaveImage(image, 0, 0, getStdString(filename).c_str());
|
||||
|
||||
m_list_images.push_back(QString::fromStdString(filename));
|
||||
m_list_images.push_back(filename);
|
||||
m_multiIndex = m_list_images.size() - 1;
|
||||
|
||||
ui->stackedWidget->setCurrentWidget(m_view);
|
||||
|
@ -193,7 +196,7 @@ void Form_mainInterface::on_testResultImg(void *img)
|
|||
|
||||
void Form_mainInterface::on_testDistortion(float value)
|
||||
{
|
||||
ui->label_destortionInfo->setText(tr("destortion value: ") + QString::number(value, 'f', 4));
|
||||
ui->label_destortionInfo->setText(tr("destortion value: ") + QString::number(value, 'f'));
|
||||
updateImgPixelInfo();
|
||||
|
||||
updateUiEnabled(true);
|
||||
|
@ -424,15 +427,22 @@ QString Form_mainInterface::getCachePath()
|
|||
QString Form_mainInterface::getCacheFileName()
|
||||
{
|
||||
QString cachePath = getCachePath();
|
||||
HGBase_CreateDir(getStdString(cachePath).c_str());
|
||||
cachePath.append(m_serialNum);
|
||||
cachePath.append("/");
|
||||
cachePath.append(m_curItemName);
|
||||
cachePath.append("/");
|
||||
HGBase_CreateDir(getStdString(getStdFileName(cachePath)).c_str());
|
||||
|
||||
char uuid[256] = {0};
|
||||
HGBase_GetUuid(uuid, 256);
|
||||
QString suffix = ".jpg";
|
||||
QString fileName = getStdFileName(cachePath + uuid + suffix);
|
||||
QString fileName = getStdFileName(cachePath + QString::number(m_curNameIndex++) + suffix);
|
||||
return fileName;
|
||||
}
|
||||
|
||||
QString Form_mainInterface::getCurItemName()
|
||||
{
|
||||
return m_curItemName;
|
||||
}
|
||||
|
||||
void Form_mainInterface::updateUiEnabled(bool enable)
|
||||
{
|
||||
ui->tableWidget->setEnabled(enable);
|
||||
|
@ -528,6 +538,7 @@ void Form_mainInterface::on_tableWidget_currentItemChanged(QTableWidgetItem *cur
|
|||
|
||||
QTableWidgetItem *item2 = ui->tableWidget->item(row, 1);
|
||||
QString title = item2->text();
|
||||
m_curItemName = title;
|
||||
|
||||
if (nullptr == m_handle)
|
||||
{
|
||||
|
@ -552,6 +563,7 @@ void Form_mainInterface::on_tableWidget_currentItemChanged(QTableWidgetItem *cur
|
|||
}
|
||||
|
||||
m_multiIndex = -1;
|
||||
m_curNameIndex = 1;
|
||||
m_list_images.clear();
|
||||
QDir dir(getCachePath());
|
||||
if (dir.exists())
|
||||
|
@ -562,6 +574,7 @@ void Form_mainInterface::on_tableWidget_currentItemChanged(QTableWidgetItem *cur
|
|||
void Form_mainInterface::on_pbtn_start_clicked()
|
||||
{
|
||||
m_multiIndex = -1;
|
||||
m_curNameIndex = 1;
|
||||
m_list_images.clear();
|
||||
QDir dir(getCachePath());
|
||||
if (dir.exists())
|
||||
|
@ -586,32 +599,32 @@ void Form_mainInterface::on_pbtn_start_clicked()
|
|||
|
||||
void Form_mainInterface::on_pbtn_showImg_clicked()
|
||||
{
|
||||
QString fileName = getCacheFileName();
|
||||
// QString fileName = getCacheFileName();
|
||||
|
||||
int row = ui->tableWidget->currentRow();
|
||||
QTableWidgetItem *item = ui->tableWidget->item(row, 1);
|
||||
QString title = item->text();
|
||||
std::string name = m_map_title_name.value(title).name.toStdString();
|
||||
HGResult ret = HGPdtToolDb_DownloadDeviceEntryImage(m_pdtToolDbDevice, name.c_str(), m_mainwnd->m_ftpHost.toStdString().c_str(),
|
||||
m_mainwnd->m_ftpPort, 0, fileName.toStdString().c_str());
|
||||
if(ret == HGBASE_ERR_OK)
|
||||
{
|
||||
m_list_images.push_back(fileName);
|
||||
// int row = ui->tableWidget->currentRow();
|
||||
// QTableWidgetItem *item = ui->tableWidget->item(row, 1);
|
||||
// QString title = item->text();
|
||||
// std::string name = m_map_title_name.value(title).name.toStdString();
|
||||
// HGResult ret = HGPdtToolDb_DownloadDeviceEntryImage(m_pdtToolDbDevice, name.c_str(), m_mainwnd->m_ftpHost.toStdString().c_str(),
|
||||
// m_mainwnd->m_ftpPort, 0, fileName.toStdString().c_str());
|
||||
// if(ret == HGBASE_ERR_OK)
|
||||
// {
|
||||
// m_list_images.push_back(fileName);
|
||||
|
||||
ui->pbtn_leftRotate->setVisible(true);
|
||||
ui->pbtn_rightRotate->setVisible(true);
|
||||
ui->pbtn_prePage->setVisible(true);
|
||||
ui->pbtn_nextPage->setVisible(true);
|
||||
ui->stackedWidget->setCurrentWidget(m_view);
|
||||
HGImage img = nullptr;
|
||||
HGImgFmt_LoadImage(fileName.toStdString().c_str(), 0, 0, 0, 0, &img);
|
||||
m_view->addImage(img);
|
||||
m_multiIndex++;
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::information(this, tr("tips"), tr("no image"));
|
||||
}
|
||||
// ui->pbtn_leftRotate->setVisible(true);
|
||||
// ui->pbtn_rightRotate->setVisible(true);
|
||||
// ui->pbtn_prePage->setVisible(true);
|
||||
// ui->pbtn_nextPage->setVisible(true);
|
||||
// ui->stackedWidget->setCurrentWidget(m_view);
|
||||
// HGImage img = nullptr;
|
||||
// HGImgFmt_LoadImage(fileName.toStdString().c_str(), 0, 0, 0, 0, &img);
|
||||
// m_view->addImage(img);
|
||||
// m_multiIndex++;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// QMessageBox::information(this, tr("tips"), tr("no image"));
|
||||
// }
|
||||
}
|
||||
|
||||
void Form_mainInterface::on_pbtn_leftRotate_clicked()
|
||||
|
@ -631,7 +644,7 @@ void Form_mainInterface::on_pbtn_prePage_clicked()
|
|||
|
||||
HGImage img = nullptr;
|
||||
QString filename = m_list_images.at(m_multiIndex);
|
||||
HGImgFmt_LoadImage(filename.toStdString().c_str(), 0, 0, 0, 0, &img);
|
||||
HGImgFmt_LoadImage(getStdString(filename).c_str(), 0, 0, 0, 0, &img);
|
||||
if (nullptr != img)
|
||||
{
|
||||
m_view->addImage(img);
|
||||
|
@ -645,7 +658,7 @@ void Form_mainInterface::on_pbtn_nextPage_clicked()
|
|||
++m_multiIndex;
|
||||
HGImage img = nullptr;
|
||||
QString filename = m_list_images.at(m_multiIndex);
|
||||
HGImgFmt_LoadImage(filename.toStdString().c_str(), 0, 0, 0, 0, &img);
|
||||
HGImgFmt_LoadImage(getStdString(filename).c_str(), 0, 0, 0, 0, &img);
|
||||
if (nullptr != img)
|
||||
{
|
||||
m_view->addImage(img);
|
||||
|
|
|
@ -79,6 +79,7 @@ private:
|
|||
QString getItemStatusStr(HGUInt status);
|
||||
QString getCachePath();
|
||||
QString getCacheFileName();
|
||||
QString getCurItemName();
|
||||
void updateUiEnabled(bool enable);
|
||||
void updateImgPixelInfo();
|
||||
QString getSpeedMode(SANE_Int speedMode);
|
||||
|
@ -114,8 +115,10 @@ private:
|
|||
QString m_devType;
|
||||
QString m_devName;
|
||||
QString m_devFwNum;
|
||||
QString m_curItemName;
|
||||
bool m_isTesting;
|
||||
int m_multiIndex;
|
||||
int m_curNameIndex;
|
||||
QStringList m_list_images;
|
||||
|
||||
QMap<QString, AnalysisJson::json_node> m_map_title_name;
|
||||
|
|
|
@ -417,9 +417,9 @@ void MainWindow::on_sane_dev_arrive(QString devName)
|
|||
else
|
||||
{
|
||||
QMessageBox msg(QMessageBox::Question, tr("tips"),
|
||||
tr("Are you sure to connect the new device"),
|
||||
tr("Confirm whether the device is reset"),
|
||||
QMessageBox::Yes | QMessageBox::No, this);
|
||||
msg.setButtonText(QMessageBox::Yes, tr("yes"));
|
||||
msg.setButtonText(QMessageBox::Yes, tr("confirm"));
|
||||
msg.setButtonText(QMessageBox::No, tr("no"));
|
||||
msg.exec();
|
||||
if (msg.clickedButton() == msg.button(QMessageBox::Yes))
|
||||
|
|
Loading…
Reference in New Issue