优化界面
This commit is contained in:
parent
7ade530466
commit
832a5b7cf8
@ -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 = "节点<font color=\"#FF00FF\">" +
|
||||
QString::number(seq) +
|
||||
"</font> 湿度:<font color=\"#0000FF\">" +
|
||||
QString::number((double)humi) +
|
||||
"%</font> 温度:<font color=\"#FF0000\">" +
|
||||
QString::number((double)temp) +
|
||||
"°C</font><br> 光照度:<font color=\"#0000FF\">" +
|
||||
QString::number((double)light) +
|
||||
"lx</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
line_str = "节点<font color=\"#FF00FF\">" +
|
||||
QString::number(seq) +
|
||||
"</font> 湿度:<font color=\"#0000FF\">" +
|
||||
QString::number((double)humi) +
|
||||
"%</font> 温度:<font color=\"#0000FF\">" +
|
||||
QString::number((double)temp) +
|
||||
"°C</font><br> 光照度:<font color=\"#0000FF\">" +
|
||||
QString::number((double)light) +
|
||||
"lx</font>";
|
||||
}
|
||||
|
||||
switch (seq)
|
||||
{
|
||||
case 2:
|
||||
ui->label_node2->setText(line_str);
|
||||
ui->textBrowser_node2->setHtml("<b><font size=\"60\">" + line_str + "</font></b>");
|
||||
break;
|
||||
case 3:
|
||||
ui->label_node3->setText(line_str);
|
||||
ui->textBrowser_node3->setHtml("<b><font size=\"60\">" + line_str + "</font></b>");
|
||||
break;
|
||||
case 4:
|
||||
ui->label_node4->setText(line_str);
|
||||
ui->textBrowser_node4->setHtml("<b><font size=\"60\">" + line_str + "</font></b>");
|
||||
break;
|
||||
case 5:
|
||||
ui->label_node5->setText(line_str);
|
||||
ui->textBrowser_node5->setHtml("<b><font size=\"60\">" + line_str + "</font></b>");
|
||||
}
|
||||
}
|
||||
|
||||
@ -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) +
|
||||
|
||||
158
mainwindow.ui
158
mainwindow.ui
@ -127,95 +127,11 @@
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_node2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>60</y>
|
||||
<width>1071</width>
|
||||
<height>101</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Arial</family>
|
||||
<pointsize>25</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>等待中</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_node3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>160</y>
|
||||
<width>1071</width>
|
||||
<height>101</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Arial</family>
|
||||
<pointsize>25</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>等待中</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_node4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>260</y>
|
||||
<width>1071</width>
|
||||
<height>101</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Arial</family>
|
||||
<pointsize>25</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>等待中</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_node5">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>360</y>
|
||||
<width>1071</width>
|
||||
<height>101</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Arial</family>
|
||||
<pointsize>25</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>等待中</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_time">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>460</y>
|
||||
<y>500</y>
|
||||
<width>1071</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
@ -235,8 +151,8 @@
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>90</x>
|
||||
<y>550</y>
|
||||
<x>70</x>
|
||||
<y>570</y>
|
||||
<width>231</width>
|
||||
<height>71</height>
|
||||
</rect>
|
||||
@ -257,6 +173,74 @@
|
||||
<double>27.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextBrowser" name="textBrowser_node2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>60</y>
|
||||
<width>371</width>
|
||||
<height>101</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!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></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextBrowser" name="textBrowser_node3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>170</y>
|
||||
<width>371</width>
|
||||
<height>101</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!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></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextBrowser" name="textBrowser_node4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>280</y>
|
||||
<width>371</width>
|
||||
<height>101</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!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></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextBrowser" name="textBrowser_node5">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>390</y>
|
||||
<width>371</width>
|
||||
<height>101</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!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></string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user