2026-06-01 09:46:36 +08:00
|
|
|
#ifndef STATUSPROCESS_H
|
|
|
|
|
#define STATUSPROCESS_H
|
|
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
|
|
#include "QDebug"
|
|
|
|
|
#include "QThread"
|
|
|
|
|
#include "mavlink.h"
|
|
|
|
|
#include "QTimer"
|
|
|
|
|
#include "QTime"
|
|
|
|
|
#include <QtEndian>
|
|
|
|
|
|
|
|
|
|
#include "ThreadTemplet.h"
|
|
|
|
|
|
|
|
|
|
#ifdef QtMavlinkNode
|
|
|
|
|
#include <mavlinknodeglobal.h>
|
|
|
|
|
class MAVLINKNODESHARED_EXPORT statusprocess : public ThreadTemplet {
|
|
|
|
|
#else
|
|
|
|
|
class statusprocess : public ThreadTemplet
|
|
|
|
|
{
|
|
|
|
|
#endif
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
explicit statusprocess(QObject *parent = nullptr);
|
|
|
|
|
~statusprocess();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mavlink_heartbeat_t m_heartbeat;
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//读取和写入指令
|
|
|
|
|
//void ReadCmd(uint8_t m_sysid, uint8_t m_compid, uint8_t type);
|
|
|
|
|
void setHeartbeat(QVariant state, QVariant frq );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//线程对外接口
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
//线程私有接口
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void process();
|
|
|
|
|
|
|
|
|
|
//状态机
|
|
|
|
|
void ReadStateMachine(void);
|
|
|
|
|
void WriteStateMachine(void);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//所有相关函数
|
|
|
|
|
void heartbeat(uint32_t custom_mode,
|
|
|
|
|
uint8_t type,
|
|
|
|
|
uint8_t autopilot,
|
|
|
|
|
uint8_t base_mode,
|
|
|
|
|
uint8_t system_status,
|
|
|
|
|
uint8_t mavlink_version);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void readError();
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // STATUSPROCESS_H
|