diff --git a/MavLinkNode/mavlinknode.cpp b/MavLinkNode/mavlinknode.cpp index d7f4e76..b8963dd 100644 --- a/MavLinkNode/mavlinknode.cpp +++ b/MavLinkNode/mavlinknode.cpp @@ -1,4 +1,4 @@ -#include "mavlinknode.h" +#include "mavlinknode.h" #include "QElapsedTimer" /* * mavlink 解析相关内容请参考如下 @@ -240,6 +240,13 @@ MavLinkNode::MavLinkNode(QObject *parent) : ThreadTemplet(parent) m_heartbeat.system_status = 0; m_heartbeat.type = 0; + + connect(&showInfoTimer, &QTimer::timeout, this, [this]() + { + infoExport(info); + }); + + showInfoTimer.start(200); } MavLinkNode::~MavLinkNode() @@ -1333,7 +1340,6 @@ void MavLinkNode::StatusParse(mavlink_message_t msg) - _showinfo info; info.flag = 0x24a8; info.id = infoExportID;//1 @@ -1353,7 +1359,6 @@ void MavLinkNode::StatusParse(mavlink_message_t msg) //qDebug() << "infoExportID" << infoExportID; - infoExport(info); } @@ -1444,8 +1449,6 @@ void MavLinkNode::StatusParse(mavlink_message_t msg) //qDebug() << gpstimebase->currentMSecsSinceEpoch(); - _showinfo info; - info.flag = 0x24a8; info.id = infoExportID;//1 @@ -1464,8 +1467,6 @@ void MavLinkNode::StatusParse(mavlink_message_t msg) //qDebug() << "infoExportID" << infoExportID; - - infoExport(info); } diff --git a/MavLinkNode/mavlinknode.h b/MavLinkNode/mavlinknode.h index 73f2c1e..2af9cae 100644 --- a/MavLinkNode/mavlinknode.h +++ b/MavLinkNode/mavlinknode.h @@ -1,4 +1,4 @@ -#ifndef MAVLINKNODE_H +#ifndef MAVLINKNODE_H #define MAVLINKNODE_H #include @@ -354,6 +354,10 @@ protected: bool use_ins1 = false; QDateTime *gpstimebase = nullptr; + + _showinfo info; + QTimer showInfoTimer; + }; #endif // MAVLINKNODE_H