|
|
@ -9,6 +9,8 @@ |
|
|
|
#include "QGC.h" |
|
|
|
#include "QGC.h" |
|
|
|
#include "ui_QGCMAVLinkLogPlayer.h" |
|
|
|
#include "ui_QGCMAVLinkLogPlayer.h" |
|
|
|
#include "QGCApplication.h" |
|
|
|
#include "QGCApplication.h" |
|
|
|
|
|
|
|
#include "SettingsManager.h" |
|
|
|
|
|
|
|
#include "AppSettings.h" |
|
|
|
#include "LinkManager.h" |
|
|
|
#include "LinkManager.h" |
|
|
|
#include "QGCQFileDialog.h" |
|
|
|
#include "QGCQFileDialog.h" |
|
|
|
#include "QGCMessageBox.h" |
|
|
|
#include "QGCMessageBox.h" |
|
|
@ -22,10 +24,10 @@ QGCMAVLinkLogPlayer::QGCMAVLinkLogPlayer(QWidget *parent) : |
|
|
|
_ui->horizontalLayout->setAlignment(Qt::AlignTop); |
|
|
|
_ui->horizontalLayout->setAlignment(Qt::AlignTop); |
|
|
|
|
|
|
|
|
|
|
|
// Setup buttons
|
|
|
|
// Setup buttons
|
|
|
|
connect(_ui->selectFileButton, &QPushButton::clicked, this, &QGCMAVLinkLogPlayer::_selectLogFileForPlayback); |
|
|
|
connect(_ui->selectFileButton, &QPushButton::clicked, this, &QGCMAVLinkLogPlayer::_selectLogFileForPlayback); |
|
|
|
connect(_ui->playButton, &QPushButton::clicked, this, &QGCMAVLinkLogPlayer::_playPauseToggle); |
|
|
|
connect(_ui->playButton, &QPushButton::clicked, this, &QGCMAVLinkLogPlayer::_playPauseToggle); |
|
|
|
connect(_ui->positionSlider, &QSlider::valueChanged, this, &QGCMAVLinkLogPlayer::_setPlayheadFromSlider); |
|
|
|
connect(_ui->positionSlider, &QSlider::valueChanged, this, &QGCMAVLinkLogPlayer::_setPlayheadFromSlider); |
|
|
|
connect(_ui->positionSlider, &QSlider::sliderPressed, this, &QGCMAVLinkLogPlayer::_pause); |
|
|
|
connect(_ui->positionSlider, &QSlider::sliderPressed, this, &QGCMAVLinkLogPlayer::_pause); |
|
|
|
|
|
|
|
|
|
|
|
#if 0 |
|
|
|
#if 0 |
|
|
|
// Speed slider is removed from 3.0 release. Too broken to fix.
|
|
|
|
// Speed slider is removed from 3.0 release. Too broken to fix.
|
|
|
@ -71,8 +73,8 @@ void QGCMAVLinkLogPlayer::_selectLogFileForPlayback(void) |
|
|
|
|
|
|
|
|
|
|
|
QString logFilename = QGCQFileDialog::getOpenFileName( |
|
|
|
QString logFilename = QGCQFileDialog::getOpenFileName( |
|
|
|
this, |
|
|
|
this, |
|
|
|
tr("Load MAVLink Log File"), |
|
|
|
tr("Load Telemetry Log File"), |
|
|
|
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), |
|
|
|
qgcApp()->toolbox()->settingsManager()->appSettings()->telemetrySavePath(), |
|
|
|
tr("MAVLink Log Files (*.tlog);;All Files (*)")); |
|
|
|
tr("MAVLink Log Files (*.tlog);;All Files (*)")); |
|
|
|
|
|
|
|
|
|
|
|
if (logFilename.isEmpty()) { |
|
|
|
if (logFilename.isEmpty()) { |
|
|
@ -138,6 +140,7 @@ void QGCMAVLinkLogPlayer::_playbackStarted(void) |
|
|
|
_enablePlaybackControls(true); |
|
|
|
_enablePlaybackControls(true); |
|
|
|
_ui->playButton->setChecked(true); |
|
|
|
_ui->playButton->setChecked(true); |
|
|
|
_ui->playButton->setIcon(QIcon(":/res/Pause")); |
|
|
|
_ui->playButton->setIcon(QIcon(":/res/Pause")); |
|
|
|
|
|
|
|
_ui->positionSlider->setEnabled(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// Signalled from LogReplayLink when replay is paused
|
|
|
|
/// Signalled from LogReplayLink when replay is paused
|
|
|
@ -145,6 +148,7 @@ void QGCMAVLinkLogPlayer::_playbackPaused(void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
_ui->playButton->setIcon(QIcon(":/res/Play")); |
|
|
|
_ui->playButton->setIcon(QIcon(":/res/Play")); |
|
|
|
_ui->playButton->setChecked(false); |
|
|
|
_ui->playButton->setChecked(false); |
|
|
|
|
|
|
|
_ui->positionSlider->setEnabled(true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void QGCMAVLinkLogPlayer::_playbackPercentCompleteChanged(int percentComplete) |
|
|
|
void QGCMAVLinkLogPlayer::_playbackPercentCompleteChanged(int percentComplete) |
|
|
|