From d32650bf7dac93328ca1972dea3e0471204d8462 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Feb 2014 22:46:20 +0100 Subject: [PATCH 01/34] Add new waypoints based on the UAV airframe type --- src/qgcunittest/MockUAS.h | 3 +++ src/uas/UAS.cc | 26 ++++++++++++++++++++++++++ src/uas/UAS.h | 3 +++ src/uas/UASInterface.h | 9 ++++++++- src/ui/WaypointList.cc | 10 ++++++++++ 5 files changed, 50 insertions(+), 1 deletion(-) diff --git a/src/qgcunittest/MockUAS.h b/src/qgcunittest/MockUAS.h index 53a5205..c121226 100644 --- a/src/qgcunittest/MockUAS.h +++ b/src/qgcunittest/MockUAS.h @@ -168,6 +168,9 @@ public slots: virtual void sendHilGps(quint64 time_us, double lat, double lon, double alt, int fix_type, float eph, float epv, float vel, float vn, float ve, float vd, float cog, int satellites) { Q_UNUSED(time_us); Q_UNUSED(lat); Q_UNUSED(lon); Q_UNUSED(alt); Q_UNUSED(fix_type); Q_UNUSED(eph); Q_UNUSED(epv); Q_UNUSED(vel); Q_UNUSED(vn); Q_UNUSED(ve); Q_UNUSED(vd); Q_UNUSED(cog); Q_UNUSED(satellites); Q_ASSERT(false); }; + virtual bool isRotaryWing() { Q_ASSERT(false); return false; } + virtual bool isFixedWing() { Q_ASSERT(false); return false; } + private: int _systemType; int _systemId; diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 9e9ee82..62fbbad 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -2178,6 +2178,32 @@ void UAS::readParametersFromStorage() sendMessage(msg); } +bool UAS::isRotaryWing() +{ + switch (airframe) { + case MAV_TYPE_QUADROTOR: + /* fallthrough */ + case MAV_TYPE_COAXIAL: + case MAV_TYPE_HELICOPTER: + case MAV_TYPE_HEXAROTOR: + case MAV_TYPE_OCTOROTOR: + case MAV_TYPE_TRICOPTER: + return true; + default: + return false; + } +} + +bool UAS::isFixedWing() +{ + switch (airframe) { + case MAV_TYPE_FIXED_WING: + return true; + default: + return false; + } +} + /** * @param rate The update rate in Hz the message should be sent */ diff --git a/src/uas/UAS.h b/src/uas/UAS.h index 9db1399..c24b3cb 100644 --- a/src/uas/UAS.h +++ b/src/uas/UAS.h @@ -306,6 +306,9 @@ public: return nedAttGlobalOffset; } + bool isRotaryWing(); + bool isFixedWing(); + #if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES) px::GLOverlay getOverlay() { diff --git a/src/uas/UASInterface.h b/src/uas/UASInterface.h index 5a863a9..6395674 100644 --- a/src/uas/UASInterface.h +++ b/src/uas/UASInterface.h @@ -267,6 +267,9 @@ public: */ virtual QList getActions() const = 0; + static const unsigned int WAYPOINT_RADIUS_DEFAULT_FIXED_WING = 25; + static const unsigned int WAYPOINT_RADIUS_DEFAULT_ROTARY_WING = 5; + public slots: /** @brief Set a new name for the system */ @@ -376,6 +379,11 @@ public slots: virtual void startGyroscopeCalibration() = 0; virtual void startPressureCalibration() = 0; + /** @brief Return if this a rotary wing */ + virtual bool isRotaryWing() = 0; + /** @brief Return if this is a fixed wing */ + virtual bool isFixedWing() = 0; + /** @brief Set the current battery type and voltages */ virtual void setBatterySpecs(const QString& specs) = 0; /** @brief Get the current battery type and specs */ @@ -393,7 +401,6 @@ public slots: /** @brief Send raw GPS for sensor HIL */ virtual void sendHilGps(quint64 time_us, double lat, double lon, double alt, int fix_type, float eph, float epv, float vel, float vn, float ve, float vd, float cog, int satellites) = 0; - protected: QColor color; diff --git a/src/ui/WaypointList.cc b/src/ui/WaypointList.cc index 2a207ca..2b2976b 100644 --- a/src/ui/WaypointList.cc +++ b/src/ui/WaypointList.cc @@ -269,6 +269,16 @@ void WaypointList::addEditable(bool onCurrentPosition) // Create waypoint with last frame Waypoint *last = waypoints.last(); wp = WPM->createWaypoint(); + if (uas) + { + if (uas->isRotaryWing()) { + wp->setAcceptanceRadius(UASInterface::WAYPOINT_RADIUS_DEFAULT_FIXED_WING); + } + else if (uas->isFixedWing()) + { + wp->setAcceptanceRadius(UASInterface::WAYPOINT_RADIUS_DEFAULT_ROTARY_WING); + } + } // wp->blockSignals(true); MAV_FRAME frame = (MAV_FRAME)last->getFrame(); wp->setFrame(frame); From 8fe1a6aef0e969a4c5b6e22e1297f550a4316cba Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 12 Feb 2014 22:59:02 +0100 Subject: [PATCH 02/34] Fixed typo / swap --- src/ui/WaypointList.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/WaypointList.cc b/src/ui/WaypointList.cc index 2b2976b..52aea3e 100644 --- a/src/ui/WaypointList.cc +++ b/src/ui/WaypointList.cc @@ -272,11 +272,11 @@ void WaypointList::addEditable(bool onCurrentPosition) if (uas) { if (uas->isRotaryWing()) { - wp->setAcceptanceRadius(UASInterface::WAYPOINT_RADIUS_DEFAULT_FIXED_WING); + wp->setAcceptanceRadius(UASInterface::WAYPOINT_RADIUS_DEFAULT_ROTARY_WING); } else if (uas->isFixedWing()) { - wp->setAcceptanceRadius(UASInterface::WAYPOINT_RADIUS_DEFAULT_ROTARY_WING); + wp->setAcceptanceRadius(UASInterface::WAYPOINT_RADIUS_DEFAULT_FIXED_WING); } } // wp->blockSignals(true); From 3cf3cf3a246fe9465f62eb8780da0f07872ccc50 Mon Sep 17 00:00:00 2001 From: Thomas Gubler Date: Thu, 13 Feb 2014 01:56:32 +0100 Subject: [PATCH 03/34] use getAcceptanceRadiusRecommendation function to set default radius based on airframe. With this commit airframe based radius setting now works for + button and double click in map and also for all waypoints (also the first one) --- src/uas/UASWaypointManager.cc | 18 +++++++++++++++--- src/ui/WaypointList.cc | 10 ---------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/uas/UASWaypointManager.cc b/src/uas/UASWaypointManager.cc index 888a548..d61f9de 100644 --- a/src/uas/UASWaypointManager.cc +++ b/src/uas/UASWaypointManager.cc @@ -1063,11 +1063,23 @@ int UASWaypointManager::getFrameRecommendation() float UASWaypointManager::getAcceptanceRadiusRecommendation() { - if (waypointsEditable.count() > 0) { + if (waypointsEditable.count() > 0) + { return waypointsEditable.last()->getAcceptanceRadius(); - } else { - return 10.0f; } + else + { + if (uas->isRotaryWing()) + { + return UASInterface::WAYPOINT_RADIUS_DEFAULT_ROTARY_WING; + } + else if (uas->isFixedWing()) + { + return UASInterface::WAYPOINT_RADIUS_DEFAULT_FIXED_WING; + } + } + + return 10.0f; } float UASWaypointManager::getHomeAltitudeOffsetDefault() diff --git a/src/ui/WaypointList.cc b/src/ui/WaypointList.cc index 52aea3e..2a207ca 100644 --- a/src/ui/WaypointList.cc +++ b/src/ui/WaypointList.cc @@ -269,16 +269,6 @@ void WaypointList::addEditable(bool onCurrentPosition) // Create waypoint with last frame Waypoint *last = waypoints.last(); wp = WPM->createWaypoint(); - if (uas) - { - if (uas->isRotaryWing()) { - wp->setAcceptanceRadius(UASInterface::WAYPOINT_RADIUS_DEFAULT_ROTARY_WING); - } - else if (uas->isFixedWing()) - { - wp->setAcceptanceRadius(UASInterface::WAYPOINT_RADIUS_DEFAULT_FIXED_WING); - } - } // wp->blockSignals(true); MAV_FRAME frame = (MAV_FRAME)last->getFrame(); wp->setFrame(frame); From 398d1622df7df77e51faf57a24dfe4f7bed8976b Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 13 Feb 2014 07:49:16 +0100 Subject: [PATCH 04/34] Updating QUpgrade version --- qupgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qupgrade b/qupgrade index 2db4b38..b8b885c 160000 --- a/qupgrade +++ b/qupgrade @@ -1 +1 @@ -Subproject commit 2db4b382b02c3822acd19e99bc57fa53f3f53d01 +Subproject commit b8b885c610ee574140c7a6ad9bc007dcf28a74b7 From b7edee79e88b60bd80186cba6eb263a137263cf0 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 13 Feb 2014 16:52:53 +0100 Subject: [PATCH 05/34] Fix video widget display --- src/ui/MainWindow.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index 11bf444..0d421b1 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -596,8 +596,6 @@ void MainWindow::buildCommonWidgets() createDockWidget(engineeringView,new HUD(320,240,this),tr("Video Downlink"),"HEAD_UP_DISPLAY_DOCKWIDGET",VIEW_ENGINEER,Qt::RightDockWidgetArea,QSize(this->width()/1.5,0)); - createDockWidget(engineeringView,new HUD(320,240,this),tr("Video Downlink"),"HEAD_UP_DISPLAY_DOCKWIDGET",VIEW_ENGINEER,Qt::RightDockWidgetArea,QSize(this->width()/1.5,0)); - createDockWidget(simView,new PrimaryFlightDisplay(320,240,this),tr("Primary Flight Display"),"PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET",VIEW_SIMULATION,Qt::RightDockWidgetArea,QSize(this->width()/1.5,0)); createDockWidget(pilotView,new PrimaryFlightDisplay(320,240,this),tr("Primary Flight Display"),"PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET",VIEW_FLIGHT,Qt::LeftDockWidgetArea,QSize(this->width()/1.8,0)); @@ -778,7 +776,11 @@ void MainWindow::loadDockWidget(const QString& name) } else if (name == "PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET") { - createDockWidget(centerStack->currentWidget(),new PrimaryFlightDisplay(320,240,this),tr("Primary Flight Display"),"HEAD_UP_DISPLAY_DOCKWIDGET",currentView,Qt::RightDockWidgetArea); + createDockWidget(centerStack->currentWidget(),new PrimaryFlightDisplay(320,240,this),tr("Primary Flight Display"),"PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET",currentView,Qt::RightDockWidgetArea); + } + else if (name == "HEAD_UP_DISPLAY_DOCKWIDGET") + { + createDockWidget(centerStack->currentWidget(),new HUD(320,240,this),tr("Head Up Display"),"HEAD_UP_DISPLAY_DOCKWIDGET",currentView,Qt::RightDockWidgetArea); } else if (name == "UAS_INFO_QUICKVIEW_DOCKWIDGET") { From 2f1d305008ebcdaadc4e84250e8711ec579cca20 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 13 Feb 2014 09:52:53 -0800 Subject: [PATCH 06/34] Hack to fix Windows Release build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Either this location is incorrect, or it is an optional install that I haven’t figured out how to get yet. Either way, this is failing TeamCity Windows Releases builds which I want to turn on. So for now, I’m disabling. I’ll figure out how to make it work correctly with my work on generating windows installs. --- QGCSetup.pri | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/QGCSetup.pri b/QGCSetup.pri index 95f4c01..894bf1d 100644 --- a/QGCSetup.pri +++ b/QGCSetup.pri @@ -186,10 +186,13 @@ WindowsBuild { ReleaseBuild { QMAKE_POST_LINK += $$escape_expand(\\n) $$quote(del /F "$$DESTDIR_WIN\\$${TARGET}.exp") + # This next xcopy does not always work because the files are not there by default, so disabling for now while + # we figure out the right way to do it + # Copy Visual Studio DLLs # Note that this is only done for release because the debugging versions of these DLLs cannot be redistributed. # I'm not certain of the path for VS2008, so this only works for VS2010. - win32-msvc2010 { + win32-msvc2010_NotWorkingButKeepingIn { QMAKE_POST_LINK += $$escape_expand(\\n) $$quote(xcopy /D /Y "\"C:\\Program Files \(x86\)\\Microsoft Visual Studio 10.0\\VC\\redist\\x86\\Microsoft.VC100.CRT\\*.dll\"" "$$DESTDIR_WIN\\") } } From 326627ae74c3ae98d535ddf31eb0111e9eb755c6 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 13 Feb 2014 09:53:43 -0800 Subject: [PATCH 07/34] Fix warnings in opmapcontrol I looked at the latest version of opmapcontrol in OpenPilot. This has not yet been fixed. So added pragma to silence. --- .../src/internals/projections/lks94projection.cpp | 10 ++++++++++ .../internals/projections/mercatorprojectionyandex.cpp | 15 +++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/libs/opmapcontrol/src/internals/projections/lks94projection.cpp b/libs/opmapcontrol/src/internals/projections/lks94projection.cpp index f8a37c0..4b72d57 100644 --- a/libs/opmapcontrol/src/internals/projections/lks94projection.cpp +++ b/libs/opmapcontrol/src/internals/projections/lks94projection.cpp @@ -28,6 +28,11 @@ #include +// These pragmas are local modifications to this third party library to silence warnings +#ifdef Q_OS_LINUX +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#endif namespace projections { LKS94Projection::LKS94Projection():MinLatitude (53.33 ), MaxLatitude (56.55 ), MinLongitude (20.22 ), @@ -787,3 +792,8 @@ Size LKS94Projection::GetTileMatrixMaxXY(int const& zoom) } } + +#ifdef Q_OS_LINUX +#pragma GCC diagnostic pop +#endif + diff --git a/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp b/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp index a6a2ba3..81b47b6 100644 --- a/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp +++ b/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp @@ -57,6 +57,16 @@ Point MercatorProjectionYandex::FromLatLngToPixel(double lat, double lng, const return ret; } + +// These pragmas are local modifications to this third party library to silence warnings +#ifdef Q_OS_LINUX +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#elif defined(Q_OS_MAC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif + internals::PointLatLng MercatorProjectionYandex::FromPixelToLatLng(const int &x, const int &y, const int &zoom) { Size s = GetTileMatrixSizePixel(zoom); @@ -82,6 +92,11 @@ internals::PointLatLng MercatorProjectionYandex::FromPixelToLatLng(const int &x, return ret; } + +#ifndef Q_OS_WIN +#pragma GCC diagnostic pop +#endif + double MercatorProjectionYandex::Clip(const double &n, const double &minValue, const double &maxValue) const { return qMin(qMax(n, minValue), maxValue); From 74136aa7f0e5b3624e705ed30dd739ad7bae593e Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 13 Feb 2014 09:55:44 -0800 Subject: [PATCH 08/34] Silence warnings in qwt The latest version of qwt does have these warnings fixed. But the latest version also has removed some deprecated printing functionality which we are currently using. I gave a try at updating but it looked fairly involved and over my level of understanding for that part of the code. So pragmas for now. When someone does upgrade qwt the pragmas will no longer be needed. --- libs/qwt/qwt_plot_spectrogram.cpp | 13 +++++++++++++ libs/qwt/qwt_plot_zoomer.h | 11 +++++++++++ 2 files changed, 24 insertions(+) diff --git a/libs/qwt/qwt_plot_spectrogram.cpp b/libs/qwt/qwt_plot_spectrogram.cpp index 152a6a3..75622ab 100644 --- a/libs/qwt/qwt_plot_spectrogram.cpp +++ b/libs/qwt/qwt_plot_spectrogram.cpp @@ -533,6 +533,15 @@ QwtRasterData::ContourLines QwtPlotSpectrogram::renderContourLines( d_data->contourLevels, d_data->conrecAttributes ); } +// These pragmas are local modifications to this third party library to silence warnings +#ifdef Q_OS_LINUX +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#elif defined(Q_OS_MAC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif + /*! Paint the contour lines @@ -578,6 +587,10 @@ void QwtPlotSpectrogram::drawContourLines(QPainter *painter, } } +#ifndef Q_OS_WIN +#pragma GCC diagnostic pop +#endif + /*! \brief Draw the spectrogram diff --git a/libs/qwt/qwt_plot_zoomer.h b/libs/qwt/qwt_plot_zoomer.h index eb27059..9904c53 100644 --- a/libs/qwt/qwt_plot_zoomer.h +++ b/libs/qwt/qwt_plot_zoomer.h @@ -85,8 +85,19 @@ public: public slots: void moveBy(double x, double y); + +// These pragmas are local modifications to this third party library to silence warnings +#ifndef Q_OS_WIN +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Woverloaded-virtual" +#endif + virtual void move(double x, double y); +#ifndef Q_OS_WIN +#pragma GCC diagnostic pop +#endif + virtual void zoom(const QwtDoubleRect &); virtual void zoom(int up); From dea781f2caffb21d3106f773313944874e6036a9 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 13 Feb 2014 09:57:24 -0800 Subject: [PATCH 09/34] Silence makefile override warnings qserialport and qextserialport use the pattern of += into PUBLIC_HEADERS and PRIVATE_HEADERS. This leads to the same header being included twice. Which in turn causes the rule for moc in the makefile to be added twice, hence the warning. Using *= instead of += removes the duplication. --- libs/serialport/qserialport.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/serialport/qserialport.pri b/libs/serialport/qserialport.pri index 9de6a7a..1210834 100644 --- a/libs/serialport/qserialport.pri +++ b/libs/serialport/qserialport.pri @@ -55,4 +55,4 @@ unix:!symbian { } } -HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS +HEADERS *= $$PUBLIC_HEADERS $$PRIVATE_HEADERS From 26847ffd1e14cde8581ab542a4f6f37534a3740e Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 13 Feb 2014 09:59:06 -0800 Subject: [PATCH 10/34] OpenSceneGraph has overridden virtuals defined in its headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use a pragma around our use of that header to silence the warning. OSG 3.01 has these warnings, 3.2 has fixed them, but 3.2 doesn’t isn’t the widely used release yet. So at some point when we upgrade to 3.2 this will no longer be needed. --- src/ui/map3D/Q3DWidget.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ui/map3D/Q3DWidget.h b/src/ui/map3D/Q3DWidget.h index 32b9dc4..037de8a 100644 --- a/src/ui/map3D/Q3DWidget.h +++ b/src/ui/map3D/Q3DWidget.h @@ -39,8 +39,20 @@ This file is part of the QGROUNDCONTROL project #include #include #include + +// OpenSceneGraph has overloaded virtuals defined, since third party code we silence the warnings when the +// headers are used. +#ifndef Q_OS_WIN +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Woverloaded-virtual" +#endif + #include +#ifndef Q_OS_WIN +#pragma GCC diagnostic pop +#endif + #include "CameraParams.h" #include "GCManipulator.h" #include "SystemGroupNode.h" From 2042d65a903bafb5d42ba7a443f3fa1f46298faf Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 13 Feb 2014 10:00:27 -0800 Subject: [PATCH 11/34] Silence some warnings from Windows build Not going to fix these two warnings in Windows builds so silence from makefile --- qgroundcontrol.pro | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index e16dc23..4e0fec9 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -117,16 +117,23 @@ WindowsBuild { } # -# Warnings cleanup. Plan of attack is to turn on warnings as error once all warnings are fixed. Please -# do no change the warning level from what they are currently set to below. +# We treat all warnings as errors which must be fixed before proceeding. If you run into a problem you can't fix +# you can always use local pragmas to work around the warning. This should be used sparingly and only in cases where +# the problem absolultey can't be fixed. # MacBuild | LinuxBuild { QMAKE_CXXFLAGS_WARN_ON += -Wall } +MacBuild { + QMAKE_CXXFLAGS_WARN_ON += -Werror +} + WindowsBuild { - QMAKE_CXXFLAGS_WARN_ON += /W3 + QMAKE_CXXFLAGS_WARN_ON += /W3 \ + /wd4996 \ # silence warnings about deprecated strcpy and whatnot + /wd4290 # ignore exception specifications } # From 07900e84120691f04c94cc991f76953b23fec8c6 Mon Sep 17 00:00:00 2001 From: Thomas Gubler Date: Thu, 13 Feb 2014 20:05:43 +0100 Subject: [PATCH 12/34] fix whitespace --- src/uas/UASWaypointManager.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/uas/UASWaypointManager.cc b/src/uas/UASWaypointManager.cc index d61f9de..fc48a3b 100644 --- a/src/uas/UASWaypointManager.cc +++ b/src/uas/UASWaypointManager.cc @@ -1071,12 +1071,12 @@ float UASWaypointManager::getAcceptanceRadiusRecommendation() { if (uas->isRotaryWing()) { - return UASInterface::WAYPOINT_RADIUS_DEFAULT_ROTARY_WING; - } - else if (uas->isFixedWing()) - { - return UASInterface::WAYPOINT_RADIUS_DEFAULT_FIXED_WING; - } + return UASInterface::WAYPOINT_RADIUS_DEFAULT_ROTARY_WING; + } + else if (uas->isFixedWing()) + { + return UASInterface::WAYPOINT_RADIUS_DEFAULT_FIXED_WING; + } } return 10.0f; From 56aea87959284d00e071405ef419307562339529 Mon Sep 17 00:00:00 2001 From: Thomas Gubler Date: Thu, 13 Feb 2014 20:06:53 +0100 Subject: [PATCH 13/34] use uas.type instead of uas.airframe to determine if system is rotarywing or fixedwing --- src/uas/UAS.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 62fbbad..b182098 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -2180,7 +2180,7 @@ void UAS::readParametersFromStorage() bool UAS::isRotaryWing() { - switch (airframe) { + switch (type) { case MAV_TYPE_QUADROTOR: /* fallthrough */ case MAV_TYPE_COAXIAL: @@ -2196,7 +2196,7 @@ bool UAS::isRotaryWing() bool UAS::isFixedWing() { - switch (airframe) { + switch (type) { case MAV_TYPE_FIXED_WING: return true; default: From b1580650a32d0bf16c6fa289a06011e5dc8208a1 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 14 Feb 2014 14:20:16 +0100 Subject: [PATCH 14/34] Bump version number, now that we have changed a few relevant things --- src/configuration.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/configuration.h b/src/configuration.h index 2f04348..a2935d8 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -11,7 +11,7 @@ #define WITH_TEXT_TO_SPEECH 1 #define QGC_APPLICATION_NAME "QGroundControl" -#define QGC_APPLICATION_VERSION "v. 2.0.0 (beta)" +#define QGC_APPLICATION_VERSION "v. 2.0.1 (beta)" namespace QGC @@ -19,7 +19,7 @@ namespace QGC const QString APPNAME = "QGROUNDCONTROL"; const QString ORG_NAME = "QGROUNDCONTROL.ORG"; //can be customized by forks to e.g. mycompany.com to maintain separate Settings for customized apps const QString ORG_DOMAIN = "org.qgroundcontrol";//can be customized by forks -const int APPLICATIONVERSION = 200; // 2.0.0 +const int APPLICATIONVERSION = 201; // 2.0.1 } #endif // QGC_CONFIGURATION_H From 01961dc346dee8343c80b859403d69c486406d60 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 14 Feb 2014 15:13:56 +0100 Subject: [PATCH 15/34] Added script for homebrew deployment setup --- deploy/mac_create_dmg_shell.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 deploy/mac_create_dmg_shell.sh diff --git a/deploy/mac_create_dmg_shell.sh b/deploy/mac_create_dmg_shell.sh new file mode 100644 index 0000000..2934eb8 --- /dev/null +++ b/deploy/mac_create_dmg_shell.sh @@ -0,0 +1,16 @@ +#!/bin/sh +cp -r ../release/qgroundcontrol.app . + + +cp -r ../files/audio qgroundcontrol.app/Contents/MacOs/. +mkdir -p qgroundcontrol.app/Contents/Frameworks/ +mkdir -p qgroundcontrol.app/Contents/PlugIns/imageformats +mkdir -p qgroundcontrol.app/Contents/PlugIns/codecs +mkdir -p qgroundcontrol.app/Contents/PlugIns/accessible +cp -r /usr/local/Cellar/qt/4.8.5/plugins/ qgroundcontrol.app/Contents/PlugIns/. +# SDL is not copied by Qt - for whatever reason +cp -r /Library/Frameworks/SDL.framework qgroundcontrol.app/Contents/Frameworks/. +echo -e '\n\nStarting to create disk image. This may take a while..\n' +macdeployqt qgroundcontrol.app -dmg +rm -rf qgroundcontrol.app +echo -e '\n\n QGroundControl .DMG file is now ready for publishing\n' From 3027250d4bede01b6cb035811a86c9ccc3194948 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 14 Feb 2014 15:15:25 +0100 Subject: [PATCH 16/34] Disable the active WP setting in the edit list, as its super error prone - only allow it in the view list and switch between views based on activity on the system / UI --- src/ui/WaypointEditableView.cc | 6 +++++- src/ui/WaypointEditableView.ui | 13 +++++++++++-- src/ui/WaypointList.cc | 9 ++++++++- src/ui/WaypointList.ui | 8 ++++---- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/ui/WaypointEditableView.cc b/src/ui/WaypointEditableView.cc index 602f4e0..8bb0c6c 100644 --- a/src/ui/WaypointEditableView.cc +++ b/src/ui/WaypointEditableView.cc @@ -92,6 +92,11 @@ WaypointEditableView::WaypointEditableView(Waypoint* wp, QWidget* parent) : m_ui->comboBox_frame->addItem("Local(NED)",MAV_FRAME_LOCAL_NED); m_ui->comboBox_frame->addItem("Mission",MAV_FRAME_MISSION); + // We do not want users to mess with the current waypoint in missions - + // they have to use the one downloaded from the MAV to change the current WP. + m_ui->selectedBox->setVisible(false); + connect(m_ui->selectedBox, SIGNAL(stateChanged(int)), this, SLOT(changedCurrent(int))); + // Initialize view correctly int actionID = wp->getAction(); initializeActionView(actionID); @@ -109,7 +114,6 @@ WaypointEditableView::WaypointEditableView(Waypoint* wp, QWidget* parent) : connect(m_ui->removeButton, SIGNAL(clicked()), this, SLOT(remove())); connect(m_ui->autoContinue, SIGNAL(stateChanged(int)), this, SLOT(changedAutoContinue(int))); - connect(m_ui->selectedBox, SIGNAL(stateChanged(int)), this, SLOT(changedCurrent(int))); connect(m_ui->comboBox_action, SIGNAL(activated(int)), this, SLOT(changedAction(int))); connect(m_ui->comboBox_frame, SIGNAL(activated(int)), this, SLOT(changedFrame(int))); diff --git a/src/ui/WaypointEditableView.ui b/src/ui/WaypointEditableView.ui index 07a8784..618842e 100644 --- a/src/ui/WaypointEditableView.ui +++ b/src/ui/WaypointEditableView.ui @@ -29,10 +29,16 @@ - + 6 - + + 6 + + + 6 + + 6 @@ -62,6 +68,9 @@ + + false + 0 diff --git a/src/ui/WaypointList.cc b/src/ui/WaypointList.cc index 2a207ca..673cfd1 100644 --- a/src/ui/WaypointList.cc +++ b/src/ui/WaypointList.cc @@ -405,6 +405,9 @@ void WaypointList::currentWaypointEditableChanged(quint16 seq) // Update waypointViews to correctly indicate the new current waypoint void WaypointList::currentWaypointViewOnlyChanged(quint16 seq) { + // First update the edit list + currentWaypointEditableChanged(seq); + const QList &waypoints = WPM->getWaypointViewOnlyList(); if (seq < waypoints.count()) @@ -423,6 +426,7 @@ void WaypointList::currentWaypointViewOnlyChanged(quint16 seq) } } } + m_ui->tabWidget->setCurrentIndex(1); // XXX magic number } void WaypointList::updateWaypointEditable(int uas, Waypoint* wp) @@ -430,6 +434,7 @@ void WaypointList::updateWaypointEditable(int uas, Waypoint* wp) Q_UNUSED(uas); WaypointEditableView *wpv = wpEditableViews.value(wp); wpv->updateValues(); + m_ui->tabWidget->setCurrentIndex(0); // XXX magic number } void WaypointList::updateWaypointViewOnly(int uas, Waypoint* wp) @@ -437,6 +442,7 @@ void WaypointList::updateWaypointViewOnly(int uas, Waypoint* wp) Q_UNUSED(uas); WaypointViewOnlyView *wpv = wpViewOnlyViews.value(wp); wpv->updateValues(); + m_ui->tabWidget->setCurrentIndex(1); // XXX magic number } void WaypointList::waypointViewOnlyListChanged() @@ -488,6 +494,8 @@ void WaypointList::waypointViewOnlyListChanged() this->setUpdatesEnabled(true); loadFileGlobalWP = false; + m_ui->tabWidget->setCurrentIndex(1); + } @@ -544,7 +552,6 @@ void WaypointList::waypointEditableListChanged() this->setUpdatesEnabled(true); loadFileGlobalWP = false; - } void WaypointList::moveUp(Waypoint* wp) diff --git a/src/ui/WaypointList.ui b/src/ui/WaypointList.ui index e890798..b635240 100644 --- a/src/ui/WaypointList.ui +++ b/src/ui/WaypointList.ui @@ -154,8 +154,8 @@ 0 0 - 836 - 316 + 834 + 325 @@ -294,8 +294,8 @@ 0 0 - 836 - 316 + 834 + 323 From 6dd9fedfb30269c9a03c539063d6c91a748604c3 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 14 Feb 2014 17:03:52 +0100 Subject: [PATCH 17/34] Hotfix for confusing / dangling video stream flags --- src/ui/HUD.cc | 28 +--------------------------- src/ui/HUD.h | 2 -- src/ui/QGCRGBDView.cc | 4 ++-- 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/src/ui/HUD.cc b/src/ui/HUD.cc index 58f1ab2..453ec68 100644 --- a/src/ui/HUD.cc +++ b/src/ui/HUD.cc @@ -581,30 +581,12 @@ void HUD::paintHUD() scalingFactor = this->width()/vwidth; double scalingFactorH = this->height()/vheight; if (scalingFactorH < scalingFactor) scalingFactor = scalingFactorH; - // Fill with black background - if (videoEnabled) { - if (nextOfflineImage != "" && QFileInfo(nextOfflineImage).exists()) { - qDebug() << __FILE__ << __LINE__ << "template image:" << nextOfflineImage; - QImage fill = QImage(nextOfflineImage); - - glImage = fill; - - // Reset to save load efforts - nextOfflineImage = ""; - } - - } // And if either video or the data stream is enabled, draw the next frame. - if (dataStreamEnabled || videoEnabled) + if (videoEnabled) { - xImageFactor = width() / (float)glImage.width(); yImageFactor = height() / (float)glImage.height(); - //float imageFactor = qMin(xImageFactor, yImageFactor); - // Resize to correct size and fill with image - // FIXME - } QPainter painter; @@ -1331,14 +1313,6 @@ void HUD::saveImage() saveImage(fileName); } -void HUD::startImage(quint64 timestamp) -{ - if (videoEnabled && offlineDirectory != "") { - // Load and diplay image file - nextOfflineImage = QString(offlineDirectory + "/%1.bmp").arg(timestamp); - } -} - void HUD::selectOfflineDirectory() { QString fileName = QFileDialog::getExistingDirectory(this, tr("Select image directory"), QDesktopServices::storageLocation(QDesktopServices::DesktopLocation)); diff --git a/src/ui/HUD.h b/src/ui/HUD.h index 0e69d0e..27bd3da 100644 --- a/src/ui/HUD.h +++ b/src/ui/HUD.h @@ -81,7 +81,6 @@ public slots: void updateLoad(UASInterface*, double); void selectWaypoint(int uasId, int id); - void startImage(quint64 timestamp); void startImage(int imgid, int width, int height, int depth, int channels); void setPixels(int imgid, const unsigned char* imageData, int length, int startIndex); void finishImage(); @@ -220,7 +219,6 @@ protected: QString nextOfflineImage; bool HUDInstrumentsEnabled; bool videoEnabled; - bool dataStreamEnabled; bool imageLoggingEnabled; float xImageFactor; float yImageFactor; diff --git a/src/ui/QGCRGBDView.cc b/src/ui/QGCRGBDView.cc index 9a06c04..5427082 100644 --- a/src/ui/QGCRGBDView.cc +++ b/src/ui/QGCRGBDView.cc @@ -103,14 +103,14 @@ void QGCRGBDView::contextMenuEvent(QContextMenuEvent* event) void QGCRGBDView::enableRGB(bool enabled) { rgbEnabled = enabled; - dataStreamEnabled = rgbEnabled | depthEnabled; + videoEnabled = rgbEnabled | depthEnabled; QWidget::resize(size().width(), size().height()); } void QGCRGBDView::enableDepth(bool enabled) { depthEnabled = enabled; - dataStreamEnabled = rgbEnabled | depthEnabled; + videoEnabled = rgbEnabled | depthEnabled; QWidget::resize(size().width(), size().height()); } From 98fb2cbffee9d80cd1b87e8ebd0981362ad2370d Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 14 Feb 2014 17:29:10 +0100 Subject: [PATCH 18/34] Add image debug output --- src/ui/HUD.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ui/HUD.cc b/src/ui/HUD.cc index 453ec68..a47117e 100644 --- a/src/ui/HUD.cc +++ b/src/ui/HUD.cc @@ -1377,6 +1377,7 @@ void HUD::copyImage() if (u) { this->glImage = u->getImage(); + qDebug() << "IMG:" << &this->glImage; // Save to directory if logging is enabled if (imageLoggingEnabled) From 837d909f96d904e972eba45b0859c404f6cbfcb5 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 14 Feb 2014 17:44:25 +0100 Subject: [PATCH 19/34] Bugfix imageready slot --- src/ui/HUD.cc | 13 +++++-------- src/ui/HUD.h | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/ui/HUD.cc b/src/ui/HUD.cc index a47117e..90b1ca0 100644 --- a/src/ui/HUD.cc +++ b/src/ui/HUD.cc @@ -292,8 +292,7 @@ void HUD::setActiveUAS(UASInterface* uas) // Try to disconnect the image link UAS* u = dynamic_cast(this->uas); if (u) { - disconnect(u, SIGNAL(imageStarted(quint64)), this, SLOT(startImage(quint64))); - disconnect(u, SIGNAL(imageReady(UASInterface*)), this, SLOT(copyImage())); + disconnect(u, SIGNAL(imageReady(UASInterface*)), this, SLOT(copyImage(UASInterface*))); } } @@ -313,10 +312,9 @@ void HUD::setActiveUAS(UASInterface* uas) connect(uas, SIGNAL(waypointSelected(int,int)), this, SLOT(selectWaypoint(int, int))); // Try to connect the image link - UAS* u = dynamic_cast(uas); + UAS* u = qobject_cast(uas); if (u) { - connect(u, SIGNAL(imageStarted(quint64)), this, SLOT(startImage(quint64))); - connect(u, SIGNAL(imageReady(UASInterface*)), this, SLOT(copyImage())); + connect(u, SIGNAL(imageReady(UASInterface*)), this, SLOT(copyImage(UASInterface*))); } } @@ -1371,13 +1369,12 @@ void HUD::setPixels(int imgid, const unsigned char* imageData, int length, int s } } -void HUD::copyImage() +void HUD::copyImage(UASInterface* uas) { - UAS* u = dynamic_cast(this->uas); + UAS* u = qobject_cast(uas); if (u) { this->glImage = u->getImage(); - qDebug() << "IMG:" << &this->glImage; // Save to directory if logging is enabled if (imageLoggingEnabled) diff --git a/src/ui/HUD.h b/src/ui/HUD.h index 27bd3da..18beedf 100644 --- a/src/ui/HUD.h +++ b/src/ui/HUD.h @@ -94,7 +94,7 @@ public slots: /** @brief Enable Video */ void enableVideo(bool enabled); /** @brief Copy an image from the current active UAS */ - void copyImage(); + void copyImage(UASInterface* uas); protected slots: From 31c5e3b9e27c6b33155da5f3c39b994357990f01 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 14 Feb 2014 18:01:10 +0100 Subject: [PATCH 20/34] Removed include guard preventing message parsing --- src/uas/UAS.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 6aa4258..f83cbd6 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -1242,7 +1242,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) } break; #endif -#ifdef MAVLINK_ENABLED_PIXHAWK + case MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE: { mavlink_data_transmission_handshake_t p; @@ -1296,8 +1296,6 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) break; - -#endif // case MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT: // { // mavlink_object_detection_event_t event; From 5d7ab736ccdbdb525654030f57718fa65c94bb9c Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 14 Feb 2014 18:10:40 +0100 Subject: [PATCH 21/34] Fix more dialect stupidity --- src/uas/UAS.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index f83cbd6..7f631b9 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -2059,7 +2059,6 @@ void UAS::getStatusForCode(int statusCode, QString& uasState, QString& stateDesc QImage UAS::getImage() { -#ifdef MAVLINK_ENABLED_PIXHAWK // qDebug() << "IMAGE TYPE:" << imageType; @@ -2105,9 +2104,6 @@ QImage UAS::getImage() imagePacketsArrived = 0; //imageRecBuffer.clear(); return image; -#else - return QImage(); -#endif } From aa23d0dcf6e56ae8a4b179ce07b7b1a438725a7f Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 14 Feb 2014 18:11:57 +0100 Subject: [PATCH 22/34] More dialect removal --- src/uas/UAS.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 7f631b9..7f84a7f 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -2109,7 +2109,6 @@ QImage UAS::getImage() void UAS::requestImage() { -#ifdef MAVLINK_ENABLED_PIXHAWK qDebug() << "trying to get an image from the uas..."; // check if there is already an image transmission going on @@ -2119,7 +2118,6 @@ void UAS::requestImage() mavlink_msg_data_transmission_handshake_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, DATA_TYPE_JPEG_IMAGE, 0, 0, 0, 0, 0, 50); sendMessage(msg); } -#endif } From 7b21d58924e505f37671275a2887c0f0964d9609 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 14 Feb 2014 18:14:02 +0100 Subject: [PATCH 23/34] Removed windows startup delay on voice output --- src/GAudioOutput.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GAudioOutput.cc b/src/GAudioOutput.cc index e4f158d..38d49a2 100644 --- a/src/GAudioOutput.cc +++ b/src/GAudioOutput.cc @@ -115,7 +115,7 @@ GAudioOutput::GAudioOutput(QObject *parent) : QObject(parent), if (SUCCEEDED(hr)) { - hr = pVoice->Speak(L"QGC audio output active!", 0, NULL); + //hr = pVoice->Speak(L"QGC audio output active!", 0, NULL); //pVoice->Release(); //pVoice = NULL; } From de3aaa03bbf84f49bb36fd332efe75c24113a4e2 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 15 Feb 2014 11:31:32 +0100 Subject: [PATCH 24/34] Fix request image compile error --- src/uas/UAS.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 7f84a7f..83dbe0c 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -2115,7 +2115,7 @@ void UAS::requestImage() if (imagePacketsArrived == 0) { mavlink_message_t msg; - mavlink_msg_data_transmission_handshake_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, DATA_TYPE_JPEG_IMAGE, 0, 0, 0, 0, 0, 50); + mavlink_msg_data_transmission_handshake_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, MAVLINK_DATA_STREAM_IMG_JPEG, 0, 0, 0, 0, 0, 50); sendMessage(msg); } } From 35fbc63d4ee355a970b1448e0c0ddb2eb3a703aa Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 13 Feb 2014 09:52:53 -0800 Subject: [PATCH 25/34] Hack to fix Windows Release build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Either this location is incorrect, or it is an optional install that I haven’t figured out how to get yet. Either way, this is failing TeamCity Windows Releases builds which I want to turn on. So for now, I’m disabling. I’ll figure out how to make it work correctly with my work on generating windows installs. --- QGCSetup.pri | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/QGCSetup.pri b/QGCSetup.pri index 95f4c01..894bf1d 100644 --- a/QGCSetup.pri +++ b/QGCSetup.pri @@ -186,10 +186,13 @@ WindowsBuild { ReleaseBuild { QMAKE_POST_LINK += $$escape_expand(\\n) $$quote(del /F "$$DESTDIR_WIN\\$${TARGET}.exp") + # This next xcopy does not always work because the files are not there by default, so disabling for now while + # we figure out the right way to do it + # Copy Visual Studio DLLs # Note that this is only done for release because the debugging versions of these DLLs cannot be redistributed. # I'm not certain of the path for VS2008, so this only works for VS2010. - win32-msvc2010 { + win32-msvc2010_NotWorkingButKeepingIn { QMAKE_POST_LINK += $$escape_expand(\\n) $$quote(xcopy /D /Y "\"C:\\Program Files \(x86\)\\Microsoft Visual Studio 10.0\\VC\\redist\\x86\\Microsoft.VC100.CRT\\*.dll\"" "$$DESTDIR_WIN\\") } } From 7b32f32ca0c76fe26ad5950662a40bdfb8269205 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 13 Feb 2014 09:53:43 -0800 Subject: [PATCH 26/34] Fix warnings in opmapcontrol I looked at the latest version of opmapcontrol in OpenPilot. This has not yet been fixed. So added pragma to silence. --- .../src/internals/projections/lks94projection.cpp | 10 ++++++++++ .../internals/projections/mercatorprojectionyandex.cpp | 15 +++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/libs/opmapcontrol/src/internals/projections/lks94projection.cpp b/libs/opmapcontrol/src/internals/projections/lks94projection.cpp index f8a37c0..4b72d57 100644 --- a/libs/opmapcontrol/src/internals/projections/lks94projection.cpp +++ b/libs/opmapcontrol/src/internals/projections/lks94projection.cpp @@ -28,6 +28,11 @@ #include +// These pragmas are local modifications to this third party library to silence warnings +#ifdef Q_OS_LINUX +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#endif namespace projections { LKS94Projection::LKS94Projection():MinLatitude (53.33 ), MaxLatitude (56.55 ), MinLongitude (20.22 ), @@ -787,3 +792,8 @@ Size LKS94Projection::GetTileMatrixMaxXY(int const& zoom) } } + +#ifdef Q_OS_LINUX +#pragma GCC diagnostic pop +#endif + diff --git a/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp b/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp index a6a2ba3..81b47b6 100644 --- a/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp +++ b/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp @@ -57,6 +57,16 @@ Point MercatorProjectionYandex::FromLatLngToPixel(double lat, double lng, const return ret; } + +// These pragmas are local modifications to this third party library to silence warnings +#ifdef Q_OS_LINUX +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#elif defined(Q_OS_MAC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif + internals::PointLatLng MercatorProjectionYandex::FromPixelToLatLng(const int &x, const int &y, const int &zoom) { Size s = GetTileMatrixSizePixel(zoom); @@ -82,6 +92,11 @@ internals::PointLatLng MercatorProjectionYandex::FromPixelToLatLng(const int &x, return ret; } + +#ifndef Q_OS_WIN +#pragma GCC diagnostic pop +#endif + double MercatorProjectionYandex::Clip(const double &n, const double &minValue, const double &maxValue) const { return qMin(qMax(n, minValue), maxValue); From 8f0f540f60672f991493c2d12a86600d8f218adc Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 13 Feb 2014 09:55:44 -0800 Subject: [PATCH 27/34] Silence warnings in qwt The latest version of qwt does have these warnings fixed. But the latest version also has removed some deprecated printing functionality which we are currently using. I gave a try at updating but it looked fairly involved and over my level of understanding for that part of the code. So pragmas for now. When someone does upgrade qwt the pragmas will no longer be needed. --- libs/qwt/qwt_plot_spectrogram.cpp | 13 +++++++++++++ libs/qwt/qwt_plot_zoomer.h | 11 +++++++++++ 2 files changed, 24 insertions(+) diff --git a/libs/qwt/qwt_plot_spectrogram.cpp b/libs/qwt/qwt_plot_spectrogram.cpp index 152a6a3..75622ab 100644 --- a/libs/qwt/qwt_plot_spectrogram.cpp +++ b/libs/qwt/qwt_plot_spectrogram.cpp @@ -533,6 +533,15 @@ QwtRasterData::ContourLines QwtPlotSpectrogram::renderContourLines( d_data->contourLevels, d_data->conrecAttributes ); } +// These pragmas are local modifications to this third party library to silence warnings +#ifdef Q_OS_LINUX +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#elif defined(Q_OS_MAC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif + /*! Paint the contour lines @@ -578,6 +587,10 @@ void QwtPlotSpectrogram::drawContourLines(QPainter *painter, } } +#ifndef Q_OS_WIN +#pragma GCC diagnostic pop +#endif + /*! \brief Draw the spectrogram diff --git a/libs/qwt/qwt_plot_zoomer.h b/libs/qwt/qwt_plot_zoomer.h index eb27059..9904c53 100644 --- a/libs/qwt/qwt_plot_zoomer.h +++ b/libs/qwt/qwt_plot_zoomer.h @@ -85,8 +85,19 @@ public: public slots: void moveBy(double x, double y); + +// These pragmas are local modifications to this third party library to silence warnings +#ifndef Q_OS_WIN +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Woverloaded-virtual" +#endif + virtual void move(double x, double y); +#ifndef Q_OS_WIN +#pragma GCC diagnostic pop +#endif + virtual void zoom(const QwtDoubleRect &); virtual void zoom(int up); From 33acee39fe4b9292105f12d888188323f7c25f9b Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 13 Feb 2014 09:57:24 -0800 Subject: [PATCH 28/34] Silence makefile override warnings qserialport and qextserialport use the pattern of += into PUBLIC_HEADERS and PRIVATE_HEADERS. This leads to the same header being included twice. Which in turn causes the rule for moc in the makefile to be added twice, hence the warning. Using *= instead of += removes the duplication. --- libs/serialport/qserialport.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/serialport/qserialport.pri b/libs/serialport/qserialport.pri index 9de6a7a..1210834 100644 --- a/libs/serialport/qserialport.pri +++ b/libs/serialport/qserialport.pri @@ -55,4 +55,4 @@ unix:!symbian { } } -HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS +HEADERS *= $$PUBLIC_HEADERS $$PRIVATE_HEADERS From 374ae6029428781c4b8e9f3a43b8903f0551caa7 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 13 Feb 2014 09:59:06 -0800 Subject: [PATCH 29/34] OpenSceneGraph has overridden virtuals defined in its headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use a pragma around our use of that header to silence the warning. OSG 3.01 has these warnings, 3.2 has fixed them, but 3.2 doesn’t isn’t the widely used release yet. So at some point when we upgrade to 3.2 this will no longer be needed. --- src/ui/map3D/Q3DWidget.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ui/map3D/Q3DWidget.h b/src/ui/map3D/Q3DWidget.h index 32b9dc4..037de8a 100644 --- a/src/ui/map3D/Q3DWidget.h +++ b/src/ui/map3D/Q3DWidget.h @@ -39,8 +39,20 @@ This file is part of the QGROUNDCONTROL project #include #include #include + +// OpenSceneGraph has overloaded virtuals defined, since third party code we silence the warnings when the +// headers are used. +#ifndef Q_OS_WIN +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Woverloaded-virtual" +#endif + #include +#ifndef Q_OS_WIN +#pragma GCC diagnostic pop +#endif + #include "CameraParams.h" #include "GCManipulator.h" #include "SystemGroupNode.h" From 174ad91de2718102d35b9b16dc05855c3abe2e52 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 13 Feb 2014 10:00:27 -0800 Subject: [PATCH 30/34] Silence some warnings from Windows build Not going to fix these two warnings in Windows builds so silence from makefile --- qgroundcontrol.pro | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index e16dc23..4e0fec9 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -117,16 +117,23 @@ WindowsBuild { } # -# Warnings cleanup. Plan of attack is to turn on warnings as error once all warnings are fixed. Please -# do no change the warning level from what they are currently set to below. +# We treat all warnings as errors which must be fixed before proceeding. If you run into a problem you can't fix +# you can always use local pragmas to work around the warning. This should be used sparingly and only in cases where +# the problem absolultey can't be fixed. # MacBuild | LinuxBuild { QMAKE_CXXFLAGS_WARN_ON += -Wall } +MacBuild { + QMAKE_CXXFLAGS_WARN_ON += -Werror +} + WindowsBuild { - QMAKE_CXXFLAGS_WARN_ON += /W3 + QMAKE_CXXFLAGS_WARN_ON += /W3 \ + /wd4996 \ # silence warnings about deprecated strcpy and whatnot + /wd4290 # ignore exception specifications } # From 5fb7912da738c2e12b875fc9f25abf4bccba0c70 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Sat, 15 Feb 2014 11:48:39 -0800 Subject: [PATCH 31/34] Bring qupgrade up to latest master --- qupgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qupgrade b/qupgrade index b8b885c..2db4b38 160000 --- a/qupgrade +++ b/qupgrade @@ -1 +1 @@ -Subproject commit b8b885c610ee574140c7a6ad9bc007dcf28a74b7 +Subproject commit 2db4b382b02c3822acd19e99bc57fa53f3f53d01 From 4377881d0b17f18600c1653867e8d797d020e3d2 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Sat, 15 Feb 2014 14:05:23 -0800 Subject: [PATCH 32/34] Reverted windows build change from ThirdPartyWarnings merge --- QGCSetup.pri | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/QGCSetup.pri b/QGCSetup.pri index 894bf1d..95f4c01 100644 --- a/QGCSetup.pri +++ b/QGCSetup.pri @@ -186,13 +186,10 @@ WindowsBuild { ReleaseBuild { QMAKE_POST_LINK += $$escape_expand(\\n) $$quote(del /F "$$DESTDIR_WIN\\$${TARGET}.exp") - # This next xcopy does not always work because the files are not there by default, so disabling for now while - # we figure out the right way to do it - # Copy Visual Studio DLLs # Note that this is only done for release because the debugging versions of these DLLs cannot be redistributed. # I'm not certain of the path for VS2008, so this only works for VS2010. - win32-msvc2010_NotWorkingButKeepingIn { + win32-msvc2010 { QMAKE_POST_LINK += $$escape_expand(\\n) $$quote(xcopy /D /Y "\"C:\\Program Files \(x86\)\\Microsoft Visual Studio 10.0\\VC\\redist\\x86\\Microsoft.VC100.CRT\\*.dll\"" "$$DESTDIR_WIN\\") } } From 40009d86f21671b4363e196a75ebf42bc3773b5b Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 16 Feb 2014 12:45:28 +0100 Subject: [PATCH 33/34] Updated qupgrade submodules --- qupgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qupgrade b/qupgrade index 2db4b38..b8b885c 160000 --- a/qupgrade +++ b/qupgrade @@ -1 +1 @@ -Subproject commit 2db4b382b02c3822acd19e99bc57fa53f3f53d01 +Subproject commit b8b885c610ee574140c7a6ad9bc007dcf28a74b7 From 436d0f78bc321fcadbb6691c7b7e1746cabcfa26 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 16 Feb 2014 13:03:22 +0100 Subject: [PATCH 34/34] Dropping support for freenect lib --- QGCExternalLibs.pri | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/QGCExternalLibs.pri b/QGCExternalLibs.pri index c112037..2b1528a 100644 --- a/QGCExternalLibs.pri +++ b/QGCExternalLibs.pri @@ -259,26 +259,6 @@ LinuxBuild : contains(MAVLINK_CONF, pixhawk) { } # -# libfreenect Kinect support -# - -MacBuild | LinuxBuild { - exists(/opt/local/include/libfreenect) | exists(/usr/local/include/libfreenect) { - message("Including support for libfreenect") - - #INCLUDEPATH += /usr/include/libusb-1.0 - DEFINES += QGC_LIBFREENECT_ENABLED - LIBS += -lfreenect - HEADERS += src/input/Freenect.h - SOURCES += src/input/Freenect.cc - } else { - message("Skipping support for libfreenect") - } -} else { - message("Skipping support for libfreenect") -} - -# # EIGEN matrix library (NOMINMAX needed to make internal min/max work) #