[Add] Release Version 1.0.1

This commit is contained in:
Carl 2024-11-07 18:07:10 +08:00
parent 25f0c01a47
commit 2e7e92e4da
7 changed files with 171 additions and 24 deletions

View File

@ -49,7 +49,7 @@ void AppSerial::setHWND(HWND hwnd)
this->m_hwnd = hwnd;
}
bool AppSerial::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result)
bool AppSerial::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
{
Q_UNUSED(eventType);
Q_UNUSED(result);

View File

@ -33,7 +33,7 @@ public:
void setHWND(HWND hwnd);
protected:
bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result);
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result);
signals:
/**

View File

@ -35,6 +35,12 @@
</item>
<item row="4" column="0" colspan="2">
<widget class="QPushButton" name="btnConnect">
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Connect</string>
</property>
@ -42,12 +48,24 @@
</item>
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="font">
<font>
<family>黑体</family>
<pointsize>11</pointsize>
</font>
</property>
<property name="title">
<string>Communication</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="8" column="3">
<widget class="QComboBox" name="comboBoxDataBits">
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
</font>
</property>
<item>
<property name="text">
<string>5</string>
@ -71,10 +89,23 @@
</widget>
</item>
<item row="4" column="3">
<widget class="QComboBox" name="comboBoxSerialPort"/>
<widget class="QComboBox" name="comboBoxSerialPort">
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
</font>
</property>
</widget>
</item>
<item row="10" column="3">
<widget class="QComboBox" name="comboBoxStopBits">
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
</font>
</property>
<item>
<property name="text">
<string>1</string>
@ -89,6 +120,12 @@
</item>
<item row="2" column="3">
<widget class="QComboBox" name="comboBoxBCUQuantity">
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
</font>
</property>
<item>
<property name="text">
<string>1</string>
@ -173,6 +210,12 @@
</item>
<item row="7" column="3">
<widget class="QComboBox" name="comboBoxBaudRate">
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
</font>
</property>
<item>
<property name="text">
<string>1200</string>
@ -217,6 +260,12 @@
</item>
<item row="7" column="2">
<widget class="QLabel" name="labelBaudRate">
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Baud Rate</string>
</property>
@ -224,6 +273,12 @@
</item>
<item row="10" column="2">
<widget class="QLabel" name="labelStopBits">
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Stop Bits</string>
</property>
@ -231,6 +286,12 @@
</item>
<item row="2" column="2">
<widget class="QLabel" name="labelBCUQuantity">
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>BCU Quantity</string>
</property>
@ -238,6 +299,12 @@
</item>
<item row="4" column="2">
<widget class="QLabel" name="labelSerialPort">
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Serial Port</string>
</property>
@ -245,6 +312,12 @@
</item>
<item row="11" column="2">
<widget class="QLabel" name="labelParity">
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Parity</string>
</property>
@ -252,6 +325,12 @@
</item>
<item row="8" column="2">
<widget class="QLabel" name="labelDataBits">
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Data Bits</string>
</property>
@ -259,6 +338,12 @@
</item>
<item row="11" column="3">
<widget class="QComboBox" name="comboBoxParity">
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
</font>
</property>
<item>
<property name="text">
<string>None</string>
@ -278,6 +363,12 @@
</item>
<item row="1" column="2">
<widget class="QLabel" name="labelBCUQuantity_2">
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Language</string>
</property>
@ -285,6 +376,12 @@
</item>
<item row="1" column="3">
<widget class="QComboBox" name="comboBoxLanguage">
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
</font>
</property>
<item>
<property name="text">
<string>Chinese</string>

View File

@ -4,6 +4,16 @@
int main(int argc, char *argv[])
{
// 设置高DPI
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QGuiApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
#endif
QApplication a(argc, argv);
a.setStyleSheet("QToolTip { font-size: 18px; font-family: 'SimHei'; }");
DialogLogin loginWidget;

View File

@ -41,7 +41,7 @@ MainWindow::MainWindow(QWidget *parent)
m_AppProto = new AppProto;
m_AppProto_English = new Appproto_English;
connect(ui->tabWidget_paraset, SIGNAL(currentChanged(int)), this, SLOT(on_tabChanged(int)));
connect(ui->comboBoxBCUSelect, &QComboBox::currentIndexChanged, this, &MainWindow::on_comBoxBCUSelect);
connect(ui->comboBoxBCUSelect, SIGNAL(currentIndexChanged(int)), this, SLOT(on_comBoxBCUSelect(int)));
}
MainWindow::~MainWindow()
@ -1494,6 +1494,7 @@ void MainWindow::pageHomeHistoryAlarm()
ui->tableView_history_alarm->setSortingEnabled(false);
/*设置是否显示网格线*/
ui->tableView_history_alarm->setShowGrid(true);
ui->tableView_history_alarm->sizePolicy();
/*设置垂直表头是否可见*/
ui->tableView_history_alarm->verticalHeader()->setVisible(false);
/*设置选中一行表头是否加粗--不加粗*/
@ -1503,7 +1504,7 @@ void MainWindow::pageHomeHistoryAlarm()
/*设置行标题最小宽度尺寸*/
ui->tableView_history_alarm->horizontalHeader()->setMinimumSectionSize(0);
/*设置行标题最小高度*/
ui->tableView_history_alarm->horizontalHeader()->setFixedHeight(35);
ui->tableView_history_alarm->horizontalHeader()->setFixedHeight(30);
/*设置表头是否可以单击--不可单击*/
ui->tableView_history_alarm->horizontalHeader()->setSectionsClickable(false);
ui->tableView_history_alarm->verticalHeader()->setHidden(false);
@ -1522,12 +1523,12 @@ void MainWindow::pageHomeHistoryAlarm()
QStringList columnNames;
QList<int> columnWidths;
columnNames << "时间" << "告警名称" << "BCUId" << "状态";
columnWidths << 240 << 240 << 240 << 240;
columnWidths << 360 << 240 << 240 << 240;
QStringList columnNames_english;
QList<int> columnWidths_english;
columnNames_english << "Time" << "Alarm Name" << "BCUId" << "Status";
columnWidths_english << 240 << 240 << 240 << 240;
columnWidths_english << 360 << 240 << 240 << 240;
if(lan == 0)
{
@ -1638,12 +1639,12 @@ void MainWindow::pageFlashGetVersion()
QStringList columnNames;
QList<int> columnWidths;
columnNames << "ID" << "升级前版本号" << "升级后版本号" ;
columnWidths << 120 << 240 << 240 ;
columnWidths << 120 << 360 << 360 ;
QStringList columnNames_english;
QList<int> columnWidths_english;
columnNames_english << "ID" << "Version before upgrade" << "Version after upgrade" ;
columnWidths_english << 120 << 240 << 240 ;
columnWidths_english << 120 << 360 << 360 ;
if(lan == 0)
{
@ -3776,7 +3777,14 @@ void MainWindow::slot_pageHomeFault(QByteArray byteArray, int dataType, uint16_t
model_history_alarm->setItem(count_history_alarm, 0, new QStandardItem(timeStr));
model_history_alarm->setItem(count_history_alarm, 1, new QStandardItem(trouble_list[i]->text()));
model_history_alarm->setItem(count_history_alarm, 2, new QStandardItem(currentBCU));
model_history_alarm->setItem(count_history_alarm, 3, new QStandardItem("一级报警"));
if (lan == 0)
{
model_history_alarm->setItem(count_history_alarm, 3, new QStandardItem("Level 1 Alarm"));
}
else if (lan == 1)
{
model_history_alarm->setItem(count_history_alarm, 3, new QStandardItem("一级报警"));
}
count_history_alarm++;
}
else if (list_result[i] == "10")
@ -3786,7 +3794,14 @@ void MainWindow::slot_pageHomeFault(QByteArray byteArray, int dataType, uint16_t
model_history_alarm->setItem(count_history_alarm, 0, new QStandardItem(timeStr));
model_history_alarm->setItem(count_history_alarm, 1, new QStandardItem(trouble_list[i]->text()));
model_history_alarm->setItem(count_history_alarm, 2, new QStandardItem(currentBCU));
model_history_alarm->setItem(count_history_alarm, 3, new QStandardItem("二级报警"));
if (lan == 0)
{
model_history_alarm->setItem(count_history_alarm, 3, new QStandardItem("Level 2 Alarm"));
}
else if (lan == 1)
{
model_history_alarm->setItem(count_history_alarm, 3, new QStandardItem("二级报警"));
}
count_history_alarm++;
}
else if (list_result[i] == "11")
@ -3796,7 +3811,14 @@ void MainWindow::slot_pageHomeFault(QByteArray byteArray, int dataType, uint16_t
model_history_alarm->setItem(count_history_alarm, 0, new QStandardItem(timeStr));
model_history_alarm->setItem(count_history_alarm, 1, new QStandardItem(trouble_list[i]->text()));
model_history_alarm->setItem(count_history_alarm, 2, new QStandardItem(currentBCU));
model_history_alarm->setItem(count_history_alarm, 3, new QStandardItem("三级报警"));
if (lan == 0)
{
model_history_alarm->setItem(count_history_alarm, 3, new QStandardItem("Level 3 Alarm"));
}
else if (lan == 1)
{
model_history_alarm->setItem(count_history_alarm, 3, new QStandardItem("三级报警"));
}
count_history_alarm++;
}
else
@ -4223,7 +4245,7 @@ void MainWindow::on_tabChanged(int index)
ui->pageParaSetCheck->setCheckState(Qt::Unchecked);
}
void MainWindow::on_comBoxBCUSelect()
void MainWindow::on_comBoxBCUSelect(int index)
{
QString BCUText = ui->comboBoxBCUSelect->currentText();
QString statusBarBCULabel = "Current BCU: ";

View File

@ -173,7 +173,7 @@ private slots:
void on_pageParaSetRead_clicked();
void on_pageParaSetWrite_clicked();
void on_tabChanged(int index);
void on_comBoxBCUSelect();
void on_comBoxBCUSelect(int index);
// void on_horizontalSlider_valueChanged(int value);
void on_btn_close_pos_clicked();

View File

@ -281,7 +281,7 @@ background-color: rgba(255, 255, 255, 0);
<string notr="true"/>
</property>
<property name="currentIndex">
<number>4</number>
<number>0</number>
</property>
<widget class="QWidget" name="pageHome">
<property name="styleSheet">
@ -2017,6 +2017,12 @@ background-color: rgba(255, 255, 255, 0);
</item>
<item>
<widget class="QGroupBox" name="groupBox_5">
<property name="font">
<font>
<family>黑体</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="title">
<string>继电器状态</string>
</property>
@ -2029,8 +2035,8 @@ background-color: rgba(255, 255, 255, 0);
<widget class="QLabel" name="relay_positive">
<property name="font">
<font>
<family>微软雅黑</family>
<pointsize>9</pointsize>
<family>黑</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="locale">
@ -2048,8 +2054,8 @@ background-color: rgba(255, 255, 255, 0);
<widget class="QLabel" name="relay_precharge">
<property name="font">
<font>
<family>微软雅黑</family>
<pointsize>9</pointsize>
<family>黑</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
@ -2064,8 +2070,8 @@ background-color: rgba(255, 255, 255, 0);
<widget class="QLabel" name="relay_negative">
<property name="font">
<font>
<family>微软雅黑</family>
<pointsize>9</pointsize>
<family>黑</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
@ -2080,8 +2086,8 @@ background-color: rgba(255, 255, 255, 0);
<widget class="QLabel" name="relay_disconnector">
<property name="font">
<font>
<family>微软雅黑</family>
<pointsize>9</pointsize>
<family>黑</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
@ -2282,6 +2288,12 @@ background-color: rgba(255, 255, 255, 0);
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
</font>
</property>
<item>
<property name="text">
<string>BCU01</string>
@ -2372,6 +2384,12 @@ background-color: rgba(255, 255, 255, 0);
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>BCU选择</string>
</property>
@ -2444,7 +2462,7 @@ background-color: rgba(255, 255, 255, 0);
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidgetBCU">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="BCU_sysInfo">
<attribute name="title">