Commit 7ae6f211 authored by Gus Grubba's avatar Gus Grubba

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

parents 3f80d491 8b3f3766
......@@ -13,6 +13,7 @@ Note: This file only contains high level features or important fixes.
* Major rewrite and bug fix pass through Structure Scan. Previous version had such bad problems that it can no longer be supported. Plans with Structure Scan will need to be recreated. New QGC will not load old Structure Scan plans.
### 3.5.1 - Not yet released
* Fix visibility of PX4/ArduPilot logo in toolbar
* Fix tile set count but in OfflineMaps which would cause image and elevation tile set to have incorrect counts and be incorrectly marked as download incomplete.
### 3.5.0 - Stable
......
......@@ -482,6 +482,7 @@ HEADERS += \
src/Settings/BrandImageSettings.h \
src/Settings/FlightMapSettings.h \
src/Settings/FlyViewSettings.h \
src/Settings/OfflineMapsSettings.h \
src/Settings/PlanViewSettings.h \
src/Settings/RTKSettings.h \
src/Settings/SettingsGroup.h \
......@@ -658,6 +659,7 @@ SOURCES += \
src/Settings/BrandImageSettings.cc \
src/Settings/FlightMapSettings.cc \
src/Settings/FlyViewSettings.cc \
src/Settings/OfflineMapsSettings.cc \
src/Settings/PlanViewSettings.cc \
src/Settings/RTKSettings.cc \
src/Settings/SettingsGroup.cc \
......
......@@ -222,6 +222,7 @@
<file alias="FlightMap.SettingsGroup.json">src/Settings/FlightMap.SettingsGroup.json</file>
<file alias="FWLandingPattern.FactMetaData.json">src/MissionManager/FWLandingPattern.FactMetaData.json</file>
<file alias="FlyView.SettingsGroup.json">src/Settings/FlyView.SettingsGroup.json</file>
<file alias="OfflineMaps.SettingsGroup.json">src/Settings/OfflineMaps.SettingsGroup.json</file>
<file alias="PlanView.SettingsGroup.json">src/Settings/PlanView.SettingsGroup.json</file>
<file alias="MavCmdInfoCommon.json">src/MissionManager/MavCmdInfoCommon.json</file>
<file alias="MavCmdInfoFixedWing.json">src/MissionManager/MavCmdInfoFixedWing.json</file>
......
......@@ -15,8 +15,7 @@
DECLARE_SETTINGGROUP(AirMap, "AirMap")
{
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership); \
qmlRegisterUncreatableType<AirMapSettings>("QGroundControl.SettingsManager", 1, 0, "AirMapSettings", "Reference only"); \
qmlRegisterUncreatableType<AirMapSettings>("QGroundControl.SettingsManager", 1, 0, "AirMapSettings", "Reference only");
}
DECLARE_SETTINGSFACT(AirMapSettings, usePersonalApiKey)
......
......@@ -43,8 +43,7 @@ QString APMAirframeComponent::name(void) const
QString APMAirframeComponent::description(void) const
{
return tr("Airframe Setup is used to select the airframe which matches your vehicle. "
"You can also the load default parameter values associated with known vehicle types.");
return tr("Airframe Setup is used to select the airframe which matches your vehicle.");
}
QString APMAirframeComponent::iconResource(void) const
......
import QtQuick 2.3
import QGroundControl 1.0
import QGroundControl.FactSystem 1.0
FactTextField {
unitsLabel: fact ? fact.units + _altitudeModeExtraUnits : ""
showUnits: true
showHelp: true
unitsLabel: fact ? fact.units : ""
extraUnitsLabel: fact ? _altitudeModeExtraUnits : ""
showUnits: true
showHelp: true
property int altitudeMode: QGroundControl.AltitudeModeNone
readonly property string _altModeNoneExtraUnits: ""
readonly property string _altModeRelativeExtraUnits: qsTr(" (Rel)")
readonly property string _altModeAbsoluteExtraUnits: qsTr(" (AMSL)")
readonly property string _altModeAboveTerrainExtraUnits: qsTr(" (Abv Terr)")
readonly property string _altModeTerrainFrameExtraUnits: qsTr(" (TerrF)")
readonly property string _altModeRelativeExtraUnits: qsTr("(Rel)")
readonly property string _altModeAbsoluteExtraUnits: qsTr("(AMSL)")
readonly property string _altModeAboveTerrainExtraUnits: qsTr("(Abv Terr)")
readonly property string _altModeTerrainFrameExtraUnits: qsTr("(TerrF)")
property string _altitudeModeExtraUnits: _altModeRelativeExtraUnits
property string _altitudeModeExtraUnits: _altModeNoneExtraUnits
onAltitudeModeChanged: updateAltitudeModeExtraUnits()
function updateAltitudeModeExtraUnits() {
if (altitudeMode === QGroundControl.AltitudeModeNone) {
......@@ -32,6 +36,4 @@ FactTextField {
_altitudeModeExtraUnits = ""
}
}
onAltitudeModeChanged: updateAltitudeModeExtraUnits()
}
......@@ -52,7 +52,7 @@
},
"param4": {
"label": "Heading",
"units": "radians",
"units": "deg",
"nanUnchanged": true,
"default": null,
"decimalPlaces": 2
......@@ -74,8 +74,9 @@
},
"param4": {
"label": "Heading",
"units": "radians",
"default": 0,
"units": "deg",
"nanUnchanged": true,
"default": null,
"decimalPlaces": 2
}
},
......@@ -100,7 +101,7 @@
},
"param4": {
"label": "Heading",
"units": "radians",
"units": "deg",
"nanUnchanged": true,
"default": null,
"decimalPlaces": 2
......@@ -128,7 +129,7 @@
},
"param4": {
"label": "Heading",
"units": "radians",
"units": "deg",
"nanUnchanged": true,
"default": null,
"decimalPlaces": 2
......@@ -158,7 +159,7 @@
},
"param4": {
"label": "Heading",
"units": "radians",
"units": "deg",
"nanUnchanged": true,
"default": null,
"decimalPlaces": 2
......@@ -180,7 +181,7 @@
},
"param4": {
"label": "Heading",
"units": "radians",
"units": "deg",
"nanUnchanged": true,
"default": null,
"decimalPlaces": 2
......
......@@ -446,7 +446,9 @@ int MissionController::insertComplexMissionItemFromKMLOrSHP(QString itemName, QS
int MissionController::_insertComplexMissionItemWorker(ComplexMissionItem* complexItem, int i)
{
int sequenceNumber = _nextSequenceNumber();
bool surveyStyleItem = qobject_cast<SurveyComplexItem*>(complexItem) || qobject_cast<CorridorScanComplexItem*>(complexItem);
bool surveyStyleItem = qobject_cast<SurveyComplexItem*>(complexItem) ||
qobject_cast<CorridorScanComplexItem*>(complexItem) ||
qobject_cast<StructureScanComplexItem*>(complexItem);
if (surveyStyleItem) {
bool rollSupported = false;
......
......@@ -15,8 +15,9 @@ Column {
spacing: _margin
property var cameraCalc
property bool vehicleFlightIsFrontal: true
property bool vehicleFlightIsFrontal: true
property string distanceToSurfaceLabel
property int distanceToSurfaceAltitudeMode: QGroundControl.AltitudeModeNone
property string frontalDistanceLabel
property string sideDistanceLabel
......@@ -226,8 +227,9 @@ Column {
onClicked: cameraCalc.valueSetIsDistance.value = 1
}
FactTextField {
AltitudeFactTextField {
fact: cameraCalc.distanceToSurface
altitudeMode: distanceToSurfaceAltitudeMode
enabled: fixedDistanceRadio.checked
Layout.fillWidth: true
}
......@@ -285,8 +287,9 @@ Column {
visible: cameraCalc.isManualCamera
QGCLabel { text: distanceToSurfaceLabel }
FactTextField {
AltitudeFactTextField {
fact: cameraCalc.distanceToSurface
altitudeMode: distanceToSurfaceAltitudeMode
Layout.fillWidth: true
}
......
......@@ -67,11 +67,12 @@ Rectangle {
CameraCalc {
cameraCalc: missionItem.cameraCalc
vehicleFlightIsFrontal: true
distanceToSurfaceLabel: qsTr("Altitude")
frontalDistanceLabel: qsTr("Trigger Distance")
sideDistanceLabel: qsTr("Spacing")
cameraCalc: missionItem.cameraCalc
vehicleFlightIsFrontal: true
distanceToSurfaceLabel: qsTr("Altitude")
distanceToSurfaceAltitudeMode: missionItem.followTerrain ? QGroundControl.AltitudeModeAboveTerrain : QGroundControl.AltitudeModeRelative
frontalDistanceLabel: qsTr("Trigger Dist")
sideDistanceLabel: qsTr("Spacing")
}
SectionHeader {
......
......@@ -40,6 +40,7 @@ Rectangle {
property string _setToVehicleHeadingStr: qsTr("Set to vehicle heading")
property string _setToVehicleLocationStr: qsTr("Set to vehicle location")
property bool _showCameraSection: !_missionVehicle.apmFirmware
property int _altitudeMode: missionItem.altitudesAreRelative ? QGroundControl.AltitudeModeRelative : QGroundControl.AltitudeModeAbsolute
ExclusiveGroup { id: distanceGlideGroup }
......@@ -65,11 +66,25 @@ Rectangle {
Item { width: 1; height: _spacer }
FactTextFieldGrid {
anchors.left: parent.left
anchors.right: parent.right
factList: [ missionItem.loiterAltitude, missionItem.loiterRadius ]
factLabels: [ qsTr("Altitude"), qsTr("Radius") ]
GridLayout {
anchors.left: parent.left
anchors.right: parent.right
columns: 2
QGCLabel { text: qsTr("Altitude") }
AltitudeFactTextField {
Layout.fillWidth: true
fact: missionItem.loiterAltitude
altitudeMode: _altitudeMode
}
QGCLabel { text: qsTr("Radius") }
FactTextField {
Layout.fillWidth: true
fact: missionItem.loiterRadius
}
}
Item { width: 1; height: _spacer }
......@@ -114,9 +129,10 @@ Rectangle {
QGCLabel { text: qsTr("Altitude") }
FactTextField {
AltitudeFactTextField {
Layout.fillWidth: true
fact: missionItem.landingAltitude
altitudeMode: _altitudeMode
}
QGCRadioButton {
......
......@@ -75,11 +75,12 @@ Rectangle {
}
CameraCalc {
cameraCalc: missionItem.cameraCalc
vehicleFlightIsFrontal: false
distanceToSurfaceLabel: qsTr("Scan Distance")
frontalDistanceLabel: qsTr("Layer Height")
sideDistanceLabel: qsTr("Trigger Distance")
cameraCalc: missionItem.cameraCalc
vehicleFlightIsFrontal: false
distanceToSurfaceLabel: qsTr("Scan Distance")
distanceToSurfaceAltitudeMode: QGroundControl.AltitudeModeNone
frontalDistanceLabel: qsTr("Layer Height")
sideDistanceLabel: qsTr("Trigger Distance")
}
SectionHeader {
......@@ -117,14 +118,16 @@ Rectangle {
}
QGCLabel { text: qsTr("Scan Bottom Alt") }
FactTextField {
AltitudeFactTextField {
fact: missionItem.scanBottomAlt
altitudeMode: QGroundControl.AltitudeModeRelative
Layout.fillWidth: true
}
QGCLabel { text: qsTr("Entrance/Exit Alt") }
FactTextField {
AltitudeFactTextField {
fact: missionItem.entranceAlt
altitudeMode: QGroundControl.AltitudeModeRelative
Layout.fillWidth: true
}
......
......@@ -67,11 +67,12 @@ Rectangle {
}
CameraCalc {
cameraCalc: missionItem.cameraCalc
vehicleFlightIsFrontal: true
distanceToSurfaceLabel: qsTr("Altitude")
frontalDistanceLabel: qsTr("Trigger Distance")
sideDistanceLabel: qsTr("Spacing")
cameraCalc: missionItem.cameraCalc
vehicleFlightIsFrontal: true
distanceToSurfaceLabel: qsTr("Altitude")
distanceToSurfaceAltitudeMode: missionItem.followTerrain ? QGroundControl.AltitudeModeAboveTerrain : QGroundControl.AltitudeModeRelative
frontalDistanceLabel: qsTr("Trigger Dist")
sideDistanceLabel: qsTr("Spacing")
}
SectionHeader {
......
......@@ -16,6 +16,8 @@ CheckBox {
activeFocusOnPress: true
style: CheckBoxStyle {
spacing: _noText ? 0 : ScreenTools.defaultFontPixelWidth * 0.25
label: Item {
implicitWidth: _noText ? 0 : text.implicitWidth + ScreenTools.defaultFontPixelWidth * 0.25
implicitHeight: _noText ? 0 : Math.max(text.implicitHeight, ScreenTools.checkBoxIndicatorSize)
......
......@@ -17,7 +17,7 @@ RadioButton {
activeFocusOnPress: true
style: RadioButtonStyle {
spacing: _noText ? 0 : ScreenTools.defaultFontPixelWidth / 2
spacing: _noText ? 0 : ScreenTools.defaultFontPixelWidth * 0.25
label: Item {
implicitWidth: _noText ? 0 : text.implicitWidth + ScreenTools.defaultFontPixelWidth * 0.25
......
......@@ -13,9 +13,10 @@ TextField {
activeFocusOnPress: true
antialiasing: true
property bool showUnits: false
property bool showHelp: false
property string unitsLabel: ""
property bool showUnits: false
property bool showHelp: false
property string unitsLabel: ""
property string extraUnitsLabel: ""
signal helpClicked
......@@ -89,7 +90,17 @@ TextField {
font.family: ScreenTools.normalFontFamily
antialiasing: true
color: control.textColor
visible: control.showUnits
visible: control.showUnits && text !== ""
}
Text {
Layout.alignment: Qt.AlignVCenter
text: control.extraUnitsLabel
font.pointSize: ScreenTools.smallFontPointSize
font.family: ScreenTools.normalFontFamily
antialiasing: true
color: control.textColor
visible: control.showUnits && text !== ""
}
Rectangle {
......
......@@ -268,48 +268,46 @@ QGCCachedTileSet::_networkReplyFinished()
qWarning() << "QGCMapEngineManager::networkReplyFinished() NULL Reply";
return;
}
//-- Get tile hash
const QString hash = reply->request().attribute(QNetworkRequest::User).toString();
if(!hash.isEmpty()) {
if(_replies.contains(hash)) {
_replies.remove(hash);
} else {
qWarning() << "QGCMapEngineManager::networkReplyFinished() Reply not in list: " << hash;
}
if (reply->error() != QNetworkReply::NoError) {
qWarning() << "QGCMapEngineManager::networkReplyFinished() Error:" << reply->errorString();
return;
}
qCDebug(QGCCachedTileSetLog) << "Tile fetched" << hash;
QByteArray image = reply->readAll();
UrlFactory::MapType type = getQGCMapEngine()->hashToType(hash);
if (type == UrlFactory::MapType::AirmapElevation) {
image = TerrainTile::serialize(image);
}
QString format = getQGCMapEngine()->urlFactory()->getImageFormat(type, image);
if(!format.isEmpty()) {
//-- Cache tile
getQGCMapEngine()->cacheTile(type, hash, image, format, _id);
QGCUpdateTileDownloadStateTask* task = new QGCUpdateTileDownloadStateTask(_id, QGCTile::StateComplete, hash);
getQGCMapEngine()->addTask(task);
//-- Updated cached (downloaded) data
_savedTileSize += image.size();
_savedTileCount++;
emit savedTileSizeChanged();
emit savedTileCountChanged();
//-- Update estimate
if(_savedTileCount % 10 == 0) {
quint32 avg = _savedTileSize / _savedTileCount;
_totalTileSize = avg * _totalTileCount;
_uniqueTileSize = avg * _uniqueTileCount;
emit totalTilesSizeChanged();
emit uniqueTileSizeChanged();
if (reply->error() == QNetworkReply::NoError) {
//-- Get tile hash
const QString hash = reply->request().attribute(QNetworkRequest::User).toString();
if(!hash.isEmpty()) {
if(_replies.contains(hash)) {
_replies.remove(hash);
} else {
qWarning() << "QGCMapEngineManager::networkReplyFinished() Reply not in list: " << hash;
}
qCDebug(QGCCachedTileSetLog) << "Tile fetched" << hash;
QByteArray image = reply->readAll();
UrlFactory::MapType type = getQGCMapEngine()->hashToType(hash);
if (type == UrlFactory::MapType::AirmapElevation) {
image = TerrainTile::serialize(image);
}
QString format = getQGCMapEngine()->urlFactory()->getImageFormat(type, image);
if(!format.isEmpty()) {
//-- Cache tile
getQGCMapEngine()->cacheTile(type, hash, image, format, _id);
QGCUpdateTileDownloadStateTask* task = new QGCUpdateTileDownloadStateTask(_id, QGCTile::StateComplete, hash);
getQGCMapEngine()->addTask(task);
//-- Updated cached (downloaded) data
_savedTileSize += image.size();
_savedTileCount++;
emit savedTileSizeChanged();
emit savedTileCountChanged();
//-- Update estimate
if(_savedTileCount % 10 == 0) {
quint32 avg = _savedTileSize / _savedTileCount;
_totalTileSize = avg * _totalTileCount;
_uniqueTileSize = avg * _uniqueTileCount;
emit totalTilesSizeChanged();
emit uniqueTileSizeChanged();
}
}
//-- Setup a new download
_prepareDownload();
} else {
qWarning() << "QGCMapEngineManager::networkReplyFinished() Empty Hash";
}
//-- Setup a new download
_prepareDownload();
} else {
qWarning() << "QGCMapEngineManager::networkReplyFinished() Empty Hash";
}
reply->deleteLater();
}
......
......@@ -32,10 +32,13 @@ Item {
property string mapKey: "lastMapType"
property Fact _mapboxFact: QGroundControl.settingsManager.appSettings.mapboxToken
property Fact _esriFact: QGroundControl.settingsManager.appSettings.esriToken
property var _settingsManager: QGroundControl.settingsManager
property var _settings: _settingsManager.offlineMapsSettings
property var _fmSettings: _settingsManager.flightMapSettings
property Fact _mapboxFact: _settingsManager.appSettings.mapboxToken
property Fact _esriFact: _settingsManager.appSettings.esriToken
property string mapType: _settings.mapProvider.enumStringValue + " " + _settings.mapType.enumStringValue
property string mapType: _fmSettings.mapProvider.enumStringValue + " " + _fmSettings.mapType.enumStringValue
property bool isMapInteractive: false
property var savedCenter: undefined
property real savedZoom: 3
......@@ -51,13 +54,12 @@ Item {
property var _mapAdjustedColor: _map.isSatelliteMap ? "white" : "black"
property bool _tooManyTiles: QGroundControl.mapEngineManager.tileCount > _maxTilesForDownload
property var _settings: QGroundControl.settingsManager.flightMapSettings
readonly property real minZoomLevel: 1
readonly property real maxZoomLevel: 20
readonly property real sliderTouchArea: ScreenTools.defaultFontPixelWidth * (ScreenTools.isTinyScreen ? 5 : (ScreenTools.isMobile ? 6 : 3))
readonly property int _maxTilesForDownload: 100000
readonly property int _maxTilesForDownload: _settings.maxTilesForDownload.rawValue
QGCPalette { id: qgcPal }
......@@ -105,7 +107,7 @@ Item {
function addNewSet() {
isMapInteractive = true
mapType = _settings.mapProvider.enumStringValue + " " + _settings.mapType.enumStringValue
mapType = _fmSettings.mapProvider.enumStringValue + " " + _fmSettings.mapType.enumStringValue
resetMapToDefaults()
handleChanges()
_map.visible = true
......@@ -808,12 +810,22 @@ Item {
maximumValue: maxZoomLevel
stepSize: 1
updateValueWhileDragging: true
property real _savedZoom
Component.onCompleted: Math.max(sliderMinZoom.value = _map.zoomLevel - 4, 2)
property bool _updateSetting: false
Component.onCompleted: {
sliderMinZoom.value = _settings.minZoomLevelDownload.rawValue
_updateSetting = true
}
onValueChanged: {
if(sliderMinZoom.value > sliderMaxZoom.value) {
sliderMaxZoom.value = sliderMinZoom.value
}
if (_updateSetting) {
// Don't update setting until after Component.onCompleted since bad values come through before that
_settings.minZoomLevelDownload.rawValue = value
}
handleChanges()
}
style: SliderStyle {
......@@ -851,12 +863,22 @@ Item {
maximumValue: maxZoomLevel
stepSize: 1
updateValueWhileDragging: true
property real _savedZoom
Component.onCompleted: Math.min(sliderMaxZoom.value = _map.zoomLevel + 2, 20)
property bool _updateSetting: false
Component.onCompleted: {
sliderMaxZoom.value = _settings.maxZoomLevelDownload.rawValue
_updateSetting = true
}
onValueChanged: {
if(sliderMaxZoom.value < sliderMinZoom.value) {
sliderMinZoom.value = sliderMaxZoom.value
}
if (_updateSetting) {
// Don't update setting until after Component.onCompleted since bad values come through before that
_settings.maxZoomLevelDownload.rawValue = value
}
handleChanges()
}
style: SliderStyle {
......
......@@ -15,7 +15,6 @@
DECLARE_SETTINGGROUP(APMMavlinkStreamRate, "APMMavlinkStreamRate")
{
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
qmlRegisterUncreatableType<APMMavlinkStreamRateSettings>("QGroundControl.SettingsManager", 1, 0, "APMMavlinkStreamRateSettings", "Reference only");
connect(streamRateRawSensors(), &Fact::rawValueChanged, this, &APMMavlinkStreamRateSettings::_updateStreamRateRawSensors);
......
......@@ -36,7 +36,6 @@ const char* AppSettings::crashDirectory = "CrashLogs";
DECLARE_SETTINGGROUP(App, "")
{
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
qmlRegisterUncreatableType<AppSettings>("QGroundControl.SettingsManager", 1, 0, "AppSettings", "Reference only");
QGCPalette::setGlobalTheme(indoorPalette()->rawValue().toBool() ? QGCPalette::Dark : QGCPalette::Light);
......
......@@ -15,7 +15,6 @@
DECLARE_SETTINGGROUP(AutoConnect, "LinkManager")
{
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership); \
qmlRegisterUncreatableType<AutoConnectSettings>("QGroundControl.SettingsManager", 1, 0, "AutoConnectSettings", "Reference only"); \
}
......
......@@ -14,7 +14,6 @@
DECLARE_SETTINGGROUP(BrandImage, "Branding")
{
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership); \
qmlRegisterUncreatableType<BrandImageSettings>("QGroundControl.SettingsManager", 1, 0, "BrandImageSettings", "Reference only"); \
}
......
......@@ -6,6 +6,7 @@ add_library(Settings
BrandImageSettings.cc
FlightMapSettings.cc
FlyViewSettings.cc
OfflineMapsSettings.cc
PlanViewSettings.cc
RTKSettings.cc
SettingsGroup.cc
......
......@@ -18,7 +18,6 @@
DECLARE_SETTINGGROUP(FlightMap, "FlightMap")
{
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
qmlRegisterUncreatableType<FlightMapSettings>("QGroundControl.SettingsManager", 1, 0, "FlightMapSettings", "Reference only");
// Save the original version since we modify based on map provider
......
......@@ -14,7 +14,6 @@
DECLARE_SETTINGGROUP(FlyView, "FlyView")
{
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership); \
qmlRegisterUncreatableType<FlyViewSettings>("QGroundControl.SettingsManager", 1, 0, "FlyViewSettings", "Reference only"); \
}
......
[
{
"name": "minZoomLevelDownload",
"shortDescription": "Minimum zoom level for downloads.",
"type": "Uint32",
"min": 1,
"max": 20,
"defaultValue": 13
},
{
"name": "maxZoomLevelDownload",
"shortDescription": "Maximum zoom level for downloads.",
"type": "Uint32",
"min": 1,
"max": 20,
"defaultValue": 19
},
{
"name": "maxTilesForDownload",
"shortDescription": "Maximum number of tiles for download.",
"type": "Uint32",
"defaultValue": 100000
}
]
/****************************************************************************
*
* (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 "OfflineMapsSettings.h"
#include <QQmlEngine>
#include <QtQml>
DECLARE_SETTINGGROUP(OfflineMaps, "OfflineMaps")
{
qmlRegisterUncreatableType<OfflineMapsSettings>("QGroundControl.SettingsManager", 1, 0, "OfflineMapsSettings", "Reference only");
}
DECLARE_SETTINGSFACT(OfflineMapsSettings, minZoomLevelDownload)
DECLARE_SETTINGSFACT(OfflineMapsSettings, maxZoomLevelDownload)
DECLARE_SETTINGSFACT(OfflineMapsSettings, maxTilesForDownload)
/****************************************************************************
*
* (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.
*
****************************************************************************/
#pragma once
#include "SettingsGroup.h"
class OfflineMapsSettings : public SettingsGroup
{
Q_OBJECT
public:
OfflineMapsSettings(QObject* parent = nullptr);
DEFINE_SETTING_NAME_GROUP()
DEFINE_SETTINGFACT(minZoomLevelDownload)
DEFINE_SETTINGFACT(maxZoomLevelDownload)
DEFINE_SETTINGFACT(maxTilesForDownload)
private:
};
......@@ -14,6 +14,5 @@
DECLARE_SETTINGGROUP(PlanView, "PlanView")
{
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership); \
qmlRegisterUncreatableType<PlanViewSettings>("QGroundControl.SettingsManager", 1, 0, "PlanViewSettings", "Reference only"); \
}
......@@ -14,7 +14,6 @@
DECLARE_SETTINGGROUP(RTK, "RTK")
{
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership); \
qmlRegisterUncreatableType<RTKSettings>("QGroundControl.SettingsManager", 1, 0, "RTKSettings", "Reference only"); \
}
......
......@@ -11,6 +11,9 @@
#include "QGCCorePlugin.h"
#include "QGCApplication.h"
#include <QQmlEngine>
#include <QtQml>
static const char* kJsonFile = ":/json/%1.SettingsGroup.json";
SettingsGroup::SettingsGroup(const QString& name, const QString& settingsGroup, QObject* parent)
......@@ -19,6 +22,8 @@ SettingsGroup::SettingsGroup(const QString& name, const QString& settingsGroup,
, _name (name)
, _settingsGroup(settingsGroup)
{
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
_nameToMetaDataMap = FactMetaData::createMapFromJsonFile(QString(kJsonFile).arg(name), this);
}
......
......@@ -26,6 +26,7 @@ SettingsManager::SettingsManager(QGCApplication* app, QGCToolbox* toolbox)
, _flyViewSettings (nullptr)
, _planViewSettings (nullptr)
, _brandImageSettings (nullptr)
, _offlineMapsSettings (nullptr)
#if !defined(NO_ARDUPILOT_DIALECT)
, _apmMavlinkStreamRateSettings (nullptr)
#endif
......@@ -48,6 +49,7 @@ void SettingsManager::setToolbox(QGCToolbox *toolbox)
_flyViewSettings = new FlyViewSettings (this);
_planViewSettings = new PlanViewSettings (this);
_brandImageSettings = new BrandImageSettings (this);
_offlineMapsSettings = new OfflineMapsSettings (this);
#if !defined(NO_ARDUPILOT_DIALECT)
_apmMavlinkStreamRateSettings = new APMMavlinkStreamRateSettings (this);
#endif
......
......@@ -23,6 +23,7 @@
#include "FlyViewSettings.h"
#include "PlanViewSettings.h"
#include "BrandImageSettings.h"
#include "OfflineMapsSettings.h"
#include "APMMavlinkStreamRateSettings.h"
#if defined(QGC_AIRMAP_ENABLED)
#include "AirMapSettings.h"
......@@ -49,6 +50,7 @@ public:
Q_PROPERTY(QObject* flyViewSettings READ flyViewSettings CONSTANT)
Q_PROPERTY(QObject* planViewSettings READ planViewSettings CONSTANT)
Q_PROPERTY(QObject* brandImageSettings READ brandImageSettings CONSTANT)
Q_PROPERTY(QObject* offlineMapsSettings READ offlineMapsSettings CONSTANT)
#if !defined(NO_ARDUPILOT_DIALECT)
Q_PROPERTY(QObject* apmMavlinkStreamRateSettings READ apmMavlinkStreamRateSettings CONSTANT)
#endif
......@@ -67,6 +69,7 @@ public:
FlyViewSettings* flyViewSettings (void) { return _flyViewSettings; }
PlanViewSettings* planViewSettings (void) { return _planViewSettings; }
BrandImageSettings* brandImageSettings (void) { return _brandImageSettings; }
OfflineMapsSettings* offlineMapsSettings (void) { return _offlineMapsSettings; }
#if !defined(NO_ARDUPILOT_DIALECT)
APMMavlinkStreamRateSettings* apmMavlinkStreamRateSettings(void) { return _apmMavlinkStreamRateSettings; }
#endif
......@@ -83,6 +86,7 @@ private:
FlyViewSettings* _flyViewSettings;
PlanViewSettings* _planViewSettings;
BrandImageSettings* _brandImageSettings;
OfflineMapsSettings* _offlineMapsSettings;
#if !defined(NO_ARDUPILOT_DIALECT)
APMMavlinkStreamRateSettings* _apmMavlinkStreamRateSettings;
#endif
......
......@@ -14,7 +14,6 @@
DECLARE_SETTINGGROUP(Units, "Units")
{
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
qmlRegisterUncreatableType<UnitsSettings>("QGroundControl.SettingsManager", 1, 0, "UnitsSettings", "Reference only");
}
......
......@@ -28,7 +28,6 @@ const char* VideoSettings::videoSourceMPEGTS = "MPEG-TS (h.264) Video Stream"
DECLARE_SETTINGGROUP(Video, "Video")
{
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
qmlRegisterUncreatableType<VideoSettings>("QGroundControl.SettingsManager", 1, 0, "VideoSettings", "Reference only");
// Setup enum values for videoSource settings into meta data
......
......@@ -1901,10 +1901,6 @@ void Vehicle::_linkInactiveOrDeleted(LinkInterface* link)
_links.removeOne(link);
if (_priorityLink.data() == link) {
_priorityLink.clear();
}
_updatePriorityLink(true /* updateActive */, true /* sendCommand */);
if (_links.count() == 0 && !_allLinksInactiveSent) {
......
......@@ -19,7 +19,7 @@ import QGroundControl.Palette 1.0
//-- GPS Indicator
Item {
id: satelitte
width: (gpsValuesColumn.x + gpsValuesColumn.width) * 1.1
width: visible ? (gpsValuesColumn.x + gpsValuesColumn.width) * 1.1 : 0
anchors.top: parent.top
anchors.bottom: parent.bottom
visible: QGroundControl.gpsRtk.connected.value
......
......@@ -23,7 +23,8 @@ import QGroundControl.Vehicle 1.0
Item {
anchors.top: parent.top
anchors.bottom: parent.bottom
width: priorityLinkSelector.width
width: visible ? priorityLinkSelector.width : 0
visible: _visible
property bool _visible: false
......@@ -33,7 +34,6 @@ Item {
font.pointSize: ScreenTools.mediumFontPointSize
color: qgcPal.buttonText
anchors.verticalCenter: parent.verticalCenter
visible: _visible
Menu {
id: linkSelectionMenu
}
......
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