From c9a863b7c78bbf0806ec3c96e365f45f1f448deb Mon Sep 17 00:00:00 2001 From: lm Date: Thu, 16 Dec 2010 11:14:53 +0100 Subject: [PATCH] Minor bugfixes and compile fixes --- src/uas/UASManager.cc | 5 +++++ src/uas/UASManager.h | 2 ++ src/ui/MainWindow.cc | 4 ---- src/ui/ParameterInterface.cc | 9 +++++++++ src/ui/linechart/LinechartPlot.cc | 2 +- src/ui/linechart/Linecharts.cc | 13 +++++++++++++ src/ui/map3D/GCManipulator.cc | 7 ++++--- src/ui/map3D/QMap3D.cc | 4 ++++ 8 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/uas/UASManager.cc b/src/uas/UASManager.cc index 2af5a5fca..fabfec6ba 100644 --- a/src/uas/UASManager.cc +++ b/src/uas/UASManager.cc @@ -85,6 +85,11 @@ void UASManager::addUAS(UASInterface* uas) } } +QList UASManager::getUASList() +{ + return systems.values(); +} + UASInterface* UASManager::getActiveUAS() { if(!activeUAS) diff --git a/src/uas/UASManager.h b/src/uas/UASManager.h index c5ca03cc5..b4d97789d 100644 --- a/src/uas/UASManager.h +++ b/src/uas/UASManager.h @@ -69,6 +69,8 @@ public: **/ UASInterface* getUASForId(int id); + QList getUASList(); + public slots: diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index 54011b14f..b6827ac29 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -504,10 +504,6 @@ void MainWindow::connectPxWidgets() { if (linechartWidget) { - connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), - linechartWidget, SLOT(addSystem(UASInterface*))); - connect(UASManager::instance(), SIGNAL(activeUASSet(int)), - linechartWidget, SLOT(selectSystem(int))); connect(linechartWidget, SIGNAL(logfileWritten(QString)), this, SLOT(loadDataView(QString))); } diff --git a/src/ui/ParameterInterface.cc b/src/ui/ParameterInterface.cc index f44e08389..d6a3a59aa 100644 --- a/src/ui/ParameterInterface.cc +++ b/src/ui/ParameterInterface.cc @@ -51,6 +51,15 @@ ParameterInterface::ParameterInterface(QWidget *parent) : // Setup UI connections connect(m_ui->vehicleComboBox, SIGNAL(activated(int)), this, SLOT(selectUAS(int))); + // Get current MAV list + QList systems = UASManager::instance()->getUASList(); + + // Add each of them + foreach (UASInterface* sys, systems) + { + addUAS(sys); + } + // Setup MAV connections connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), this, SLOT(addUAS(UASInterface*))); this->setVisible(false); diff --git a/src/ui/linechart/LinechartPlot.cc b/src/ui/linechart/LinechartPlot.cc index 7d1613845..3a7cb0183 100644 --- a/src/ui/linechart/LinechartPlot.cc +++ b/src/ui/linechart/LinechartPlot.cc @@ -56,7 +56,7 @@ maxInterval(MAX_STORAGE_INTERVAL), timeScaleStep(DEFAULT_SCALE_INTERVAL), // 10 seconds automaticScrollActive(false), m_active(true), -m_groundTime(false), +m_groundTime(true), d_data(NULL), d_curve(NULL) { diff --git a/src/ui/linechart/Linecharts.cc b/src/ui/linechart/Linecharts.cc index 2cfaf83ad..b47ea71a7 100644 --- a/src/ui/linechart/Linecharts.cc +++ b/src/ui/linechart/Linecharts.cc @@ -1,4 +1,5 @@ #include "Linecharts.h" +#include "UASManager.h" Linecharts::Linecharts(QWidget *parent) : QStackedWidget(parent), @@ -6,6 +7,18 @@ Linecharts::Linecharts(QWidget *parent) : active(true) { this->setVisible(false); + // Get current MAV list + QList systems = UASManager::instance()->getUASList(); + + // Add each of them + foreach (UASInterface* sys, systems) + { + addSystem(sys); + } + connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), + this, SLOT(addSystem(UASInterface*))); + connect(UASManager::instance(), SIGNAL(activeUASSet(int)), + this, SLOT(selectSystem(int))); } diff --git a/src/ui/map3D/GCManipulator.cc b/src/ui/map3D/GCManipulator.cc index 05c9b246c..06a7527b4 100644 --- a/src/ui/map3D/GCManipulator.cc +++ b/src/ui/map3D/GCManipulator.cc @@ -30,6 +30,7 @@ This file is part of the QGROUNDCONTROL project */ #include "GCManipulator.h" +#include GCManipulator::GCManipulator() { @@ -254,10 +255,10 @@ GCManipulator::calcMovement(void) if (buttonMask == GUIEventAdapter::LEFT_MOUSE_BUTTON) { // rotate camera -#ifdef __WIN32__ - osg::Vec3 axis; -#else +#if ((OPENSCENEGRAPH_MAJOR_VERSION == 2) & (OPENSCENEGRAPH_MINOR_VERSION > 8)) | (OPENSCENEGRAPH_MAJOR_VERSION > 2) osg::Vec3d axis; +#else + osg::Vec3 axis; #endif float angle; diff --git a/src/ui/map3D/QMap3D.cc b/src/ui/map3D/QMap3D.cc index 83ff90179..0a6e11f28 100644 --- a/src/ui/map3D/QMap3D.cc +++ b/src/ui/map3D/QMap3D.cc @@ -39,7 +39,11 @@ QMap3D::QMap3D(QWidget * parent, const char * name, WindowFlags f) : QWidget(parent,f) { setupUi(this); +#if ((OPENSCENEGRAPH_MAJOR_VERSION == 2) & (OPENSCENEGRAPH_MINOR_VERSION > 8)) | (OPENSCENEGRAPH_MAJOR_VERSION > 2) graphicsView->setCameraManipulator(new osgEarth::Util::EarthManipulator); +#else + graphicsView->setCameraManipulator(new osgEarthUtil::EarthManipulator); +#endif graphicsView->setSceneData(new osg::Group); graphicsView->updateCamera(); show(); -- 2.22.0