2025-03-05 更新日志

- 暂时移除了自动扫描串口号的功能[会导致软件闪退]
- 对界面进行了汉化
- 重构了软件底层的工作逻辑
- 优化了串口信息接收窗口的显示方式
- 关闭了软件的调试输出
This commit is contained in:
JRNitre 2025-03-05 18:13:33 +08:00
parent 52c4723dd9
commit f4c304056e
7 changed files with 344 additions and 310 deletions

View File

@ -6,9 +6,9 @@
# 当前软件待完善的内容
- [ ] 优化信息显示形式
- [ ] 完善hex&text模式选择
- [ ] 增加版本号系统
- [ ] 软件增加LOGO
# 预计会增加的功能
- [ ] 跨平台支持 (Linux)
- [ ] 跨平台支持 (Linux)

Binary file not shown.

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.11.1, 2024-09-25T20:43:19. -->
<!-- Written by QtCreator 4.11.1, 2024-10-16T17:24:57. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
@ -542,7 +542,7 @@
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">E:/system/desktop/PROJECT/CodeLibrary_Next/Cplus/build-06_QtCreator_Cplus_SerialDebug_20240425-Desktop_Qt_5_14_2_MinGW_64_bit-Release</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>

View File

@ -3,10 +3,11 @@
#include <QApplication>
// 更新报告
// 增加了定时扫描是否有可用串口功能
// 发送功能
// 接收功能
// 在连接了串口后禁止改动波特率等参数
// 移除了自动扫描串口号的功能(其会使软件闪退)
// 界面汉化
// 重构软件底层逻辑
// 优化了串口信息接收部分的信息显示
// 关闭了调试输出
int main(int argc, char *argv[])
{

View File

@ -6,50 +6,34 @@ Widget::Widget(QWidget *parent)
, ui(new Ui::Widget)
{
ui->setupUi(this);
serialPort = new QSerialPort(this);
// 循环扫描可用串口
QTimer *timer = new QTimer(this);
QStringList previousPorts;
timer->setInterval(500);
QObject::connect(timer, &QTimer::timeout, [this, &previousPorts]() {
QStringList currentPorts;
const QList<QSerialPortInfo> ports = QSerialPortInfo::availablePorts();
for (const QSerialPortInfo &info : ports){
currentPorts << info.portName();
}
if (currentPorts != previousPorts){
ui->config_port_comboBox->clear();
for (const QString &portName : currentPorts){
ui->config_port_comboBox->addItem(portName);
}
previousPorts = currentPorts;
}
});
timer -> start();
// 修改窗口标题
this->setWindowTitle("Serial Port Debug Tools - by JRNitre");
// 设置串口信息显示部分为只读
ui->receive_edit->setReadOnly(true);
// 串口配置数据初始化
// // 循环扫描可用串口
// QTimer *timer = new QTimer(this);
// QStringList previousPorts;
// timer->setInterval(500);
// QObject::connect(timer, &QTimer::timeout, [this, &previousPorts]() {
// QStringList currentPorts;
// const QList<QSerialPortInfo> ports = QSerialPortInfo::availablePorts();
// for (const QSerialPortInfo &info : ports){
// currentPorts << info.portName();
// }
// 默认接收&发送模式
if (recive_config_select == 1){
ui->receivetextmode->setChecked(1);
}
if (recive_config_select == 0){
ui->receive_hexmode->setChecked(1);
}
if (transmission_config_select == 1){
ui->transmission_textmode->setChecked(1);
}
if (transmission_config_select == 1){
ui->transmission_hexmode->setChecked(1);
}
// if (currentPorts != previousPorts){
// ui->config_port_comboBox->clear();
// for (const QString &portName : currentPorts){
// ui->config_port_comboBox->addItem(portName);
// }
// previousPorts = currentPorts;
// }
// });
// timer -> start();
// Enter 发送数据
QShortcut *shortcut = new QShortcut(QKeySequence(Qt::Key_Return), ui->transmission_Edit);
@ -67,24 +51,61 @@ Widget::Widget(QWidget *parent)
connect(serialPort, SIGNAL(readyRead()), this, SLOT(serialPort_readyRead()));
// 读取默认波特率并赋值
baud_rate = ui->config_baud_comboBox->currentText().toInt();
// 读取默认数据位长度并赋值
data_bit = ui->config_databit_comboBox->currentText().toInt();
// 读取默认停止位长度并赋值
stop_bit = ui->config_stopbit_comboBox->currentText().toDouble() * 10;
// 读取默认校验模式
if (ui->config_check_comboBox->currentText() != "no"){
if (ui->config_check_comboBox->currentText() == "odd"){
check = 1;
}
if (ui->config_check_comboBox->currentText() == "even"){
check = 2;
}
}else{
check = 0;
/* Loding Default Config */
/* 默认接收&发送模式 */
tx_model = TX_Model_HEX;
rx_model = RX_Model_HEX;
if(tx_model == TX_Model_HEX){
ui->transmission_hexmode->setChecked(1);
ui->transmission_textmode->setChecked(0);
}
if(tx_model == TX_Model_TEXT){
ui->transmission_textmode->setChecked(1);
ui->transmission_hexmode->setChecked(0);
}
if(rx_model == RX_Model_HEX){
ui->receive_hexmode->setChecked(1);
ui->receivetextmode->setChecked(0);
}
if(rx_model == RX_Model_TEXT){
ui->receive_hexmode->setChecked(0);
ui->receivetextmode->setChecked(1);
}
// 默认校验模式
check_model = check_model_no;
ui->config_check_comboBox->addItem("无校验");
ui->config_check_comboBox->addItem("奇校验");
ui->config_check_comboBox->addItem("偶校验");
ui->config_check_comboBox->setCurrentIndex(check_model);
// 默认停止位长度
stop_model = stop_model_1;
ui->config_stopbit_comboBox->addItem("1");
ui->config_stopbit_comboBox->addItem("1.5");
ui->config_stopbit_comboBox->addItem("2");
ui->config_stopbit_comboBox->setCurrentIndex(stop_model);
// 默认数据位长度
databit_model = databit_model_8;
ui->config_databit_comboBox->addItem("5");
ui->config_databit_comboBox->addItem("6");
ui->config_databit_comboBox->addItem("7");
ui->config_databit_comboBox->addItem("8");
ui->config_databit_comboBox->setCurrentIndex(databit_model);
// 默认波特率
baud_model = baud_model_115200;
ui->config_baud_comboBox->addItem("4800");
ui->config_baud_comboBox->addItem("9600");
ui->config_baud_comboBox->addItem("38400");
ui->config_baud_comboBox->addItem("115200");
ui->config_baud_comboBox->setCurrentIndex(baud_model);
initDone = true;
}
Widget::~Widget()
@ -92,6 +113,15 @@ Widget::~Widget()
delete ui;
}
// 向串口信息框追加信息(自动换行)
void Widget::appendText(const QString& text) {
ui->receive_edit->append(text); // 自动在末尾添加文本和换行符
QTextCursor cursor = ui->receive_edit->textCursor();
cursor.movePosition(QTextCursor::End);
ui->receive_edit->setTextCursor(cursor);
ui->receive_edit->ensureCursorVisible(); // 确保光标可见,从而实现自动滚动
}
// Button: Clear
void Widget::on_transmission_clear_Button_clicked()
{
@ -99,7 +129,7 @@ void Widget::on_transmission_clear_Button_clicked()
}
void Widget::on_receive_clear_Button_clicked()
{
ui->receive_Edit->clear();
ui->receive_edit->clear();
}
// 手动更新串口列表
@ -113,162 +143,217 @@ void Widget::on_updateport_Button_clicked()
}
}
// 发送模式 - Hex 模式被选中
/* 接收模式选择 */
// Hex Model
void Widget::receiveHex_selectSlot(){
//ui->receive_Edit->insertPlainText("Receive Hex select\n");
#ifdef DEBUGFLAG
appendText("接收模式Hex");
#endif
rx_model = RX_Model_HEX;
}
// 发送模式 - Text 模式被选中
// Text Model
void Widget::receiveText_selectSlot(){
//ui->receive_Edit->insertPlainText("Receive Text select\n");
}
// 接收模式 - Hex 模式被选中
void Widget::transmissionHex_selectSlot(){
//ui->receive_Edit->insertPlainText("Transmission Hex select\n");
}
// 接收模式 - Text 模式被选中
void Widget::transmissionText_selectSlot(){
//ui->receive_Edit->insertPlainText("Transmission Text select\n");
#ifdef DEBUGFLAG
appendText("接收模式Text");
#endif
rx_model = RX_Model_TEXT;
}
// 波特率选择
/* 发送模式选择 */
// Hex Model
void Widget::transmissionHex_selectSlot(){
#ifdef DEBUGFLAG
appendText("发送模式Hex");
#endif
tx_model = TX_Model_HEX;
}
// Hex Model
void Widget::transmissionText_selectSlot(){
#ifdef DEBUGFLAG
appendText("发送模式Text");
#endif
tx_model = TX_Model_TEXT;
}
/* 波特率选择 */
void Widget::on_config_baud_comboBox_currentIndexChanged(int index)
{
baud_rate = ui->config_baud_comboBox->itemText(index).toInt();
ui->receive_Edit->insertPlainText("baud rate to " + QString::number(baud_rate) + "\n");
if(initDone){
switch (index) {
case 0:
baud_model = baud_model_4800;
break;
case 1:
baud_model = baud_model_9600;
break;
case 2:
baud_model = baud_model_38400;
break;
case 3:
baud_model = baud_model_115200;
break;
}
#ifdef DEBUGFLAG
appendText("当前波特率:" + ui->config_baud_comboBox->itemText(index));
#endif
}
}
// 数据位长度选择
/* 数据位长度选择 */
void Widget::on_config_databit_comboBox_currentIndexChanged(int index)
{
data_bit = ui->config_databit_comboBox->itemText(index).toInt();
ui->receive_Edit->insertPlainText("data bit to " + QString::number(data_bit) + "\n");
if(initDone){
switch (index) {
case 0:
databit_model = databit_model_5;
break;
case 1:
databit_model = databit_model_6;
break;
case 2:
databit_model = databit_model_7;
break;
case 3:
databit_model = databit_model_8;
break;
}
#ifdef DEBUGFLAG
appendText("当前数据位长度:" + ui->config_databit_comboBox->itemText(index));
#endif
}
}
// 停止位长度选择
/* 停止位长度选择 */
void Widget::on_config_stopbit_comboBox_currentIndexChanged(int index)
{
stop_bit = ui->config_stopbit_comboBox->itemText(index).toDouble() * 10;
ui->receive_Edit->insertPlainText("stop bit to " + QString::number(stop_bit) + "\n");
if(initDone){
switch (index) {
case 0:
stop_model = stop_model_1;
break;
case 1:
stop_model = stop_model_1_5;
break;
case 2:
stop_model = stop_model_2;
break;
}
#ifdef DEBUGFLAG
QString stopbit_length;
if(stop_model == stop_model_1){stopbit_length = "1.0";}
if(stop_model == stop_model_1_5){stopbit_length = "1.5";}
if(stop_model == stop_model_2){stopbit_length = "2.0";}
appendText("停止位长度: " + stopbit_length);
#endif
}
}
/* 校验模式选择 */
void Widget::on_config_check_comboBox_currentIndexChanged(int index)
{
if (ui->config_check_comboBox->itemText(index) != "no"){
if (ui->config_check_comboBox->itemText(index) == "odd"){
check = 1;
if(initDone){
// 更新校验枚举
switch(index){
case 0:
check_model = check_model_no;
break;
case 1:
check_model = check_model_even;
break;
case 2:
check_model = check_model_odd;
break;
}
if (ui->config_check_comboBox->itemText(index) == "even"){
check = 2;
#ifdef DEBUGFLAG
QString checkModel;
switch (index) {
case 0:
checkModel = "无校验";
break;
case 1:
checkModel = "奇校验";
break;
case 2:
checkModel = "偶校验";
break;
}
}else{
check = 0;
appendText("校验模式: " + checkModel);
#endif
}
ui->receive_Edit->insertPlainText("check to " + QString::number(check) + "\n");
}
// 打开串口
void Widget::on_openserial_button_clicked()
{
// 串口初始化
// 串口号
/* 配置连接的串口 */
serialPort->setPortName(ui->config_port_comboBox->currentText());
// 波特率
switch (baud_rate) {
case 4800:
serialPort->setBaudRate(QSerialPort::Baud4800);
break;
case 9600:
serialPort->setBaudRate(QSerialPort::Baud9600);
break;
case 38400:
serialPort->setBaudRate(QSerialPort::Baud38400);
break;
case 115200:
serialPort->setBaudRate(QSerialPort::Baud115200);
break;
}
// 数据位
switch (data_bit) {
case 5:
serialPort->setDataBits(QSerialPort::Data5);
break;
case 6:
serialPort->setDataBits(QSerialPort::Data6);
break;
case 7:
serialPort->setDataBits(QSerialPort::Data7);
break;
case 8:
serialPort->setDataBits(QSerialPort::Data8);
break;
}
// 停止位
switch (stop_bit) {
case 10:
serialPort->setStopBits(QSerialPort::OneStop);
break;
case 15:
serialPort->setStopBits(QSerialPort::OneAndHalfStop);
break;
case 20:
serialPort->setStopBits(QSerialPort::TwoStop);
break;
}
// 奇偶校验
switch (check) {
case 0:
serialPort->setParity(QSerialPort::NoParity);
break;
case 1:
serialPort->setParity(QSerialPort::OddParity);
break;
case 2:
serialPort->setParity(QSerialPort::EvenParity);
break;
}
/* 配置波特率 */
if(baud_model == baud_model_4800){serialPort->setBaudRate(QSerialPort::Baud4800);}
if(baud_model == baud_model_9600){serialPort->setBaudRate(QSerialPort::Baud9600);}
if(baud_model == baud_model_38400){serialPort->setBaudRate(QSerialPort::Baud38400);}
if(baud_model == baud_model_115200){serialPort->setBaudRate(QSerialPort::Baud115200);}
/* 配置数据位长度 */
if(databit_model == databit_model_5){serialPort->setDataBits(QSerialPort::Data5);}
if(databit_model == databit_model_6){serialPort->setDataBits(QSerialPort::Data6);}
if(databit_model == databit_model_7){serialPort->setDataBits(QSerialPort::Data7);}
if(databit_model == databit_model_8){serialPort->setDataBits(QSerialPort::Data8);}
/* 配置停止位长度 */
if(stop_model == stop_model_1){serialPort->setStopBits(QSerialPort::OneStop);}
if(stop_model == stop_model_1_5){serialPort->setStopBits(QSerialPort::OneAndHalfStop);}
if(stop_model == stop_model_2){serialPort->setStopBits(QSerialPort::TwoStop);}
/* 配置奇偶校验 */
// 这里的 ODD 和 EVEN 反了
if(check_model == check_model_no){serialPort->setParity(QSerialPort::NoParity);}
if(check_model == check_model_odd){serialPort->setParity(QSerialPort::EvenParity);}
if(check_model == check_model_even){serialPort->setParity(QSerialPort::OddParity);}
// 按下后是否需要执行打开端口功能
if (ui->openserial_button->text() == "Open Serial"){
if (ui->openserial_button->text() == "开启串口"){
// 提示正在连接
#ifdef DEBUGFLAG
QDateTime dateTime = QDateTime::currentDateTime();
QString dateStr = dateTime.toString("yyyy-MM-dd hh:mm:ss");
ui->receive_Edit->insertPlainText("[" + dateStr + "]\n");
ui->receive_Edit->insertPlainText("Connect to Serial " + ui->config_port_comboBox->currentText() + " ...\n");
appendText("[" + dateStr + "]\n");
appendText("正在连接至串口:" + ui->config_port_comboBox->currentText() + " ...");
#endif
// 端口开启成功
if (serialPort->open(QIODevice::ReadWrite) == true){
// 改变按钮名
ui->openserial_button->setText("Close Serial");
ui->openserial_button->setText("关闭串口");
// 让端口下拉框不可选
ui->config_port_comboBox->setEnabled(false);
ui->config_baud_comboBox->setEnabled(false);
ui->config_databit_comboBox->setEnabled(false);
ui->config_stopbit_comboBox->setEnabled(false);
ui->config_check_comboBox->setEnabled(false);
// 更新提示
ui->status->setText("Connect to " + ui->config_port_comboBox->currentText());
ui->status->setText("连接至:" + ui->config_port_comboBox->currentText());
ui->status->setStyleSheet("color:green");
// 提示用户已连接
ui->receive_Edit->insertPlainText("Connect Succesufully! \n");
#ifdef DEBUGFLAG
appendText("连接成功!");
#endif
}else{
// 连接失败
ui->receive_Edit->insertPlainText("Connect Faild\n");
#ifdef DEBUGFLAG
appendText("连接失败!");
#endif
}
}else{
// 关闭串口
serialPort->close();
// 改变按钮名
ui->openserial_button->setText("Open Serial");
ui->openserial_button->setText("开启串口");
// 让端口下拉框可选
ui->config_port_comboBox->setEnabled(true);
ui->config_baud_comboBox->setEnabled(true);
ui->config_databit_comboBox->setEnabled(true);
ui->config_stopbit_comboBox->setEnabled(true);
ui->config_check_comboBox->setEnabled(true);
ui->status->setText("Disconnect");
// 更新提示
ui->status->setText("未连接");
ui->status->setStyleSheet("color:black");
}
}
@ -281,7 +366,7 @@ void Widget::on_transmission_send_Button_clicked()
// 判断发送的内容是否为空
if (ui->transmission_Edit->toPlainText().isEmpty()){
QMessageBox::information(this, tr("Attention"), tr("No Send Data"), QMessageBox::Ok);
QMessageBox::information(this, tr("注意"), tr("发送内容为空!"), QMessageBox::Ok);
return;
}
@ -289,26 +374,21 @@ void Widget::on_transmission_send_Button_clicked()
SendText = ui->transmission_Edit->toPlainText().toUtf8();
// 判断发送模式
if (ui->transmission_textmode->isChecked()){
qbytearray = SendText;
}
if (ui->transmission_hexmode->isChecked()){
qbytearray = SendText.toHex();
}
if(tx_model == TX_Model_TEXT){qbytearray = SendText;}
if(tx_model == TX_Model_HEX){qbytearray = SendText.toHex();}
// 判断是否连接了串口
if (serialPort->isOpen()){
serialPort->write(qbytearray);
if (ui->transmission_textmode->isChecked()){
ui->receive_Edit->insertPlainText("[Send]\n" + SendText + "\n");
if(tx_model == TX_Model_TEXT){
appendText(SendText);
}
if (ui->transmission_hexmode->isChecked()){
ui->receive_Edit->insertPlainText("[Send]\n" + SendText.toHex(' ').toUpper() + "\n");
if(tx_model == TX_Model_HEX){
appendText(SendText.toHex(' ').toUpper());
}
} else {
QMessageBox::information(this, tr("Attention"), tr("Not connected to an available serial port"), QMessageBox::Ok);
QMessageBox::information(this, tr("注意"), tr("未连接至任何串口,无法发送!"), QMessageBox::Ok);
}
ui->transmission_Edit->clear();
}
// Button: setting
@ -320,18 +400,15 @@ void Widget::on_setting_button_clicked()
// 接受数据
void Widget::serialPort_readyRead(){
// 读取串口中所有的数据
QByteArray receive_data = serialPort->readAll();
QString str_reveive_data;
if (ui->receivetextmode->isChecked()){
str_reveive_data = QString(receive_data);
if (serialPort->isOpen()){
QByteArray receive_data = serialPort->readAll();
QString str_reveive_data;
if (rx_model == RX_Model_TEXT){
str_reveive_data = QString(receive_data);
}
if (rx_model == RX_Model_HEX){
str_reveive_data = receive_data.toHex(' ').toUpper();
}
appendText(str_reveive_data);
}
if (ui->receive_hexmode->isChecked()){
str_reveive_data = receive_data.toHex(' ').toUpper();
}
ui->receive_Edit->insertPlainText("[Receive]\n" + str_reveive_data + "\n");
}

View File

@ -11,6 +11,8 @@
#include <QShortcut>
#include "setting.h"
//#define DEBUGFLAG 1
QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE
@ -53,6 +55,7 @@ private slots:
void serialPort_readyRead();
void appendText(const QString& text);
private:
Ui::Widget *ui;
@ -61,23 +64,49 @@ private:
int Timer_ID;
int id = 0;
// 发送&接收模式 - 通过调整此处可以更改默认值
// 1 - Text
// 0 - Hex
int recive_config_select = 1;
int transmission_config_select = 1;
// 初始化完毕标志位
bool initDone = false;
// 波特率
int baud_rate = 0;
// 数据位长度
int data_bit = 0;
// 停止位长度
int stop_bit = 0;
// 校验模式
// 0 - no 无
// 1 - odd 奇
// 2 - even 偶
quint8 check = 0;
// 发送&接收模式 - 通过调整此处可以更改默认值
enum TX_Model{
TX_Model_TEXT = 1,
TX_Model_HEX
}tx_model;
// 接收模式枚举
enum RX_Model{
RX_Model_TEXT = 1,
RX_Model_HEX
}rx_model;
// 默认校验模式 - 通过调整此处可以更改默认值
enum Check_Model{
check_model_no = 0, // 无校验
check_model_even, // 奇校验
check_model_odd // 偶校验
}check_model;
// 默认停止位长度 - 通过调整此处可以更改默认值
enum Stop_Model{
stop_model_1 = 0,
stop_model_1_5,
stop_model_2
}stop_model;
// 默认数据位长度 - 通过调整此处可以更改默认值
enum DataBit_Model{
databit_model_5 = 0,
databit_model_6,
databit_model_7,
databit_model_8
}databit_model;
// 默认波特率 - 通过调整此处可以更改默认值
enum Baud_Model{
baud_model_4800 = 0,
baud_model_9600,
baud_model_38400,
baud_model_115200
}baud_model;
QByteArray SendText,ReceiveText;
};

View File

@ -35,18 +35,8 @@
</rect>
</property>
<property name="title">
<string>Receive</string>
<string>接收</string>
</property>
<widget class="QTextBrowser" name="receive_Edit">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>421</width>
<height>191</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="receive_clear_Button">
<property name="geometry">
<rect>
@ -57,7 +47,7 @@
</rect>
</property>
<property name="text">
<string>Clear</string>
<string>清除</string>
</property>
</widget>
<widget class="QPushButton" name="updateport_Button">
@ -70,7 +60,17 @@
</rect>
</property>
<property name="text">
<string>update port</string>
<string>更新串口</string>
</property>
</widget>
<widget class="QTextEdit" name="receive_edit">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>421</width>
<height>191</height>
</rect>
</property>
</widget>
</widget>
@ -84,7 +84,7 @@
</rect>
</property>
<property name="title">
<string>Transmission</string>
<string>发送</string>
</property>
<widget class="QPushButton" name="transmission_send_Button">
<property name="geometry">
@ -96,7 +96,7 @@
</rect>
</property>
<property name="text">
<string>Send</string>
<string>发送</string>
</property>
</widget>
<widget class="QPushButton" name="transmission_clear_Button">
@ -109,7 +109,7 @@
</rect>
</property>
<property name="text">
<string>Clear</string>
<string>清除</string>
</property>
</widget>
<widget class="QTextEdit" name="transmission_Edit">
@ -132,7 +132,7 @@
</rect>
</property>
<property name="text">
<string>Disconnected</string>
<string>未连接</string>
</property>
</widget>
</widget>
@ -146,7 +146,7 @@
</rect>
</property>
<property name="title">
<string>Serial Config</string>
<string>串口配置</string>
</property>
<widget class="QWidget" name="verticalLayoutWidget">
<property name="geometry">
@ -175,7 +175,7 @@
</size>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Port&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;串口&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
@ -201,33 +201,12 @@
</size>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Baud&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;波特率&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="config_baud_comboBox">
<item>
<property name="text">
<string>4800</string>
</property>
</item>
<item>
<property name="text">
<string>9600</string>
</property>
</item>
<item>
<property name="text">
<string>38400</string>
</property>
</item>
<item>
<property name="text">
<string>115200</string>
</property>
</item>
</widget>
<widget class="QComboBox" name="config_baud_comboBox"/>
</item>
</layout>
</item>
@ -248,35 +227,15 @@
</size>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;DataBit&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;数据长度&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="config_databit_comboBox">
<property name="currentText">
<string>5</string>
<string/>
</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>
</layout>
@ -298,28 +257,12 @@
</size>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;StopBit&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;停止位&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="config_stopbit_comboBox">
<item>
<property name="text">
<string>1</string>
</property>
</item>
<item>
<property name="text">
<string>1.5</string>
</property>
</item>
<item>
<property name="text">
<string>2</string>
</property>
</item>
</widget>
<widget class="QComboBox" name="config_stopbit_comboBox"/>
</item>
</layout>
</item>
@ -340,28 +283,12 @@
</size>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Check&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;校验&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="config_check_comboBox">
<item>
<property name="text">
<string>no</string>
</property>
</item>
<item>
<property name="text">
<string>odd</string>
</property>
</item>
<item>
<property name="text">
<string>even</string>
</property>
</item>
</widget>
<widget class="QComboBox" name="config_check_comboBox"/>
</item>
</layout>
</item>
@ -378,7 +305,7 @@
</rect>
</property>
<property name="title">
<string>Receive Config</string>
<string>接收模式</string>
</property>
<widget class="QWidget" name="verticalLayoutWidget_2">
<property name="geometry">
@ -417,7 +344,7 @@
</rect>
</property>
<property name="title">
<string>Transmission Config</string>
<string>发送模式</string>
</property>
<widget class="QWidget" name="verticalLayoutWidget_3">
<property name="geometry">
@ -456,7 +383,7 @@
</rect>
</property>
<property name="text">
<string>Open Serial</string>
<string>开启串口</string>
</property>
</widget>
<widget class="QPushButton" name="setting_button">
@ -469,7 +396,7 @@
</rect>
</property>
<property name="text">
<string>setting</string>
<string>关于</string>
</property>
</widget>
</widget>