使用GPS时间作为基准
This commit is contained in:
@@ -446,7 +446,7 @@ void PowerSystem::setFuel(QVariant press, QVariant value)
|
||||
|
||||
|
||||
|
||||
void PowerSystem::setMa(QVariant Ma)
|
||||
void PowerSystem::setMa(qint64 time, QVariant Ma)
|
||||
{
|
||||
if(AMaTimer)
|
||||
{
|
||||
@@ -456,9 +456,8 @@ void PowerSystem::setMa(QVariant Ma)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
averageMa.append(Ma.toDouble());
|
||||
averageTime.append(QDateTime::currentMSecsSinceEpoch());
|
||||
averageTime.append(time);
|
||||
|
||||
while(averageTime.back() - averageTime.first() > (100 * 1000))
|
||||
{
|
||||
|
||||
@@ -59,10 +59,7 @@ public:
|
||||
void setTurbineState(mavlink_turbinestate_t *t);
|
||||
void setCCMState(mavlink_ccmstate_t *t);
|
||||
|
||||
void setMa(QVariant Ma);
|
||||
void setAlt(QVariant Alt);
|
||||
|
||||
void setFuel(QVariant press,QVariant value);
|
||||
|
||||
void updateUI();
|
||||
|
||||
@@ -82,6 +79,11 @@ private slots:
|
||||
public slots:
|
||||
void setFloat(void);
|
||||
|
||||
void setMa(qint64 time, QVariant Ma);
|
||||
void setAlt(QVariant Alt);
|
||||
|
||||
void setFuel(QVariant press,QVariant value);
|
||||
|
||||
|
||||
private:
|
||||
QTimer timer2;
|
||||
|
||||
+10
-2
@@ -1,4 +1,4 @@
|
||||
#include "mainwindow.h"
|
||||
#include "mainwindow.h"
|
||||
#include "QPushButton"
|
||||
#include "QAction"
|
||||
|
||||
@@ -275,6 +275,14 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
|
||||
|
||||
|
||||
//dlink ----toolsui-power
|
||||
|
||||
//toolsui->powersystem->setMa(vehicle.timebase,vehicle.emb_atom_com.mach);
|
||||
|
||||
connect(dlink->mavlinknode,SIGNAL(setMa(qint64,QVariant)),
|
||||
toolsui->powersystem,SLOT(setMa(qint64,QVariant)));
|
||||
|
||||
|
||||
|
||||
//setting ----- map
|
||||
connect(setting->index0->globalsetting,SIGNAL(getMapTypes()),
|
||||
@@ -1545,7 +1553,7 @@ void MainWindow::updateUI()//事件驱动式更新数据
|
||||
toolsui->powersystem->setTurbineState(&vehicle.turbinstate);
|
||||
toolsui->powersystem->setCCMState(&vehicle.ccmstate);
|
||||
|
||||
toolsui->powersystem->setMa(vehicle.emb_atom_com.mach);
|
||||
//toolsui->powersystem->setMa(vehicle.timebase,vehicle.emb_atom_com.mach);
|
||||
toolsui->powersystem->setAlt(vehicle.gps_raw_int.alt * 10e-4);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user