Commit 9982bcd5 authored by Bryant's avatar Bryant

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

Conflicts:
	QGCExternalLibs.pri
parents 2a7dc76e 436d0f78
......@@ -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
......
#!/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'
......@@ -28,6 +28,11 @@
#include <qmath.h>
// 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
......@@ -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);
......
......@@ -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
......
......@@ -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);
......
......@@ -55,4 +55,4 @@ unix:!symbian {
}
}
HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS
HEADERS *= $$PUBLIC_HEADERS $$PRIVATE_HEADERS
......@@ -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
}
#
......
Subproject commit 2db4b382b02c3822acd19e99bc57fa53f3f53d01
Subproject commit b8b885c610ee574140c7a6ad9bc007dcf28a74b7
......@@ -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;
}
......
......@@ -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
......@@ -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;
......
......@@ -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
*/
......
......@@ -306,6 +306,9 @@ public:
return nedAttGlobalOffset;
}
bool isRotaryWing();
bool isFixedWing();
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
px::GLOverlay getOverlay()
{
......
......@@ -267,6 +267,9 @@ public:
*/
virtual QList<QAction*> 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;
......
......@@ -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()
......
......@@ -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*)));
}
}
......@@ -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<UAS*>(this->uas);
UAS* u = qobject_cast<UAS*>(uas);
if (u)
{
this->glImage = u->getImage();
......
......@@ -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;
......
......@@ -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")
{
......
......@@ -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());
}
......
......@@ -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)));
......
......@@ -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>
......
......@@ -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)
......
......@@ -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">
......
......@@ -39,8 +39,20 @@ This file is part of the QGROUNDCONTROL project
#include <osg/PositionAttitudeTransform>
#include <osgGA/TrackballManipulator>
#include <osgText/Font>
// 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 <osgViewer/Viewer>
#ifndef Q_OS_WIN
#pragma GCC diagnostic pop
#endif
#include "CameraParams.h"
#include "GCManipulator.h"
#include "SystemGroupNode.h"
......
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