diff --git a/mainwindow.cpp b/mainwindow.cpp index 616ba35..ff33b8c 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -45,29 +45,44 @@ void MainWindow::dispNodeData(int seq, float humi, float temp, float light) { QString line_str; - line_str = "节点" + - QString::number(seq) + - " 湿度:" + - QString::number((double)humi) + - "% 温度:" + - QString::number((double)temp) + - "°C\n 光照度:" + - QString::number((double)light) + - "lx"; + if (temp >= temp_max) + { + line_str = "节点" + + QString::number(seq) + + " 湿度:" + + QString::number((double)humi) + + "% 温度:" + + QString::number((double)temp) + + "°C
           光照度:" + + QString::number((double)light) + + "lx"; + } + else + { + line_str = "节点" + + QString::number(seq) + + " 湿度:" + + QString::number((double)humi) + + "% 温度:" + + QString::number((double)temp) + + "°C
           光照度:" + + QString::number((double)light) + + "lx"; + } switch (seq) { case 2: - ui->label_node2->setText(line_str); + ui->textBrowser_node2->setHtml("" + line_str + ""); break; case 3: - ui->label_node3->setText(line_str); + ui->textBrowser_node3->setHtml("" + line_str + ""); break; case 4: - ui->label_node4->setText(line_str); + ui->textBrowser_node4->setHtml("" + line_str + ""); break; case 5: - ui->label_node5->setText(line_str); + ui->textBrowser_node5->setHtml("" + line_str + ""); } } @@ -95,7 +110,7 @@ void MainWindow::sendNodeWarn(int seq, float humi, float temp, float light) is_first_run = false; } - if (temp > temp_max) + if (temp >= temp_max) { QString warn_str = "节点" + QString::number(seq) + diff --git a/mainwindow.ui b/mainwindow.ui index 7c804ff..0660e53 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -127,95 +127,11 @@ Qt::Horizontal - - - - 10 - 60 - 1071 - 101 - - - - - Arial - 25 - 75 - true - - - - 等待中 - - - - - - 10 - 160 - 1071 - 101 - - - - - Arial - 25 - 75 - true - - - - 等待中 - - - - - - 10 - 260 - 1071 - 101 - - - - - Arial - 25 - 75 - true - - - - 等待中 - - - - - - 10 - 360 - 1071 - 101 - - - - - Arial - 25 - 75 - true - - - - 等待中 - - 10 - 460 + 500 1071 41 @@ -235,8 +151,8 @@ - 90 - 550 + 70 + 570 231 71 @@ -257,6 +173,74 @@ 27.000000000000000 + + + + 10 + 60 + 371 + 101 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Arial'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:25pt;">等待获取数据</span></p></body></html> + + + + + + 10 + 170 + 371 + 101 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Arial'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:25pt;">等待获取数据</span></p></body></html> + + + + + + 10 + 280 + 371 + 101 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Arial'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:25pt;">等待获取数据</span></p></body></html> + + + + + + 10 + 390 + 371 + 101 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Arial'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:25pt;">等待获取数据</span></p></body></html> + +