[Add] Release Version 1.1.0 modify the login ui and some others

This commit is contained in:
Carl 2024-11-08 10:59:42 +08:00
parent 2e7e92e4da
commit 525d6adb0c
9 changed files with 569 additions and 496 deletions

BIN
Image/bluesun.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
Image/bunuo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -54,9 +54,15 @@ void DialogLogin::init()
ini = new QSettings("config.ini", QSettings::IniFormat);
connect(ui->btnConnect, &QPushButton::clicked, this, &DialogLogin::slot_btnConnect_clicked);
ui->groupBox->setStyleSheet("QGroupBox { border: none; }");
ui->label_bluesunLogo->setStyleSheet("QLabel { background-image: url(:/Image/bluesun.png); "
"background-repeat: no-repeat; background-size: cover; background-position: center center;}");
// //将背景设置为白色
// ui->groupBox->setStyleSheet("background-color: #FFFFFF;");
m_MainWindow->setStyleSheet("background-color: #FFFFFF;");
// //传递BCU个数的信号与槽
// BCUNumbers = ui->comboBoxBCUQuantity->currentText().toInt();
// qDebug() << "the number of the BCU: " << BCUNumbers;
@ -101,6 +107,7 @@ void DialogLogin::init()
m_ModbusRTU->quit();
});
// ui->btnConnect->setStyleSheet("QPushButton { background-color: lightgray; color: black; border: none; }");
//主窗口接受语言选择number的信号与槽的连接
connect(this, &DialogLogin::sendLanNumberSignals, m_MainWindow, &MainWindow::getLanNumberSlot);
@ -116,6 +123,9 @@ void DialogLogin::init()
connect(m_MainWindow, &MainWindow::row_of_bmus_index, m_ModbusRTU, &ModbusRTU::change_BMUIndex_slot);
// ui->btnConnect->setStyleSheet("QPushButton { background-color: #87CEFA; color: white; }"
// "QPushButton:hover { background-color: #77B5D6; color: white; }");
// QMetaObject::invokeMethod(m_ModbusRTU,"read_regs_slot",Qt::QueuedConnection);
// connect(m_ModbusRTU, &ModbusRTU::sig_readMoveToThread, m_ModbusRTU, &ModbusRTU::read_regs_slot, Qt::QueuedConnection);
// thread = new QThread;
@ -161,29 +171,29 @@ void DialogLogin::mainwindowInit()
connect(m_MainWindow, &MainWindow::showLogin, this, [=]{
this->show();
});
connect(this, &DialogLogin::finished, m_MainWindow, [=]{
m_MainWindow->ui->btnSetup->setStyleSheet("#btnSetup{"
"background-image: url(:/Image/advance-set-line.png);"
"background-repeat: no-repeat;"
"background-position: center;"
"background-color: rgba(255, 255, 255, 0);"
"}"
"#btnSetup::hover{"
"background-image: url(:/Image/advance-set-line1.png);"
"background-repeat: no-repeat;"
"background-position: center;"
"background-color: rgba(255, 255, 255, 0);"
"}");
});
connect(m_MainWindow->ui->btnSetup, &QPushButton::pressed, this, [=]{
qDebug() << __FUNCTION__ << "disconnected";
m_ModbusRTU->isConnect = false;
m_MainWindow->statusBarConnectedIcon->setPixmap(QPixmap(QIcon(":/Image/connected1.png").pixmap(QSize(24, 24))));
m_Serial->m_SerialPort->close();
m_ModbusRTU->modbusRTUDisconnect();
ui->comboBoxSerialPort->clear();
ui->comboBoxSerialPort->addItems(m_Serial->getAvailablePort());
});
// connect(this, &DialogLogin::finished, m_MainWindow, [=]{
// m_MainWindow->ui->btnSetup->setStyleSheet("#btnSetup{"
// "background-image: url(:/Image/advance-set-line.png);"
// "background-repeat: no-repeat;"
// "background-position: center;"
// "background-color: rgba(255, 255, 255, 0);"
// "}"
// "#btnSetup::hover{"
// "background-image: url(:/Image/advance-set-line1.png);"
// "background-repeat: no-repeat;"
// "background-position: center;"
// "background-color: rgba(255, 255, 255, 0);"
// "}");
// });
// connect(m_MainWindow->ui->btnSetup, &QPushButton::pressed, this, [=]{
// qDebug() << __FUNCTION__ << "disconnected";
// m_ModbusRTU->isConnect = false;
// m_MainWindow->statusBarConnectedIcon->setPixmap(QPixmap(QIcon(":/Image/connected1.png").pixmap(QSize(24, 24))));
// m_Serial->m_SerialPort->close();
// m_ModbusRTU->modbusRTUDisconnect();
// ui->comboBoxSerialPort->clear();
// ui->comboBoxSerialPort->addItems(m_Serial->getAvailablePort());
// });
}
void DialogLogin::slot_comChangeStatus(QString name, bool flag)
@ -196,7 +206,7 @@ void DialogLogin::slot_comChangeStatus(QString name, bool flag)
void DialogLogin::slot_btnConnect_clicked()
{
BCUNumbers = ui->comboBoxBCUQuantity->currentText().toInt();
// BCUNumbers = ui->comboBoxBCUQuantity->currentText().toInt();
QString language = ui->comboBoxLanguage->currentText();
if (language == "English")

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>260</width>
<height>320</height>
<width>430</width>
<height>539</height>
</rect>
</property>
<property name="sizePolicy">
@ -20,33 +20,7 @@
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</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>
</widget>
</item>
<item row="0" column="0" colspan="2">
<item row="2" column="1">
<widget class="QGroupBox" name="groupBox">
<property name="font">
<font>
@ -55,344 +29,370 @@
</font>
</property>
<property name="title">
<string>Communication</string>
<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>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout" stretch="4,7,1,2,3">
<item>
<property name="text">
<string>5</string>
</property>
<widget class="QLabel" name="label_bluesunLogo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<property name="text">
<string>6</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="labelBCUQuantity_2">
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Language</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxLanguage">
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>10</pointsize>
</font>
</property>
<item>
<property name="text">
<string>Chinese</string>
</property>
</item>
<item>
<property name="text">
<string>English</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelSerialPort">
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Serial Port</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxSerialPort">
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>10</pointsize>
</font>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelBaudRate">
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Baud Rate</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxBaudRate">
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>10</pointsize>
</font>
</property>
<item>
<property name="text">
<string>1200</string>
</property>
</item>
<item>
<property name="text">
<string>2400</string>
</property>
</item>
<item>
<property name="text">
<string>4800</string>
</property>
</item>
<item>
<property name="text">
<string>9600</string>
</property>
</item>
<item>
<property name="text">
<string>19200</string>
</property>
</item>
<item>
<property name="text">
<string>38400</string>
</property>
</item>
<item>
<property name="text">
<string>57600</string>
</property>
</item>
<item>
<property name="text">
<string>115200</string>
</property>
</item>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelDataBits">
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Data Bits</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxDataBits">
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>10</pointsize>
</font>
</property>
<item>
<property name="text">
<string>5</string>
</property>
</item>
<item>
<property name="text">
<string>6</string>
</property>
</item>
<item>
<property name="text">
<string>7</string>
</property>
</item>
<item>
<property name="text">
<string>8</string>
</property>
</item>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="labelStopBits">
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Stop Bits</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="comboBoxStopBits">
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>10</pointsize>
</font>
</property>
<item>
<property name="text">
<string>1</string>
</property>
</item>
<item>
<property name="text">
<string>2</string>
</property>
</item>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="labelParity">
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Parity</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="comboBoxParity">
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>10</pointsize>
</font>
</property>
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>Odd</string>
</property>
</item>
<item>
<property name="text">
<string>Even</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<property name="text">
<string>7</string>
</property>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<property name="text">
<string>8</string>
</property>
</item>
</widget>
</item>
<item row="4" column="3">
<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>
</property>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1,1">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnConnect">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>40</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Connect</string>
</property>
</widget>
</item>
<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>
</item>
<item>
<property name="text">
<string>2</string>
</property>
<widget class="QLabel" name="label_Copyright">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>幼圆</family>
<pointsize>11</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Copyright © 2016 Bluesun Solar Co.Ltd &lt;/p&gt;&lt;p align=&quot;center&quot;&gt;All Rights Reserved.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</widget>
</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>
</property>
</item>
<item>
<property name="text">
<string>2</string>
</property>
</item>
<item>
<property name="text">
<string>3</string>
</property>
</item>
<item>
<property name="text">
<string>4</string>
</property>
</item>
<item>
<property name="text">
<string>5</string>
</property>
</item>
<item>
<property name="text">
<string>6</string>
</property>
</item>
<item>
<property name="text">
<string>7</string>
</property>
</item>
<item>
<property name="text">
<string>8</string>
</property>
</item>
<item>
<property name="text">
<string>9</string>
</property>
</item>
<item>
<property name="text">
<string>10</string>
</property>
</item>
<item>
<property name="text">
<string>11</string>
</property>
</item>
<item>
<property name="text">
<string>12</string>
</property>
</item>
<item>
<property name="text">
<string>13</string>
</property>
</item>
<item>
<property name="text">
<string>14</string>
</property>
</item>
<item>
<property name="text">
<string>15</string>
</property>
</item>
<item>
<property name="text">
<string>16</string>
</property>
</item>
</widget>
</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>
</property>
</item>
<item>
<property name="text">
<string>2400</string>
</property>
</item>
<item>
<property name="text">
<string>4800</string>
</property>
</item>
<item>
<property name="text">
<string>9600</string>
</property>
</item>
<item>
<property name="text">
<string>19200</string>
</property>
</item>
<item>
<property name="text">
<string>38400</string>
</property>
</item>
<item>
<property name="text">
<string>57600</string>
</property>
</item>
<item>
<property name="text">
<string>115200</string>
</property>
</item>
</widget>
</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>
</widget>
</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>
</widget>
</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>
</widget>
</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>
</widget>
</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>
</widget>
</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>
</widget>
</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>
</property>
</item>
<item>
<property name="text">
<string>Odd</string>
</property>
</item>
<item>
<property name="text">
<string>Even</string>
</property>
</item>
</widget>
</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>
</widget>
</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>
</property>
</item>
<item>
<property name="text">
<string>English</string>
</property>
</item>
</widget>
</layout>
</item>
</layout>
</widget>

View File

@ -35,5 +35,7 @@
<file>Image/record-out-black.png</file>
<file>Image/record-out-gray.png</file>
<file>Image/record-out-green.png</file>
<file>Image/bluesun.png</file>
<file>Image/bunuo.png</file>
</qresource>
</RCC>

View File

@ -17,6 +17,7 @@ int main(int argc, char *argv[])
QApplication a(argc, argv);
a.setStyleSheet("QToolTip { font-size: 18px; font-family: 'SimHei'; }");
DialogLogin loginWidget;
loginWidget.setStyleSheet("background-color: #FFFFFF;");
loginWidget.show();
return a.exec();
}

View File

@ -212,6 +212,7 @@ void MainWindow::init()
// ui->scrollAreaChart->setFrameShape(QFrame::NoFrame);
// ui->scrollAreaChart->setStyleSheet("background-color: #FFFFFF;"); //设置背景颜色为纯白色
ui->scrollArea_trouble->setStyleSheet("border: none;");
ui->widgetControl->setStyleSheet("background-color: #FFFFFF;");
ui->groupBox->setStyleSheet("background-color: #FFFFFF;");
ui->groupBox_trouble_control->setStyleSheet("background-color: #FFFFFF;");
@ -239,8 +240,6 @@ void MainWindow::init()
ui->btnParaSet->setToolTip("参数设置(Parameter Settings)");
ui->btnDebug->setToolTip("报文信息(Message Information)");
ui->btnFlash->setToolTip("升级调试(Upgrade Debugging)");
ui->btnSetup->setToolTip("串口信息(Serial Port)");
ui->btnSetup->setStyleSheet("QToolTip { position: absolute; left: 20px; top: 20px; }");
// ui->btnRecord->setToolTip("记录导出");
@ -698,18 +697,18 @@ void MainWindow::setMenuStyle()
"background-color: rgba(255, 255, 255, 0);"
"}");
ui->btnSetup->setStyleSheet("#btnSetup{"
"background-image: url(:/Image/advance-set-line.png);"
"background-repeat: no-repeat;"
"background-position: center;"
"background-color: rgba(255, 255, 255, 0);"
"}"
"#btnSetup::hover{"
"background-image: url(:/Image/advance-set-line1.png);"
"background-repeat: no-repeat;"
"background-position: center;"
"background-color: rgba(255, 255, 255, 0);"
"}");
// ui->btnSetup->setStyleSheet("#btnSetup{"
// "background-image: url(:/Image/advance-set-line.png);"
// "background-repeat: no-repeat;"
// "background-position: center;"
// "background-color: rgba(255, 255, 255, 0);"
// "}"
// "#btnSetup::hover{"
// "background-image: url(:/Image/advance-set-line1.png);"
// "background-repeat: no-repeat;"
// "background-position: center;"
// "background-color: rgba(255, 255, 255, 0);"
// "}");
// ui->btnRecord->setStyleSheet("#btnRecord{"
// "background-image: url(:/Image/record-out-black.png);"
@ -786,18 +785,18 @@ void MainWindow::setMenuStyle()
"background-color: rgba(255, 255, 255, 0);"
"}");
ui->btnSetup->setStyleSheet("#btnSetup{"
"background-image: url(:/Image/advance-set-line.png);"
"background-repeat: no-repeat;"
"background-position: center;"
"background-color: rgba(255, 255, 255, 0);"
"}"
"#btnSetup::hover{"
"background-image: url(:/Image/advance-set-line1.png);"
"background-repeat: no-repeat;"
"background-position: center;"
"background-color: rgba(255, 255, 255, 0);"
"}");
// ui->btnSetup->setStyleSheet("#btnSetup{"
// "background-image: url(:/Image/advance-set-line.png);"
// "background-repeat: no-repeat;"
// "background-position: center;"
// "background-color: rgba(255, 255, 255, 0);"
// "}"
// "#btnSetup::hover{"
// "background-image: url(:/Image/advance-set-line1.png);"
// "background-repeat: no-repeat;"
// "background-position: center;"
// "background-color: rgba(255, 255, 255, 0);"
// "}");
// ui->btnRecord->setStyleSheet("#btnRecord{"
// "background-image: url(:/Image/record-out-black.png);"
@ -874,18 +873,18 @@ void MainWindow::setMenuStyle()
"background-color: rgba(255, 255, 255, 0);"
"}");
ui->btnSetup->setStyleSheet("#btnSetup{"
"background-image: url(:/Image/advance-set-line.png);"
"background-repeat: no-repeat;"
"background-position: center;"
"background-color: rgba(255, 255, 255, 0);"
"}"
"#btnSetup::hover{"
"background-image: url(:/Image/advance-set-line1.png);"
"background-repeat: no-repeat;"
"background-position: center;"
"background-color: rgba(255, 255, 255, 0);"
"}");
// ui->btnSetup->setStyleSheet("#btnSetup{"
// "background-image: url(:/Image/advance-set-line.png);"
// "background-repeat: no-repeat;"
// "background-position: center;"
// "background-color: rgba(255, 255, 255, 0);"
// "}"
// "#btnSetup::hover{"
// "background-image: url(:/Image/advance-set-line1.png);"
// "background-repeat: no-repeat;"
// "background-position: center;"
// "background-color: rgba(255, 255, 255, 0);"
// "}");
// ui->btnRecord->setStyleSheet("#btnRecord{"
// "background-image: url(:/Image/record-out-black.png);"
@ -962,18 +961,18 @@ void MainWindow::setMenuStyle()
"background-color: rgba(255, 255, 255, 0);"
"}");
ui->btnSetup->setStyleSheet("#btnSetup{"
"background-image: url(:/Image/advance-set-line.png);"
"background-repeat: no-repeat;"
"background-position: center;"
"background-color: rgba(255, 255, 255, 0);"
"}"
"#btnSetup::hover{"
"background-image: url(:/Image/advance-set-line1.png);"
"background-repeat: no-repeat;"
"background-position: center;"
"background-color: rgba(255, 255, 255, 0);"
"}");
// ui->btnSetup->setStyleSheet("#btnSetup{"
// "background-image: url(:/Image/advance-set-line.png);"
// "background-repeat: no-repeat;"
// "background-position: center;"
// "background-color: rgba(255, 255, 255, 0);"
// "}"
// "#btnSetup::hover{"
// "background-image: url(:/Image/advance-set-line1.png);"
// "background-repeat: no-repeat;"
// "background-position: center;"
// "background-color: rgba(255, 255, 255, 0);"
// "}");
// ui->btnRecord->setStyleSheet("#btnRecord{"
// "background-image: url(:/Image/record-out-black.png);"
@ -1050,29 +1049,29 @@ void MainWindow::setMenuStyle()
"background-color: rgba(255, 255, 255, 0);"
"}");
ui->btnSetup->setStyleSheet("#btnSetup{"
"background-image: url(:/Image/advance-set-line.png);"
"background-repeat: no-repeat;"
"background-position: center;"
"background-color: rgba(255, 255, 255, 0);"
"}"
"#btnSetup::hover{"
"background-image: url(:/Image/advance-set-line1.png);"
"background-repeat: no-repeat;"
"background-position: center;"
"background-color: rgba(255, 255, 255, 0);"
"}");
// ui->btnSetup->setStyleSheet("#btnSetup{"
// "background-image: url(:/Image/advance-set-line.png);"
// "background-repeat: no-repeat;"
// "background-position: center;"
// "background-color: rgba(255, 255, 255, 0);"
// "}"
// "#btnSetup::hover{"
// "background-image: url(:/Image/advance-set-line1.png);"
// "background-repeat: no-repeat;"
// "background-position: center;"
// "background-color: rgba(255, 255, 255, 0);"
// "}");
});
connect(ui->btnSetup, &QPushButton::pressed, this, [=]{
emit showLogin();
ui->btnSetup->setStyleSheet("#btnSetup{"
"background-image: url(:/Image/advance-set-line2.png);"
"background-repeat: no-repeat;"
"background-position: center;"
"background-color: rgba(255, 255, 255, 0);"
"}");
});
// connect(ui->btnSetup, &QPushButton::pressed, this, [=]{
// emit showLogin();
// ui->btnSetup->setStyleSheet("#btnSetup{"
// "background-image: url(:/Image/advance-set-line2.png);"
// "background-repeat: no-repeat;"
// "background-position: center;"
// "background-color: rgba(255, 255, 255, 0);"
// "}");
// });
ui->btn_close_neg->setStyleSheet("QPushButton { background-color: #87CEFA; color: white; }"
"QPushButton:hover { background-color: #77B5D6; color: white; }");
@ -1086,6 +1085,21 @@ void MainWindow::setMenuStyle()
"QPushButton:hover { background-color: #77B5D6; color: white; }");
ui->btn_open_pos->setStyleSheet("QPushButton { background-color: #87CEFA; color: white; }"
"QPushButton:hover { background-color: #77B5D6; color: white; }");
ui->pageParaSetRead->setStyleSheet("QPushButton { background-color: #87CEFA; color: white; }"
"QPushButton:hover { background-color: #77B5D6; color: white; }");
ui->pageParaSetWrite->setStyleSheet("QPushButton { background-color: #87CEFA; color: white; }"
"QPushButton:hover { background-color: #77B5D6; color: white; }");
ui->btnGetVersion->setStyleSheet("QPushButton { background-color: #87CEFA; color: white; }"
"QPushButton:hover { background-color: #77B5D6; color: white; }");
ui->btnStartUpgrade->setStyleSheet("QPushButton { background-color: #87CEFA; color: white; }"
"QPushButton:hover { background-color: #77B5D6; color: white; }");
ui->btnImport->setStyleSheet("QPushButton { background-color: #87CEFA; color: white; }"
"QPushButton:hover { background-color: #77B5D6; color: white; }");
ui->btnSendData->setStyleSheet("QPushButton { background-color: #87CEFA; color: white; }"
"QPushButton:hover { background-color: #77B5D6; color: white; }");
ui->pageDebugBtnClear->setStyleSheet("QPushButton { background-color: #87CEFA; color: white; }"
"QPushButton:hover { background-color: #77B5D6; color: white; }");
}
void MainWindow::slot_pageDebugDisplayMessage(QByteArray byteArray, int dataType, uint16_t *data)
@ -4215,6 +4229,7 @@ void MainWindow::on_pageParaSetWrite_clicked()
for (int i=0; i<checkRow_write.size();i++)
{
emit write_regs_signals(checkRow_write[i], originVector[i]);
QThread::msleep(100);
}
}
// 序列化消息对象

View File

@ -43,11 +43,11 @@
</property>
<property name="styleSheet">
<string notr="true">#widget{
background-color: rgb(161, 161, 161);
background-color: rgb(245, 245, 220);
max-width:60px;
}</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,0,0,1,0">
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,0,0,1">
<property name="spacing">
<number>0</number>
</property>
@ -233,39 +233,6 @@ background-color: rgba(255, 255, 255, 0);
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnSetup">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>62</width>
<height>62</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;串口信息&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="toolTipDuration">
<number>-1</number>
</property>
<property name="styleSheet">
<string notr="true">#btnSetup{
background-image: url(:/Image/advance-set-line2.png);
background-repeat: no-repeat;
background-position: center;
background-color: rgba(255, 255, 255, 0);
}</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -758,7 +725,7 @@ background-color: rgba(255, 255, 255, 0);
</property>
<layout class="QGridLayout" name="gridLayout_11">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollArea">
<widget class="QScrollArea" name="scrollArea_trouble">
<property name="widgetResizable">
<bool>true</bool>
</property>
@ -768,7 +735,7 @@ background-color: rgba(255, 255, 255, 0);
<x>0</x>
<y>0</y>
<width>1041</width>
<height>448</height>
<height>450</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_12">
@ -2290,8 +2257,8 @@ background-color: rgba(255, 255, 255, 0);
</property>
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
<family>华文中宋</family>
<pointsize>11</pointsize>
</font>
</property>
<item>
@ -2386,8 +2353,8 @@ background-color: rgba(255, 255, 255, 0);
</property>
<property name="font">
<font>
<family>黑体</family>
<pointsize>10</pointsize>
<family>华文中宋</family>
<pointsize>11</pointsize>
</font>
</property>
<property name="text">
@ -2461,6 +2428,12 @@ background-color: rgba(255, 255, 255, 0);
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidgetBCU">
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="currentIndex">
<number>1</number>
</property>
@ -7813,11 +7786,23 @@ background-color: rgba(255, 255, 255, 0);
</layout>
</widget>
<widget class="QWidget" name="pageBMU">
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>12</pointsize>
</font>
</property>
<layout class="QGridLayout" name="gridLayout_18">
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidgetBMU">
<property name="font">
<font>
<family>黑体</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="bmu_volInfo">
<attribute name="title">
@ -10492,7 +10477,7 @@ background-color: rgba(255, 255, 255, 0);
<widget class="QWidget" name="pageParaSet">
<layout class="QVBoxLayout" name="verticalLayout_15">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_126" stretch="1,1,20,1,1">
<layout class="QHBoxLayout" name="horizontalLayout_126" stretch="1,1,13,1,1">
<item>
<spacer name="horizontalSpacer_191">
<property name="orientation">
@ -10508,6 +10493,18 @@ background-color: rgba(255, 255, 255, 0);
</item>
<item>
<widget class="QCheckBox" name="pageParaSetCheck">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>11</pointsize>
</font>
</property>
<property name="text">
<string>全部勾选</string>
</property>
@ -10528,6 +10525,18 @@ background-color: rgba(255, 255, 255, 0);
</item>
<item>
<widget class="QPushButton" name="pageParaSetRead">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>11</pointsize>
</font>
</property>
<property name="text">
<string>读取</string>
</property>
@ -10535,6 +10544,18 @@ background-color: rgba(255, 255, 255, 0);
</item>
<item>
<widget class="QPushButton" name="pageParaSetWrite">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>11</pointsize>
</font>
</property>
<property name="text">
<string>写入</string>
</property>
@ -10709,6 +10730,12 @@ li.checked::marker { content: &quot;\2612&quot;; }
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="pageDebugCheckBoxDisplay">
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>显示</string>
</property>
@ -10729,6 +10756,12 @@ li.checked::marker { content: &quot;\2612&quot;; }
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="pageDebugCheckBoxStarmp">
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>时间戳</string>
</property>
@ -10736,6 +10769,12 @@ li.checked::marker { content: &quot;\2612&quot;; }
</item>
<item row="1" column="0">
<widget class="QPushButton" name="btnSendData">
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>发送数据</string>
</property>
@ -10743,6 +10782,12 @@ li.checked::marker { content: &quot;\2612&quot;; }
</item>
<item row="0" column="0">
<widget class="QPushButton" name="pageDebugBtnClear">
<property name="font">
<font>
<family>华文中宋</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>清除</string>
</property>

View File

@ -207,7 +207,7 @@ void ModbusRTU::write_regs_slot(int addr,const uint16_t data)
// qDebug() << "write:进入线程:" << QThread::currentThread();
int rc = write_single_register(addr, data);
if(MODBUS_ERR == rc) {
qDebug() << "######modbus no message";
qDebug() << "write######modbus no message";
return;
}
}
@ -217,7 +217,7 @@ void ModbusRTU::read_regs_slot(int addr, int nb, uint16_t *data, int row)
// qDebug() << "read:进入线程:" << QThread::currentThread();
int rc = read_holding_register(addr, nb, data);
if(MODBUS_ERR == rc) {
// qDebug() << "modbus no message";
qDebug() << "read modbus no message";
return;
}
else {