QGCMAVLinkLogPlayer.h 1.31 KB
Newer Older
1 2 3 4 5 6 7
#ifndef QGCMAVLINKLOGPLAYER_H
#define QGCMAVLINKLOGPLAYER_H

#include <QWidget>
#include <QFile>

#include "MAVLinkProtocol.h"
8
#include "LinkInterface.h"
Don Gagne's avatar
Don Gagne committed
9
#include "LogReplayLink.h"
10

11 12 13
namespace Ui
{
class QGCMAVLinkLogPlayer;
14 15 16 17 18 19 20 21 22 23 24 25 26 27
}

/**
 * @brief Replays MAVLink log files
 *
 * This class allows to replay MAVLink logs at varying speeds.
 * captured flights can be replayed, shown to others and analyzed
 * in-depth later on.
 */
class QGCMAVLinkLogPlayer : public QWidget
{
    Q_OBJECT

public:
Don Gagne's avatar
Don Gagne committed
28
    explicit QGCMAVLinkLogPlayer(QWidget *parent = 0);
29
    ~QGCMAVLinkLogPlayer();
30

Don Gagne's avatar
Don Gagne committed
31 32
private slots:
    void _selectLogFileForPlayback(void);
Don Gagne's avatar
Don Gagne committed
33 34 35
    void _playPauseToggle(void);
    void _pause(void);
    void _setPlayheadFromSlider(int value);
36
#if 0
Don Gagne's avatar
Don Gagne committed
37
    void _setAccelerationFromSlider(int value);
38
#endif
Don Gagne's avatar
Don Gagne committed
39 40 41 42 43 44
    void _logFileStats(bool logTimestamped, int logDurationSeconds, int binaryBaudRate);
    void _playbackStarted(void);
    void _playbackPaused(void);
    void _playbackPercentCompleteChanged(int percentComplete);
    void _playbackError(void);
    void _replayLinkDisconnected(void);
Lorenz Meier's avatar
Lorenz Meier committed
45

46
private:
Don Gagne's avatar
Don Gagne committed
47 48 49
    void _finishPlayback(void);
    QString _secondsToHMS(int seconds);
    void _enablePlaybackControls(bool enabled);
50

Don Gagne's avatar
Don Gagne committed
51 52
    LogReplayLink*  _replayLink;
    int             _logDurationSeconds;
Don Gagne's avatar
Don Gagne committed
53
    
Don Gagne's avatar
Don Gagne committed
54
    Ui::QGCMAVLinkLogPlayer* _ui;
55 56
};

Don Gagne's avatar
Don Gagne committed
57
#endif