Commit f9d811fa authored by Gus Grubba's avatar Gus Grubba

Merge branch 'master' of https://github.com/mavlink/qgroundcontrol into pr-mgrs

parents 3be7c93b 67204922
......@@ -6,6 +6,7 @@ Note: This file only contains high level features or important fixes.
### 3.6.0 - Daily Build
* ADSB: Added support for connecting to SBS server. Adds support for ADSB data from USB SDR Dongle running 'dump1090 --net' for example.
* Toolbar: Scrollable left/right on small screens like phones
* Plan View: New create plan UI for initial plan creation
* New Corridor editing tools ui. Includes ability to trace polyline by clicking.
......
This system is for posting bugs or feature requests ONLY. For questions about how to use or build QGC see: http://qgroundcontrol.com/#resources
# This system is for posting bugs or feature requests ONLY. Support questions will be automatically closed with no response.
# For questions about how to use or build QGC see: http://qgroundcontrol.com/#resources
----
# To post a bug report
When posting bug reports, include the following informaiton:
- Ground station operating system.
- QGroundControl version and build (daily, stable, self-built from source, etc.)
......
......@@ -5,15 +5,18 @@ pipeline {
stage('build') {
parallel {
stage('Android Release') {
stage('Android 32 bit Release') {
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
CCACHE_CPP2 = '1'
QGC_CONFIG = 'release'
QMAKE_VER = "5.11.0/android_armv7/bin/qmake"
QMAKE_VER = "5.12.5/android_armv7/bin/qmake"
QT_MKSPEC = "android-clang"
BITNESS=32
}
agent {
docker {
image 'mavlink/qgc-build-android:2019-02-03'
image 'mavlink/qgc-build-android:2019-11-12'
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
......@@ -34,15 +37,47 @@ pipeline {
}
}
stage('Android 64 bit Release') {
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
CCACHE_CPP2 = '1'
QGC_CONFIG = 'release'
QMAKE_VER = "5.12.5/android_arm64_v8a/bin/qmake"
QT_MKSPEC = "android-clang"
BITNESS=64
}
agent {
docker {
image 'mavlink/qgc-build-android_arm64_v8a:2019-11-12'
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
steps {
sh 'export'
sh 'ccache -z'
sh 'git submodule deinit -f .'
sh 'git clean -ff -x -d .'
sh 'git submodule update --init --recursive --force'
sh 'mkdir build; cd build; ${QT_PATH}/${QMAKE_VER} -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=${QGC_CONFIG} CONFIG+=WarningsAsErrorsOn'
//sh 'cd build; make -j`nproc --all`' // FIXME
sh 'ccache -s'
}
post {
cleanup {
sh 'git clean -ff -x -d .'
}
}
}
stage('Linux Debug') {
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
QGC_CONFIG = 'debug'
QMAKE_VER = "5.11.0/gcc_64/bin/qmake"
QMAKE_VER = "5.12.5/gcc_64/bin/qmake"
}
agent {
docker {
image 'mavlink/qgc-build-linux:2019-02-03'
image 'mavlink/qgc-build-linux:2019-11-12'
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
......@@ -67,12 +102,12 @@ pipeline {
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
CMAKE_BUILD_TYPE = 'Debug'
QT_VERSION = "5.11.0"
QT_VERSION = "5.12.5"
QT_MKSPEC = "gcc_64"
}
agent {
docker {
image 'mavlink/qgc-build-linux:2019-02-03'
image 'mavlink/qgc-build-linux:2019-11-12'
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
......@@ -97,11 +132,11 @@ pipeline {
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
QGC_CONFIG = 'release'
QMAKE_VER = "5.11.0/gcc_64/bin/qmake"
QMAKE_VER = "5.12.5/gcc_64/bin/qmake"
}
agent {
docker {
image 'mavlink/qgc-build-linux:2019-02-03'
image 'mavlink/qgc-build-linux:2019-11-12'
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
......@@ -129,12 +164,12 @@ pipeline {
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
CMAKE_BUILD_TYPE = 'Release'
QT_VERSION = "5.11.0"
QT_VERSION = "5.12.5"
QT_MKSPEC = "gcc_64"
}
agent {
docker {
image 'mavlink/qgc-build-linux:2019-02-03'
image 'mavlink/qgc-build-linux:2019-11-12'
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
......@@ -190,6 +225,7 @@ pipeline {
}
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
CCACHE_CPP2 = '1'
CMAKE_BUILD_TYPE = 'Debug'
QT_VERSION = "5.11.0"
QT_MKSPEC = "clang_64"
......@@ -218,6 +254,7 @@ pipeline {
}
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
CCACHE_CPP2 = '1'
QGC_CONFIG = 'installer'
QMAKE_VER = "5.11.0/clang_64/bin/qmake"
}
......@@ -270,6 +307,7 @@ pipeline {
}
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
CCACHE_CPP2 = '1'
CMAKE_BUILD_TYPE = 'Release'
QT_VERSION = "5.11.0"
QT_MKSPEC = "clang_64"
......@@ -295,7 +333,6 @@ pipeline {
} // stages
environment {
CCACHE_CPP2 = '1'
CCACHE_DIR = '/tmp/ccache'
QT_FATAL_WARNINGS = '1'
}
......
---
name: Bug report
about: Create a report to help us improve
---
**Describe the bug**
A clear and concise description of the bug.
**To Reproduce**
Steps to reproduce the behavior:
1. Drone switched on '...'
2. Uploaded mission '....' (attach QGC mission file)
3. Took off '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Log Files and Screenshots**
*Always* add screenshots and the QGC console log.
**Drone (please complete the following information):**
- Describe the type of drone.
- Photo of the IMU / autopilot setup if possible.
**Additional context**
Add any other context about the problem here.
......@@ -4,7 +4,7 @@ endif()
if(NOT QT_VERSION)
# try Qt 5.12.0 if none specified, last LTS.
set(QT_VERSION "5.12.0")
set(QT_VERSION "5.12.5")
endif()
if(DEFINED ENV{QT_MKSPEC})
......
......@@ -39,6 +39,8 @@ add_compile_options(
-Wno-return-type
)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Use rpath?
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# No rpath on Darwin. Setting it will only cause trouble.
......@@ -175,7 +177,7 @@ if(BUILD_TEST)
endif(BUILD_TEST)
foreach(executable ${executables})
add_executable(${executable} ${executable}.c)
add_executable(${executable} EXCLUDE_FROM_ALL ${executable}.c)
target_link_libraries(${executable} shp)
if(USE_RPATH)
set_target_properties(${executable}
......@@ -200,7 +202,7 @@ if(BUILD_TEST)
# Other executables to be built to facilitate tests.
foreach(executable shptest shputils)
add_executable(${executable} ${executable}.c)
add_executable(${executable} EXCLUDE_FROM_ALL ${executable}.c)
target_link_libraries(${executable} shp)
get_target_property(${executable}_LOC ${executable} LOCATION)
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/script.sed "s?\\./${executable}?${${executable}_LOC}?\n")
......
......@@ -127,7 +127,7 @@
<file alias="pipHide.svg">src/FlightMap/Images/pipHide.svg</file>
<file alias="pipResize.svg">src/FlightMap/Images/pipResize.svg</file>
<file alias="Plan.svg">src/ui/toolbar/Images/Plan.svg</file>
<file alias="PlanCreator/CustomPlanCreator.png">src/MissionManager/CustomPlanCreator.png</file>
<file alias="PlanCreator/BlankPlanCreator.png">src/MissionManager/BlankPlanCreator.png</file>
<file alias="PlanCreator/CorridorScanPlanCreator.png">src/MissionManager/CorridorScanPlanCreator.png</file>
<file alias="PlanCreator/StructureScanPlanCreator.png">src/MissionManager/StructureScanPlanCreator.png</file>
<file alias="PlanCreator/SurveyPlanCreator.png">src/MissionManager/SurveyPlanCreator.png</file>
......
......@@ -398,6 +398,7 @@ INCLUDEPATH += .
INCLUDEPATH += \
include/ui \
src \
src/ADSB \
src/api \
src/AnalyzeView \
src/Camera \
......@@ -567,6 +568,8 @@ DebugBuild { PX4FirmwarePlugin { PX4FirmwarePluginFactory { APMFirmwarePlugin {
# Main QGC Headers and Source files
HEADERS += \
src/ADSB/ADSBVehicle.h \
src/ADSB/ADSBVehicleManager.h \
src/AnalyzeView/LogDownloadController.h \
src/AnalyzeView/PX4LogParser.h \
src/AnalyzeView/ULogParser.h \
......@@ -593,7 +596,7 @@ HEADERS += \
src/MissionManager/ComplexMissionItem.h \
src/MissionManager/CorridorScanComplexItem.h \
src/MissionManager/CorridorScanPlanCreator.h \
src/MissionManager/CustomPlanCreator.h \
src/MissionManager/BlankPlanCreator.h \
src/MissionManager/FixedWingLandingComplexItem.h \
src/MissionManager/GeoFenceController.h \
src/MissionManager/GeoFenceManager.h \
......@@ -624,6 +627,7 @@ HEADERS += \
src/MissionManager/StructureScanPlanCreator.h \
src/MissionManager/SurveyComplexItem.h \
src/MissionManager/SurveyPlanCreator.h \
src/MissionManager/TakeoffMissionItem.h \
src/MissionManager/TransectStyleComplexItem.h \
src/MissionManager/VisualMissionItem.h \
src/PositionManager/PositionManager.h \
......@@ -659,6 +663,7 @@ HEADERS += \
src/QmlControls/RCChannelMonitorController.h \
src/QmlControls/ScreenToolsController.h \
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.h \
src/Settings/ADSBVehicleManagerSettings.h \
src/Settings/AppSettings.h \
src/Settings/AutoConnectSettings.h \
src/Settings/BrandImageSettings.h \
......@@ -676,7 +681,6 @@ HEADERS += \
src/SHPFileHelper.h \
src/Terrain/TerrainQuery.h \
src/TerrainTile.h \
src/Vehicle/ADSBVehicle.h \
src/Vehicle/GPSRTKFactGroup.h \
src/Vehicle/MAVLinkLogManager.h \
src/Vehicle/MultiVehicleManager.h \
......@@ -806,6 +810,8 @@ AndroidBuild {
}
SOURCES += \
src/ADSB/ADSBVehicle.cc \
src/ADSB/ADSBVehicleManager.cc \
src/AnalyzeView/LogDownloadController.cc \
src/AnalyzeView/PX4LogParser.cc \
src/AnalyzeView/ULogParser.cc \
......@@ -830,7 +836,7 @@ SOURCES += \
src/MissionManager/ComplexMissionItem.cc \
src/MissionManager/CorridorScanComplexItem.cc \
src/MissionManager/CorridorScanPlanCreator.cc \
src/MissionManager/CustomPlanCreator.cc \
src/MissionManager/BlankPlanCreator.cc \
src/MissionManager/FixedWingLandingComplexItem.cc \
src/MissionManager/GeoFenceController.cc \
src/MissionManager/GeoFenceManager.cc \
......@@ -860,6 +866,7 @@ SOURCES += \
src/MissionManager/StructureScanPlanCreator.cc \
src/MissionManager/SurveyComplexItem.cc \
src/MissionManager/SurveyPlanCreator.cc \
src/MissionManager/TakeoffMissionItem.cc \
src/MissionManager/TransectStyleComplexItem.cc \
src/MissionManager/VisualMissionItem.cc \
src/PositionManager/PositionManager.cpp \
......@@ -893,6 +900,7 @@ SOURCES += \
src/QmlControls/RCChannelMonitorController.cc \
src/QmlControls/ScreenToolsController.cc \
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc \
src/Settings/ADSBVehicleManagerSettings.cc \
src/Settings/AppSettings.cc \
src/Settings/AutoConnectSettings.cc \
src/Settings/BrandImageSettings.cc \
......@@ -910,7 +918,6 @@ SOURCES += \
src/SHPFileHelper.cc \
src/Terrain/TerrainQuery.cc \
src/TerrainTile.cc\
src/Vehicle/ADSBVehicle.cc \
src/Vehicle/GPSRTKFactGroup.cc \
src/Vehicle/MAVLinkLogManager.cc \
src/Vehicle/MultiVehicleManager.cc \
......
......@@ -102,7 +102,6 @@
<file alias="QGroundControl/Controls/ParameterEditorDialog.qml">src/QmlControls/ParameterEditorDialog.qml</file>
<file alias="QGroundControl/Controls/PIDTuning.qml">src/QmlControls/PIDTuning.qml</file>
<file alias="QGroundControl/Controls/PlanEditToolbar.qml">src/PlanView/PlanEditToolbar.qml</file>
<file alias="QGroundControl/Controls/PlanStartOverlay.qml">src/PlanView/PlanStartOverlay.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckButton.qml">src/QmlControls/PreFlightCheckButton.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckGroup.qml">src/QmlControls/PreFlightCheckGroup.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckModel.qml">src/QmlControls/PreFlightCheckModel.qml</file>
......@@ -153,6 +152,7 @@
<file alias="QGroundControl/Controls/StructureScanMapVisual.qml">src/PlanView/StructureScanMapVisual.qml</file>
<file alias="QGroundControl/Controls/SubMenuButton.qml">src/QmlControls/SubMenuButton.qml</file>
<file alias="QGroundControl/Controls/SurveyMapVisual.qml">src/PlanView/SurveyMapVisual.qml</file>
<file alias="QGroundControl/Controls/TakeoffItemMapVisual.qml">src/PlanView/TakeoffItemMapVisual.qml</file>
<file alias="QGroundControl/Controls/ToolStrip.qml">src/QmlControls/ToolStrip.qml</file>
<file alias="QGroundControl/Controls/TransectStyleComplexItemStats.qml">src/PlanView/TransectStyleComplexItemStats.qml</file>
<file alias="QGroundControl/Controls/TransectStyleMapVisuals.qml">src/PlanView/TransectStyleMapVisuals.qml</file>
......@@ -234,6 +234,7 @@
<qresource prefix="/json">
<file alias="APMMavlinkStreamRate.SettingsGroup.json">src/Settings/APMMavlinkStreamRate.SettingsGroup.json</file>
<file alias="BreachReturn.FactMetaData.json">src/MissionManager/BreachReturn.FactMetaData.json</file>
<file alias="ADSBVehicleManager.SettingsGroup.json">src/Settings/ADSBVehicleManager.SettingsGroup.json</file>
<file alias="App.SettingsGroup.json">src/Settings/App.SettingsGroup.json</file>
<file alias="AutoConnect.SettingsGroup.json">src/Settings/AutoConnect.SettingsGroup.json</file>
<file alias="BrandImage.SettingsGroup.json">src/Settings/BrandImage.SettingsGroup.json</file>
......
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="-89 46 72 72" enable-background="new -89 46 72 72" xml:space="preserve">
<rect x="-78.911" y="46" fill="#FFFFFF" width="51.822" height="10.66"/>
<path fill="#FFFFFF" d="M-27.089,59.781h-51.822V118h51.822L-27.089,59.781L-27.089,59.781z M-33.927,110.332h-7.17V68.068h7.17
V110.332z M-49.416,110.332h-7.17V68.068h7.17V110.332z M-64.245,110.332h-7.17V68.068h7.17V110.332z"/>
</svg>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="-89 46 72 72"
enable-background="new -89 46 72 72"
xml:space="preserve"
sodipodi:docname="TrashDelete.svg"
inkscape:version="0.92.4 (f8dce91, 2019-08-02)"><metadata
id="metadata3771"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs3769"><inkscape:path-effect
effect="bspline"
id="path-effect3883"
is_visible="true"
weight="50"
steps="2"
helper_size="0"
apply_no_weight="true"
apply_with_weight="true"
only_selected="false" /><inkscape:path-effect
effect="bspline"
id="path-effect3874"
is_visible="true"
weight="10"
steps="2"
helper_size="0"
apply_no_weight="true"
apply_with_weight="true"
only_selected="false" /><filter
inkscape:collect="always"
style="color-interpolation-filters:sRGB"
id="filter3830"
x="-1.2740651"
width="3.5481301"
y="-1.1340731"
height="3.2681461"><feBlend
inkscape:collect="always"
mode="lighten"
in2="BackgroundImage"
id="feBlend3834" /></filter><inkscape:path-effect
effect="bspline"
id="path-effect3883-3"
is_visible="true"
weight="50"
steps="2"
helper_size="0"
apply_no_weight="true"
apply_with_weight="true"
only_selected="false" /></defs><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1735"
inkscape:window-height="1038"
id="namedview3767"
showgrid="false"
inkscape:pagecheckerboard="true"
inkscape:zoom="2.9861111"
inkscape:cx="-39.595586"
inkscape:cy="61.570647"
inkscape:window-x="2103"
inkscape:window-y="20"
inkscape:window-maximized="0"
inkscape:current-layer="Layer_1" />
<path
style="fill:#ffffff;stroke-width:1.1104244"
d="m -81.92009,46.487004 c 0.487005,-0.487004 57.353171,-0.487004 57.840175,0 0.487005,0.487005 2.055265,2.055266 2.54227,2.54227 0.487005,0.487005 0.487005,4.114447 0,4.601451 -0.487004,0.487005 -2.055265,2.055266 -2.54227,2.54227 -0.487004,0.487005 -57.35317,0.487005 -57.840175,0 -0.487004,-0.487004 -2.055265,-2.055265 -2.54227,-2.54227 -0.487004,-0.487004 -0.487004,-4.114446 10e-7,-4.601451 0.487005,-0.487005 2.055265,-2.055265 2.542269,-2.54227 z"
id="rect3762"
inkscape:path-effect="#path-effect3883"
inkscape:original-d="m -81.433085,46 h 56.866166 c 1.948018,0 3.516279,1.56826 3.516279,3.516279 v 3.627442 c 0,1.948018 -1.568261,3.516279 -3.516279,3.516279 h -56.866166 c -1.948018,0 -3.516279,-1.568261 -3.516279,-3.516279 V 49.516279 C -84.949364,47.56826 -83.381103,46 -81.433085,46 Z"
inkscape:connector-curvature="0"
transform="matrix(0.83070712,0,0,0.82950228,-8.6376373,16.905515)" />
<g
inkscape:groupmode="layer"
id="layer1"
inkscape:label="Layer 1"
style="display:inline" /><path
d="m -29.6796,62.69245 c -2.5906,-2.91145 -44.0482,-2.91145 -46.6398,0 -2.5916,2.91145 -2.5916,49.48665 0,52.3971 2.5916,2.91045 44.0492,2.91045 46.6398,0 2.5906,-2.91045 2.5906,-49.48565 0,-52.3971 z m -4.6054,45.52685 c -0.358,2.1127 -6.094,2.1127 -6.453,0 -0.359,-2.1127 -0.359,-35.9239 0,-38.0376 0.359,-2.1137 6.095,-2.1137 6.453,0 0.358,2.1137 0.358,35.9249 0,38.0376 z m -15.489,0 c -0.358,2.1127 -6.094,2.1127 -6.453,0 -0.359,-2.1127 -0.359,-35.9239 0,-38.0376 0.359,-2.1137 6.095,-2.1137 6.453,0 0.358,2.1137 0.358,35.9249 0,38.0376 z m -14.829,0 c -0.358,2.1127 -6.094,2.1127 -6.453,0 -0.359,-2.1127 -0.359,-35.9239 0,-38.0376 0.359,-2.1137 6.095,-2.1137 6.453,0 0.358,2.1137 0.358,35.9249 0,38.0376 z"
id="path3764"
inkscape:connector-curvature="0"
style="fill:#ffffff;filter:url(#filter3830)"
inkscape:path-effect="#path-effect3874"
inkscape:original-d="m -27.089,59.781 c -5.1812,10e-4 -46.6388,10e-4 -51.822,0 0.001,5.8229 0.001,52.3981 0,58.219 5.1832,0.001 46.6408,0.001 51.822,0 10e-4,-5.8209 10e-4,-52.3961 0,-58.219 z m -6.838,50.551 c -0.716,0.001 -6.452,0.001 -7.17,0 0.001,-4.2254 0.001,-38.0366 0,-42.264 0.718,0.001 6.454,0.001 7.17,0 10e-4,4.2274 10e-4,38.0386 0,42.264 z m -15.489,0 c -0.716,0.001 -6.452,0.001 -7.17,0 10e-4,-4.2254 10e-4,-38.0366 0,-42.264 0.718,0.001 6.454,0.001 7.17,0 10e-4,4.2274 10e-4,38.0386 0,42.264 z m -14.829,0 c -0.716,0.001 -6.452,0.001 -7.17,0 0.001,-4.2254 0.001,-38.0366 0,-42.264 0.718,0.001 6.454,0.001 7.17,0 0.001,4.2274 0.001,38.0386 0,42.264 z"
transform="matrix(1,0,0,0.76115058,0.66964846,21.432082)" /><g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="Layer 3" /><g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Layer 2" /><path
style="fill:#ffffff;stroke-width:1.1104244"
d="m -81.92009,46.487004 c 0.487005,-0.487004 57.353171,-0.487004 57.840175,0 0.487005,0.487005 2.055265,2.055266 2.54227,2.54227 0.487005,0.487005 0.487005,4.114447 0,4.601451 -0.487004,0.487005 -2.055265,2.055266 -2.54227,2.54227 -0.487004,0.487005 -57.35317,0.487005 -57.840175,0 -0.487004,-0.487004 -2.055265,-2.055265 -2.54227,-2.54227 -0.487004,-0.487004 -0.487004,-4.114446 10e-7,-4.601451 0.487005,-0.487005 2.055265,-2.055265 2.542269,-2.54227 z"
id="rect3762-6"
inkscape:path-effect="#path-effect3883-3"
inkscape:original-d="m -81.433085,46 h 56.866166 c 1.948018,0 3.516279,1.56826 3.516279,3.516279 v 3.627442 c 0,1.948018 -1.568261,3.516279 -3.516279,3.516279 h -56.866166 c -1.948018,0 -3.516279,-1.568261 -3.516279,-3.516279 V 49.516279 C -84.949364,47.56826 -83.381103,46 -81.433085,46 Z"
inkscape:connector-curvature="0"
transform="matrix(0.20525298,0,0,0.52828964,-41.786708,26.697818)" /></svg>
\ No newline at end of file
/****************************************************************************
*
* (c) 2009-2016 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 "ADSBVehicle.h"
#include "QGCLoggingCategory.h"
#include <QDebug>
#include <QtMath>
ADSBVehicle::ADSBVehicle(const VehicleInfo_t& vehicleInfo, QObject* parent)
: QObject (parent)
, _icaoAddress (vehicleInfo.icaoAddress)
, _altitude (qQNaN())
, _heading (qQNaN())
, _alert (false)
{
update(vehicleInfo);
}
void ADSBVehicle::update(const VehicleInfo_t& vehicleInfo)
{
if (_icaoAddress != vehicleInfo.icaoAddress) {
qCWarning(ADSBVehicleManagerLog) << "ICAO address mismatch expected:actual" << _icaoAddress << vehicleInfo.icaoAddress;
return;
}
if (vehicleInfo.availableFlags & CallsignAvailable) {
if (vehicleInfo.callsign != _callsign) {
_callsign = vehicleInfo.callsign;
emit callsignChanged();
}
}
if (vehicleInfo.availableFlags & LocationAvailable) {
if (_coordinate != vehicleInfo.location) {
_coordinate = vehicleInfo.location;
emit coordinateChanged();
}
}
if (vehicleInfo.availableFlags & AltitudeAvailable) {
if (!(qIsNaN(vehicleInfo.altitude) && qIsNaN(_altitude)) && !qFuzzyCompare(vehicleInfo.altitude, _altitude)) {
_altitude = vehicleInfo.altitude;
emit altitudeChanged();
}
}
if (vehicleInfo.availableFlags & HeadingAvailable) {
if (!(qIsNaN(vehicleInfo.heading) && qIsNaN(_heading)) && !qFuzzyCompare(vehicleInfo.heading, _heading)) {
_heading = vehicleInfo.heading;
emit headingChanged();
}
}
if (vehicleInfo.availableFlags & AlertAvailable) {
if (vehicleInfo.alert != _alert) {
_alert = vehicleInfo.alert;
emit alertChanged();
}
}
_lastUpdateTimer.restart();
}
bool ADSBVehicle::expired()
{
return _lastUpdateTimer.hasExpired(expirationTimeoutMs);
}
......@@ -20,9 +20,25 @@ class ADSBVehicle : public QObject
Q_OBJECT
public:
ADSBVehicle(mavlink_adsb_vehicle_t& adsbVehicle, QObject* parent = nullptr);
enum {
CallsignAvailable = 1 << 1,
LocationAvailable = 1 << 2,
AltitudeAvailable = 1 << 3,
HeadingAvailable = 1 << 4,
AlertAvailable = 1 << 5,
};
ADSBVehicle(const QGeoCoordinate& location, float heading, bool alert = false, QObject* parent = nullptr);
typedef struct {
uint32_t icaoAddress; // Required
QString callsign;
QGeoCoordinate location;
double altitude;
double heading;
bool alert;
uint32_t availableFlags;
} VehicleInfo_t;
ADSBVehicle(const VehicleInfo_t& vehicleInfo, QObject* parent);
Q_PROPERTY(int icaoAddress READ icaoAddress CONSTANT)
Q_PROPERTY(QString callsign READ callsign NOTIFY callsignChanged)
......@@ -31,17 +47,14 @@ public:
Q_PROPERTY(double heading READ heading NOTIFY headingChanged) // NaN for not available
Q_PROPERTY(bool alert READ alert NOTIFY alertChanged) // Collision path
int icaoAddress (void) const { return _icaoAddress; }
int icaoAddress (void) const { return static_cast<int>(_icaoAddress); }
QString callsign (void) const { return _callsign; }
QGeoCoordinate coordinate (void) const { return _coordinate; }
double altitude (void) const { return _altitude; }
double heading (void) const { return _heading; }
bool alert (void) const { return _alert; }
/// Update the vehicle with new information
void update(mavlink_adsb_vehicle_t& adsbVehicle);
void update(bool alert, const QGeoCoordinate& location, float heading);
void update(const VehicleInfo_t& vehicleInfo);
/// check if the vehicle is expired and should be removed
bool expired();
......@@ -69,3 +82,6 @@ private:
QElapsedTimer _lastUpdateTimer;
};
Q_DECLARE_METATYPE(ADSBVehicle::VehicleInfo_t)
/****************************************************************************
*
* (c) 2009-2016 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 "ADSBVehicleManager.h"
#include "QGCLoggingCategory.h"
#include "QGCApplication.h"
#include "SettingsManager.h"
#include "ADSBVehicleManagerSettings.h"
#include <QDebug>
ADSBVehicleManager::ADSBVehicleManager(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool(app, toolbox)
{
}
void ADSBVehicleManager::setToolbox(QGCToolbox* toolbox)
{
QGCTool::setToolbox(toolbox);
connect(&_adsbVehicleCleanupTimer, &QTimer::timeout, this, &ADSBVehicleManager::_cleanupStaleVehicles);
_adsbVehicleCleanupTimer.setSingleShot(false);
_adsbVehicleCleanupTimer.start(1000);
ADSBVehicleManagerSettings* settings = qgcApp()->toolbox()->settingsManager()->adsbVehicleManagerSettings();
if (settings->adsbServerConnectEnabled()->rawValue().toBool()) {
_tcpLink = new ADSBTCPLink(settings->adsbServerHostAddress()->rawValue().toString(), settings->adsbServerPort()->rawValue().toInt(), this);
connect(_tcpLink, &ADSBTCPLink::adsbVehicleUpdate, this, &ADSBVehicleManager::adsbVehicleUpdate, Qt::QueuedConnection);
connect(_tcpLink, &ADSBTCPLink::error, this, &ADSBVehicleManager::_tcpError, Qt::QueuedConnection);
}
}
void ADSBVehicleManager::_cleanupStaleVehicles()
{
// Remove all expired ADSB vehicles
for (int i=_adsbVehicles.count()-1; i>=0; i--) {
ADSBVehicle* adsbVehicle = _adsbVehicles.value<ADSBVehicle*>(i);
if (adsbVehicle->expired()) {
qCDebug(ADSBVehicleManagerLog) << "Expired" << QStringLiteral("%1").arg(adsbVehicle->icaoAddress(), 0, 16);
_adsbVehicles.removeAt(i);
adsbVehicle->deleteLater();
}
}
}
void ADSBVehicleManager::adsbVehicleUpdate(const ADSBVehicle::VehicleInfo_t vehicleInfo)
{
uint32_t icaoAddress = vehicleInfo.icaoAddress;
if (_adsbICAOMap.contains(icaoAddress)) {
_adsbICAOMap[icaoAddress]->update(vehicleInfo);
} else {
if (vehicleInfo.availableFlags & ADSBVehicle::LocationAvailable) {
ADSBVehicle* adsbVehicle = new ADSBVehicle(vehicleInfo, this);
_adsbICAOMap[icaoAddress] = adsbVehicle;
_adsbVehicles.append(adsbVehicle);
}
}
}
void ADSBVehicleManager::_tcpError(const QString errorMsg)
{
qgcApp()->showMessage(tr("ADSB Server Error: %1").arg(errorMsg));
}
ADSBTCPLink::ADSBTCPLink(const QString& hostAddress, int port, QObject* parent)
: QThread (parent)
, _hostAddress (hostAddress)
, _port (port)
{
moveToThread(this);
start();
}
ADSBTCPLink::~ADSBTCPLink(void)
{
if (_socket) {
_socket->disconnectFromHost();
_socket->deleteLater();
_socket = nullptr;
}
quit();
wait();
}
void ADSBTCPLink::run(void)