Files
gcs-nf/MavLinkNode/replay.h
T

70 lines
1.2 KiB
C++
Raw Normal View History

2020-12-15 13:47:14 +08:00
#ifndef REPLAY_H
2020-08-19 14:12:36 +08:00
#define REPLAY_H
#include <QObject>
#include "QThread"
#include "QMutex"
2020-08-19 14:12:36 +08:00
#include "QMessageBox"
#include "QDebug"
#include "QFile"
#include "replay.h"
#include "QDataStream"
2020-08-20 17:48:09 +08:00
#include "mavlink.h"
#include <QtEndian>
#include "QByteArray"
2021-01-05 19:24:48 +08:00
#include <QtEndian>
2020-08-19 14:12:36 +08:00
#include "ThreadTemplet.h"
2020-08-20 17:48:09 +08:00
#ifdef QtMavlinkNode
#include <mavlinknodeglobal.h>
class MAVLINKNODESHARED_EXPORT Replay : public ThreadTemplet {
2020-08-19 14:12:36 +08:00
#else
class Replay : public ThreadTemplet
2020-08-19 14:12:36 +08:00
{
#endif
Q_OBJECT
public:
explicit Replay(QObject *parent = nullptr);
~Replay();
QByteArray readAll(void);
signals:
void readReady();
2020-08-19 22:21:48 +08:00
void currentPercentage(float vlaue);
void replayComplete();
2020-08-19 14:12:36 +08:00
public slots:
//线程对外接口
2020-08-19 22:21:48 +08:00
//对外接口
void setLogfile(const QString name,float percent = 0);
void setPercentage(float value);
void startReplay(bool flag);
2020-12-15 13:47:14 +08:00
void setMultiple(double value);
2020-08-19 14:12:36 +08:00
private slots:
//线程私有接口
void process();
protected:
QString logFile;
QFile *file = nullptr;
2020-08-19 22:21:48 +08:00
float percentage = 0.5;
2020-08-19 14:12:36 +08:00
int position = 0;
2020-08-19 22:21:48 +08:00
bool ispause = true;//控制暂停
2020-08-19 14:12:36 +08:00
bool isplaying = false;//控制开始和结束
QByteArray buff;
2021-01-05 19:24:48 +08:00
double multiple = 1;
2020-12-15 13:47:14 +08:00
2020-08-19 14:12:36 +08:00
};
#endif // MAVLINKNODE_H