Commit 946ef6c3 authored by Lorenz Meier's avatar Lorenz Meier

Merge branch 'master' of github.com:mavlink/qgroundcontrol

parents 398d1622 7b21d589
#!/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'
...@@ -115,7 +115,7 @@ GAudioOutput::GAudioOutput(QObject *parent) : QObject(parent), ...@@ -115,7 +115,7 @@ GAudioOutput::GAudioOutput(QObject *parent) : QObject(parent),
if (SUCCEEDED(hr)) 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->Release();
//pVoice = NULL; //pVoice = NULL;
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#define WITH_TEXT_TO_SPEECH 1 #define WITH_TEXT_TO_SPEECH 1
#define QGC_APPLICATION_NAME "QGroundControl" #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 namespace QGC
...@@ -19,7 +19,7 @@ namespace QGC ...@@ -19,7 +19,7 @@ namespace QGC
const QString APPNAME = "QGROUNDCONTROL"; 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_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 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 #endif // QGC_CONFIGURATION_H
...@@ -1242,7 +1242,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -1242,7 +1242,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
} }
break; break;
#endif #endif
#ifdef MAVLINK_ENABLED_PIXHAWK
case MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE: case MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE:
{ {
mavlink_data_transmission_handshake_t p; mavlink_data_transmission_handshake_t p;
...@@ -1296,8 +1296,6 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -1296,8 +1296,6 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
break; break;
#endif
// case MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT: // case MAVLINK_MSG_ID_OBJECT_DETECTION_EVENT:
// { // {
// mavlink_object_detection_event_t event; // mavlink_object_detection_event_t event;
...@@ -2061,7 +2059,6 @@ void UAS::getStatusForCode(int statusCode, QString& uasState, QString& stateDesc ...@@ -2061,7 +2059,6 @@ void UAS::getStatusForCode(int statusCode, QString& uasState, QString& stateDesc
QImage UAS::getImage() QImage UAS::getImage()
{ {
#ifdef MAVLINK_ENABLED_PIXHAWK
// qDebug() << "IMAGE TYPE:" << imageType; // qDebug() << "IMAGE TYPE:" << imageType;
...@@ -2107,15 +2104,11 @@ QImage UAS::getImage() ...@@ -2107,15 +2104,11 @@ QImage UAS::getImage()
imagePacketsArrived = 0; imagePacketsArrived = 0;
//imageRecBuffer.clear(); //imageRecBuffer.clear();
return image; return image;
#else
return QImage();
#endif
} }
void UAS::requestImage() void UAS::requestImage()
{ {
#ifdef MAVLINK_ENABLED_PIXHAWK
qDebug() << "trying to get an image from the uas..."; qDebug() << "trying to get an image from the uas...";
// check if there is already an image transmission going on // check if there is already an image transmission going on
...@@ -2125,7 +2118,6 @@ void UAS::requestImage() ...@@ -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); mavlink_msg_data_transmission_handshake_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, DATA_TYPE_JPEG_IMAGE, 0, 0, 0, 0, 0, 50);
sendMessage(msg); sendMessage(msg);
} }
#endif
} }
......
...@@ -292,8 +292,7 @@ void HUD::setActiveUAS(UASInterface* uas) ...@@ -292,8 +292,7 @@ void HUD::setActiveUAS(UASInterface* uas)
// Try to disconnect the image link // Try to disconnect the image link
UAS* u = dynamic_cast<UAS*>(this->uas); UAS* u = dynamic_cast<UAS*>(this->uas);
if (u) { if (u) {
disconnect(u, SIGNAL(imageStarted(quint64)), this, SLOT(startImage(quint64))); disconnect(u, SIGNAL(imageReady(UASInterface*)), this, SLOT(copyImage(UASInterface*)));
disconnect(u, SIGNAL(imageReady(UASInterface*)), this, SLOT(copyImage()));
} }
} }
...@@ -313,10 +312,9 @@ void HUD::setActiveUAS(UASInterface* uas) ...@@ -313,10 +312,9 @@ void HUD::setActiveUAS(UASInterface* uas)
connect(uas, SIGNAL(waypointSelected(int,int)), this, SLOT(selectWaypoint(int, int))); connect(uas, SIGNAL(waypointSelected(int,int)), this, SLOT(selectWaypoint(int, int)));
// Try to connect the image link // Try to connect the image link
UAS* u = dynamic_cast<UAS*>(uas); UAS* u = qobject_cast<UAS*>(uas);
if (u) { if (u) {
connect(u, SIGNAL(imageStarted(quint64)), this, SLOT(startImage(quint64))); connect(u, SIGNAL(imageReady(UASInterface*)), this, SLOT(copyImage(UASInterface*)));
connect(u, SIGNAL(imageReady(UASInterface*)), this, SLOT(copyImage()));
} }
} }
...@@ -581,30 +579,12 @@ void HUD::paintHUD() ...@@ -581,30 +579,12 @@ void HUD::paintHUD()
scalingFactor = this->width()/vwidth; scalingFactor = this->width()/vwidth;
double scalingFactorH = this->height()/vheight; double scalingFactorH = this->height()/vheight;
if (scalingFactorH < scalingFactor) scalingFactor = scalingFactorH; 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. // And if either video or the data stream is enabled, draw the next frame.
if (dataStreamEnabled || videoEnabled) if (videoEnabled)
{ {
xImageFactor = width() / (float)glImage.width(); xImageFactor = width() / (float)glImage.width();
yImageFactor = height() / (float)glImage.height(); yImageFactor = height() / (float)glImage.height();
//float imageFactor = qMin(xImageFactor, yImageFactor);
// Resize to correct size and fill with image
// FIXME
} }
QPainter painter; QPainter painter;
...@@ -1331,14 +1311,6 @@ void HUD::saveImage() ...@@ -1331,14 +1311,6 @@ void HUD::saveImage()
saveImage(fileName); 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() void HUD::selectOfflineDirectory()
{ {
QString fileName = QFileDialog::getExistingDirectory(this, tr("Select image directory"), QDesktopServices::storageLocation(QDesktopServices::DesktopLocation)); 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 ...@@ -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<UAS*>(this->uas); UAS* u = qobject_cast<UAS*>(uas);
if (u) if (u)
{ {
this->glImage = u->getImage(); this->glImage = u->getImage();
......
...@@ -81,7 +81,6 @@ public slots: ...@@ -81,7 +81,6 @@ public slots:
void updateLoad(UASInterface*, double); void updateLoad(UASInterface*, double);
void selectWaypoint(int uasId, int id); void selectWaypoint(int uasId, int id);
void startImage(quint64 timestamp);
void startImage(int imgid, int width, int height, int depth, int channels); 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 setPixels(int imgid, const unsigned char* imageData, int length, int startIndex);
void finishImage(); void finishImage();
...@@ -95,7 +94,7 @@ public slots: ...@@ -95,7 +94,7 @@ public slots:
/** @brief Enable Video */ /** @brief Enable Video */
void enableVideo(bool enabled); void enableVideo(bool enabled);
/** @brief Copy an image from the current active UAS */ /** @brief Copy an image from the current active UAS */
void copyImage(); void copyImage(UASInterface* uas);
protected slots: protected slots:
...@@ -220,7 +219,6 @@ protected: ...@@ -220,7 +219,6 @@ protected:
QString nextOfflineImage; QString nextOfflineImage;
bool HUDInstrumentsEnabled; bool HUDInstrumentsEnabled;
bool videoEnabled; bool videoEnabled;
bool dataStreamEnabled;
bool imageLoggingEnabled; bool imageLoggingEnabled;
float xImageFactor; float xImageFactor;
float yImageFactor; float yImageFactor;
......
...@@ -596,8 +596,6 @@ void MainWindow::buildCommonWidgets() ...@@ -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(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(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)); 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) ...@@ -778,7 +776,11 @@ void MainWindow::loadDockWidget(const QString& name)
} }
else if (name == "PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET") 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") else if (name == "UAS_INFO_QUICKVIEW_DOCKWIDGET")
{ {
......
...@@ -103,14 +103,14 @@ void QGCRGBDView::contextMenuEvent(QContextMenuEvent* event) ...@@ -103,14 +103,14 @@ void QGCRGBDView::contextMenuEvent(QContextMenuEvent* event)
void QGCRGBDView::enableRGB(bool enabled) void QGCRGBDView::enableRGB(bool enabled)
{ {
rgbEnabled = enabled; rgbEnabled = enabled;
dataStreamEnabled = rgbEnabled | depthEnabled; videoEnabled = rgbEnabled | depthEnabled;
QWidget::resize(size().width(), size().height()); QWidget::resize(size().width(), size().height());
} }
void QGCRGBDView::enableDepth(bool enabled) void QGCRGBDView::enableDepth(bool enabled)
{ {
depthEnabled = enabled; depthEnabled = enabled;
dataStreamEnabled = rgbEnabled | depthEnabled; videoEnabled = rgbEnabled | depthEnabled;
QWidget::resize(size().width(), size().height()); QWidget::resize(size().width(), size().height());
} }
......
...@@ -92,6 +92,11 @@ WaypointEditableView::WaypointEditableView(Waypoint* wp, QWidget* parent) : ...@@ -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("Local(NED)",MAV_FRAME_LOCAL_NED);
m_ui->comboBox_frame->addItem("Mission",MAV_FRAME_MISSION); 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 // Initialize view correctly
int actionID = wp->getAction(); int actionID = wp->getAction();
initializeActionView(actionID); initializeActionView(actionID);
...@@ -109,7 +114,6 @@ WaypointEditableView::WaypointEditableView(Waypoint* wp, QWidget* parent) : ...@@ -109,7 +114,6 @@ WaypointEditableView::WaypointEditableView(Waypoint* wp, QWidget* parent) :
connect(m_ui->removeButton, SIGNAL(clicked()), this, SLOT(remove())); connect(m_ui->removeButton, SIGNAL(clicked()), this, SLOT(remove()));
connect(m_ui->autoContinue, SIGNAL(stateChanged(int)), this, SLOT(changedAutoContinue(int))); 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_action, SIGNAL(activated(int)), this, SLOT(changedAction(int)));
connect(m_ui->comboBox_frame, SIGNAL(activated(int)), this, SLOT(changedFrame(int))); connect(m_ui->comboBox_frame, SIGNAL(activated(int)), this, SLOT(changedFrame(int)));
......
...@@ -29,10 +29,16 @@ ...@@ -29,10 +29,16 @@
<string notr="true"/> <string notr="true"/>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing"> <property name="leftMargin">
<number>6</number> <number>6</number>
</property> </property>
<property name="margin"> <property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number> <number>6</number>
</property> </property>
<item> <item>
...@@ -62,6 +68,9 @@ ...@@ -62,6 +68,9 @@
</item> </item>
<item> <item>
<widget class="QCheckBox" name="selectedBox"> <widget class="QCheckBox" name="selectedBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
......
...@@ -405,6 +405,9 @@ void WaypointList::currentWaypointEditableChanged(quint16 seq) ...@@ -405,6 +405,9 @@ void WaypointList::currentWaypointEditableChanged(quint16 seq)
// Update waypointViews to correctly indicate the new current waypoint // Update waypointViews to correctly indicate the new current waypoint
void WaypointList::currentWaypointViewOnlyChanged(quint16 seq) void WaypointList::currentWaypointViewOnlyChanged(quint16 seq)
{ {
// First update the edit list
currentWaypointEditableChanged(seq);
const QList<Waypoint *> &waypoints = WPM->getWaypointViewOnlyList(); const QList<Waypoint *> &waypoints = WPM->getWaypointViewOnlyList();
if (seq < waypoints.count()) if (seq < waypoints.count())
...@@ -423,6 +426,7 @@ void WaypointList::currentWaypointViewOnlyChanged(quint16 seq) ...@@ -423,6 +426,7 @@ void WaypointList::currentWaypointViewOnlyChanged(quint16 seq)
} }
} }
} }
m_ui->tabWidget->setCurrentIndex(1); // XXX magic number
} }
void WaypointList::updateWaypointEditable(int uas, Waypoint* wp) void WaypointList::updateWaypointEditable(int uas, Waypoint* wp)
...@@ -430,6 +434,7 @@ void WaypointList::updateWaypointEditable(int uas, Waypoint* wp) ...@@ -430,6 +434,7 @@ void WaypointList::updateWaypointEditable(int uas, Waypoint* wp)
Q_UNUSED(uas); Q_UNUSED(uas);
WaypointEditableView *wpv = wpEditableViews.value(wp); WaypointEditableView *wpv = wpEditableViews.value(wp);
wpv->updateValues(); wpv->updateValues();
m_ui->tabWidget->setCurrentIndex(0); // XXX magic number
} }
void WaypointList::updateWaypointViewOnly(int uas, Waypoint* wp) void WaypointList::updateWaypointViewOnly(int uas, Waypoint* wp)
...@@ -437,6 +442,7 @@ void WaypointList::updateWaypointViewOnly(int uas, Waypoint* wp) ...@@ -437,6 +442,7 @@ void WaypointList::updateWaypointViewOnly(int uas, Waypoint* wp)
Q_UNUSED(uas); Q_UNUSED(uas);
WaypointViewOnlyView *wpv = wpViewOnlyViews.value(wp); WaypointViewOnlyView *wpv = wpViewOnlyViews.value(wp);
wpv->updateValues(); wpv->updateValues();
m_ui->tabWidget->setCurrentIndex(1); // XXX magic number
} }
void WaypointList::waypointViewOnlyListChanged() void WaypointList::waypointViewOnlyListChanged()
...@@ -488,6 +494,8 @@ void WaypointList::waypointViewOnlyListChanged() ...@@ -488,6 +494,8 @@ void WaypointList::waypointViewOnlyListChanged()
this->setUpdatesEnabled(true); this->setUpdatesEnabled(true);
loadFileGlobalWP = false; loadFileGlobalWP = false;
m_ui->tabWidget->setCurrentIndex(1);
} }
...@@ -544,7 +552,6 @@ void WaypointList::waypointEditableListChanged() ...@@ -544,7 +552,6 @@ void WaypointList::waypointEditableListChanged()
this->setUpdatesEnabled(true); this->setUpdatesEnabled(true);
loadFileGlobalWP = false; loadFileGlobalWP = false;
} }
void WaypointList::moveUp(Waypoint* wp) void WaypointList::moveUp(Waypoint* wp)
......
...@@ -154,8 +154,8 @@ ...@@ -154,8 +154,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>836</width> <width>834</width>
<height>316</height> <height>325</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
...@@ -294,8 +294,8 @@ ...@@ -294,8 +294,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>836</width> <width>834</width>
<height>316</height> <height>323</height>
</rect> </rect>
</property> </property>
<property name="autoFillBackground"> <property name="autoFillBackground">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment