Files
gcs-nf/Plugins/MavLinkNode/inc/rcprocess.h
T

70 lines
1.0 KiB
C++
Raw Normal View History

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"
#include "ThreadTemplet.h"
2021-04-29 09:54:21 +08:00
#ifdef QtMavlinkNode
#include <mavlinknodeglobal.h>
class MAVLINKNODESHARED_EXPORT rcprocess : public ThreadTemplet {
2021-04-29 09:54:21 +08:00
#else
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