添加曲线,修正状态显示

This commit is contained in:
hm
2020-10-24 20:07:28 +08:00
parent d5784849a2
commit 791b81d871
16 changed files with 355 additions and 220 deletions
+56
View File
@@ -643,6 +643,29 @@ void CommandUI::DoubleClickTimeout()
DoubleClickTimer->stop();
}
void CommandUI::addVehicles(int sysid, int compid)
{
Q_UNUSED(compid)
if(ui->comboBox_uav->findData(sysid) == -1)
{
ui->comboBox_uav->addItem(QString::number(sysid),sysid);
ui->comboBox_uav->setCurrentIndex(0);
}
}
void CommandUI::setPointCount(int num)
{
ui->comboBox_seq->clear();
for(int i = 1; i <= num;i++)
{
ui->comboBox_seq->addItem(QString::number(i),i);
}
ui->comboBox_seq->setCurrentIndex(0);
}
void CommandUI::on_groupBox_Command_clicked()
{
@@ -663,3 +686,36 @@ void CommandUI::on_groupBox_Command_clicked()
}
}
}
void CommandUI::on_pushButton_setSeq_clicked()
{
if(ui->comboBox_seq->currentIndex() != -1)
{
int seq = ui->comboBox_seq->currentData(Qt::UserRole).toInt();
missionConfirm(seq);
}
}
void CommandUI::on_pushButton_setUAV_clicked()
{
if(ui->comboBox_uav->currentIndex() != -1)
{
int seq = ui->comboBox_uav->currentData(Qt::UserRole).toInt();
//根据这个comfirm 确定要输入的参数
Confirm *confirmor = new Confirm(this);
confirmor->setGeometry(0,0,this->width(),this->height());
//设置警告界面
confirmor->setNotice(tr("click confirm to set uav %1 as current").arg(seq));
connect(confirmor,SIGNAL(confirmValue(QVariant)),
this,SLOT(setCurrent(QVariant)));
confirmor->show();
}
}
+12 -1
View File
@@ -75,13 +75,22 @@ public slots:
void setCommandFile(QString File);
void addVehicles(int sysid, int compid);
signals:
void showMessage(const QString &message,int TimeOut = 0);
void SetCurrentPoint(int seq);
void SetCurrentUAV(int seq);
void cmd_int(float param1, float param2, float param3, float param4, int x, int y, float z);
void cmd_long( float param1,float param2,float param3,float param4,float param5,float param6,float param7,uint16_t command,uint8_t confirmation);
/*
void searchallPoint(void);
void searchallUav(void);
*/
private slots:
void on_commandClicked();
@@ -93,11 +102,13 @@ private slots:
void setCurrent(QVariant value);
void setPointCount(int num);
void on_groupBox_Command_clicked();
void on_pushButton_setSeq_clicked();
void on_pushButton_setUAV_clicked();
private:
+36 -46
View File
@@ -14,68 +14,58 @@
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>1</number>
</property>
<property name="topMargin">
<number>1</number>
</property>
<property name="rightMargin">
<number>1</number>
</property>
<property name="bottomMargin">
<number>1</number>
</property>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>无人机#</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>无人机#</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_uav"/>
</item>
</layout>
</item>
<item>
<widget class="QComboBox" name="comboBox_2"/>
<widget class="QPushButton" name="pushButton_setUAV">
<property name="text">
<string>切换无人机</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>航点#</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_seq"/>
</item>
</layout>
</item>
<item>
<widget class="QPushButton" name="pushButton_setSeq">
<property name="text">
<string>航点#</string>
<string>切换航点</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox"/>
</item>
</layout>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>切换航点</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0">
+8 -8
View File
@@ -1,4 +1,4 @@
#include "Chart.h"
#include "Chart.h"
int Chart::ChannelIndex = 0;
@@ -21,7 +21,7 @@ Chart::Chart(QChart *chart, QWidget *parent)
QValueAxis *axisY = new QValueAxis();
axisY->setRange(-3, 3);
axisY->setTickCount(7);
//axisY->setLabelFormat("%.2f");
axisY->setLabelFormat("%.2f");
chart->addAxis(axisY, Qt::AlignLeft);
setParent(parent);
@@ -53,9 +53,9 @@ Chart::Chart(QWidget *parent)
QValueAxis *axisX = new QValueAxis();
//axisX->setRange(-5, 5);
//axisX->setTickCount(11);
//axisX->setLabelFormat("%.2f");
axisX->setRange(-5, 5);
axisX->setTickCount(11);
axisX->setLabelFormat("%.2f");
chart()->addAxis(axisX, Qt::AlignBottom);
@@ -233,8 +233,8 @@ void Chart::resizeEvent(QResizeEvent *e)
void Chart::timeout(void)//10Hz
{
//timeseries += 0.1;
//chartUpdate();
timeseries += 0.01;
chartUpdate();
}
@@ -252,7 +252,7 @@ void Chart::chartUpdate(void)
const double Max = axis->max();
if(timeseries > (Min + (Max - Min) * 0.95))
{
chart()->axisX()->setRange(Min + 0.01,Max + 0.01);
chart()->axisX()->setRange(Min + 0.1,Max + 0.1);
}
}
}
+5 -5
View File
@@ -266,7 +266,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>左</string>
<string>左升降</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -285,7 +285,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>左副</string>
<string>左副</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -340,7 +340,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>右</string>
<string>右升降</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -353,7 +353,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>右副</string>
<string>右副</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -379,7 +379,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>垂尾</string>
<string>方向舵</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -1,4 +1,4 @@
#include "ParameterInspector.h"
#include "ParameterInspector.h"
#include "ui_ParameterInspector.h"
ParameterInspector::ParameterInspector(QWidget *parent) :
@@ -134,6 +134,11 @@ void ParameterInspector::addVehicles(int sysid, int compid)
vehicles.insert(sysid,param);
ui->pushButton_system->setText(tr("Vehicle %1").arg(sysid));
//发送一次读取
uint8_t m_type = 0;
emit ReadCmd(sysid,compid,m_type);
}
}
@@ -301,7 +306,7 @@ void ParameterInspector::clearview(void)
}
uasTopLevelItems.clear();
/*
QMap<int,QMap<int,mavlink_param_value_t>>::iterator vehicle_ite;//删除这个
for (vehicle_ite=vehicles.begin(); vehicle_ite!=vehicles.end();++vehicle_ite)
{
@@ -311,6 +316,7 @@ void ParameterInspector::clearview(void)
//vehicle_ite.value() = NULL;
}
vehicles.clear();
*/
ui->treeWidget->clear();
}
@@ -660,6 +666,14 @@ void ParameterInspector::on_ReadButton_clicked()
emit ReadCmd(m_sysid,m_compid,m_type);
}
QVariant ParameterInspector::getParameter(QVariant id)
{
QVariant value;
return value;
}
void ParameterInspector::on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
{
if(item->parent())//不是根节点才可以把数据写入框内
@@ -683,6 +697,9 @@ void ParameterInspector::on_clearButton_clicked()
{
//清除所有的存储数据,包括显示
clearview();
//vehicles.clear();
}
void ParameterInspector::on_WriteButton_clicked()
@@ -1,4 +1,4 @@
#ifndef PARAMETERINSPECTOR_H
#ifndef PARAMETERINSPECTOR_H
#define PARAMETERINSPECTOR_H
#include <QWidget>
@@ -127,7 +127,7 @@ public slots:
void addVehicles(int sysid, int compid);
void appendParameter(mavlink_message_t msg);
QVariant getParameter(QVariant id);
protected:
+14 -13
View File
@@ -115,26 +115,27 @@ void StatusUI::setDigitalAtmosphereSystem(uint32_t pos,QVariant real,QVariant me
void StatusUI::setServo(uint32_t pos,QVariant real,QVariant meas)
{
switch (pos) {
case 1:
ui->label_rud_real->setText(real.toString());
ui->label_rud_meas->setText(meas.toString());
break;
case 2:
ui->label_lv_real->setText(real.toString());
ui->label_lv_meas->setText(meas.toString());
break;
case 3:
ui->label_rv_real->setText(real.toString());
ui->label_rv_meas->setText(meas.toString());
break;
case 4:
ui->label_la_real->setText(real.toString());
ui->label_la_meas->setText(meas.toString());
break;
case 5:
case 2:
ui->label_ra_real->setText(real.toString());
ui->label_ra_meas->setText(meas.toString());
break;
case 3:
ui->label_lv_real->setText(real.toString());
ui->label_lv_meas->setText(meas.toString());
break;
case 4:
ui->label_rv_real->setText(real.toString());
ui->label_rv_meas->setText(meas.toString());
break;
case 5:
ui->label_rud_real->setText(real.toString());
ui->label_rud_meas->setText(meas.toString());
break;
}
}
+120 -120
View File
@@ -64,7 +64,7 @@
<item row="8" column="0">
<widget class="QLabel" name="label_49">
<property name="text">
<string>滚转</string>
<string>滚转[°]</string>
</property>
</widget>
</item>
@@ -97,7 +97,7 @@
<item row="4" column="0" rowspan="2">
<widget class="QLabel" name="label_23">
<property name="text">
<string>角速率X</string>
<string>p[°/s]</string>
</property>
</widget>
</item>
@@ -114,14 +114,14 @@
<item row="3" column="0">
<widget class="QLabel" name="label_25">
<property name="text">
<string>加速度Z</string>
<string>az[m/s2]</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_48">
<property name="text">
<string>俯仰</string>
<string>俯仰[°]</string>
</property>
</widget>
</item>
@@ -141,7 +141,7 @@
<item row="1" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>加速度X</string>
<string>ax[m/s2]</string>
</property>
</widget>
</item>
@@ -161,7 +161,7 @@
<item row="6" column="0">
<widget class="QLabel" name="label_31">
<property name="text">
<string>角速率Y</string>
<string>q[°/s]</string>
</property>
</widget>
</item>
@@ -207,14 +207,14 @@
<item row="2" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>加速度Y</string>
<string>ay[m/s2]</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_38">
<property name="text">
<string>航向</string>
<string>航向[°]</string>
</property>
</widget>
</item>
@@ -257,7 +257,7 @@
<item row="7" column="0">
<widget class="QLabel" name="label_29">
<property name="text">
<string>角速率Z</string>
<string>r[°/s]</string>
</property>
</widget>
</item>
@@ -628,60 +628,28 @@
<string>舵面指令</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_34">
<property name="text">
<string>方向舵</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_rud_real">
<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="2">
<widget class="QLabel" name="label_rud_meas">
<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="0">
<item row="2" column="0">
<widget class="QLabel" name="label_37">
<property name="text">
<string>左升降</string>
<string>左升降[°]</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_lv_real">
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_43">
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<string>左副翼[°]</string>
</property>
</widget>
</item>
<item row="1" column="2">
<item row="6" column="0">
<widget class="QLabel" name="label_34">
<property name="text">
<string>方向舵[°]</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_lv_meas">
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
@@ -694,27 +662,7 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_40">
<property name="text">
<string>右升降</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_rv_real">
<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="2" column="2">
<item row="3" column="2">
<widget class="QLabel" name="label_rv_meas">
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
@@ -727,14 +675,73 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_43">
<item row="3" column="1">
<widget class="QLabel" name="label_rv_real">
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
<property name="text">
<string>左副翼</string>
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="6" column="1">
<widget class="QLabel" name="label_rud_real">
<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="6" column="2">
<widget class="QLabel" name="label_rud_meas">
<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="2" column="1">
<widget class="QLabel" name="label_lv_real">
<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="0">
<widget class="QLabel" name="label_40">
<property name="text">
<string>右升降[°]</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_46">
<property name="text">
<string>右副翼[°]</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_la_real">
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
@@ -747,27 +754,7 @@
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="label_la_meas">
<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="4" column="0">
<widget class="QLabel" name="label_46">
<property name="text">
<string>右副翼</string>
</property>
</widget>
</item>
<item row="4" column="1">
<item row="1" column="1">
<widget class="QLabel" name="label_ra_real">
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
@@ -780,7 +767,20 @@
</property>
</widget>
</item>
<item row="4" column="2">
<item row="0" column="2">
<widget class="QLabel" name="label_la_meas">
<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="2">
<widget class="QLabel" name="label_ra_meas">
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
@@ -861,14 +861,14 @@
<item row="0" column="0">
<widget class="QLabel" name="label_54">
<property name="text">
<string>信号质量</string>
<string>信号质量[%]</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_56">
<property name="text">
<string>字节速度</string>
<string>字节速度[Byte/s]</string>
</property>
</widget>
</item>
@@ -910,14 +910,14 @@
<item row="0" column="0">
<widget class="QLabel" name="label_58">
<property name="text">
<string>油门</string>
<string>油门[%]</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_61">
<property name="text">
<string>舱壁温度1</string>
<string>舱温1[℃]</string>
</property>
</widget>
</item>
@@ -950,14 +950,14 @@
<item row="1" column="0">
<widget class="QLabel" name="label_60">
<property name="text">
<string>转速</string>
<string>转速[rpm]</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>舱壁温度2</string>
<string>舱温2[℃]</string>
</property>
</widget>
</item>
@@ -977,14 +977,14 @@
<item row="4" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>剩余油量</string>
<string>剩余油量[L]</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>油箱压力</string>
<string>油箱压力[kPa]</string>
</property>
</widget>
</item>
@@ -1013,14 +1013,14 @@
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>28V剩余(%)</string>
<string>机载剩余[%]</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>电流28V(A)</string>
<string>机载电流[A]</string>
</property>
</widget>
</item>
@@ -1040,7 +1040,7 @@
<item row="0" column="0">
<widget class="QLabel" name="label_50">
<property name="text">
<string>机载28V(V)</string>
<string>机载电压[V]</string>
</property>
</widget>
</item>
@@ -1073,14 +1073,14 @@
<item row="1" column="0">
<widget class="QLabel" name="label_52">
<property name="text">
<string>机载56V(V)</string>
<string>舵机电压[V]</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>电流56V(A)</string>
<string>舵机电流[A]</string>
</property>
</widget>
</item>
@@ -1100,7 +1100,7 @@
<item row="5" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>56V剩余(%)</string>
<string>舵机剩余[%]</string>
</property>
</widget>
</item>
@@ -1142,7 +1142,7 @@
<item row="3" column="0">
<widget class="QLabel" name="label_72">
<property name="text">
<string>速度</string>
<string>速度[m/s]</string>
</property>
</widget>
</item>
@@ -1182,28 +1182,28 @@
<item row="1" column="0">
<widget class="QLabel" name="label_65">
<property name="text">
<string>经度</string>
<string>经度[°]</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_64">
<property name="text">
<string>航迹角</string>
<string>航迹角[°]</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_51">
<property name="text">
<string>高度</string>
<string>高度[m]</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_59">
<property name="text">
<string>纬度</string>
<string>纬度[°]</string>
</property>
</widget>
</item>
+24 -4
View File
@@ -102,10 +102,28 @@ PowerSystem::PowerSystem(QWidget *parent) :
cmdList.insert(0xea,"加力点火快速阀");
ScopeRPM = new Scope(ui->frame_scope);
ScopeTemp = new Scope(ui->frame_scope);
ScopeAlt = new Scope(ui->frame_scope);
ScopeMa = new Scope(ui->frame_scope);
ScopeRPM->hideButton(true);
ScopeTemp->hideButton(true);
ScopeAlt->hideButton(true);
ScopeMa->hideButton(true);
ScopeRPM->chartView->chart()->axisX()->hide();
ScopeTemp->chartView->chart()->axisX()->hide();
ScopeAlt->chartView->chart()->axisX()->hide();
ScopeMa->chartView->chart()->axisX()->hide();
/*
ScopeRPM = new QtCharts::QChart();
ScopeTemp = new QtCharts::QChart();
ScopeAlt = new QtCharts::QChart();
ScopeMa = new QtCharts::QChart();
*/
}
@@ -117,12 +135,12 @@ PowerSystem::~PowerSystem()
void PowerSystem::resizeEvent(QResizeEvent *event)
{
/*
ScopeRPM->setGeometry(0,0,ui->frame_scope->width(),ui->frame_scope->height()/4);
ScopeTemp->setGeometry(0,ui->frame_scope->height()/4,ui->frame_scope->width(),ui->frame_scope->height()/4);
ScopeAlt->setGeometry(0,ui->frame_scope->height()/2,ui->frame_scope->width(),ui->frame_scope->height()/4);
ScopeMa->setGeometry(0,3*ui->frame_scope->height()/4,ui->frame_scope->width(),ui->frame_scope->height()/4);
*/
}
@@ -294,16 +312,18 @@ void PowerSystem::setTurbineState(mavlink_turbinestate_t *t)
//qDebug() << t->Cmd;
/*
ScopeRPM->chartView->setSerieData(tr("物理转速"),t->RPM_mea);
ScopeRPM->chartView->setSerieData(tr("期望物理转速"),t->RPM_des);
ScopeTemp->chartView->setSerieData(tr("排气温度T5"),t->T5);
//从新做一个函数
ScopeAlt->chartView->setSerieData(tr("海拔"),10);
ScopeMa->chartView->setSerieData(tr("马赫"),t->tas_ap);
*/
}
+5 -4
View File
@@ -15,10 +15,10 @@
#include "QScreen"
#include <QtGlobal>
//#include "Scope.h"
#include "Scope.h"
#include "QChart"
//#include "QChart"
namespace Ui {
class PowerSystem;
@@ -71,17 +71,18 @@ private:
Ui::PowerSystem *ui;
/*
Scope *ScopeRPM = nullptr;
Scope *ScopeTemp = nullptr;
Scope *ScopeAlt = nullptr;
Scope *ScopeMa = nullptr;
*/
/*
QtCharts::QChart *ScopeRPM = nullptr;
QtCharts::QChart *ScopeTemp = nullptr;
QtCharts::QChart *ScopeAlt = nullptr;
QtCharts::QChart *ScopeMa = nullptr;
*/
};
+15 -8
View File
@@ -146,8 +146,14 @@ MainWindow::MainWindow(QWidget *parent)
connect(toolsui->command,SIGNAL(WriteCmd(uint8_t,uint8_t,const char*,uint8_t,float)),
dlink->mavlinknode->Parameter,SLOT(WriteCmd(uint8_t,uint8_t,const char*,uint8_t,float)),Qt::DirectConnection);
//command ----- map
connect(dlink->mavlinknode,SIGNAL(addVehicles(int,int)),
commandUI,SLOT(addVehicles(int,int)),Qt::DirectConnection);
connect(map,SIGNAL(PointNumber(int)),
commandUI,SLOT(setPointCount(int)),Qt::DirectConnection);
//this ----- dlink
connect(dlink->mavlinknode,SIGNAL(beep()),
@@ -1096,16 +1102,17 @@ void MainWindow::updateUI()//事件驱动式更新数据
QString::number(-dlink->mavlinknode->vehicle.vfr_hud.climb,'f',1));
statusui->setServo(1,QString::number(((int16_t)dlink->mavlinknode->vehicle.servo_output_raw.servo13_raw)/32767.0 * 35.0,'f',2),
QString::number(((int16_t)dlink->mavlinknode->vehicle.servo_output_raw.servo3_raw)/32767.0 * 35.0,'f',2));
statusui->setServo(2,QString::number(((int16_t)dlink->mavlinknode->vehicle.servo_output_raw.servo15_raw)/32767.0 * 35.0,'f',2),
QString::number(((int16_t)dlink->mavlinknode->vehicle.servo_output_raw.servo1_raw)/32767.0 * 35.0,'f',2));
statusui->setServo(3,QString::number(((int16_t)dlink->mavlinknode->vehicle.servo_output_raw.servo12_raw)/32767.0 * 35.0,'f',2),
QString::number(((int16_t)dlink->mavlinknode->vehicle.servo_output_raw.servo2_raw)/32767.0 * 35.0,'f',2));
statusui->setServo(4,QString::number(((int16_t)dlink->mavlinknode->vehicle.servo_output_raw.servo14_raw)/32767.0 * 35.0,'f',2),
statusui->setServo(1,QString::number(((int16_t)dlink->mavlinknode->vehicle.servo_output_raw.servo14_raw)/32767.0 * 35.0,'f',2),
QString::number(((int16_t)dlink->mavlinknode->vehicle.servo_output_raw.servo4_raw)/32767.0 * 35.0,'f',2));
statusui->setServo(5,QString::number(((int16_t)dlink->mavlinknode->vehicle.servo_output_raw.servo11_raw)/32767.0 * 35.0,'f',2),
statusui->setServo(2,QString::number(((int16_t)dlink->mavlinknode->vehicle.servo_output_raw.servo11_raw)/32767.0 * 35.0,'f',2),
QString::number(((int16_t)dlink->mavlinknode->vehicle.servo_output_raw.servo5_raw)/32767.0 * 35.0,'f',2));
statusui->setServo(3,QString::number(((int16_t)dlink->mavlinknode->vehicle.servo_output_raw.servo15_raw)/32767.0 * 35.0,'f',2),
QString::number(((int16_t)dlink->mavlinknode->vehicle.servo_output_raw.servo1_raw)/32767.0 * 35.0,'f',2));
statusui->setServo(4,QString::number(((int16_t)dlink->mavlinknode->vehicle.servo_output_raw.servo12_raw)/32767.0 * 35.0,'f',2),
QString::number(((int16_t)dlink->mavlinknode->vehicle.servo_output_raw.servo2_raw)/32767.0 * 35.0,'f',2));
statusui->setServo(5,QString::number(((int16_t)dlink->mavlinknode->vehicle.servo_output_raw.servo13_raw)/32767.0 * 35.0,'f',2),
QString::number(((int16_t)dlink->mavlinknode->vehicle.servo_output_raw.servo3_raw)/32767.0 * 35.0,'f',2));
statusui->setEngine(1,QString::number((dlink->mavlinknode->vehicle.servo_output_raw.servo6_raw - 1000) * 0.1,'f',0));