2021-04-29 09:54:21 +08:00
|
|
|
#ifndef RCPROCESS_H
|
|
|
|
|
#define RCPROCESS_H
|
|
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
#include "QDebug"
|
|
|
|
|
#include "QtEndian"
|
|
|
|
|
#include "QDateTime"
|
|
|
|
|
|
|
|
|
|
#include "sbusparser.h"
|
|
|
|
|
|
2021-07-08 18:35:03 +08:00
|
|
|
#include "ThreadTemplet.h"
|
2021-04-29 09:54:21 +08:00
|
|
|
|
|
|
|
|
#ifdef QtMavlinkNode
|
|
|
|
|
#include <mavlinknodeglobal.h>
|
2021-07-08 18:35:03 +08:00
|
|
|
class MAVLINKNODESHARED_EXPORT rcprocess : public ThreadTemplet {
|
2021-04-29 09:54:21 +08:00
|
|
|
#else
|
2021-07-08 18:35:03 +08:00
|
|
|
class rcprocess : public ThreadTemplet
|
2021-04-29 09:54:21 +08:00
|
|
|
{
|
|
|
|
|
#endif
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit rcprocess(QObject *parent = nullptr);
|
|
|
|
|
~rcprocess();
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void new_remote_ctrl(QList<uint16_t>);
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
|
|
//缓存对外接口
|
|
|
|
|
|
|
|
|
|
void SoftRCUpdate(QList<uint16_t> rc);
|
|
|
|
|
void setRCActive(uint32_t value)
|
|
|
|
|
{
|
|
|
|
|
isRCActive = value;
|
|
|
|
|
qDebug() << "set ch" << isRCActive;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
//线程私有接口
|
|
|
|
|
void process();
|
|
|
|
|
|
|
|
|
|
//缓存私有接口
|
|
|
|
|
|
|
|
|
|
void update15Hz(void);
|
|
|
|
|
|
|
|
|
|
//解析
|
|
|
|
|
void parse(quint32 src,QByteArray datagram);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
uint16_t rcin[20];
|
|
|
|
|
int rcin_cnt = 0;
|
|
|
|
|
bool rcin_update = true;
|
|
|
|
|
|
|
|
|
|
uint32_t isRCActive = 0;
|
|
|
|
|
|
|
|
|
|
SBusParser sbus;
|
|
|
|
|
QList<uint16_t> sbuslist;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // RCPROCESS_H
|
|
|
|
|
|