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/src/GAudioOutput.cc b/src/GAudioOutput.cc index e4f158d5efe4cd14e7465541d258bcfef8ba94d9..38d49a2af0bfa0afa5df31a42a643607a50b196f 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/uas/UAS.cc b/src/uas/UAS.cc index 6aa4258a785099de901bda7786374ebc5ec993e8..7f84a7f0bd75f6c263c9efd26feb784050ffb9a3 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,15 +2104,11 @@ 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 @@ -2125,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 } 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 11bf444a2d130144d1e427de66c015c4a0ae30ed..0d421b13b815a0d66c1ef043c905dedf5a8cf1fd 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") { 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