QGCMAVLinkLogPlayer.h 1.29 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 36 37 38 39 40 41 42
    void _playPauseToggle(void);
    void _pause(void);
    void _setPlayheadFromSlider(int value);
    void _setAccelerationFromSlider(int value);
    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
43

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

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

Don Gagne's avatar
Don Gagne committed
55
#endif