From 98549e640cfe165eb7a940c1e8fcbaa0180f39b2 Mon Sep 17 00:00:00 2001 From: 95384 <664090429@qq.com> Date: Wed, 18 Dec 2024 09:06:49 +0800 Subject: [PATCH] =?UTF-8?q?ok=EF=BC=8C=E5=8F=AF=E4=BB=A5=E7=AE=80=E5=8D=95?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=87=BA=E5=8E=82=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 1 + micro_climate_config.pro.user | 2 +- widget.cpp | 447 +++++++- widget.h | 30 + widget.ui | 1828 +++++++++++++++++++++++++++------ 5 files changed, 1965 insertions(+), 343 deletions(-) diff --git a/main.cpp b/main.cpp index b0a4ec2..912a035 100644 --- a/main.cpp +++ b/main.cpp @@ -1,6 +1,7 @@ #include "widget.h" #include +#include int main(int argc, char *argv[]) { diff --git a/micro_climate_config.pro.user b/micro_climate_config.pro.user index fdc5055..6a5714a 100644 --- a/micro_climate_config.pro.user +++ b/micro_climate_config.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/widget.cpp b/widget.cpp index db14b36..63048a5 100644 --- a/widget.cpp +++ b/widget.cpp @@ -1,11 +1,56 @@ #include "widget.h" #include "ui_widget.h" +#define UART_WAIT_MS 50 + Widget::Widget(QWidget *parent) : QWidget(parent) , ui(new Ui::Widget) { ui->setupUi(this); +// 启动时关闭按钮 + disable__(); + // 限制输入范围 + QLineEdit *edit_1R5 = ui -> write_1R5_lineEdit; + QLineEdit *edit_4R5 = ui -> write_4R5_lineEdit; + QLineEdit *edit_8R0 = ui -> write_8R0_lineEdit; + QLineEdit *rssi = ui -> write_lineEdit; + QLineEdit *coefficient = ui -> write_Coefficient_lineEdit; + QLineEdit *edit_ns = ui -> write_distance_NS_lineEdit; + QLineEdit *edit_we = ui -> write_distance_WE_lineEdit; + // 创建正则表达式对象 + QRegExp rx_0_100("^([0-9]|[1-9][0-9]|100)$"); + QRegExp rx_x_xxxx("^([0-9])(\\.\\d{4})$"); + QRegExp rx__xx("^\\d+\\.\\d{2}$"); + // 创建 QRegExpValidator 对象 + QRegExpValidator *pReg_0_100 = new QRegExpValidator(rx_0_100, this); + QRegExpValidator *pReg_x_xxxx = new QRegExpValidator(rx_x_xxxx, this); + QRegExpValidator *pReg__xx = new QRegExpValidator(rx__xx, this); + edit_1R5->setValidator(pReg_0_100); + edit_4R5->setValidator(pReg_0_100); + edit_8R0->setValidator(pReg_0_100); + rssi->setValidator(pReg_0_100); + coefficient->setValidator(pReg_x_xxxx); + edit_ns->setValidator(pReg__xx); + edit_we->setValidator(pReg__xx); + + error1_status_label[0] = ui -> error1_status_label; + error1_status_label[1] = ui -> error2_status_label; + error1_status_label[2] = ui -> error3_status_label; + error1_status_label[3] = ui -> error4_status_label; + error1_status_label[4] = ui -> error5_status_label; + error1_status_label[5] = ui -> error6_status_label; + error1_status_label[6] = ui -> error7_status_label; + error1_status_label[7] = ui -> error8_status_label; + error1_status_label[8] = ui -> error9_status_label; + error1_status_label[9] = ui -> error10_status_label; + error1_status_label[10] = ui -> error11_status_label; + error1_status_label[11] = ui -> error12_status_label; + error1_status_label[12] = ui -> error13_status_label; + error1_status_label[13] = ui -> error14_status_label; + error1_status_label[14] = ui -> error15_status_label; + error1_status_label[15] = ui -> error16_status_label; + // 启动时刷新串口 QStringList serialNamePort; foreach(const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) @@ -41,6 +86,35 @@ void Widget::closeEvent(QCloseEvent *event) } } +void Widget::disable__() +{ + ui->groupBox->setEnabled(false); + ui->groupBox_2->setEnabled(false); + ui->groupBox_3->setEnabled(false); +} + +void Widget::able__() +{ + ui->groupBox->setEnabled(true); + ui->groupBox_2->setEnabled(true); + ui->groupBox_3->setEnabled(true); +} + +uint16_t Widget::modbusCrc16(const uint8_t *data, const int len) +{ + uint16_t crc = 0xFFFF; + for (int pos = 0; pos < len; pos++) { + crc ^= *data++; + for (int i = 0; i < 8; i++) { + if ((crc & 0x0001) > 0) + crc = (crc >> 1) ^ 0xA001; + else + crc = crc >> 1; + } + } + return (crc<<8&0xFF00)|(crc>>8&0x00FF); +} + //串口刷新 void Widget::on_SerialPort_refresh_pushButton_clicked() { @@ -163,6 +237,10 @@ void Widget::on_Open_Serial_pushButton_clicked() ui -> DataBits_label -> setEnabled(false); ui -> CheckBits_label -> setEnabled(false); ui -> StopBits_label -> setEnabled(false); +// 串口打开后使能功能 + able__(); + + open_button_status = !open_button_status; } else{ QMessageBox::critical(this, "提示", "串口打开失败"); @@ -172,7 +250,7 @@ void Widget::on_Open_Serial_pushButton_clicked() else { //将按钮变为打开按钮,红色指示标志 ui -> Open_Serial_pushButton ->setText("打开串口"); - ui -> serial_status_label ->setStyleSheet("QLabel { background-color :rgb(184, 0, 0); border-radius: 10px;}"); + ui -> serial_status_label -> setStyleSheet("QLabel { background-color :rgb(184, 0, 0); border-radius: 10px;}"); Serial_port -> close(); //关闭串口后允许配置 ui -> SerialPort_comboBox -> setEnabled(true); @@ -185,6 +263,371 @@ void Widget::on_Open_Serial_pushButton_clicked() ui -> DataBits_label -> setEnabled(true); ui -> CheckBits_label -> setEnabled(true); ui -> StopBits_label -> setEnabled(true); +// 串口关闭后取消使能功能 + disable__(); + + open_button_status = !open_button_status; } - open_button_status = !open_button_status; +} + +//读取按钮 +void Widget::on_get_data_pushButton_clicked() +{ + QByteArray sent_comand; + + sent_comand.append(static_cast(0x30)); + sent_comand.append(static_cast(0x03)); + sent_comand.append(static_cast(0x00)); + sent_comand.append(static_cast(0x1E)); + sent_comand.append(static_cast(0x00)); + sent_comand.append(static_cast(0x0A)); + + uint8_t sent_comand_u8[sent_comand.length()]; + for(int i = 0; i < sent_comand.length(); i++) + { + sent_comand_u8[i] = sent_comand[i]; + } + + uint16_t crc_16_val = modbusCrc16(sent_comand_u8, sent_comand.length()); + + sent_comand.append(crc_16_val >> 8); + sent_comand.append(crc_16_val); + + Serial_port->write(sent_comand); + + //连接信号与槽 + //断开所有其他的信号与槽连接 + disconnect(Serial_port, &QSerialPort::readyRead, nullptr, nullptr); + connect(Serial_port, SIGNAL(readyRead()), this, SLOT(get_configdata()), Qt::UniqueConnection); +} + +std::array getBits(unsigned short num) { + std::array bits; + for (int i = 15; i >= 0; --i) { + bits[15 - i] = ((num >> i) & 1); + } + return bits; +} + +void Widget::get_configdata() +{ + // 接收数据,一会再接收,以便接收超长数据 + QByteArray readed_data; + while(Serial_port->waitForReadyRead(UART_WAIT_MS)==true); + readed_data.append(Serial_port -> readAll()); + + //防止干扰 + while(readed_data.length() > 1) + { + qDebug() << readed_data.length(); + qDebug() << readed_data; + if(readed_data[0] != static_cast(0x30) || readed_data[1] != static_cast(0x03)) + { + readed_data.remove(0, 1); + } + else + break; + } + + uint8_t read_comand_u8[readed_data.length()]; + for(int i = 0; i < readed_data.length(); i++) + { + read_comand_u8[i] = readed_data[i]; + } + + if(readed_data.length() >= 25) + if(modbusCrc16(read_comand_u8, 23) >> 8 == read_comand_u8[23] && (modbusCrc16(read_comand_u8, 23) & 0x00FF) == read_comand_u8[24]) + { + qDebug() << "CRC16校验成功"; + uint16_t config_1R5 = read_comand_u8[3] << 8 | read_comand_u8[4]; + uint16_t config_4R5 = read_comand_u8[5] << 8 | read_comand_u8[6]; + uint16_t config_8R0 = read_comand_u8[7] << 8 | read_comand_u8[8]; + uint16_t rssi = read_comand_u8[9] << 8 | read_comand_u8[10]; + uint16_t coefficient = read_comand_u8[11] <<8 | read_comand_u8[12]; + uint16_t ns_distance = read_comand_u8[13] << 8 | read_comand_u8[14]; + uint16_t we_distance = read_comand_u8[15] << 8 | read_comand_u8[16]; + uint16_t errorlog = read_comand_u8[17] << 8 | read_comand_u8[18]; + uint16_t ns_c = read_comand_u8[19] << 8 | read_comand_u8[20]; + uint16_t we_c = read_comand_u8[21] << 8 | read_comand_u8[22]; + + qDebug() << "config_1R5:" << config_1R5; + qDebug() << "config_4R5:" << config_4R5; + qDebug() << "config_8R0:" << config_8R0; + qDebug() << "rssi:" << rssi; + qDebug() << "coefficient:" << coefficient; + qDebug() << "ns_distance:" << ns_distance; + qDebug() << "we_distance:" << we_distance; + qDebug() << "errorlog:" << errorlog; + qDebug() << "ns_c:" << ns_c; + qDebug() << "we_c:" << we_c; + + ui -> config_1R5_lineEdit -> setText(QString::number(config_1R5)); + ui -> config_4R5_lineEdit -> setText(QString::number(config_4R5)); + ui -> config_8R0_lineEdit -> setText(QString::number(config_8R0)); + ui -> RSSI_lineEdit -> setText(QString::number((float)rssi/100.0)); + ui -> Coefficient_lineEdit ->setText(QString::number((float)coefficient/10000.0)); + ui -> distance_NS_lineEdit -> setText(QString::number((float)ns_distance/500.0) + "mm"); + ui -> distance_WE_lineEdit -> setText(QString::number((float)we_distance/500.0) + "mm"); + ui -> c_NS_lineEdit -> setText(QString::number((float)ns_c/10.0) + "m/s"); + ui -> c_WE_lineEdit -> setText(QString::number((float)we_c/10.0) + "m/s"); + + std::array bits = getBits(errorlog); + for (int i = 15; i >= 0; --i) + { + qDebug() << bits[i]; + bits[i] ? error1_status_label[15 - i] -> setStyleSheet("QLabel { background-color :rgb(184, 0, 0); border-radius: 10px;}") \ + : error1_status_label[15 - i] -> setStyleSheet("QLabel { background-color :rgb(0, 144, 0); border-radius: 10px;}"); + } + } + disconnect(Serial_port, &QSerialPort::readyRead, nullptr, nullptr); +} + + + +//30->1E +void Widget::on_pushButton_clicked() +{ + QString text = ui -> write_1R5_lineEdit -> text(); + bool ok; + double data = text.toDouble(&ok); + qDebug() << data; + uint16_t data_u16 = (uint16_t)data; + + QByteArray sent_comand; + + sent_comand.append(static_cast(0x30)); + sent_comand.append(static_cast(0x10)); + sent_comand.append(static_cast(0x00)); + sent_comand.append(static_cast(0x1E)); + sent_comand.append(static_cast(0x00)); + sent_comand.append(static_cast(0x01)); + sent_comand.append(static_cast(0x02)); + sent_comand.append(static_cast(data_u16 >> 8)); + sent_comand.append(static_cast(data_u16 & 0x00FF)); + + uint8_t sent_comand_u8[sent_comand.length()]; + for(int i = 0; i < sent_comand.length(); i++) + { + sent_comand_u8[i] = sent_comand[i]; + } + + uint16_t crc_16_val = modbusCrc16(sent_comand_u8, sent_comand.length()); + + sent_comand.append(crc_16_val >> 8); + sent_comand.append(crc_16_val); + + Serial_port->write(sent_comand); +} + +//31->1F +void Widget::on_pushButton_2_clicked() +{ + QString text = ui -> write_4R5_lineEdit -> text(); + bool ok; + double data = text.toDouble(&ok); + qDebug() << data; + uint16_t data_u16 = (uint16_t)data; + + QByteArray sent_comand; + + sent_comand.append(static_cast(0x30)); + sent_comand.append(static_cast(0x10)); + sent_comand.append(static_cast(0x00)); + sent_comand.append(static_cast(0x1F)); + sent_comand.append(static_cast(0x00)); + sent_comand.append(static_cast(0x01)); + sent_comand.append(static_cast(0x02)); + sent_comand.append(static_cast(data_u16 >> 8)); + sent_comand.append(static_cast(data_u16 & 0x00FF)); + + uint8_t sent_comand_u8[sent_comand.length()]; + for(int i = 0; i < sent_comand.length(); i++) + { + sent_comand_u8[i] = sent_comand[i]; + } + + uint16_t crc_16_val = modbusCrc16(sent_comand_u8, sent_comand.length()); + + sent_comand.append(crc_16_val >> 8); + sent_comand.append(crc_16_val); + + Serial_port->write(sent_comand); +} + +//32->20 +void Widget::on_pushButton_3_clicked() +{ + QString text = ui -> write_8R0_lineEdit -> text(); + bool ok; + double data = text.toDouble(&ok); + qDebug() << data; + uint16_t data_u16 = (uint16_t)data; + + QByteArray sent_comand; + + sent_comand.append(static_cast(0x30)); + sent_comand.append(static_cast(0x10)); + sent_comand.append(static_cast(0x00)); + sent_comand.append(static_cast(0x20)); + sent_comand.append(static_cast(0x00)); + sent_comand.append(static_cast(0x01)); + sent_comand.append(static_cast(0x02)); + sent_comand.append(static_cast(data_u16 >> 8)); + sent_comand.append(static_cast(data_u16 & 0x00FF)); + + uint8_t sent_comand_u8[sent_comand.length()]; + for(int i = 0; i < sent_comand.length(); i++) + { + sent_comand_u8[i] = sent_comand[i]; + } + + uint16_t crc_16_val = modbusCrc16(sent_comand_u8, sent_comand.length()); + + sent_comand.append(crc_16_val >> 8); + sent_comand.append(crc_16_val); + + Serial_port->write(sent_comand); +} + +//33->21 +void Widget::on_pushButton_4_clicked() +{ + QString text = ui -> write_lineEdit -> text(); + bool ok; + double data = text.toDouble(&ok); + qDebug() << data; + uint16_t data_u16 = (uint16_t)data; + + QByteArray sent_comand; + + sent_comand.append(static_cast(0x30)); + sent_comand.append(static_cast(0x10)); + sent_comand.append(static_cast(0x00)); + sent_comand.append(static_cast(0x21)); + sent_comand.append(static_cast(0x00)); + sent_comand.append(static_cast(0x01)); + sent_comand.append(static_cast(0x02)); + sent_comand.append(static_cast(data_u16 >> 8)); + sent_comand.append(static_cast(data_u16 & 0x00FF)); + + uint8_t sent_comand_u8[sent_comand.length()]; + for(int i = 0; i < sent_comand.length(); i++) + { + sent_comand_u8[i] = sent_comand[i]; + } + + uint16_t crc_16_val = modbusCrc16(sent_comand_u8, sent_comand.length()); + + sent_comand.append(crc_16_val >> 8); + sent_comand.append(crc_16_val); + + Serial_port->write(sent_comand); +} + +//34->22 +void Widget::on_pushButton_5_clicked() +{ + QString text = ui -> write_Coefficient_lineEdit -> text(); + bool ok; + double data = text.toDouble(&ok); + data *= 10000; + qDebug() << data; + uint16_t data_u16 = (uint16_t)data; + + QByteArray sent_comand; + + sent_comand.append(static_cast(0x30)); + sent_comand.append(static_cast(0x10)); + sent_comand.append(static_cast(0x00)); + sent_comand.append(static_cast(0x22)); + sent_comand.append(static_cast(0x00)); + sent_comand.append(static_cast(0x01)); + sent_comand.append(static_cast(0x02)); + sent_comand.append(static_cast(data_u16 >> 8)); + sent_comand.append(static_cast(data_u16 & 0x00FF)); + + uint8_t sent_comand_u8[sent_comand.length()]; + for(int i = 0; i < sent_comand.length(); i++) + { + sent_comand_u8[i] = sent_comand[i]; + } + + uint16_t crc_16_val = modbusCrc16(sent_comand_u8, sent_comand.length()); + + sent_comand.append(crc_16_val >> 8); + sent_comand.append(crc_16_val); + + Serial_port->write(sent_comand); +} + +//35->23 +void Widget::on_pushButton_6_clicked() +{ + QString text = ui -> write_distance_NS_lineEdit -> text(); + bool ok; + double data = text.toDouble(&ok); + data *= 500; + qDebug() << data; + uint16_t data_u16 = (uint16_t)data; + + QByteArray sent_comand; + + sent_comand.append(static_cast(0x30)); + sent_comand.append(static_cast(0x10)); + sent_comand.append(static_cast(0x00)); + sent_comand.append(static_cast(0x23)); + sent_comand.append(static_cast(0x00)); + sent_comand.append(static_cast(0x01)); + sent_comand.append(static_cast(0x02)); + sent_comand.append(static_cast(data_u16 >> 8)); + sent_comand.append(static_cast(data_u16 & 0x00FF)); + + uint8_t sent_comand_u8[sent_comand.length()]; + for(int i = 0; i < sent_comand.length(); i++) + { + sent_comand_u8[i] = sent_comand[i]; + } + + uint16_t crc_16_val = modbusCrc16(sent_comand_u8, sent_comand.length()); + + sent_comand.append(crc_16_val >> 8); + sent_comand.append(crc_16_val); + + Serial_port->write(sent_comand); +} + +//36->24 +void Widget::on_pushButton_7_clicked() +{ + QString text = ui -> write_distance_WE_lineEdit -> text(); + bool ok; + double data = text.toDouble(&ok); + data *= 500; + qDebug() << data; + uint16_t data_u16 = (uint16_t)data; + + QByteArray sent_comand; + + sent_comand.append(static_cast(0x30)); + sent_comand.append(static_cast(0x10)); + sent_comand.append(static_cast(0x00)); + sent_comand.append(static_cast(0x24)); + sent_comand.append(static_cast(0x00)); + sent_comand.append(static_cast(0x01)); + sent_comand.append(static_cast(0x02)); + sent_comand.append(static_cast(data_u16 >> 8)); + sent_comand.append(static_cast(data_u16 & 0x00FF)); + + uint8_t sent_comand_u8[sent_comand.length()]; + for(int i = 0; i < sent_comand.length(); i++) + { + sent_comand_u8[i] = sent_comand[i]; + } + + uint16_t crc_16_val = modbusCrc16(sent_comand_u8, sent_comand.length()); + + sent_comand.append(crc_16_val >> 8); + sent_comand.append(crc_16_val); + + Serial_port->write(sent_comand); } diff --git a/widget.h b/widget.h index ac27474..1ae637f 100644 --- a/widget.h +++ b/widget.h @@ -7,6 +7,9 @@ #include #include #include +#include +#include +#include QT_BEGIN_NAMESPACE namespace Ui { class Widget; } @@ -25,12 +28,39 @@ private slots: void on_Open_Serial_pushButton_clicked(); + void on_get_data_pushButton_clicked(); + + //槽函数 + void get_configdata(void); + + void on_pushButton_clicked(); + + void on_pushButton_2_clicked(); + + void on_pushButton_3_clicked(); + + void on_pushButton_4_clicked(); + + void on_pushButton_5_clicked(); + + void on_pushButton_6_clicked(); + + void on_pushButton_7_clicked(); + private: Ui::Widget *ui; //关闭窗口提示 void closeEvent(QCloseEvent *event) override; + //关闭控件 + void disable__(void); + //打开控件 + void able__(void); + //crc校验 + uint16_t modbusCrc16(const uint8_t *data, const int len); //串口 QSerialPort * Serial_port; + QLabel *error1_status_label[16]; + }; #endif // WIDGET_H diff --git a/widget.ui b/widget.ui index 100b369..ab78150 100644 --- a/widget.ui +++ b/widget.ui @@ -6,351 +6,862 @@ 0 0 - 684 - 427 + 700 + 340 + + + 700 + 340 + + + + + 700 + 340 + + + + + 宋体 + 10 + + 微气象传感器调试助手 - + + + + 宋体 + 10 + + 0 - 串口配置 + 微气象配置 - - - - 50 - 50 - 156 - 207 - + + + 1 - - - - - - - - 宋体 - 12 - - - - - - - - - - 刷新 + + 1 + + + 1 + + + 1 + + + 3 + + + + + + + + + + 宋体 + 12 + + + + + + + + + + 刷新 + + + + + + + + + + 宋体 + 12 + + + + 波特率: + + + + + + + + 宋体 + 12 + + + + 6 + + + + 110 + + + + + 300 + + + + + 600 + + + + + 1200 + + + + + 2400 + + + + + 4800 + + + + + 9600 + + + + + 14400 + + + + + 19200 + + + + + 38400 + + + + + 43000 + + + + + 57600 + + + + + 76800 + + + + + 115200 + + + + + 128000 + + + + + 230400 + + + + + 256000 + + + + + 460800 + + + + + 921600 + + + + + 1000000 + + + + + 2000000 + + + + + 3000000 + + + + + + + + + + + + + 宋体 + 12 + + + + 数据位: + + + + + + + + 宋体 + 12 + + + + 3 + + + + 5 + + + + + 6 + + + + + 7 + + + + + 8 + + + + + + + + + + + + + 宋体 + 12 + + + + 校验位: + + + + + + + + 宋体 + 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 宋体 + 12 + + + + 停止位: + + + + + + + + 宋体 + 12 + + + + + 1 + + + + + 1.5 + + + + + 2 + + + + + + + + + + + + + 0 + 0 + + + + + 宋体 + 12 + + + + 打开串口 + + + + + + + + 0 + 0 + + + + + 20 + 20 + + + + + 20 + 20 + + + + background-color:rgb(184, 0, 0); /* 背景 */ +border-radius: 10px; /* 圆角半径 */ + + + + + + + + + + + + + + 配置 + + + + 1 - - - - - - - - - 宋体 - 12 - - + + 1 + + + 1 + + + 1 + + + 1 + + + - 波特率: + RSSI有效范围: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - 宋体 - 12 - + + + + 风速WE: - - 6 + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 换能器参数8R0: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 换能器表面距离NS: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 换能器表面距离WE: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 换能器参数1R5: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 风速NS: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 粘度修正系数: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 换能器参数4R5: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true - - - 110 - - - - - 300 - - - - - 600 - - - - - 1200 - - - - - 2400 - - - - - 4800 - - - - - 9600 - - - - - 14400 - - - - - 19200 - - - - - 38400 - - - - - 43000 - - - - - 57600 - - - - - 76800 - - - - - 115200 - - - - - 128000 - - - - - 230400 - - - - - 256000 - - - - - 460800 - - - - - 921600 - - - - - 1000000 - - - - - 2000000 - - - - - 3000000 - - - - - - - - - - 宋体 - 12 - - + + + + + + 写入配置 + + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + - 数据位: + 写入 - - - - - 宋体 - 12 - + + + + - - 3 + + + + + false + + + 0-100 + + + Qt::LogicalMoveStyle + + + + + + + RSSI有效范围: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + false + + + 0-100 + + + + + + + false + + + 0-100 + + + + + + + false + + + 1.1201 + + + + + + + 写入 + + + + + + + 换能器参数8R0: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + false + + + 115.12mm + + + + + + + 换能器参数1R5: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 换能器表面距离WE: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 写入 + + + + + + + false + + + 0-100 + + + + + + + 写入 + + + + + + + 换能器表面距离NS: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + false + + + 115.12mm + + + + + + + 换能器参数4R5: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 粘度修正系数: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 写入 + + + + + + + 写入 + + + + + + + 写入 + + + + + + + 读取数据 - - - 5 - - - - - 6 - - - - - 7 - - - - - 8 - - - - - - - - - - 宋体 - 12 - + + + + + + Qt::LeftToRight + + + 错误日志 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + + + Qt::LeftToRight - 校验位: + 大气压 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - 宋体 - 12 - - - - - - - - - - - - - - - - - - - - - - - - - - - - 宋体 - 12 - - - - 停止位: - - - - - - - - 宋体 - 12 - - - - - 1 - - - - - 1.5 - - - - - 2 - - - - - - - - - - - - - 0 - 0 - - - - - 宋体 - 12 - - - - 打开串口 - - - - - + + 0 @@ -370,8 +881,673 @@ - background-color:rgb(184, 0, 0); /* 背景 */ -border-radius: 10px; /* 圆角半径 */ + /*background-color:rgb(184, 0, 0); /* 背景 */ +background-color:rgb(0, 144, 0); /* 背景 */ +border-radius: 10px; /* 圆角半径 */ + + + + + + + + + + + Qt::LeftToRight + + + 东西探头 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 20 + 20 + + + + + 20 + 20 + + + + /*background-color:rgb(184, 0, 0); /* 背景 */ +background-color:rgb(0, 144, 0); /* 背景 */ +border-radius: 10px; /* 圆角半径 */ + + + + + + + + + + + Qt::LeftToRight + + + 占位 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 20 + 20 + + + + + 20 + 20 + + + + /*background-color:rgb(184, 0, 0); /* 背景 */ +background-color:rgb(0, 144, 0); /* 背景 */ +border-radius: 10px; /* 圆角半径 */ + + + + + + + + + + + + 0 + 0 + + + + + 20 + 20 + + + + + 20 + 20 + + + + Qt::LeftToRight + + + /*background-color:rgb(184, 0, 0); /* 背景 */ +background-color:rgb(0, 144, 0); /* 背景 */ +border-radius: 10px; /* 圆角半径 */ + + + + + + + + + + + Qt::LeftToRight + + + 占位 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 20 + 20 + + + + + 20 + 20 + + + + /*background-color:rgb(184, 0, 0); /* 背景 */ +background-color:rgb(0, 144, 0); /* 背景 */ +border-radius: 10px; /* 圆角半径 */ + + + + + + + + + + + + 0 + 0 + + + + + 20 + 20 + + + + + 20 + 20 + + + + /*background-color:rgb(184, 0, 0); /* 背景 */ +background-color:rgb(0, 144, 0); /* 背景 */ +border-radius: 10px; /* 圆角半径 */ + + + + + + + + + + + Qt::LeftToRight + + + 温湿度 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::LeftToRight + + + 占位 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::LeftToRight + + + 占位 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::LeftToRight + + + 南北探头 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 20 + 20 + + + + + 20 + 20 + + + + /*background-color:rgb(184, 0, 0); /* 背景 */ +background-color:rgb(0, 144, 0); /* 背景 */ +border-radius: 10px; /* 圆角半径 */ + + + + + + + + + + + + 0 + 0 + + + + + 20 + 20 + + + + + 20 + 20 + + + + /*background-color:rgb(184, 0, 0); /* 背景 */ +background-color:rgb(0, 144, 0); /* 背景 */ +border-radius: 10px; /* 圆角半径 */ + + + + + + + + + + + Qt::LeftToRight + + + 占位 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 20 + 20 + + + + + 20 + 20 + + + + /*background-color:rgb(184, 0, 0); /* 背景 */ +background-color:rgb(0, 144, 0); /* 背景 */ +border-radius: 10px; /* 圆角半径 */ + + + + + + + + + + + Qt::LeftToRight + + + 占位 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 20 + 20 + + + + + 20 + 20 + + + + /*background-color:rgb(184, 0, 0); /* 背景 */ +background-color:rgb(0, 144, 0); /* 背景 */ +border-radius: 10px; /* 圆角半径 */ + + + + + + + + + + + Qt::LeftToRight + + + 占位 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 20 + 20 + + + + + 20 + 20 + + + + /*background-color:rgb(184, 0, 0); /* 背景 */ +background-color:rgb(0, 144, 0); /* 背景 */ +border-radius: 10px; /* 圆角半径 */ + + + + + + + + + + + Qt::LeftToRight + + + 占位 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 20 + 20 + + + + + 20 + 20 + + + + /*background-color:rgb(184, 0, 0); /* 背景 */ +background-color:rgb(0, 144, 0); /* 背景 */ +border-radius: 10px; /* 圆角半径 */ + + + + + + + + + + + Qt::LeftToRight + + + 占位 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 20 + 20 + + + + + 20 + 20 + + + + /*background-color:rgb(184, 0, 0); /* 背景 */ +background-color:rgb(0, 144, 0); /* 背景 */ +border-radius: 10px; /* 圆角半径 */ + + + + + + + + + + + Qt::LeftToRight + + + 占位 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 20 + 20 + + + + + 20 + 20 + + + + /*background-color:rgb(184, 0, 0); /* 背景 */ +background-color:rgb(0, 144, 0); /* 背景 */ +border-radius: 10px; /* 圆角半径 */ + + + + + + + + + + + Qt::LeftToRight + + + 占位 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 20 + 20 + + + + + 20 + 20 + + + + /*background-color:rgb(184, 0, 0); /* 背景 */ +background-color:rgb(0, 144, 0); /* 背景 */ +border-radius: 10px; /* 圆角半径 */ + + + + + + + + + + + Qt::LeftToRight + + + 占位 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 20 + 20 + + + + + 20 + 20 + + + + /*background-color:rgb(184, 0, 0); /* 背景 */ +background-color:rgb(0, 144, 0); /* 背景 */ +border-radius: 10px; /* 圆角半径 */ + @@ -379,37 +1555,9 @@ border-radius: 10px; /* 圆角半径 */ - - - - - - - HSD变频器控制 - - - - - 20 - 20 - 75 - 23 - - - - PushButton - - - - - - 310 - 0 - 211 - 221 - - - + + +