1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-27 16:54:15 +01:00

OP-1119 Starting to implement the export functionality. Aiming to do it so it is compatible with the standard .opl file format and replayable in the logging plugin.

This commit is contained in:
m_thread 2013-11-26 23:45:38 +01:00
parent 144b2c587d
commit bc9bbebfdf
4 changed files with 22 additions and 3 deletions
ground/openpilotgcs/src/plugins

@ -6,6 +6,7 @@ QT += qml quick
include(../../openpilotgcsplugin.pri)
include(../../plugins/coreplugin/coreplugin.pri)
include(../../plugins/uavobjects/uavobjects.pri)
include(../../plugins/uavtalk/uavtalk.pri)
HEADERS += flightlogplugin.h \
flightlogmanager.h \

@ -29,9 +29,11 @@
#include "extensionsystem/pluginmanager.h"
#include <QApplication>
#include <QFileDialog>
#include "debuglogcontrol.h"
#include "uavobjecthelper.h"
#include "uavtalk/uavtalk.h"
FlightLogManager::FlightLogManager(QObject *parent) :
QObject(parent), m_disableControls(false)
@ -175,7 +177,23 @@ void FlightLogManager::retrieveLogs(int flightToRetrieve)
}
void FlightLogManager::exportLogs()
{}
{
setDisableControls(true);
QApplication::setOverrideCursor(Qt::WaitCursor);
QString fileName = QFileDialog::getSaveFileName(NULL, tr("Save Log"),
tr("OP-%0.opl").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss")),
tr("OpenPilot Log (*.opl)"));
/*
if (!fileName.isEmpty()) {
logFile.setFileName(fileName);
logFile.open(QIODevice::WriteOnly);
UAVTalk uavTalk(file, m_objectManager);
}
*/
QApplication::restoreOverrideCursor();
setDisableControls(false);
}
void FlightLogManager::updateFlightEntries(quint16 currentFlight)
{

@ -7,8 +7,7 @@
#include <QMutexLocker>
#include <QDebug>
#include <QBuffer>
#include "uavobjectmanager.h"
#include <math.h>
#include <QFile>
class LogFile : public QIODevice {
Q_OBJECT

@ -242,5 +242,6 @@ SUBDIRS += plugin_setupwizard
plugin_flightlog.subdir = flightlog
plugin_flightlog.depends = plugin_coreplugin
plugin_flightlog.depends += plugin_uavobjects
plugin_flightlog.depends += plugin_uavtalk
SUBDIRS += plugin_flightlog