diff --git a/QGCExternalLibs.pri b/QGCExternalLibs.pri index 9e08c3ce37afa037314bfcd5052693e485c64712..e701b9878d59a8de0409dc0348ced5e0652788d3 100644 --- a/QGCExternalLibs.pri +++ b/QGCExternalLibs.pri @@ -362,8 +362,8 @@ contains(DEFINES, DISABLE_KINECT) { } # -# [REQUIRED] EIGEN matrix library (NOMINMAX needed to make internal min/max work) -# +# [REQUIRED] EIGEN matrix library +# NOMINMAX constant required to make internal min/max work. INCLUDEPATH += libs/eigen DEFINES += NOMINMAX diff --git a/deploy/mac_create_dmg_shell.sh b/deploy/mac_create_dmg_shell.sh new file mode 100644 index 0000000000000000000000000000000000000000..2934eb8deb7e350cc3c3fd753d9be299748cafce --- /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' diff --git a/libs/opmapcontrol/src/internals/projections/lks94projection.cpp b/libs/opmapcontrol/src/internals/projections/lks94projection.cpp index f8a37c0be4f3077c071624ccf27596c8661080f5..4b72d57ceb2378285dc3515c869cca0b312d5045 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 a6a2ba3066b5da21f45d1a0a9940d1628ad0c0fc..81b47b6d7748da54114dbb6862a04ec6afaf76e1 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); diff --git a/libs/qwt/qwt_plot_spectrogram.cpp b/libs/qwt/qwt_plot_spectrogram.cpp index 152a6a38129904cf76d211f7d124e4fc5e964307..75622ab7eeed2228d6cf46ba6cfd73a53c3054c5 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 eb27059b8e7262a0792ec419a971301ffe8ba930..9904c53aeebb59a186981bdab35b22f7f8d3d5eb 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); diff --git a/libs/serialport/qserialport.pri b/libs/serialport/qserialport.pri index 9de6a7ab05f6d50072774e49bc7adb53c0609e04..1210834c2434eebff91a90fab7806c7370ec27cb 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 diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index bdaf67dc14c015d78f8e36ca7ef3a8da95e44997..0120c5ac44c46e777591276e2e9d498091401ce7 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -121,16 +121,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 } # diff --git a/qupgrade b/qupgrade index 2db4b382b02c3822acd19e99bc57fa53f3f53d01..b8b885c610ee574140c7a6ad9bc007dcf28a74b7 160000 --- a/qupgrade +++ b/qupgrade @@ -1 +1 @@ -Subproject commit 2db4b382b02c3822acd19e99bc57fa53f3f53d01 +Subproject commit b8b885c610ee574140c7a6ad9bc007dcf28a74b7 diff --git a/src/GAudioOutput.cc b/src/GAudioOutput.cc index fd360796301b83d80ee7ead2d8c0571fb952d470..e7dafc55e67d95bfa56c5b0e19db1189f98dbd2b 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; } diff --git a/src/configuration.h b/src/configuration.h index 2f0434812374cb13e4f1a93fa99e3ca496a015a9..a2935d89d7148992efa3adc2e946b7d3240c785e 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 diff --git a/src/qgcunittest/MockUAS.h b/src/qgcunittest/MockUAS.h index 418df5d5b7581ed802f6695f8d0b6b110f68bbff..8f6ad10b430f5d2d7c0b8651906d919e7eeddafd 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 6aa4258a785099de901bda7786374ebc5ec993e8..93165d2373af86cad84b21636db9f3731f3f17c1 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; @@ -2061,7 +2059,6 @@ void UAS::getStatusForCode(int statusCode, QString& uasState, QString& stateDesc QImage UAS::getImage() { -#ifdef MAVLINK_ENABLED_PIXHAWK // qDebug() << "IMAGE TYPE:" << imageType; @@ -2107,25 +2104,20 @@ QImage UAS::getImage() imagePacketsArrived = 0; //imageRecBuffer.clear(); return image; -#else - return QImage(); -#endif } 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 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); } -#endif } @@ -2178,6 +2170,32 @@ void UAS::readParametersFromStorage() sendMessage(msg); } +bool UAS::isRotaryWing() +{ + switch (type) { + 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 (type) { + 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 9db1399a78ccd600a3cf356945aa47b2c4821b10..c24b3cb14847cfa0ffdb3d33a919702730497d8b 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 5a863a982ca888caebcd93f810d517a971606304..6395674eaa683d2e7ea4af968ecb2ed929645693 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/uas/UASWaypointManager.cc b/src/uas/UASWaypointManager.cc index 888a548e707cf80f7f696e12be379991bccefcb9..fc48a3bbdee1a522673a6686b49080c9de05edc8 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/HUD.cc b/src/ui/HUD.cc index 58f1ab23a440a3c8f5dcf92dbd5934a15f3bf78a..90b1ca0b7f3b4044b782545722930c8ac8151db5 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*))); } } @@ -581,30 +579,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 +1311,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)); @@ -1397,9 +1369,9 @@ 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(); diff --git a/src/ui/HUD.h b/src/ui/HUD.h index 0e69d0e74eaeafdf41f9f53162c5b8def91718c7..18beedf447ed38942001fd8757f04cf20a60bccd 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(); @@ -95,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: @@ -220,7 +219,6 @@ protected: QString nextOfflineImage; bool HUDInstrumentsEnabled; bool videoEnabled; - bool dataStreamEnabled; bool imageLoggingEnabled; float xImageFactor; float yImageFactor; diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index e2d70c706d927d77d0648143307fae3454b8583a..fdbf2c19951ce297ef7ca700287248b32465572f 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -604,8 +604,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)); @@ -786,7 +784,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") { diff --git a/src/ui/QGCRGBDView.cc b/src/ui/QGCRGBDView.cc index 9a06c04ccab546741f1cfbb38715147fa2997d71..5427082a80ecfb74af42831f08469bb666631cbe 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()); } diff --git a/src/ui/WaypointEditableView.cc b/src/ui/WaypointEditableView.cc index 602f4e04a37b1beaf2b3313ce82a30a5aeee66ca..8bb0c6cff828fae0ddcc0eb9f50fc6a98b9987b9 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 07a8784df7ba2b5634ec734fc1c48e65a372bbfa..618842ee3983491550d5eb29554c650449cb7b25 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 2a207ca005fbbff4b698a31bb40331355b8da9fb..673cfd1245a8aaf0a9c5ae8053f49dc1d346ede0 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 e89079886e17a98a3b7b0a0576fb8dbf719e093d..b635240c563478e54f09a5e4e71108642625759c 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 diff --git a/src/ui/map3D/Q3DWidget.h b/src/ui/map3D/Q3DWidget.h index 32b9dc46415567c443e16b3a3c18ca99280129ad..037de8aa9b01916fe5bb3cdd10510602d25e3c43 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"