Commit 05fa5200 authored by Pierre TILAK's avatar Pierre TILAK

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

parents f3815a9f c33fb061
......@@ -23,8 +23,7 @@ matrix:
env: SPEC=linux-g++-64 CONFIG=debug
services: xvfb
sudo: required
- os: android
dist: trusty
- dist: trusty
language: android
env: SPEC=android-g++ CONFIG=installer
sudo: false
......
......@@ -10,6 +10,10 @@ set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options(-Wall -Wextra -Wno-address-of-packed-member)
endif()
# CMake build type
# Debug Release RelWithDebInfo MinSizeRel Coverage
if (NOT CMAKE_BUILD_TYPE)
......@@ -142,7 +146,6 @@ set(QGC_RESOURCES
qgcresources.qrc
qgroundcontrol.qrc
qgcimages.qrc
src/FirmwarePlugin/APM/APMResources.qrc
src/FirmwarePlugin/PX4/PX4Resources.qrc
src/Airmap/airmap.qrc
......
......@@ -6,6 +6,8 @@ Note: This file only contains high level features or important fixes.
### 3.6.0 - Daily Build
* Log Replay: Support changing speed of playback
* Basic object avoidance added to vehicles.
* Added ability to set a joystick button to be single action or repeated action while the button is held down.
* Rework joysticks. Fixed several issues and updated setup UI.
* Adding support for UDP RTP h.265 video streams
......
......@@ -3,7 +3,7 @@
# Please see our website at <http://qgroundcontrol.org>
# Maintainer:
# Lorenz Meier <lm@inf.ethz.ch>
# (c) 2009-2014 QGroundControl Developers
# (c) 2009-2019 QGroundControl Developers
# License terms set in COPYING.md
# -------------------------------------------------
......@@ -21,6 +21,7 @@ linux {
message("Linux build")
CONFIG += LinuxBuild
DEFINES += __STDC_LIMIT_MACROS
DEFINES += QGC_ENABLE_NFC RW_SUPPORT
DEFINES += QGC_GST_TAISYNC_ENABLED
DEFINES += QGC_GST_MICROHARD_ENABLED
linux-clang {
......@@ -132,14 +133,15 @@ exists ($$PWD/.git) {
contains(GIT_DESCRIBE, v[0-9]+.[0-9]+.[0-9]+) {
# release version "vX.Y.Z"
GIT_VERSION = $${GIT_DESCRIBE}
VERSION = $$replace(GIT_DESCRIBE, "v", "")
VERSION = $$replace(VERSION, "-", ".")
VERSION = $$section(VERSION, ".", 0, 3)
} else {
# development version "Development branch:sha date"
GIT_VERSION = "Development $${GIT_BRANCH}:$${GIT_HASH} $${GIT_TIME}"
VERSION = 0.0.0
}
VERSION = $$replace(GIT_DESCRIBE, "v", "")
VERSION = $$replace(VERSION, "-", ".")
VERSION = $$section(VERSION, ".", 0, 3)
MacBuild {
MAC_VERSION = $$section(VERSION, ".", 0, 2)
MAC_BUILD = $$section(VERSION, ".", 3, 3)
......@@ -254,6 +256,10 @@ ReleaseBuild {
}
WindowsBuild {
*msvc* { # visual studio spec filter
# Run compilation using VS compiler using multiple threads
QMAKE_CXXFLAGS += -MP
}
# Enable function level linking and enhanced optimized debugging
QMAKE_CFLAGS_RELEASE += /Gy /Zo
QMAKE_CXXFLAGS_RELEASE += /Gy /Zo
......
......@@ -92,6 +92,20 @@ exists($$MAVLINKPATH/common) {
INCLUDEPATH += libs/eigen
DEFINES += NOMINMAX
# Pairing
MacBuild {
#- Pairing is generally not supported on macOS. This is here solely for development.
exists(/usr/local/Cellar/openssl/1.0.2s/include) {
INCLUDEPATH += /usr/local/Cellar/openssl/1.0.2s/include
LIBS += -L/usr/local/Cellar/openssl/1.0.2s/lib
LIBS += -lcrypto -lz
} else {
DEFINES += QGC_DISABLE_PAIRING
}
} else {
LIBS += -lcrypto -lz
}
#
# [REQUIRED] shapelib library
INCLUDEPATH += libs/shapelib
......@@ -115,24 +129,36 @@ MacBuild {
PKGCONFIG = sdl2
} else:WindowsBuild {
INCLUDEPATH += $$BASEDIR/libs/lib/sdl2/msvc/include
INCLUDEPATH += $$BASEDIR/libs/zlib/Windows/include
contains(QT_ARCH, i386) {
INCLUDEPATH += $$BASEDIR/libs/OpenSSL/Windows/x86/include
LIBS += -L$$BASEDIR/libs/lib/sdl2/msvc/lib/x86
LIBS += -L$$BASEDIR/libs/OpenSSL/Windows/x86/lib
} else {
INCLUDEPATH += $$BASEDIR/libs/OpenSSL/Windows/x64/include
LIBS += -L$$BASEDIR/libs/lib/sdl2/msvc/lib/x64
LIBS += -L$$BASEDIR/libs/OpenSSL/Windows/x64/lib
}
LIBS += -L$$BASEDIR/libs/zlib/Windows/libs
LIBS += \
-lSDL2main \
-lSDL2
-lSDL2 \
-lz \
-llibeay32
}
AndroidBuild {
contains(QT_ARCH, arm) {
ANDROID_EXTRA_LIBS += $$BASEDIR/libs/AndroidOpenSSL/arch-armeabi-v7a/lib/libcrypto.so
ANDROID_EXTRA_LIBS += $$BASEDIR/libs/AndroidOpenSSL/arch-armeabi-v7a/lib/libssl.so
ANDROID_EXTRA_LIBS += $$BASEDIR/libs/OpenSSL/Android/arch-armeabi-v7a/lib/libcrypto.so
ANDROID_EXTRA_LIBS += $$BASEDIR/libs/OpenSSL/Android/arch-armeabi-v7a/lib/libssl.so
LIBS += $$ANDROID_EXTRA_LIBS
INCLUDEPATH += $$BASEDIR/libs/OpenSSL/Android/arch-armeabi-v7a/include
} else {
ANDROID_EXTRA_LIBS += $$BASEDIR/libs/AndroidOpenSSL/arch-x86/lib/libcrypto.so
ANDROID_EXTRA_LIBS += $$BASEDIR/libs/AndroidOpenSSL/arch-x86/lib/libssl.so
ANDROID_EXTRA_LIBS += $$BASEDIR/libs/OpenSSL/Android/arch-x86/lib/libcrypto.so
ANDROID_EXTRA_LIBS += $$BASEDIR/libs/OpenSSL/Android/arch-x86/lib/libssl.so
LIBS += $$ANDROID_EXTRA_LIBS
INCLUDEPATH += $$BASEDIR/libs/OpenSSL/Android/arch-x86/include
}
}
......@@ -165,7 +191,7 @@ contains (DEFINES, DISABLE_AIRMAP) {
} else {
AIRMAPD_PATH = $$PWD/libs/airmapd
AIRMAP_QT_PATH = Qt.$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}
message(Looking for Airmap in $$AIRMAP_QT_PATH)
message('Looking for Airmap in folder "$${AIRMAPD_PATH}", variant: "$$AIRMAP_QT_PATH"')
MacBuild {
exists($${AIRMAPD_PATH}/macOS/$$AIRMAP_QT_PATH) {
message("Including support for AirMap for macOS")
......
......@@ -43,13 +43,13 @@ installer {
QMAKE_POST_LINK += && rm /tmp/tmp.dmg
}
WindowsBuild {
QMAKE_POST_LINK += $$escape_expand(\\n) cd $$BASEDIR_WIN && $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" /DINSTALLER_ICON="\"$${QGC_INSTALLER_ICON}\"" /DHEADER_BITMAP="\"$${QGC_INSTALLER_HEADER_BITMAP}\"" /DAPPNAME="\"$${QGC_APP_NAME}\"" /DEXENAME="\"$${TARGET}\"" /DORGNAME="\"$${QGC_ORG_NAME}\"" /DDESTDIR=$${DESTDIR} /NOCD "\"/XOutFile $${DESTDIR_WIN}\\$${TARGET}-installer.exe\"" "$$BASEDIR_WIN\\deploy\\qgroundcontrol_installer.nsi")
QMAKE_POST_LINK += $$escape_expand(\\n) cd $$BASEDIR_WIN && $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" $$(QGC_NSIS_INSTALLER_PARAMETERS) /DINSTALLER_ICON="\"$${QGC_INSTALLER_ICON}\"" /DHEADER_BITMAP="\"$${QGC_INSTALLER_HEADER_BITMAP}\"" /DAPPNAME="\"$${QGC_APP_NAME}\"" /DEXENAME="\"$${TARGET}\"" /DORGNAME="\"$${QGC_ORG_NAME}\"" /DDESTDIR=$${DESTDIR} /NOCD "\"/XOutFile $${DESTDIR_WIN}\\$${TARGET}-installer.exe\"" "$$BASEDIR_WIN\\deploy\\qgroundcontrol_installer.nsi")
OTHER_FILES += deploy/qgroundcontrol_installer.nsi
}
LinuxBuild {
#-- TODO: This uses hardcoded paths. It should use $${DESTDIR}
QMAKE_POST_LINK += && mkdir -p release/package
QMAKE_POST_LINK += && tar -cjf release/package/QGroundControl.tar.bz2 release --exclude='package' --transform 's/release/qgroundcontrol/'
QMAKE_POST_LINK += && tar --warning=no-file-changed -cjf release/package/QGroundControl.tar.bz2 release --exclude='package' --transform 's/release/qgroundcontrol/'
}
AndroidBuild {
#-- TODO: This uses hardcoded paths. It should use $${DESTDIR}
......
......@@ -87,7 +87,7 @@ WindowsBuild {
}
DEPLOY_TARGET = $$shell_quote($$shell_path($$DESTDIR_WIN\\$${TARGET}.exe))
QMAKE_POST_LINK += $$escape_expand(\\n) $$QT_BIN_DIR\\windeployqt --no-compiler-runtime --qmldir=$${BASEDIR_WIN}\\src $${DEPLOY_TARGET}
QMAKE_POST_LINK += $$escape_expand(\\n) $$QT_BIN_DIR\\windeployqt --qmldir=$${BASEDIR_WIN}\\src $${DEPLOY_TARGET}
}
LinuxBuild {
......
......@@ -58,11 +58,13 @@ QML_IMPORT_PATH += \
# Our own, custom sources
SOURCES += \
$$PWD/src/CustomPlugin.cc \
$$PWD/src/CustomQuickInterface.cc
$$PWD/src/CustomQuickInterface.cc \
$$PWD/src/CustomVideoManager.cc
HEADERS += \
$$PWD/src/CustomPlugin.h \
$$PWD/src/CustomQuickInterface.h
$$PWD/src/CustomQuickInterface.h \
$$PWD/src/CustomVideoManager.h
INCLUDEPATH += \
$$PWD/src \
......
......@@ -379,22 +379,20 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
}
}
/*
//-----------------------------------------------------------------
//-- Recording Time / Images Captured
CustomLabel {
QGCLabel {
text: (_cameraVideoMode && _camera.videoStatus === QGCCameraControl.VIDEO_CAPTURE_STATUS_RUNNING) ? _camera.recordTimeStr : "00:00:00"
visible: _cameraVideoMode
pointSize: ScreenTools.smallFontPointSize
font.pointSize: ScreenTools.smallFontPointSize
anchors.horizontalCenter: parent.horizontalCenter
}
CustomLabel {
QGCLabel {
text: activeVehicle && _cameraPhotoMode ? ('00000' + activeVehicle.cameraTriggerPoints.count).slice(-5) : "00000"
visible: _cameraPhotoMode
pointSize: ScreenTools.smallFontPointSize
font.pointSize: ScreenTools.smallFontPointSize
anchors.horizontalCenter: parent.horizontalCenter
}
*/
Item {
height: 1
width: 1
......
This diff is collapsed.
......@@ -34,6 +34,7 @@ Item {
anchors.left: parent.left
QGCColoredImage {
id: menuEdge
visible: !QGroundControl.supportsPairing || !QGroundControl.settingsManager.appSettings.usePairing.rawValue
anchors.verticalCenter: parent.verticalCenter
height: ScreenTools.defaultFontPixelHeight
width: height
......@@ -43,11 +44,19 @@ Item {
color: qgcPal.buttonText
}
QGCLabel {
visible: menuEdge.visible
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Waiting for a vehicle")
font.pointSize: ScreenTools.mediumFontPointSize
font.family: ScreenTools.demiboldFontFamily
}
Loader {
visible: !menuEdge.visible
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.margins: _indicatorMargins
source: "/toolbar/PairingIndicator.qml"
}
}
//-------------------------------------------------------------------------
//-- Toolbar Indicators
......
......@@ -17,6 +17,7 @@
#include "CustomPlugin.h"
#include "CustomQuickInterface.h"
#include "CustomVideoManager.h"
#include "MultiVehicleManager.h"
#include "QGCApplication.h"
......@@ -46,7 +47,7 @@ customQuickInterfaceSingletonFactory(QQmlEngine*, QJSEngine*)
{
qCDebug(CustomLog) << "Creating CustomQuickInterface instance";
CustomQuickInterface* pIFace = new CustomQuickInterface();
CustomPlugin* pPlug = dynamic_cast<CustomPlugin*>(qgcApp()->toolbox()->corePlugin());
auto* pPlug = qobject_cast<CustomPlugin*>(qgcApp()->toolbox()->corePlugin());
if(pPlug) {
pIFace->init();
} else {
......@@ -191,6 +192,13 @@ CustomPlugin::overrideSettingsGroupVisibility(QString name)
return true;
}
//-----------------------------------------------------------------------------
VideoManager*
CustomPlugin::createVideoManager(QGCApplication *app, QGCToolbox *toolbox)
{
return new CustomVideoManager(app, toolbox);
}
//-----------------------------------------------------------------------------
VideoReceiver*
CustomPlugin::createVideoReceiver(QObject* parent)
......@@ -216,6 +224,7 @@ CustomPlugin::createRootWindow(QObject *parent)
bool
CustomPlugin::adjustSettingMetaData(const QString& settingsGroup, FactMetaData& metaData)
{
bool parentResult = QGCCorePlugin::adjustSettingMetaData(settingsGroup, metaData);
if (settingsGroup == AppSettings::settingsGroup) {
if (metaData.name() == AppSettings::appFontPointSizeName) {
#if defined(Q_OS_LINUX)
......@@ -225,10 +234,10 @@ CustomPlugin::adjustSettingMetaData(const QString& settingsGroup, FactMetaData&
} else if (metaData.name() == AppSettings::indoorPaletteName) {
QVariant indoorPalette = 1;
metaData.setRawDefaultValue(indoorPalette);
return true;
parentResult = true;
}
}
return true;
return parentResult;
}
const QColor CustomPlugin::_windowShadeEnabledLightColor("#FFFFFF");
......
......@@ -79,6 +79,7 @@ public:
QString brandImageIndoor () const final;
QString brandImageOutdoor () const final;
bool overrideSettingsGroupVisibility (QString name) final;
VideoManager* createVideoManager (QGCApplication* app, QGCToolbox* toolbox) final;
VideoReceiver* createVideoReceiver (QObject* parent) final;
QQmlApplicationEngine* createRootWindow (QObject* parent) final;
bool adjustSettingMetaData (const QString& settingsGroup, FactMetaData& metaData) final;
......
......@@ -25,6 +25,7 @@
static const char* kGroupName = "CustomSettings";
static const char* kShowGimbalCtl = "ShowGimbalCtl";
static const char* kShowAttitudeWidget = "ShowAttitudeWidget";
//-----------------------------------------------------------------------------
CustomQuickInterface::CustomQuickInterface(QObject* parent)
......@@ -45,7 +46,8 @@ CustomQuickInterface::init()
{
QSettings settings;
settings.beginGroup(kGroupName);
_showGimbalControl = settings.value(kShowGimbalCtl, true).toBool();
_showGimbalControl = settings.value(kShowGimbalCtl, false).toBool();
_showAttitudeWidget = settings.value(kShowAttitudeWidget, false).toBool();
}
//-----------------------------------------------------------------------------
......@@ -60,3 +62,16 @@ CustomQuickInterface::setShowGimbalControl(bool set)
emit showGimbalControlChanged();
}
}
//-----------------------------------------------------------------------------
void
CustomQuickInterface::setShowAttitudeWidget(bool set)
{
if(_showAttitudeWidget != set) {
_showAttitudeWidget = set;
QSettings settings;
settings.beginGroup(kGroupName);
settings.setValue(kShowAttitudeWidget,set);
emit showAttitudeWidgetChanged();
}
}
......@@ -29,12 +29,20 @@ public:
CustomQuickInterface(QObject* parent = nullptr);
~CustomQuickInterface();
Q_PROPERTY(bool showGimbalControl READ showGimbalControl WRITE setShowGimbalControl NOTIFY showGimbalControlChanged)
Q_PROPERTY(bool showAttitudeWidget READ showAttitudeWidget WRITE setShowAttitudeWidget NOTIFY showAttitudeWidgetChanged)
bool showGimbalControl () { return _showGimbalControl; }
void setShowGimbalControl (bool set);
void init ();
bool showAttitudeWidget () { return _showAttitudeWidget; }
void setShowAttitudeWidget (bool set);
signals:
void showGimbalControlChanged ();
void showAttitudeWidgetChanged();
private:
bool _showGimbalControl = true;
bool _showAttitudeWidget = false;
};
/****************************************************************************
*
* (c) 2009-2019 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#include "CustomVideoManager.h"
#include "MultiVehicleManager.h"
#include "CustomCameraManager.h"
#include "CustomCameraControl.h"
//-----------------------------------------------------------------------------
CustomVideoManager::CustomVideoManager(QGCApplication* app, QGCToolbox* toolbox)
: VideoManager(app, toolbox)
{
}
//-----------------------------------------------------------------------------
void
CustomVideoManager::_updateSettings()
{
if(!_videoSettings || !_videoReceiver)
return;
//-- Check encoding
if(_activeVehicle && _activeVehicle->dynamicCameras()) {
auto* pCamera = qobject_cast<CustomCameraControl*>(_activeVehicle->dynamicCameras()->currentCameraInstance());
if(pCamera) {
Fact *fact = pCamera->videoEncoding();
if (fact) {
_videoReceiver->setVideoDecoder(static_cast<VideoReceiver::VideoEncoding>(fact->rawValue().toInt()));
}
}
}
VideoManager::_updateSettings();
}
/****************************************************************************
*
* (c) 2009-2019 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#pragma once
#include <QObject>
#include <QTimer>
#include <QTime>
#include <QUrl>
#include "VideoManager.h"
class CustomVideoManager : public VideoManager
{
Q_OBJECT
public:
CustomVideoManager (QGCApplication* app, QGCToolbox* toolbox);
protected:
void _updateSettings ();
};
......@@ -19,6 +19,7 @@ QGC_LOGGING_CATEGORY(CustomCameraVerboseLog, "CustomCameraVerboseLog")
static const char* kCAM_IRPALETTE = "CAM_IRPALETTE";
static const char* kCAM_NEXTVISION_IRPALETTE = "IR_SENS_POL";
static const char* kCAM_ENC = "CAM_ENC";
//-----------------------------------------------------------------------------
CustomCameraControl::CustomCameraControl(const mavlink_camera_information_t *info, Vehicle* vehicle, int compID, QObject* parent)
......@@ -116,6 +117,13 @@ CustomCameraControl::irPalette()
return nullptr;
}
//-----------------------------------------------------------------------------
Fact*
CustomCameraControl::videoEncoding()
{
return _paramComplete ? getFact(kCAM_ENC) : nullptr;
}
//-----------------------------------------------------------------------------
void
CustomCameraControl::setThermalMode(ThermalViewMode mode)
......
......@@ -29,8 +29,11 @@ public:
CustomCameraControl(const mavlink_camera_information_t* info, Vehicle* vehicle, int compID, QObject* parent = nullptr);