曲线界面添加温度

This commit is contained in:
hm
2020-12-09 17:29:28 +08:00
parent 81be3445e8
commit 26e2dbf922
8 changed files with 192 additions and 176 deletions
+1 -2
View File
@@ -13,7 +13,6 @@ QT += svg
QT += texttospeech
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
@@ -34,7 +33,7 @@ DEFINES += APP_VERSION=\"\\\"$$APP_VERSION\\\"\"
win32:
{
VERSION = 1.0.0.1
VERSION = 1.0.0.2
QMAKE_TARGET_PRODUCT = Ground Control Station
QMAKE_TARGET_COMPANY = company
+16 -1
View File
@@ -207,8 +207,18 @@ void CommandBox::commandAccepted(bool flag,uint16_t command,uint8_t result)
break;
}
m_command = 0;
ui->lineEdit_CommandName->clear();
m_name.clear();
m_param1 = 0;
m_param2 = 0;
m_param3 = 0;
m_param4 = 0;
m_param5 = 0;
m_param6 = 0;
m_param7 = 0;
m_command = 0;
m_confirm = 0;
}
if(string.size() > 0)
@@ -296,6 +306,8 @@ void CommandBox::setSecondConfirm(QVariant value)
}
else
{
ui->lineEdit_CommandName->clear();
m_name.clear();
m_param1 = 0;
m_param2 = 0;
m_param3 = 0;
@@ -305,6 +317,7 @@ void CommandBox::setSecondConfirm(QVariant value)
m_param7 = 0;
m_command = 0;
m_confirm = 0;
}
}
@@ -356,6 +369,8 @@ void CommandBox::on_pushButton_SendCommand_clicked()
void CommandBox::on_pushButton_Cancel_clicked()
{
ui->lineEdit_CommandName->clear();
m_name.clear();
m_param1 = 0;
m_param2 = 0;
m_param3 = 0;
+4 -4
View File
@@ -26,7 +26,7 @@ Inputter::Inputter(QWidget *parent) :
inputType = type::Normal;
DecimalPlaces = -1;
ui->label->hide();
ui->label_decription->hide();
ui->lineEdit->setText(curentStr);
ui->lineEdit->setReadOnly(true);
@@ -161,12 +161,12 @@ void Inputter::setDecimalPlaces(int value)
void Inputter::setLabel(QVariant s)
{
if(ui->label->isHidden())
if(ui->label_decription->isHidden())
{
ui->label->show();
ui->label_decription->show();
}
ui->label->setText(s.toString());
ui->label_decription->setText(s.toString());
}
+23 -49
View File
@@ -41,20 +41,14 @@
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="2" column="0">
<widget class="QLabel" name="label_decription">
<property name="text">
<string/>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</widget>
</item>
<item row="1" column="0">
<item row="0" column="0">
<widget class="QLineEdit" name="lineEdit">
<property name="minimumSize">
<size>
@@ -75,21 +69,14 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_decription">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="0">
<item row="3" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="3">
<widget class="QPushButton" name="pushButton_3">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
<height>20</height>
</size>
</property>
<property name="maximumSize">
@@ -108,7 +95,7 @@
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
<height>20</height>
</size>
</property>
<property name="maximumSize">
@@ -127,7 +114,7 @@
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
<height>20</height>
</size>
</property>
<property name="maximumSize">
@@ -146,7 +133,7 @@
<property name="minimumSize">
<size>
<width>80</width>
<height>160</height>
<height>40</height>
</size>
</property>
<property name="maximumSize">
@@ -165,7 +152,7 @@
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
<height>20</height>
</size>
</property>
<property name="maximumSize">
@@ -184,7 +171,7 @@
<property name="minimumSize">
<size>
<width>160</width>
<height>80</height>
<height>20</height>
</size>
</property>
<property name="maximumSize">
@@ -203,7 +190,7 @@
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
<height>20</height>
</size>
</property>
<property name="maximumSize">
@@ -222,7 +209,7 @@
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
<height>20</height>
</size>
</property>
<property name="maximumSize">
@@ -241,7 +228,7 @@
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
<height>20</height>
</size>
</property>
<property name="maximumSize">
@@ -260,7 +247,7 @@
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
<height>20</height>
</size>
</property>
<property name="maximumSize">
@@ -279,7 +266,7 @@
<property name="minimumSize">
<size>
<width>160</width>
<height>80</height>
<height>20</height>
</size>
</property>
<property name="maximumSize">
@@ -298,7 +285,7 @@
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
<height>20</height>
</size>
</property>
<property name="maximumSize">
@@ -330,7 +317,7 @@
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
<height>20</height>
</size>
</property>
<property name="maximumSize">
@@ -349,7 +336,7 @@
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
<height>20</height>
</size>
</property>
<property name="maximumSize">
@@ -368,7 +355,7 @@
<property name="minimumSize">
<size>
<width>80</width>
<height>160</height>
<height>40</height>
</size>
</property>
<property name="maximumSize">
@@ -387,7 +374,7 @@
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
<height>20</height>
</size>
</property>
<property name="maximumSize">
@@ -416,19 +403,6 @@
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
+29 -2
View File
@@ -461,6 +461,20 @@ void Diagram::setBattery(uint32_t pos,QVariant value)
ui->label_28V_percent->setText(value.toString());
break;
case 4:
ui->label_28V_Temp->setText(value.toString());
if(value.toFloat() <= 0)
{
setColor(ui->label_28V_Temp,state::failure);
}
else
{
setColor(ui->label_28V_Temp,state::inital);
}
break;
case 5:
ui->label_56V_V->setText(value.toString());
if(qAbs(value.toFloat()) <= 46)
@@ -480,7 +494,7 @@ void Diagram::setBattery(uint32_t pos,QVariant value)
}
break;
case 5:
case 6:
ui->label_56V_A->setText(value.toString());
if(qAbs(value.toFloat()) >= 10)
@@ -493,8 +507,21 @@ void Diagram::setBattery(uint32_t pos,QVariant value)
}
break;
case 6:
case 7:
ui->label_56V_percent->setText(value.toString());
break;
case 8:
ui->label_56V_Temp->setText(value.toString());
if(value.toFloat() <= 0)
{
setColor(ui->label_56V_Temp,state::failure);
}
else
{
setColor(ui->label_56V_Temp,state::inital);
}
break;
}
}
+111 -111
View File
@@ -996,43 +996,8 @@ color: rgb(0, 128, 0);</string>
<property name="spacing">
<number>12</number>
</property>
<item row="0" column="3">
<widget class="QLabel" name="label_52">
<property name="text">
<string>舵机电压[V]</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>机载电量[%]</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_14">
<property name="text">
<string>舵机电流[A]</string>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QLabel" name="label_8">
<property name="text">
<string>舵机电量[%]</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_50">
<property name="text">
<string>机载电压[V]</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QLabel" name="label_56V_percent">
<item row="2" column="1">
<widget class="QLabel" name="label_28V_percent">
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
@@ -1069,15 +1034,20 @@ color: rgb(0, 128, 0);</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>机载电流[A]</string>
<item row="0" column="1">
<widget class="QLabel" name="label_28V_V">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QLabel" name="label_56V_A">
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
@@ -1089,16 +1059,24 @@ color: rgb(0, 128, 0);</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_28V_percent">
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_50">
<property name="text">
<string>0</string>
<string>机载电压[V]</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</widget>
</item>
<item row="2" column="3">
<widget class="QLabel" name="label_8">
<property name="text">
<string>舵机电量[%]</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>机载电量[%]</string>
</property>
</widget>
</item>
@@ -1115,20 +1093,82 @@ color: rgb(0, 128, 0);</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_28V_V">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
<item row="1" column="3">
<widget class="QLabel" name="label_14">
<property name="text">
<string>舵机电流[A]</string>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</widget>
</item>
<item row="2" column="4">
<widget class="QLabel" name="label_56V_percent">
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QLabel" name="label_56V_A">
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_52">
<property name="text">
<string>舵机电压[V]</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>机载电流[A]</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_29">
<property name="text">
<string>机载温度[℃]</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_28V_Temp">
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLabel" name="label_32">
<property name="text">
<string>舵机温度[℃]</string>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QLabel" name="label_56V_Temp">
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
@@ -1305,10 +1345,10 @@ color: rgb(0, 128, 0);</string>
<property name="spacing">
<number>12</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_68">
<item row="0" column="2">
<widget class="QLabel" name="label_70">
<property name="text">
<string>控制模式</string>
<string>飞行模式</string>
</property>
</widget>
</item>
@@ -1337,13 +1377,6 @@ color: rgb(0, 128, 0);</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_70">
<property name="text">
<string>飞行模式</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_FlightMode">
<property name="minimumSize">
@@ -1369,43 +1402,10 @@ color: rgb(0, 128, 0);</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_72">
<item row="0" column="0">
<widget class="QLabel" name="label_68">
<property name="text">
<string>纵向模态</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_VMode">
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_74">
<property name="text">
<string>横向模态</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_HMode">
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<string>控制模式</string>
</property>
</widget>
</item>
+3 -4
View File
@@ -108,16 +108,15 @@ void Tools_Index1::on_pushButton_ExportLog_clicked()
{
QStringList l = StringModel->stringList();
//QDataStream data(log_file);
QDataStream data(log_file);
foreach (QString s, l) {
s.append("\n");
s.append("\r\n");
// log_file->write(s.toHtmlEscaped());
log_file->write(s.toUtf8());
}
log_file->close();
}
}
+5 -3
View File
@@ -1641,10 +1641,12 @@ void MainWindow::updateUI()//事件驱动式更新数据
toolsui->diagram->setBattery(1,QString::number(dlink->mavlinknode->vehicle.bmustate.BAT1_group_voltage_mv * 0.001,'f',1));
toolsui->diagram->setBattery(2,QString::number((float)((int16_t)dlink->mavlinknode->vehicle.bmustate.BAT1_group_current_dA) *0.1f,'f',1));
toolsui->diagram->setBattery(3,QString::number(dlink->mavlinknode->vehicle.bmustate.BAT1_remain_perc *0.1f,'f',1));
toolsui->diagram->setBattery(4,QString::number((int16_t)dlink->mavlinknode->vehicle.bmustate.BAT1_low_temp_degC,'f',1));
toolsui->diagram->setBattery(4,QString::number(dlink->mavlinknode->vehicle.bmustate.BAT2_group_voltage_mv * 0.001,'f',1));
toolsui->diagram->setBattery(5,QString::number((float)((int16_t)dlink->mavlinknode->vehicle.bmustate.BAT2_group_current_dA) *0.1f,'f',1));
toolsui->diagram->setBattery(6,QString::number(dlink->mavlinknode->vehicle.bmustate.BAT2_remain_perc *0.1f,'f',1));
toolsui->diagram->setBattery(5,QString::number(dlink->mavlinknode->vehicle.bmustate.BAT2_group_voltage_mv * 0.001,'f',1));
toolsui->diagram->setBattery(6,QString::number((float)((int16_t)dlink->mavlinknode->vehicle.bmustate.BAT2_group_current_dA) *0.1f,'f',1));
toolsui->diagram->setBattery(7,QString::number(dlink->mavlinknode->vehicle.bmustate.BAT2_remain_perc *0.1f,'f',1));
toolsui->diagram->setBattery(8,QString::number((int16_t)dlink->mavlinknode->vehicle.bmustate.BAT2_low_temp_degC,'f',1));
toolsui->diagram->setDlink(1,QString::number(dlink->mavlinknode->rssi,'f',0));
toolsui->diagram->setDlink(2,QString::number(dlink->mavlinknode->bitrate));