微调界面和翻译,暂时json不生成分辨率等特殊key值

This commit is contained in:
yangjiaxuan 2024-03-05 15:24:42 +08:00
parent 416d5d5262
commit 632607bdf5
6 changed files with 136 additions and 66 deletions

View File

@ -19,6 +19,47 @@ TARGET = HGPdtJsonTool
RC_ICONS = image_rsc/logo/logo.ico RC_ICONS = image_rsc/logo/logo.ico
CONFIG(debug, debug|release) {
MY_CONFIGURE = Debug
}
CONFIG(release, debug|release) {
MY_CONFIGURE = Release
}
MY_OS = windows
OEM_NAME = huagao
OEM_PREFIX = HG
win32 {
contains(QT_ARCH, i386) {
MY_ARCH = x86
}
contains(QT_ARCH, x86_64) {
MY_ARCH = x64
}
}
DESTDIR = $$PWD/../../../code_app/build2/build/$${MY_OS}/$${OEM_NAME}/$${MY_ARCH}/$${MY_CONFIGURE}
win32 {
CONFIG(release, debug|release) {
DESTEXE_PATH = $${PWD}/../../../release/win/$${MY_ARCH}/$${MY_CONFIGURE}/
DESTEXE_PATH = $$replace(DESTEXE_PATH, /, \\)
message(DESTEXE_PATH: $$DESTEXE_PATH)
SRCEXE_FILE = $${DESTDIR}/$${TARGET}.exe
SRCEXE_FILE = $$replace(SRCEXE_FILE, /, \\)
message(SRCEXE_FILE: $$SRCEXE_FILE)
SRCPDB_FILE = $${DESTDIR}/$${TARGET}.pdb
SRCPDB_FILE = $$replace(SRCPDB_FILE, /, \\)
message(SRCPDB_FILE: $$SRCPDB_FILE)
QMAKE_POST_LINK += xcopy /y $$SRCEXE_FILE $$DESTEXE_PATH && xcopy /y $$SRCPDB_FILE $$DESTEXE_PATH
}
}
SOURCES += \ SOURCES += \
main.cpp \ main.cpp \
mainwindow.cpp \ mainwindow.cpp \
@ -39,8 +80,3 @@ TRANSLATIONS += \
DISTFILES += \ DISTFILES += \
HGPdtJsonTool_zh_CN.qm HGPdtJsonTool_zh_CN.qm
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

View File

@ -101,7 +101,7 @@
<message> <message>
<location filename="mainwindow.ui" line="421"/> <location filename="mainwindow.ui" line="421"/>
<source>Delete</source> <source>Delete</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.ui" line="434"/> <location filename="mainwindow.ui" line="434"/>
@ -229,7 +229,7 @@
<message> <message>
<location filename="mainwindow.cpp" line="52"/> <location filename="mainwindow.cpp" line="52"/>
<source>Fill in hexadecimal format, such as &apos;0xFFFF&apos;</source> <source>Fill in hexadecimal format, such as &apos;0xFFFF&apos;</source>
<translation>160xFFFF</translation> <translation>0xFFFF</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="66"/> <location filename="mainwindow.cpp" line="66"/>

View File

@ -52,6 +52,8 @@ void MainWindow::initDeviceInfo()
QString prompt(tr("Fill in hexadecimal format, such as '0xFFFF'")); QString prompt(tr("Fill in hexadecimal format, such as '0xFFFF'"));
ui->lineEdit_vid->setToolTip(prompt); ui->lineEdit_vid->setToolTip(prompt);
ui->lineEdit_pid->setToolTip(prompt); ui->lineEdit_pid->setToolTip(prompt);
ui->lineEdit_vid->setPlaceholderText(prompt);
ui->lineEdit_pid->setPlaceholderText(prompt);
} }
void MainWindow::initTableWidgetUi() void MainWindow::initTableWidgetUi()
@ -108,11 +110,13 @@ void MainWindow::on_pushButton_generate_clicked()
globalObject.insert("pid-to", ui->lineEdit_pid->text().toInt(&ok, 16)); globalObject.insert("pid-to", ui->lineEdit_pid->text().toInt(&ok, 16));
globalObject.insert("sleep-time", sleepTime[ui->comboBox_sleepTime->currentIndex()]); globalObject.insert("sleep-time", sleepTime[ui->comboBox_sleepTime->currentIndex()]);
globalObject.insert("speed-mode", ui->comboBox_speedMode->currentText().toInt()); globalObject.insert("speed-mode", ui->comboBox_speedMode->currentText().toInt());
globalObject.insert("device-model", ui->lineEdit_deviceModle->text());
globalObject.insert("cpu-size", ui->lineEdit_cpuSize->text().toInt()); globalObject.insert("cpu-size", ui->lineEdit_cpuSize->text().toInt());
globalObject.insert("disk-size", ui->lineEdit_diskSize->text().toInt()); globalObject.insert("disk-size", ui->lineEdit_diskSize->text().toInt());
globalObject.insert("firmware-version", ui->lineEdit_fwVersion->text());
globalObject.insert("lock-device", ui->comboBox_lockDevice->currentIndex() == 0 ? false : true); globalObject.insert("lock-device", ui->comboBox_lockDevice->currentIndex() == 0 ? false : true);
if (!ui->lineEdit_deviceModle->text().isEmpty())
globalObject.insert("device-model", ui->lineEdit_deviceModle->text());
if (!ui->lineEdit_fwVersion->text().isEmpty())
globalObject.insert("firmware-version", ui->lineEdit_fwVersion->text());
QJsonObject json; QJsonObject json;
json.insert("global", QJsonValue(globalObject)); json.insert("global", QJsonValue(globalObject));
@ -133,6 +137,9 @@ void MainWindow::on_pushButton_generate_clicked()
doc.setObject(json); doc.setObject(json);
QString fileName = QFileDialog::getSaveFileName(this, tr("Select profile path"), "", tr("Json(*.json)")); QString fileName = QFileDialog::getSaveFileName(this, tr("Select profile path"), "", tr("Json(*.json)"));
if (fileName.isEmpty())
return;
if (!fileName.endsWith(".json")) if (!fileName.endsWith(".json"))
fileName.append(".json"); fileName.append(".json");
@ -264,7 +271,7 @@ void MainWindow::on_pushButton_import_clicked()
ui->tableWidget->setItem(i, 4, new QTableWidgetItem(node.station)); ui->tableWidget->setItem(i, 4, new QTableWidgetItem(node.station));
ui->tableWidget->item(i, 4)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter); ui->tableWidget->item(i, 4)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
ui->tableWidget->setItem(i, 5, new QTableWidgetItem(node.is_man ? tr("automatic testing") : tr("Manual testing"))); ui->tableWidget->setItem(i, 5, new QTableWidgetItem(node.is_man ? tr("Manual testing") : tr("automatic testing")));
ui->tableWidget->item(i, 5)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter); ui->tableWidget->item(i, 5)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
ui->tableWidget->setItem(i, 6, new QTableWidgetItem(node.desc)); ui->tableWidget->setItem(i, 6, new QTableWidgetItem(node.desc));
@ -284,7 +291,10 @@ void MainWindow::on_pushButton_delete_clicked()
if (item != nullptr) if (item != nullptr)
{ {
if (item->checkState() == Qt::Checked) if (item->checkState() == Qt::Checked)
ui->tableWidget->removeRow(i); {
ui->tableWidget->removeRow(item->row());
i = 0;
}
} }
} }
updateTableWidget(); updateTableWidget();

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>965</width> <width>988</width>
<height>752</height> <height>758</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -17,7 +17,7 @@
<widget class="QLineEdit" name="lineEdit_pid"> <widget class="QLineEdit" name="lineEdit_pid">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>720</x> <x>740</x>
<y>30</y> <y>30</y>
<width>161</width> <width>161</width>
<height>20</height> <height>20</height>
@ -37,9 +37,9 @@
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>680</x> <x>690</x>
<y>30</y> <y>30</y>
<width>51</width> <width>41</width>
<height>21</height> <height>21</height>
</rect> </rect>
</property> </property>
@ -83,7 +83,7 @@
<widget class="QLabel" name="label_15"> <widget class="QLabel" name="label_15">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>20</x> <x>50</x>
<y>140</y> <y>140</y>
<width>101</width> <width>101</width>
<height>21</height> <height>21</height>
@ -96,9 +96,9 @@
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>360</x> <x>400</x>
<y>30</y> <y>30</y>
<width>54</width> <width>41</width>
<height>21</height> <height>21</height>
</rect> </rect>
</property> </property>
@ -122,7 +122,7 @@
<widget class="QLineEdit" name="lineEdit_deviceModle"> <widget class="QLineEdit" name="lineEdit_deviceModle">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>720</x> <x>740</x>
<y>90</y> <y>90</y>
<width>161</width> <width>161</width>
<height>20</height> <height>20</height>
@ -132,9 +132,9 @@
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="label_6">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>630</x> <x>660</x>
<y>90</y> <y>90</y>
<width>91</width> <width>81</width>
<height>16</height> <height>16</height>
</rect> </rect>
</property> </property>
@ -145,10 +145,10 @@
<widget class="QLabel" name="label_7"> <widget class="QLabel" name="label_7">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>340</x>
<y>140</y> <y>140</y>
<width>81</width> <width>91</width>
<height>16</height> <height>20</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
@ -158,7 +158,7 @@
<widget class="QLineEdit" name="lineEdit_cpuSize"> <widget class="QLineEdit" name="lineEdit_cpuSize">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>720</x> <x>740</x>
<y>140</y> <y>140</y>
<width>161</width> <width>161</width>
<height>20</height> <height>20</height>
@ -168,7 +168,7 @@
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>30</x> <x>20</x>
<y>90</y> <y>90</y>
<width>101</width> <width>101</width>
<height>21</height> <height>21</height>
@ -191,10 +191,10 @@
<widget class="QLabel" name="label_5"> <widget class="QLabel" name="label_5">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>370</x>
<y>90</y> <y>90</y>
<width>81</width> <width>71</width>
<height>16</height> <height>21</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
@ -216,8 +216,8 @@
<rect> <rect>
<x>640</x> <x>640</x>
<y>140</y> <y>140</y>
<width>71</width> <width>91</width>
<height>16</height> <height>20</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
@ -247,10 +247,10 @@
<widget class="QLabel" name="label_9"> <widget class="QLabel" name="label_9">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>50</x> <x>60</x>
<y>190</y> <y>190</y>
<width>71</width> <width>71</width>
<height>16</height> <height>21</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
@ -260,10 +260,10 @@
<widget class="QLabel" name="label_10"> <widget class="QLabel" name="label_10">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>360</x>
<y>190</y> <y>190</y>
<width>71</width> <width>71</width>
<height>16</height> <height>21</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
@ -283,7 +283,7 @@
<widget class="QLabel" name="label_11"> <widget class="QLabel" name="label_11">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>640</x> <x>660</x>
<y>190</y> <y>190</y>
<width>71</width> <width>71</width>
<height>16</height> <height>16</height>
@ -296,7 +296,7 @@
<widget class="QLineEdit" name="lineEdit_testItem"> <widget class="QLineEdit" name="lineEdit_testItem">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>720</x> <x>740</x>
<y>190</y> <y>190</y>
<width>161</width> <width>161</width>
<height>20</height> <height>20</height>
@ -329,10 +329,10 @@
<widget class="QLabel" name="label_13"> <widget class="QLabel" name="label_13">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>360</x>
<y>250</y> <y>250</y>
<width>71</width> <width>71</width>
<height>16</height> <height>21</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
@ -365,7 +365,7 @@
<widget class="QLabel" name="label_12"> <widget class="QLabel" name="label_12">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>630</x> <x>660</x>
<y>250</y> <y>250</y>
<width>81</width> <width>81</width>
<height>21</height> <height>21</height>
@ -378,9 +378,9 @@
<widget class="QTextEdit" name="textEdit_testContent"> <widget class="QTextEdit" name="textEdit_testContent">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>720</x> <x>740</x>
<y>230</y> <y>230</y>
<width>231</width> <width>221</width>
<height>71</height> <height>71</height>
</rect> </rect>
</property> </property>
@ -408,31 +408,44 @@
<string>Import</string> <string>Import</string>
</property> </property>
</widget> </widget>
<widget class="QPushButton" name="pushButton_delete"> <widget class="QWidget" name="">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>150</x> <x>20</x>
<y>670</y> <y>670</y>
<width>141</width> <width>531</width>
<height>31</height> <height>41</height>
</rect> </rect>
</property> </property>
<property name="text"> <layout class="QHBoxLayout" name="horizontalLayout">
<string>Delete</string> <item>
</property> <widget class="QCheckBox" name="checkBox_selectAll">
</widget> <property name="text">
<widget class="QCheckBox" name="checkBox_selectAll"> <string>SelectAll</string>
<property name="geometry"> </property>
<rect> </widget>
<x>40</x> </item>
<y>680</y> <item>
<width>91</width> <widget class="QPushButton" name="pushButton_delete">
<height>16</height> <property name="text">
</rect> <string>Delete</string>
</property> </property>
<property name="text"> </widget>
<string>SelectAll</string> </item>
</property> <item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget> </widget>
</widget> </widget>
<widget class="QMenuBar" name="menubar"> <widget class="QMenuBar" name="menubar">
@ -440,7 +453,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>965</width> <width>988</width>
<height>22</height> <height>22</height>
</rect> </rect>
</property> </property>

View File

@ -833,8 +833,19 @@ 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 correct_value = m_map_title_name.value(title).correct_value;
int dpi = m_map_title_name.value(title).resolution; int dpi = 0;
if (title == "扫描图像彩色质量确认_200dpi" || title == "扫描图像灰度质量确认_200dpi" || title == "计算畸变修正值_200dpi" || title == "设置畸变修正值_200dpi")
dpi = 200;
else if (title == "扫描图像彩色质量确认_300dpi" || title == "扫描图像灰度质量确认_300dpi" || title == "计算畸变修正值_300dpi" || title == "设置畸变修正值_300dpi")
dpi = 300;
else if (title == "扫描图像彩色质量确认_600dpi" || title == "扫描图像灰度质量确认_600dpi" || title == "计算畸变修正值_600dpi" || title == "设置畸变修正值_600dpi")
dpi = 600;
int correct_value = -1;
if (name == "AUTO_FLAT_FIELD")
correct_value = 0;
wchar_t buf[5] = {0}; wchar_t buf[5] = {0};
if (dpi > 0) if (dpi > 0)
{ {