Skip to content
QGCMAVLinkLogPlayer.h 1.31 KiB
Newer Older
#ifndef QGCMAVLINKLOGPLAYER_H
#define QGCMAVLINKLOGPLAYER_H

#include <QWidget>
#include <QFile>

#include "MAVLinkProtocol.h"
#include "LinkInterface.h"
Don Gagne's avatar
Don Gagne committed
#include "LogReplayLink.h"
namespace Ui
{
class QGCMAVLinkLogPlayer;
}

/**
 * @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
    explicit QGCMAVLinkLogPlayer(QWidget *parent = 0);
Don Gagne's avatar
Don Gagne committed
private slots:
    void _selectLogFileForPlayback(void);
Don Gagne's avatar
Don Gagne committed
    void _playPauseToggle(void);
    void _pause(void);
    void _setPlayheadFromSlider(int value);
Don Gagne's avatar
Don Gagne committed
    void _setAccelerationFromSlider(int value);
Don Gagne's avatar
Don Gagne committed
    void _logFileStats(bool logTimestamped, int logDurationSeconds, int binaryBaudRate);
    void _playbackStarted(void);
    void _playbackPaused(void);
    void _playbackPercentCompleteChanged(int percentComplete);
    void _playbackError(void);
    void _replayLinkDisconnected(void);
Don Gagne's avatar
Don Gagne committed
    void _finishPlayback(void);
    QString _secondsToHMS(int seconds);
    void _enablePlaybackControls(bool enabled);
Don Gagne's avatar
Don Gagne committed
    LogReplayLink*  _replayLink;
    int             _logDurationSeconds;
Don Gagne's avatar
Don Gagne committed
    Ui::QGCMAVLinkLogPlayer* _ui;
Don Gagne's avatar
Don Gagne committed
#endif