From b7edee79e88b60bd80186cba6eb263a137263cf0 Mon Sep 17 00:00:00 2001 From: Lorenz Meier <lm@inf.ethz.ch> Date: Thu, 13 Feb 2014 16:52:53 +0100 Subject: [PATCH 01/11] 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 b1580650a32d0bf16c6fa289a06011e5dc8208a1 Mon Sep 17 00:00:00 2001 From: Lorenz Meier <lm@inf.ethz.ch> Date: Fri, 14 Feb 2014 14:20:16 +0100 Subject: [PATCH 02/11] 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 <lm@inf.ethz.ch> Date: Fri, 14 Feb 2014 15:13:56 +0100 Subject: [PATCH 03/11] 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 <lm@inf.ethz.ch> Date: Fri, 14 Feb 2014 15:15:25 +0100 Subject: [PATCH 04/11] 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 @@ <string notr="true"/> </property> <layout class="QHBoxLayout" name="horizontalLayout"> - <property name="spacing"> + <property name="leftMargin"> <number>6</number> </property> - <property name="margin"> + <property name="topMargin"> + <number>6</number> + </property> + <property name="rightMargin"> + <number>6</number> + </property> + <property name="bottomMargin"> <number>6</number> </property> <item> @@ -62,6 +68,9 @@ </item> <item> <widget class="QCheckBox" name="selectedBox"> + <property name="enabled"> + <bool>false</bool> + </property> <property name="sizePolicy"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> 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<Waypoint *> &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 @@ <rect> <x>0</x> <y>0</y> - <width>836</width> - <height>316</height> + <width>834</width> + <height>325</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout_2"> @@ -294,8 +294,8 @@ <rect> <x>0</x> <y>0</y> - <width>836</width> - <height>316</height> + <width>834</width> + <height>323</height> </rect> </property> <property name="autoFillBackground"> From 6dd9fedfb30269c9a03c539063d6c91a748604c3 Mon Sep 17 00:00:00 2001 From: Lorenz Meier <lm@inf.ethz.ch> Date: Fri, 14 Feb 2014 17:03:52 +0100 Subject: [PATCH 05/11] 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 <lm@inf.ethz.ch> Date: Fri, 14 Feb 2014 17:29:10 +0100 Subject: [PATCH 06/11] 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 <lm@inf.ethz.ch> Date: Fri, 14 Feb 2014 17:44:25 +0100 Subject: [PATCH 07/11] 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<UAS*>(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); + UAS* u = qobject_cast<UAS*>(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<UAS*>(this->uas); + UAS* u = qobject_cast<UAS*>(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 <lm@inf.ethz.ch> Date: Fri, 14 Feb 2014 18:01:10 +0100 Subject: [PATCH 08/11] 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 <lm@inf.ethz.ch> Date: Fri, 14 Feb 2014 18:10:40 +0100 Subject: [PATCH 09/11] 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 <lm@inf.ethz.ch> Date: Fri, 14 Feb 2014 18:11:57 +0100 Subject: [PATCH 10/11] 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 <lm@inf.ethz.ch> Date: Fri, 14 Feb 2014 18:14:02 +0100 Subject: [PATCH 11/11] 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; }