Browse Source

Merge branch 'AirmapUI' into Airmap

* AirmapUI:
  Restore expanded state when enabling AirMap
  AirMap Settings
  Control on Fly View Eliminated flight widget "states" Define flight widget top margin (plugin options)
  Add expand icon
  Expand/Colapse Controllers Adjust colors Remove unused image
  Initial Mockup

# Conflicts:
#	src/Settings/AppSettings.cc
#	src/Settings/AppSettings.h
QGC4.4
Gus Grubba 7 years ago
parent
commit
191f9caeae
  1. 9
      qgcresources.qrc
  2. 4
      qgroundcontrol.qrc
  3. 10
      resources/waypoint.svg
  4. 195
      src/Airmap/AirmapSettings.qml
  5. 259
      src/Airmap/AirspaceControl.qml
  6. 58
      src/Airmap/AirspaceRegulation.qml
  7. 4
      src/Airmap/QGroundControl.Airmap.qmldir
  8. 21
      src/Airmap/images/advisory-icon.svg
  9. 9
      src/Airmap/images/colapse.svg
  10. 9
      src/Airmap/images/expand.svg
  11. 17
      src/Airmap/images/pencil.svg
  12. 91
      src/FlightDisplay/FlightDisplayViewWidgets.qml
  13. 9
      src/FlightMap/Images/HomeBlack.svg
  14. 1
      src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml
  15. 2
      src/PlanView/GeoFenceEditor.qml
  16. 137
      src/PlanView/MissionItemEditor.qml
  17. 328
      src/PlanView/PlanView.qml
  18. 1
      src/PlanView/RallyPointEditorHeader.qml
  19. 12
      src/PlanView/RallyPointItemEditor.qml
  20. 4
      src/QGCPalette.cc
  21. 1
      src/QmlControls/PageView.qml
  22. 32
      src/QmlControls/QmlTest.qml
  23. 7
      src/Settings/App.SettingsGroup.json
  24. 11
      src/Settings/AppSettings.cc
  25. 6
      src/Settings/AppSettings.h
  26. 8
      src/api/QGCCorePlugin.cc
  27. 13
      src/api/QGCOptions.h

9
qgcresources.qrc

@ -123,6 +123,7 @@
<file alias="ZoomPlus.svg">src/FlightMap/Images/ZoomPlus.svg</file> <file alias="ZoomPlus.svg">src/FlightMap/Images/ZoomPlus.svg</file>
<file alias="ZoomMinus.svg">src/FlightMap/Images/ZoomMinus.svg</file> <file alias="ZoomMinus.svg">src/FlightMap/Images/ZoomMinus.svg</file>
<file alias="Help.svg">src/FlightMap/Images/Help.svg</file> <file alias="Help.svg">src/FlightMap/Images/Help.svg</file>
<file alias="Home.svg">src/FlightMap/Images/Home.svg</file>
<file alias="HelpBlack.svg">src/FlightMap/Images/HelpBlack.svg</file> <file alias="HelpBlack.svg">src/FlightMap/Images/HelpBlack.svg</file>
<file alias="MapAddMission.svg">src/FlightMap/Images/MapAddMission.svg</file> <file alias="MapAddMission.svg">src/FlightMap/Images/MapAddMission.svg</file>
<file alias="MapAddMissionBlack.svg">src/FlightMap/Images/MapAddMissionBlack.svg</file> <file alias="MapAddMissionBlack.svg">src/FlightMap/Images/MapAddMissionBlack.svg</file>
@ -171,6 +172,13 @@
<file alias="APM/BrandImageSub">src/FirmwarePlugin/APM/APMBrandImageSub.png</file> <file alias="APM/BrandImageSub">src/FirmwarePlugin/APM/APMBrandImageSub.png</file>
<file alias="PX4/BrandImage">src/FirmwarePlugin/PX4/PX4BrandImage.png</file> <file alias="PX4/BrandImage">src/FirmwarePlugin/PX4/PX4BrandImage.png</file>
<file alias="subVehicleArrowOpaque.png">src/FlightMap/Images/sub.png</file> <file alias="subVehicleArrowOpaque.png">src/FlightMap/Images/sub.png</file>
<file alias="advisory-icon.svg">src/Airmap/images/advisory-icon.svg</file>
</qresource>
<qresource prefix="/airmap">
<file alias="advisory-icon.svg">src/Airmap/images/advisory-icon.svg</file>
<file alias="colapse.svg">src/Airmap/images/colapse.svg</file>
<file alias="expand.svg">src/Airmap/images/expand.svg</file>
<file alias="pencil.svg">src/Airmap/images/pencil.svg</file>
</qresource> </qresource>
<qresource prefix="/res"> <qresource prefix="/res">
<file alias="action.svg">resources/action.svg</file> <file alias="action.svg">resources/action.svg</file>
@ -207,6 +215,7 @@
<file alias="wind-rose-arrow.svg">resources/wind-rose-arrow.svg</file> <file alias="wind-rose-arrow.svg">resources/wind-rose-arrow.svg</file>
<file alias="XDelete.svg">resources/XDelete.svg</file> <file alias="XDelete.svg">resources/XDelete.svg</file>
<file alias="XDeleteBlack.svg">resources/XDeleteBlack.svg</file> <file alias="XDeleteBlack.svg">resources/XDeleteBlack.svg</file>
<file alias="waypoint.svg">resources/waypoint.svg</file>
<file>resources/icons/qgroundcontrol.ico</file> <file>resources/icons/qgroundcontrol.ico</file>
</qresource> </qresource>
<qresource prefix="/res/firmware"> <qresource prefix="/res/firmware">

4
qgroundcontrol.qrc

@ -15,6 +15,10 @@
<file alias="JoystickIndicator.qml">src/ui/toolbar/JoystickIndicator.qml</file> <file alias="JoystickIndicator.qml">src/ui/toolbar/JoystickIndicator.qml</file>
</qresource> </qresource>
<qresource prefix="/qml"> <qresource prefix="/qml">
<file alias="QGroundControl/Airmap/qmldir">src/Airmap/QGroundControl.Airmap.qmldir</file>
<file alias="QGroundControl/Airmap/AirspaceControl.qml">src/Airmap/AirspaceControl.qml</file>
<file alias="QGroundControl/Airmap/AirspaceRegulation.qml">src/Airmap/AirspaceRegulation.qml</file>
<file alias="AirmapSettings.qml">src/Airmap/AirmapSettings.qml</file>
<file alias="AnalyzeView.qml">src/AnalyzeView/AnalyzeView.qml</file> <file alias="AnalyzeView.qml">src/AnalyzeView/AnalyzeView.qml</file>
<file alias="AppSettings.qml">src/ui/AppSettings.qml</file> <file alias="AppSettings.qml">src/ui/AppSettings.qml</file>
<file alias="BluetoothSettings.qml">src/ui/preferences/BluetoothSettings.qml</file> <file alias="BluetoothSettings.qml">src/ui/preferences/BluetoothSettings.qml</file>

10
resources/waypoint.svg

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.0.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"
width="72px" height="72px" viewBox="0 0 72 72" style="enable-background:new 0 0 72 72;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
</style>
<path class="st0" d="M36,0C21.089,0,9,12.089,9,27s22.5,45,27,45s27-30.089,27-45S50.911,0,36,0z M36,45c-9.927,0-18-8.077-18-18
S26.073,9,36,9s18,8.077,18,18S45.927,45,36,45z"/>
</svg>

After

Width:  |  Height:  |  Size: 610 B

195
src/Airmap/AirmapSettings.qml

@ -0,0 +1,195 @@
/****************************************************************************
*
* (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.
*
****************************************************************************/
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.4
import QtQuick.Dialogs 1.2
import QtMultimedia 5.5
import QtQuick.Layouts 1.2
import QGroundControl 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.MultiVehicleManager 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Controllers 1.0
import QGroundControl.SettingsManager 1.0
QGCView {
id: _qgcView
viewPanel: panel
color: qgcPal.window
anchors.fill: parent
anchors.margins: ScreenTools.defaultFontPixelWidth
property real _labelWidth: ScreenTools.defaultFontPixelWidth * 20
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 30
property real _panelWidth: _qgcView.width * _internalWidthRatio
property Fact _enableAirMapFact: QGroundControl.settingsManager.appSettings.enableAirMap
property bool _airMapEnabled: _enableAirMapFact.rawValue
readonly property real _internalWidthRatio: 0.8
QGCPalette { id: qgcPal }
QGCViewPanel {
id: panel
anchors.fill: parent
QGCFlickable {
clip: true
anchors.fill: parent
contentHeight: settingsColumn.height
contentWidth: settingsColumn.width
Column {
id: settingsColumn
width: _qgcView.width
spacing: ScreenTools.defaultFontPixelHeight * 0.5
anchors.margins: ScreenTools.defaultFontPixelWidth
//-----------------------------------------------------------------
//-- General
Item {
width: _panelWidth
height: generalLabel.height
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.settingsManager.unitsSettings.visible
QGCLabel {
id: generalLabel
text: qsTr("General")
font.family: ScreenTools.demiboldFontFamily
}
}
Rectangle {
height: generalCol.height + (ScreenTools.defaultFontPixelHeight * 2)
width: _panelWidth
color: qgcPal.windowShade
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
Column {
id: generalCol
spacing: ScreenTools.defaultFontPixelWidth
anchors.centerIn: parent
FactCheckBox {
text: qsTr("Enable AirMap Services")
fact: _enableAirMapFact
visible: _enableAirMapFact.visible
}
QGCCheckBox {
text: qsTr("Disable Telemetry")
checked: false
enabled: _airMapEnabled
onClicked:
{
}
}
}
}
//-----------------------------------------------------------------
//-- Login / Registration
Item {
width: _panelWidth
height: loginLabel.height
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.settingsManager.appSettings.visible
QGCLabel {
id: loginLabel
text: qsTr("Login / Registration")
font.family: ScreenTools.demiboldFontFamily
}
}
Rectangle {
height: loginGrid.height + (ScreenTools.defaultFontPixelHeight * 2)
width: _panelWidth
color: qgcPal.windowShade
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
GridLayout {
id: loginGrid
columns: 2
rowSpacing: ScreenTools.defaultFontPixelHeight * 0.25
anchors.centerIn: parent
QGCLabel { text: qsTr("Email:") }
QGCTextField {
width: _editFieldWidth
enabled: _airMapEnabled
}
QGCLabel { text: qsTr("Password:") }
QGCTextField {
width: _editFieldWidth
enabled: _airMapEnabled
}
Item {
width: 1
height: 1
Layout.columnSpan: 2
}
QGCLabel {
text: qsTr("Forgot Your AirMap Password?")
Layout.alignment: Qt.AlignHCenter
Layout.columnSpan: 2
}
Item {
width: 1
height: 1
Layout.columnSpan: 2
}
QGCButton {
text: qsTr("Register for an AirMap Account")
Layout.alignment: Qt.AlignHCenter
Layout.columnSpan: 2
enabled: _airMapEnabled
}
}
}
//-----------------------------------------------------------------
//-- Pilot Profile
Item {
width: _panelWidth
height: profileLabel.height
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.settingsManager.appSettings.visible
QGCLabel {
id: profileLabel
text: qsTr("Pilot Profile")
font.family: ScreenTools.demiboldFontFamily
}
}
Rectangle {
height: profileGrid.height + (ScreenTools.defaultFontPixelHeight * 2)
width: _panelWidth
color: qgcPal.windowShade
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
GridLayout {
id: profileGrid
columns: 2
columnSpacing: ScreenTools.defaultFontPixelHeight * 2
rowSpacing: ScreenTools.defaultFontPixelWidth * 0.25
anchors.centerIn: parent
QGCLabel { text: qsTr("Name:") }
QGCLabel { text: qsTr("John Doe") }
QGCLabel { text: qsTr("User Name:") }
QGCLabel { text: qsTr("joe36") }
QGCLabel { text: qsTr("Email:") }
QGCLabel { text: qsTr("jonh@doe.com") }
QGCLabel { text: qsTr("Phone:") }
QGCLabel { text: qsTr("+1 212 555 1212") }
}
}
}
}
}
}

259
src/Airmap/AirspaceControl.qml

@ -0,0 +1,259 @@
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.4
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.2
import QtQml 2.2
import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Vehicle 1.0
import QGroundControl.Controls 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Airmap 1.0
Item {
id: _root
width: parent.width
height: colapsed ? colapsedRect.height : expandedRect.height
property bool colapsed: true
property bool showColapse: true
readonly property real _radius: ScreenTools.defaultFontPixelWidth * 0.5
readonly property color _colorOrange: "#d75e0d"
readonly property color _colorBrown: "#3c2b24"
readonly property color _colorLightBrown: "#5a4e49"
readonly property color _colorGray: "#615c61"
readonly property color _colorMidBrown: "#3a322f"
readonly property color _colorYellow: "#d7c61d"
readonly property color _colorWhite: "#ffffff"
QGCPalette {
id: qgcPal
colorGroupEnabled: enabled
}
//---------------------------------------------------------------
//-- Colapsed State
Rectangle {
id: colapsedRect
width: parent.width
height: colapsed ? colapsedRow.height + ScreenTools.defaultFontPixelHeight : 0
color: _colorOrange
radius: _radius
visible: colapsed
Row {
id: colapsedRow
spacing: ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
anchors.leftMargin: ScreenTools.defaultFontPixelWidth
anchors.verticalCenter: parent.verticalCenter
QGCColoredImage {
width: height
height: ScreenTools.defaultFontPixelWidth * 2.5
sourceSize.height: height
source: "qrc:/airmap/advisory-icon.svg"
color: _colorWhite
anchors.verticalCenter: parent.verticalCenter
}
QGCLabel {
text: qsTr("Airspace")
color: _colorWhite
anchors.verticalCenter: parent.verticalCenter
}
}
QGCColoredImage {
width: height
height: ScreenTools.defaultFontPixelWidth * 2.5
sourceSize.height: height
source: "qrc:/airmap/expand.svg"
color: _colorWhite
anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.verticalCenter: parent.verticalCenter
}
MouseArea {
anchors.fill: parent
onClicked: colapsed = false
}
}
//---------------------------------------------------------------
//-- Expanded State
Rectangle {
id: expandedRect
width: parent.width
height: !colapsed ? expandedCol.height + ScreenTools.defaultFontPixelHeight : 0
color: _colorOrange
radius: _radius
visible: !colapsed
Column {
id: expandedCol
spacing: ScreenTools.defaultFontPixelHeight * 0.5
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
//-- Header
Item {
height: expandedRow.height
anchors.left: parent.left
anchors.right: parent.right
Row {
id: expandedRow
spacing: ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
anchors.leftMargin: ScreenTools.defaultFontPixelWidth
QGCColoredImage {
width: height
height: ScreenTools.defaultFontPixelWidth * 2.5
sourceSize.height: height
source: "qrc:/airmap/advisory-icon.svg"
color: _colorWhite
anchors.verticalCenter: parent.verticalCenter
}
Column {
spacing: 0
anchors.verticalCenter: parent.verticalCenter
QGCLabel {
text: qsTr("Airspace")
color: _colorWhite
}
QGCLabel {
text: qsTr("3 Advisories")
color: _colorWhite
font.pointSize: ScreenTools.smallFontPointSize
}
}
}
QGCColoredImage {
width: height
height: ScreenTools.defaultFontPixelWidth * 2.5
sourceSize.height: height
source: "qrc:/airmap/colapse.svg"
color: _colorWhite
visible: showColapse
anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.verticalCenter: parent.verticalCenter
MouseArea {
anchors.fill: parent
enabled: showColapse
onClicked: colapsed = true
}
}
}
//-- Contents (Brown Box)
Rectangle {
color: _colorBrown
height: airspaceCol.height + ScreenTools.defaultFontPixelHeight
radius: _radius
anchors.left: parent.left
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5
anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5
Column {
id: airspaceCol
spacing: ScreenTools.defaultFontPixelHeight * 0.5
anchors.left: parent.left
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5
anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5
anchors.verticalCenter: parent.verticalCenter
//-- Regulations
Rectangle {
color: _colorLightBrown
height: regCol.height + ScreenTools.defaultFontPixelHeight
radius: _radius
anchors.left: parent.left
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5
anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5
Column {
id: regCol
spacing: ScreenTools.defaultFontPixelHeight * 0.5
anchors.left: parent.left
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5
anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5
anchors.verticalCenter: parent.verticalCenter
QGCLabel {
text: qsTr("Airspace Regulations")
color: _colorWhite
anchors.horizontalCenter: parent.horizontalCenter
}
QGCLabel {
text: qsTr("Airspace advisories based on the selected rules.")
color: _colorWhite
anchors.left: parent.left
anchors.right: parent.right
wrapMode: Text.WordWrap
font.pointSize: ScreenTools.smallFontPointSize
}
GridLayout {
columns: 2
anchors.left: parent.left
anchors.right: parent.right
Rectangle {
width: regButton.height
height: width
radius: 2
color: _colorGray
anchors.verticalCenter: parent.verticalCenter
QGCColoredImage {
width: height
height: parent.height * 0.5
sourceSize.height: height
source: "qrc:/airmap/pencil.svg"
color: _colorWhite
anchors.centerIn: parent
}
}
Rectangle {
id: regButton
height: regLabel.height + ScreenTools.defaultFontPixelHeight * 0.5
radius: 2
color: _colorMidBrown
Layout.fillWidth: true
QGCLabel {
id: regLabel
text: qsTr("FAA-107, Airmap")
color: _colorWhite
anchors.centerIn: parent
}
}
}
}
}
AirspaceRegulation {
regTitle: qsTr("Controlled Aispace (1)")
regText: qsTr("Santa Monica Class D requires FAA Authorization, permissible below 100ft.")
regColor: _colorOrange
textColor: _colorWhite
anchors.left: parent.left
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5
anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5
}
AirspaceRegulation {
regTitle: qsTr("Schools (2)")
regText: qsTr("Santa Monica School of Something.")
regColor: _colorYellow
textColor: _colorWhite
anchors.left: parent.left
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5
anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5
}
}
}
//-- Footer
QGCLabel {
text: qsTr("Powered by <b>AIRMAP</b>")
color: _colorWhite
font.pointSize: ScreenTools.smallFontPointSize
anchors.horizontalCenter: parent.horizontalCenter
}
}
}
}

58
src/Airmap/AirspaceRegulation.qml

@ -0,0 +1,58 @@
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.4
import QtQuick.Dialogs 1.2
import QtQml 2.2
import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Airmap 1.0
Item {
id: _root
height: regCol.height
property var textColor: "white"
property var regColor: "white"
property var regTitle: ""
property var regText: ""
Column {
id: regCol
spacing: ScreenTools.defaultFontPixelHeight * 0.5
anchors.left: parent.left
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5
anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5
Row {
spacing: ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5
anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5
Rectangle {
width: height
height: ScreenTools.defaultFontPixelWidth * 1.5
radius: height * 0.5
color: regColor
anchors.verticalCenter: parent.verticalCenter
}
QGCLabel {
text: regTitle
color: textColor
}
}
QGCLabel {
text: regText
color: textColor
anchors.left: parent.left
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5
anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5
wrapMode: Text.WordWrap
font.pointSize: ScreenTools.smallFontPointSize
}
}
}

4
src/Airmap/QGroundControl.Airmap.qmldir

@ -0,0 +1,4 @@
Module QGroundControl.Airmap
AirspaceControl 1.0 AirspaceControl.qml
AirspaceRegulation 1.0 AirspaceRegulation.qml

21
src/Airmap/images/advisory-icon.svg

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.0.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"
width="72px" height="72px" viewBox="0 0 72 72" style="enable-background:new 0 0 72 72;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
</style>
<title>Page 1</title>
<desc>Created with Sketch.</desc>
<g id="Map-Copy-8" transform="translate(-2396.000000, -714.000000)">
<g id="Group-3" transform="translate(2379.000000, 693.000000)">
<path id="Page-1" class="st0" d="M88.463,84.307L57.076,25.426c-0.797-1.46-2.322-2.388-4-2.388c-1.681,0-3.203,0.928-3.978,2.388
L17.532,84.307c-0.753,1.391-0.706,3.095,0.106,4.445c0.822,1.372,2.303,2.21,3.894,2.21h62.95c1.591,0,3.05-0.841,3.869-2.21
C89.17,87.402,89.213,85.701,88.463,84.307L88.463,84.307z M52.995,82.811c-1.876,0-3.395-1.519-3.395-3.396
c0-1.874,1.519-3.396,3.395-3.396s3.398,1.523,3.398,3.396C56.39,81.289,54.871,82.811,52.995,82.811z M56.363,48.674
L54.505,72.04c-0.104,1.499-0.929,2.62-2.188,2.62c-1.258,0-2.083-1.121-2.188-2.62l-1.858-23.367
c-0.096-1.352-0.014-2.576,1.059-3.691c0.861-0.896,1.853-1.568,2.99-1.568s2.126,0.671,2.99,1.568
C56.377,46.097,56.459,47.322,56.363,48.674L56.363,48.674z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

9
src/Airmap/images/colapse.svg

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.0.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"
width="72px" height="36px" viewBox="0 0 72 36" style="enable-background:new 0 0 72 36;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#FFFFFF;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<polyline class="st0" points="3.6,34 36,1.6 68.4,34 "/>
</svg>

After

Width:  |  Height:  |  Size: 580 B

9
src/Airmap/images/expand.svg

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.0.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"
width="72px" height="36px" viewBox="0 0 72 36" style="enable-background:new 0 0 72 36;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#FFFFFF;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<polyline class="st0" points="3.6,1.6 36,34 68.4,1.6 "/>
</svg>

After

Width:  |  Height:  |  Size: 581 B

17
src/Airmap/images/pencil.svg

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.0.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"
width="72px" height="72px" viewBox="0 0 72 72" style="enable-background:new 0 0 72 72;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
</style>
<path class="st0" d="M60.299,0.003c-3.006,0-6.011,1.132-8.285,3.41l-0.011,0.011L7.931,48.217L0,71.997l23.781-7.931l0.492-0.481
l44.311-43.59v-0.011c4.553-4.553,4.556-12.023,0-16.571C66.308,1.137,63.304,0.003,60.299,0.003z M60.299,5.828
c1.493,0,2.986,0.571,4.143,1.728c2.311,2.307,2.314,5.971,0,8.285l-4.623,4.555c-0.651-1.589-1.671-3.273-3.307-4.909
c-1.633-1.633-3.32-2.647-4.909-3.296l4.578-4.646C57.33,6.402,58.814,5.828,60.299,5.828z M47.733,17.157
c1.084,0.091,2.652,0.489,4.635,2.472c1.986,1.986,2.4,3.556,2.495,4.635c0.072,0.818-0.029,0.933-0.08,1.076L24.513,55.129
c-0.652-1.448-1.65-2.977-3.159-4.486c-1.509-1.509-3.038-2.506-4.486-3.159l29.777-30.258
C46.796,17.179,46.916,17.088,47.733,17.157z M12.84,52.348c0.909,0.072,2.359,0.425,4.372,2.438
c2.012,2.012,2.366,3.462,2.438,4.372c0.008,0.099-0.015,0.033-0.011,0.114l-5.585,1.865c-0.438-0.566-0.917-1.135-1.488-1.705
c-0.567-0.567-1.139-1.04-1.705-1.476l1.865-5.596C12.807,52.362,12.741,52.34,12.84,52.348z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

91
src/FlightDisplay/FlightDisplayViewWidgets.qml

@ -15,23 +15,26 @@ import QtLocation 5.3
import QtPositioning 5.3 import QtPositioning 5.3
import QtQuick.Layouts 1.2 import QtQuick.Layouts 1.2
import QGroundControl 1.0 import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
import QGroundControl.Vehicle 1.0 import QGroundControl.Vehicle 1.0
import QGroundControl.FlightMap 1.0 import QGroundControl.FlightMap 1.0
import QGroundControl.Airmap 1.0
Item { Item {
id: _root id: widgetRoot
property var qgcView property var qgcView
property bool useLightColors property bool useLightColors
property var missionController property var missionController
property bool showValues: true
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _isSatellite: _mainIsMap ? (_flightMap ? _flightMap.isSatelliteMap : true) : true property bool _isSatellite: _mainIsMap ? (_flightMap ? _flightMap.isSatelliteMap : true) : true
property bool _lightWidgetBorders: _isSatellite property bool _lightWidgetBorders: _isSatellite
property bool _enableAirMap: QGroundControl.settingsManager.appSettings.enableAirMap.rawValue
readonly property real _margins: ScreenTools.defaultFontPixelHeight * 0.5 readonly property real _margins: ScreenTools.defaultFontPixelHeight * 0.5
@ -51,28 +54,14 @@ Item {
if(QGroundControl.corePlugin.options.instrumentWidget) { if(QGroundControl.corePlugin.options.instrumentWidget) {
if(QGroundControl.corePlugin.options.instrumentWidget.source.toString().length) { if(QGroundControl.corePlugin.options.instrumentWidget.source.toString().length) {
instrumentsLoader.source = QGroundControl.corePlugin.options.instrumentWidget.source instrumentsLoader.source = QGroundControl.corePlugin.options.instrumentWidget.source
switch(QGroundControl.corePlugin.options.instrumentWidget.widgetPosition) {
case CustomInstrumentWidget.POS_TOP_RIGHT:
instrumentsLoader.state = "topMode"
break;
case CustomInstrumentWidget.POS_BOTTOM_RIGHT:
instrumentsLoader.state = "bottomMode"
break;
case CustomInstrumentWidget.POS_CENTER_RIGHT:
default:
instrumentsLoader.state = "centerMode"
break;
}
} else { } else {
// Note: We currently show alternate instruments all the time. This is a trial change for daily builds. // Note: We currently show alternate instruments all the time. This is a trial change for daily builds.
// Leaving non-alternate code in for now in case the trial fails. // Leaving non-alternate code in for now in case the trial fails.
var useAlternateInstruments = true//QGroundControl.settingsManager.appSettings.virtualJoystick.value || ScreenTools.isTinyScreen var useAlternateInstruments = true//QGroundControl.settingsManager.appSettings.virtualJoystick.value || ScreenTools.isTinyScreen
if(useAlternateInstruments) { if(useAlternateInstruments) {
instrumentsLoader.source = "qrc:/qml/QGCInstrumentWidgetAlternate.qml" instrumentsLoader.source = "qrc:/qml/QGCInstrumentWidgetAlternate.qml"
instrumentsLoader.state = "topMode"
} else { } else {
instrumentsLoader.source = "qrc:/qml/QGCInstrumentWidget.qml" instrumentsLoader.source = "qrc:/qml/QGCInstrumentWidget.qml"
instrumentsLoader.state = QGroundControl.settingsManager.appSettings.showLargeCompass.value == 1 ? "centerMode" : "topMode"
} }
} }
} else { } else {
@ -130,43 +119,31 @@ Item {
text: "The vehicle has failed a pre-arm check. In order to arm the vehicle, resolve the failure or disable the arming check via the Safety tab on the Vehicle Setup page." text: "The vehicle has failed a pre-arm check. In order to arm the vehicle, resolve the failure or disable the arming check via the Safety tab on the Vehicle Setup page."
} }
} }
Column {
//-- Instrument Panel id: instrumentsColumn
Loader { spacing: ScreenTools.defaultFontPixelHeight * 0.25
id: instrumentsLoader anchors.top: parent.top
anchors.margins: ScreenTools.defaultFontPixelHeight / 2 anchors.topMargin: QGroundControl.corePlugin.options.instrumentWidget.widgetTopMargin + (ScreenTools.defaultFontPixelHeight * 0.5)
anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5
anchors.right: parent.right anchors.right: parent.right
z: QGroundControl.zOrderWidgets //-------------------------------------------------------
property var qgcView: _root.qgcView // Airmap Airspace Control
property real maxHeight:parent.height - (anchors.margins * 2) AirspaceControl {
states: [ id: airspaceControl
State { width: getPreferredInstrumentWidth()
name: "topMode" visible: _enableAirMap
AnchorChanges { anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5
target: instrumentsLoader onColapsedChanged: {
anchors.verticalCenter: undefined widgetRoot.showValues = colapsed
anchors.bottom: undefined
anchors.top: _root ? _root.top : undefined
}
},
State {
name: "centerMode"
AnchorChanges {
target: instrumentsLoader
anchors.top: undefined
anchors.bottom: undefined
anchors.verticalCenter: _root ? _root.verticalCenter : undefined
}
},
State {
name: "bottomMode"
AnchorChanges {
target: instrumentsLoader
anchors.top: undefined
anchors.verticalCenter: undefined
anchors.bottom: _root ? _root.bottom : undefined
}
} }
] }
//-------------------------------------------------------
//-- Instrument Panel
Loader {
id: instrumentsLoader
anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5
property var qgcView: widgetRoot.qgcView
property real maxHeight: widgetRoot ? widgetRoot.height - instrumentsColumn.y - airspaceControl.height - (ScreenTools.defaultFontPixelHeight * 4) : 0
}
} }
} }

9
src/FlightMap/Images/HomeBlack.svg

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, 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="0 0 72 72" enable-background="new 0 0 72 72" xml:space="preserve">
<g>
<polygon points="70.2,41.7 36,1.797 1.8,41.7 10.35,41.7 10.35,70.203 27.45,70.203 27.45,47.401 44.55,47.401 44.55,70.203
61.65,70.203 61.65,41.7 "/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 517 B

1
src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml

@ -66,6 +66,7 @@ Rectangle {
anchors.top: parent.bottom anchors.top: parent.bottom
width: parent.width width: parent.width
height: _valuesWidget.height height: _valuesWidget.height
visible: widgetRoot.showValues
Rectangle { Rectangle {
anchors.fill: _valuesWidget anchors.fill: _valuesWidget

2
src/PlanView/GeoFenceEditor.qml

@ -42,7 +42,7 @@ QGCFlickable {
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
text: qsTr("GeoFence") text: qsTr("GeoFence")
color: "black" anchors.leftMargin: ScreenTools.defaultFontPixelWidth
} }
Rectangle { Rectangle {

137
src/PlanView/MissionItemEditor.qml

@ -15,7 +15,7 @@ import QGroundControl.Palette 1.0
/// Mission item edit control /// Mission item edit control
Rectangle { Rectangle {
id: _root id: _root
height: editorLoader.y + (editorLoader.visible ? editorLoader.height : 0) + (_margin * 2) height: header.height + (editorLoader.visible ? (editorLoader.height + (_margin * 3)) : 0)
color: _currentItem ? qgcPal.missionItemEditor : qgcPal.windowShade color: _currentItem ? qgcPal.missionItemEditor : qgcPal.windowShade
radius: _radius radius: _radius
@ -33,15 +33,14 @@ Rectangle {
property var _masterController: masterController property var _masterController: masterController
property var _missionController: _masterController.missionController property var _missionController: _masterController.missionController
property bool _currentItem: missionItem.isCurrentItem property bool _currentItem: missionItem.isCurrentItem
property color _outerTextColor: _currentItem ? qgcPal.primaryButtonText : qgcPal.text
property bool _noMissionItemsAdded: ListView.view.model.count === 1 property bool _noMissionItemsAdded: ListView.view.model.count === 1
property real _sectionSpacer: ScreenTools.defaultFontPixelWidth / 2 // spacing between section headings property real _sectionSpacer: ScreenTools.defaultFontPixelWidth / 2 // spacing between section headings
property bool _singleComplexItem: _missionController.complexMissionItemNames.length === 1 property bool _singleComplexItem: _missionController.complexMissionItemNames.length === 1
readonly property real _editFieldWidth: Math.min(width - _margin * 2, ScreenTools.defaultFontPixelWidth * 12) readonly property real _editFieldWidth: Math.min(width - _margin * 2, ScreenTools.defaultFontPixelWidth * 12)
readonly property real _margin: ScreenTools.defaultFontPixelWidth / 2 readonly property real _margin: ScreenTools.defaultFontPixelWidth * 0.5
readonly property real _radius: ScreenTools.defaultFontPixelWidth / 2 readonly property real _radius: ScreenTools.defaultFontPixelWidth * 0.5
readonly property real _hamburgerSize: commandPicker.height * 0.75 readonly property real _hamburgerSize: header.height * 0.75
readonly property bool _waypointsOnlyMode: QGroundControl.corePlugin.options.missionWaypointsOnly readonly property bool _waypointsOnlyMode: QGroundControl.corePlugin.options.missionWaypointsOnly
QGCPalette { QGCPalette {
@ -52,7 +51,6 @@ Rectangle {
FocusScope { FocusScope {
id: currentItemScope id: currentItemScope
anchors.fill: parent anchors.fill: parent
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
@ -62,38 +60,76 @@ Rectangle {
} }
} }
//-- Dialog
Component { Component {
id: editPositionDialog id: editPositionDialog
EditPositionDialog { EditPositionDialog {
coordinate: missionItem.coordinate coordinate: missionItem.coordinate
onCoordinateChanged: missionItem.coordinate = coordinate onCoordinateChanged: missionItem.coordinate = coordinate
} }
} }
//-- Header
QGCLabel { Row {
id: label id: header
anchors.verticalCenter: commandPicker.verticalCenter spacing: ScreenTools.defaultFontPixelWidth
anchors.leftMargin: _margin height: ScreenTools.defaultFontPixelHeight * 3
anchors.verticalCenter: editorLoader.visible ? undefined : parent.verticalCenter
anchors.left: parent.left anchors.left: parent.left
text: missionItem.homePosition ? "H" : missionItem.sequenceNumber anchors.leftMargin: ScreenTools.defaultFontPixelWidth
color: _outerTextColor Item {
width: ScreenTools.defaultFontPixelWidth * 3
height: parent.height
QGCColoredImage {
width: ScreenTools.defaultFontPixelHeight
height: width
sourceSize.height: width
source: "qrc:/qmlimages/Home.svg"
visible: missionItem.homePosition
color: qgcPal.text
anchors.centerIn: parent
}
QGCLabel {
text: missionItem.sequenceNumber
color: qgcPal.text
visible: !missionItem.homePosition
anchors.centerIn: parent
}
}
QGCLabel {
id: label
visible: !missionItem.isCurrentItem || !missionItem.isSimpleItem || _waypointsOnlyMode
text: missionItem.commandName
color: qgcPal.text
anchors.verticalCenter: parent.verticalCenter
}
QGCButton {
id: commandPicker
visible: !label.visible
text: missionItem.commandName
anchors.verticalCenter: parent.verticalCenter
Component {
id: commandDialog
MissionCommandDialog {
missionItem: _root.missionItem
}
}
onClicked: qgcView.showDialog(commandDialog, qsTr("Select Mission Command"), qgcView.showDialogDefaultWidth, StandardButton.Cancel)
}
} }
//-- Hamburger button at the right of header
QGCColoredImage { QGCColoredImage {
id: hamburger id: hamburger
anchors.rightMargin: ScreenTools.defaultFontPixelWidth anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: commandPicker.verticalCenter anchors.verticalCenter: header.verticalCenter
width: _hamburgerSize width: _hamburgerSize
height: _hamburgerSize height: _hamburgerSize
sourceSize.height: _hamburgerSize sourceSize.height: _hamburgerSize
source: "qrc:/qmlimages/Hamburger.svg" source: "qrc:/qmlimages/Hamburger.svg"
visible: missionItem.isCurrentItem && missionItem.sequenceNumber != 0 visible: missionItem.isCurrentItem && missionItem.sequenceNumber !== 0
color: qgcPal.windowShade color: qgcPal.text
} }
//-- Hamburger Menu
QGCMouseArea { QGCMouseArea {
fillItem: hamburger fillItem: hamburger
visible: hamburger.visible visible: hamburger.visible
@ -101,67 +137,54 @@ Rectangle {
currentItemScope.focus = true currentItemScope.focus = true
hamburgerMenu.popup() hamburgerMenu.popup()
} }
Menu { Menu {
id: hamburgerMenu id: hamburgerMenu
MenuItem { MenuItem {
text: qsTr("Insert waypoint") text: qsTr("Insert waypoint")
onTriggered: insertWaypoint() onTriggered: insertWaypoint()
} }
Menu { Menu {
id: patternMenu id: patternMenu
title: qsTr("Insert pattern") title: qsTr("Insert pattern")
visible: !_singleComplexItem visible: !_singleComplexItem
Instantiator { Instantiator {
model: _missionController.complexMissionItemNames model: _missionController.complexMissionItemNames
onObjectAdded: patternMenu.insertItem(index, object) onObjectAdded: patternMenu.insertItem(index, object)
onObjectRemoved: patternMenu.removeItem(object) onObjectRemoved: patternMenu.removeItem(object)
MenuItem { MenuItem {
text: modelData text: modelData
onTriggered: insertComplexItem(modelData) onTriggered: insertComplexItem(modelData)
} }
} }
} }
MenuItem { MenuItem {
text: qsTr("Insert ") + _missionController.complexMissionItemNames[0] text: qsTr("Insert ") + _missionController.complexMissionItemNames[0]
visible: _singleComplexItem visible: _singleComplexItem
onTriggered: insertComplexItem(_missionController.complexMissionItemNames[0]) onTriggered: insertComplexItem(_missionController.complexMissionItemNames[0])
} }
MenuItem { MenuItem {
text: qsTr("Delete") text: qsTr("Delete")
onTriggered: remove() onTriggered: remove()
} }
MenuItem { MenuItem {
text: qsTr("Change command...") text: qsTr("Change command...")
onTriggered: commandPicker.clicked() onTriggered: commandPicker.clicked()
visible: !_waypointsOnlyMode visible: !_waypointsOnlyMode
} }
MenuItem { MenuItem {
text: qsTr("Edit position...") text: qsTr("Edit position...")
visible: missionItem.specifiesCoordinate visible: missionItem.specifiesCoordinate
onTriggered: qgcView.showDialog(editPositionDialog, qsTr("Edit Position"), qgcView.showDialogDefaultWidth, StandardButton.Cancel) onTriggered: qgcView.showDialog(editPositionDialog, qsTr("Edit Position"), qgcView.showDialogDefaultWidth, StandardButton.Cancel)
} }
MenuSeparator { MenuSeparator {
visible: missionItem.isSimpleItem && !_waypointsOnlyMode visible: missionItem.isSimpleItem && !_waypointsOnlyMode
} }
MenuItem { MenuItem {
text: qsTr("Show all values") text: qsTr("Show all values")
checkable: true checkable: true
checked: missionItem.isSimpleItem ? missionItem.rawEdit : false checked: missionItem.isSimpleItem ? missionItem.rawEdit : false
visible: missionItem.isSimpleItem && !_waypointsOnlyMode visible: missionItem.isSimpleItem && !_waypointsOnlyMode
onTriggered: {
onTriggered: {
if (missionItem.rawEdit) { if (missionItem.rawEdit) {
if (missionItem.friendlyEditAllowed) { if (missionItem.friendlyEditAllowed) {
missionItem.rawEdit = false missionItem.rawEdit = false
@ -176,48 +199,16 @@ Rectangle {
} }
} }
} }
//-- Editor Content
QGCButton {
id: commandPicker
anchors.topMargin: _margin / 2
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2
anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.left: label.right
anchors.top: parent.top
visible: !commandLabel.visible
text: missionItem.commandName
Component {
id: commandDialog
MissionCommandDialog {
missionItem: _root.missionItem
}
}
onClicked: qgcView.showDialog(commandDialog, qsTr("Select Mission Command"), qgcView.showDialogDefaultWidth, StandardButton.Cancel)
}
QGCLabel {
id: commandLabel
anchors.fill: commandPicker
visible: !missionItem.isCurrentItem || !missionItem.isSimpleItem || _waypointsOnlyMode
verticalAlignment: Text.AlignVCenter
text: missionItem.commandName
color: _outerTextColor
}
Loader { Loader {
id: editorLoader id: editorLoader
anchors.leftMargin: _margin anchors.leftMargin: _margin
anchors.topMargin: _margin
anchors.left: parent.left anchors.left: parent.left
anchors.top: commandPicker.bottom anchors.top: header.bottom
source: missionItem.editorQml source: missionItem.editorQml
visible: _currentItem visible: _currentItem
property var masterController: _masterController property var masterController: _masterController
property real availableWidth: _root.width - (_margin * 2) ///< How wide the editor should be property real availableWidth: _root.width - (_margin * 2) ///< How wide the editor should be
property var editorRoot: _root property var editorRoot: _root
} }
} // Rectangle }

328
src/PlanView/PlanView.qml

@ -25,6 +25,7 @@ import QGroundControl.FactControls 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
import QGroundControl.Mavlink 1.0 import QGroundControl.Mavlink 1.0
import QGroundControl.Controllers 1.0 import QGroundControl.Controllers 1.0
import QGroundControl.Airmap 1.0
/// Mission Editor /// Mission Editor
@ -33,27 +34,31 @@ QGCView {
viewPanel: panel viewPanel: panel
z: QGroundControl.zOrderTopMost z: QGroundControl.zOrderTopMost
property bool planControlColapsed: false
readonly property int _decimalPlaces: 8 readonly property int _decimalPlaces: 8
readonly property real _horizontalMargin: ScreenTools.defaultFontPixelWidth / 2 readonly property real _horizontalMargin: ScreenTools.defaultFontPixelWidth * 0.5
readonly property real _margin: ScreenTools.defaultFontPixelHeight * 0.5 readonly property real _margin: ScreenTools.defaultFontPixelHeight * 0.5
readonly property real _radius: ScreenTools.defaultFontPixelWidth * 0.5
readonly property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle readonly property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
readonly property real _rightPanelWidth: Math.min(parent.width / 3, ScreenTools.defaultFontPixelWidth * 30) readonly property real _rightPanelWidth: Math.min(parent.width / 3, ScreenTools.defaultFontPixelWidth * 30)
readonly property real _toolButtonTopMargin: parent.height - ScreenTools.availableHeight + (ScreenTools.defaultFontPixelHeight / 2) readonly property real _toolButtonTopMargin: parent.height - ScreenTools.availableHeight + (ScreenTools.defaultFontPixelHeight / 2)
readonly property var _defaultVehicleCoordinate: QtPositioning.coordinate(37.803784, -122.462276) readonly property var _defaultVehicleCoordinate: QtPositioning.coordinate(37.803784, -122.462276)
readonly property bool _waypointsOnlyMode: QGroundControl.corePlugin.options.missionWaypointsOnly readonly property bool _waypointsOnlyMode: QGroundControl.corePlugin.options.missionWaypointsOnly
property var _planMasterController: masterController property bool _enableAirMap: QGroundControl.settingsManager.appSettings.enableAirMap.rawValue
property var _missionController: _planMasterController.missionController property var _planMasterController: masterController
property var _geoFenceController: _planMasterController.geoFenceController property var _missionController: _planMasterController.missionController
property var _rallyPointController: _planMasterController.rallyPointController property var _geoFenceController: _planMasterController.geoFenceController
property var _visualItems: _missionController.visualItems property var _rallyPointController: _planMasterController.rallyPointController
property bool _lightWidgetBorders: editorMap.isSatelliteMap property var _visualItems: _missionController.visualItems
property bool _addWaypointOnClick: false property bool _lightWidgetBorders: editorMap.isSatelliteMap
property bool _addROIOnClick: false property bool _addWaypointOnClick: false
property bool _singleComplexItem: _missionController.complexMissionItemNames.length === 1 property bool _addROIOnClick: false
property real _toolbarHeight: _qgcView.height - ScreenTools.availableHeight property bool _singleComplexItem: _missionController.complexMissionItemNames.length === 1
property int _editingLayer: _layerMission property real _toolbarHeight: _qgcView.height - ScreenTools.availableHeight
property int _toolStripBottom: toolStrip.height + toolStrip.y property int _editingLayer: _layerMission
property int _toolStripBottom: toolStrip.height + toolStrip.y
readonly property int _layerMission: 1 readonly property int _layerMission: 1
readonly property int _layerGeoFence: 2 readonly property int _layerGeoFence: 2
@ -90,6 +95,15 @@ QGCView {
planMasterController: _planMasterController planMasterController: _planMasterController
} }
on_EnableAirMapChanged: {
if(_enableAirMap) {
planControlColapsed = true
airspaceControl.colapsed = false
} else {
planControlColapsed = false
}
}
Connections { Connections {
target: QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude target: QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude
@ -263,7 +277,7 @@ QGCView {
function accept() { function accept() {
var toIndex = toCombo.currentIndex var toIndex = toCombo.currentIndex
if (toIndex == 0) { if (toIndex === 0) {
toIndex = 1 toIndex = 1
} }
_missionController.moveMissionItem(_moveDialogMissionItemIndex, toIndex) _missionController.moveMissionItem(_moveDialogMissionItemIndex, toIndex)
@ -304,7 +318,7 @@ QGCView {
planView: true planView: true
// This is the center rectangle of the map which is not obscured by tools // This is the center rectangle of the map which is not obscured by tools
property rect centerViewport: Qt.rect(_leftToolWidth, _toolbarHeight, editorMap.width - _leftToolWidth - _rightPanelWidth, editorMap.height - _statusHeight - _toolbarHeight) property rect centerViewport: Qt.rect(_leftToolWidth, _toolbarHeight, editorMap.width - _leftToolWidth - _rightPanelWidth, editorMap.height - _statusHeight - _toolbarHeight)
property real _leftToolWidth: toolStrip.x + toolStrip.width property real _leftToolWidth: toolStrip.x + toolStrip.width
property real _statusHeight: waypointValuesDisplay.visible ? editorMap.height - waypointValuesDisplay.y : 0 property real _statusHeight: waypointValuesDisplay.visible ? editorMap.height - waypointValuesDisplay.y : 0
@ -481,105 +495,196 @@ QGCView {
} }
} }
} }
} // FlightMap }
//-----------------------------------------------------------
// Right pane for mission editing controls // Right pane for mission editing controls
Rectangle { Rectangle {
id: rightPanel id: rightPanel
anchors.bottom: parent.bottom
anchors.right: parent.right
height: ScreenTools.availableHeight height: ScreenTools.availableHeight
width: _rightPanelWidth width: _rightPanelWidth
color: qgcPal.window color: qgcPal.window
opacity: 0.2 opacity: 0.2
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth
} }
//-------------------------------------------------------
// Right Panel Controls
Item { Item {
anchors.fill: rightPanel anchors.fill: rightPanel
Column {
// Plan Element selector (Mission/Fence/Rally) id: rightControls
Row { spacing: ScreenTools.defaultFontPixelHeight * 0.5
id: planElementSelectorRow
anchors.topMargin: Math.round(ScreenTools.defaultFontPixelHeight / 3)
anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
spacing: _horizontalMargin anchors.top: parent.top
visible: QGroundControl.corePlugin.options.enablePlanViewSelector anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.25
//-------------------------------------------------------
readonly property real _buttonRadius: ScreenTools.defaultFontPixelHeight * 0.75 // Airmap Airspace Control
AirspaceControl {
ExclusiveGroup { id: airspaceControl
id: planElementSelectorGroup width: parent.width
onCurrentChanged: { visible: _enableAirMap
switch (current) { showColapse: false
case planElementMission: onColapsedChanged: {
_editingLayer = _layerMission if(!airspaceControl.colasped) {
break planControlColapsed = true
case planElementGeoFence:
_editingLayer = _layerGeoFence
break
case planElementRallyPoints:
_editingLayer = _layerRallyPoints
break
} }
} }
} }
//-------------------------------------------------------
QGCRadioButton { // Mission Controls (Colapsed)
id: planElementMission Rectangle {
exclusiveGroup: planElementSelectorGroup id: planColapsed
text: qsTr("Mission") width: parent.width
checked: true height: planControlColapsed ? colapsedRow.height + ScreenTools.defaultFontPixelHeight : 0
color: mapPal.text color: qgcPal.missionItemEditor
textStyle: Text.Outline radius: _radius
textStyleColor: mapPal.textOutline visible: planControlColapsed && _enableAirMap
} Row {
id: colapsedRow
Item { height: 1; width: 1 } spacing: ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
QGCRadioButton { anchors.leftMargin: ScreenTools.defaultFontPixelWidth
id: planElementGeoFence anchors.verticalCenter: parent.verticalCenter
exclusiveGroup: planElementSelectorGroup QGCColoredImage {
text: qsTr("Fence") width: height
color: mapPal.text height: ScreenTools.defaultFontPixelWidth * 2.5
textStyle: Text.Outline sourceSize.height: height
textStyleColor: mapPal.textOutline source: "qrc:/res/waypoint.svg"
color: qgcPal.text
anchors.verticalCenter: parent.verticalCenter
}
QGCLabel {
text: qsTr("Plan")
color: qgcPal.text
anchors.verticalCenter: parent.verticalCenter
}
}
QGCColoredImage {
width: height
height: ScreenTools.defaultFontPixelWidth * 2.5
sourceSize.height: height
source: "qrc:/airmap/expand.svg"
color: "white"
anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.verticalCenter: parent.verticalCenter
}
MouseArea {
anchors.fill: parent
onClicked: {
airspaceControl.colapsed = true
planControlColapsed = false
}
}
} }
//-------------------------------------------------------
Item { height: 1; width: 1 } // Mission Controls (Expanded)
Rectangle {
QGCRadioButton { id: planExpanded
id: planElementRallyPoints width: parent.width
exclusiveGroup: planElementSelectorGroup height: !planControlColapsed ? expandedCol.height + ScreenTools.defaultFontPixelHeight : 0
text: qsTr("Rally") color: qgcPal.missionItemEditor
color: mapPal.text radius: _radius
textStyle: Text.Outline visible: !planControlColapsed || !_enableAirMap
textStyleColor: mapPal.textOutline Item {
height: expandedCol.height
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
Column {
id: expandedCol
spacing: ScreenTools.defaultFontPixelHeight * 0.5
anchors.left: parent.left
anchors.right: parent.right
//-- Header
Row {
id: expandedRow
spacing: ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
anchors.leftMargin: ScreenTools.defaultFontPixelWidth
readonly property real _buttonRadius: ScreenTools.defaultFontPixelHeight * 0.75
QGCColoredImage {
width: height
height: ScreenTools.defaultFontPixelWidth * 2.5
sourceSize.height: height
source: "qrc:/res/waypoint.svg"
color: qgcPal.text
anchors.verticalCenter: parent.verticalCenter
}
QGCLabel {
text: qsTr("Plan")
color: qgcPal.text
visible: !QGroundControl.corePlugin.options.enablePlanViewSelector
anchors.verticalCenter: parent.verticalCenter
}
ExclusiveGroup {
id: planElementSelectorGroup
onCurrentChanged: {
switch (current) {
case planElementMission:
_editingLayer = _layerMission
break
case planElementGeoFence:
_editingLayer = _layerGeoFence
break
case planElementRallyPoints:
_editingLayer = _layerRallyPoints
break
}
}
}
QGCRadioButton {
id: planElementMission
exclusiveGroup: planElementSelectorGroup
text: qsTr("Mission")
checked: true
visible: QGroundControl.corePlugin.options.enablePlanViewSelector
anchors.verticalCenter: parent.verticalCenter
}
QGCRadioButton {
id: planElementGeoFence
exclusiveGroup: planElementSelectorGroup
text: qsTr("Fence")
visible: QGroundControl.corePlugin.options.enablePlanViewSelector
anchors.verticalCenter: parent.verticalCenter
}
QGCRadioButton {
id: planElementRallyPoints
exclusiveGroup: planElementSelectorGroup
text: qsTr("Rally")
visible: QGroundControl.corePlugin.options.enablePlanViewSelector
anchors.verticalCenter: parent.verticalCenter
}
}
}
}
} }
} // Row - Plan Element Selector }
//-------------------------------------------------------
// Mission Item Editor // Mission Item Editor
Item { Item {
id: missionItemEditor id: missionItemEditor
anchors.topMargin: ScreenTools.defaultFontPixelHeight / 2 anchors.left: parent.left
anchors.top: planElementSelectorRow.visible ? planElementSelectorRow.bottom : planElementSelectorRow.top anchors.right: parent.right
anchors.left: parent.left anchors.top: rightControls.bottom
anchors.right: parent.right anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.5
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
visible: _editingLayer == _layerMission anchors.bottomMargin: ScreenTools.defaultFontPixelHeight * 0.25
visible: _editingLayer == _layerMission && !planControlColapsed
QGCListView { QGCListView {
id: missionItemEditorListView id: missionItemEditorListView
anchors.fill: parent anchors.fill: parent
spacing: _margin / 2 spacing: ScreenTools.defaultFontPixelHeight * 0.5
orientation: ListView.Vertical orientation: ListView.Vertical
model: _missionController.visualItems model: _missionController.visualItems
cacheBuffer: Math.max(height * 2, 0) cacheBuffer: Math.max(height * 2, 0)
clip: true clip: true
currentIndex: _missionController.currentPlanViewIndex currentIndex: _missionController.currentPlanViewIndex
highlightMoveDuration: 250 highlightMoveDuration: 250
visible: _editingLayer == _layerMission && !planControlColapsed
//-- List Elements
delegate: MissionItemEditor { delegate: MissionItemEditor {
map: editorMap map: editorMap
masterController: _planMasterController masterController: _planMasterController
@ -587,9 +692,7 @@ QGCView {
width: parent.width width: parent.width
readOnly: false readOnly: false
rootQgcView: _qgcView rootQgcView: _qgcView
onClicked: _missionController.setCurrentPlanViewIndex(object.sequenceNumber, false) onClicked: _missionController.setCurrentPlanViewIndex(object.sequenceNumber, false)
onRemove: { onRemove: {
var removeIndex = index var removeIndex = index
_missionController.removeMissionItem(removeIndex) _missionController.removeMissionItem(removeIndex)
@ -598,17 +701,15 @@ QGCView {
} }
_missionController.setCurrentPlanViewIndex(removeIndex, true) _missionController.setCurrentPlanViewIndex(removeIndex, true)
} }
onInsertWaypoint: insertSimpleMissionItem(editorMap.center, index) onInsertWaypoint: insertSimpleMissionItem(editorMap.center, index)
onInsertComplexItem: insertComplexMissionItem(complexItemName, editorMap.center, index) onInsertComplexItem: insertComplexMissionItem(complexItemName, editorMap.center, index)
} }
} // QGCListView }
} // Item - Mission Item editor }
// GeoFence Editor // GeoFence Editor
GeoFenceEditor { GeoFenceEditor {
anchors.topMargin: ScreenTools.defaultFontPixelHeight / 2 anchors.top: rightControls.bottom
anchors.top: planElementSelectorRow.bottom anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.5
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
availableHeight: ScreenTools.availableHeight availableHeight: ScreenTools.availableHeight
@ -616,30 +717,27 @@ QGCView {
flightMap: editorMap flightMap: editorMap
visible: _editingLayer == _layerGeoFence visible: _editingLayer == _layerGeoFence
} }
// Rally Point Editor // Rally Point Editor
RallyPointEditorHeader { RallyPointEditorHeader {
id: rallyPointHeader id: rallyPointHeader
anchors.topMargin: ScreenTools.defaultFontPixelHeight / 2 anchors.top: rightControls.bottom
anchors.top: planElementSelectorRow.bottom anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.5
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
visible: _editingLayer == _layerRallyPoints visible: _editingLayer == _layerRallyPoints
controller: _rallyPointController controller: _rallyPointController
} }
RallyPointItemEditor { RallyPointItemEditor {
id: rallyPointEditor id: rallyPointEditor
anchors.topMargin: ScreenTools.defaultFontPixelHeight / 2 anchors.top: rallyPointHeader.bottom
anchors.top: rallyPointHeader.bottom anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.5
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
visible: _editingLayer == _layerRallyPoints && _rallyPointController.points.count visible: _editingLayer == _layerRallyPoints && _rallyPointController.points.count
rallyPoint: _rallyPointController.currentRallyPoint rallyPoint: _rallyPointController.currentRallyPoint
controller: _rallyPointController controller: _rallyPointController
} }
} // Right panel }
MapScale { MapScale {
id: mapScale id: mapScale
@ -660,7 +758,7 @@ QGCView {
missionItems: _missionController.visualItems missionItems: _missionController.visualItems
visible: _editingLayer === _layerMission && (_toolStripBottom + mapScale.height) < y && QGroundControl.corePlugin.options.showMissionStatus visible: _editingLayer === _layerMission && (_toolStripBottom + mapScale.height) < y && QGroundControl.corePlugin.options.showMissionStatus
} }
} // QGCViewPanel }
Component { Component {
id: syncLoadFromVehicleOverwrite id: syncLoadFromVehicleOverwrite

1
src/PlanView/RallyPointEditorHeader.qml

@ -28,7 +28,6 @@ QGCFlickable {
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
text: qsTr("Rally Points") text: qsTr("Rally Points")
color: "black"
} }
Rectangle { Rectangle {

12
src/PlanView/RallyPointItemEditor.qml

@ -17,8 +17,7 @@ Rectangle {
property var rallyPoint ///< RallyPoint object associated with editor property var rallyPoint ///< RallyPoint object associated with editor
property var controller ///< RallyPointController property var controller ///< RallyPointController
property bool _currentItem: rallyPoint ? rallyPoint == controller.currentRallyPoint : false property bool _currentItem: rallyPoint ? rallyPoint === controller.currentRallyPoint : false
property color _outerTextColor: _currentItem ? "black" : qgcPal.text
readonly property real _margin: ScreenTools.defaultFontPixelWidth / 2 readonly property real _margin: ScreenTools.defaultFontPixelWidth / 2
readonly property real _radius: ScreenTools.defaultFontPixelWidth / 2 readonly property real _radius: ScreenTools.defaultFontPixelWidth / 2
@ -47,10 +46,9 @@ Rectangle {
anchors.left: indicator.right anchors.left: indicator.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: qsTr("Rally Point") text: qsTr("Rally Point")
color: _outerTextColor
} }
Image { QGCColoredImage {
id: hamburger id: hamburger
anchors.rightMargin: _margin anchors.rightMargin: _margin
anchors.right: parent.right anchors.right: parent.right
@ -59,14 +57,12 @@ Rectangle {
height: width height: width
sourceSize.height: height sourceSize.height: height
source: "qrc:/qmlimages/Hamburger.svg" source: "qrc:/qmlimages/Hamburger.svg"
color: qgcPal.text
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: hamburgerMenu.popup() onClicked: hamburgerMenu.popup()
Menu { Menu {
id: hamburgerMenu id: hamburgerMenu
MenuItem { MenuItem {
text: qsTr("Delete") text: qsTr("Delete")
onTriggered: controller.removePoint(rallyPoint) onTriggered: controller.removePoint(rallyPoint)
@ -74,7 +70,7 @@ Rectangle {
} }
} }
} }
} // Item - titleBar }
Rectangle { Rectangle {
id: valuesRect id: valuesRect

4
src/QGCPalette.cc

@ -73,13 +73,13 @@ void QGCPalette::_buildMap(void)
DECLARE_QGC_COLOR(alertBackground, "#eecc44", "#eecc44", "#eecc44", "#eecc44") DECLARE_QGC_COLOR(alertBackground, "#eecc44", "#eecc44", "#eecc44", "#eecc44")
DECLARE_QGC_COLOR(alertBorder, "#808080", "#808080", "#808080", "#808080") DECLARE_QGC_COLOR(alertBorder, "#808080", "#808080", "#808080", "#808080")
DECLARE_QGC_COLOR(alertText, "#000000", "#000000", "#000000", "#000000") DECLARE_QGC_COLOR(alertText, "#000000", "#000000", "#000000", "#000000")
DECLARE_QGC_COLOR(missionItemEditor, "#585858", "#8cb3be", "#585858", "#8cb3be") DECLARE_QGC_COLOR(missionItemEditor, "#585858", "#dbfef8", "#585858", "#585d83")
// Colors are not affecting by theming // Colors are not affecting by theming
DECLARE_QGC_COLOR(mapWidgetBorderLight, "#ffffff", "#ffffff", "#ffffff", "#ffffff") DECLARE_QGC_COLOR(mapWidgetBorderLight, "#ffffff", "#ffffff", "#ffffff", "#ffffff")
DECLARE_QGC_COLOR(mapWidgetBorderDark, "#000000", "#000000", "#000000", "#000000") DECLARE_QGC_COLOR(mapWidgetBorderDark, "#000000", "#000000", "#000000", "#000000")
DECLARE_QGC_COLOR(brandingPurple, "#4A2C6D", "#4A2C6D", "#4A2C6D", "#4A2C6D") DECLARE_QGC_COLOR(brandingPurple, "#4A2C6D", "#4A2C6D", "#4A2C6D", "#4A2C6D")
DECLARE_QGC_COLOR(brandingBlue, "#48D6FF", "#48D6FF", "#48D6FF", "#48D6FF") DECLARE_QGC_COLOR(brandingBlue, "#48D6FF", "#6045c5", "#48D6FF", "#6045c5")
} }
void QGCPalette::setColorGroupEnabled(bool enabled) void QGCPalette::setColorGroupEnabled(bool enabled)

1
src/QmlControls/PageView.qml

@ -10,6 +10,7 @@ Rectangle {
id: _root id: _root
height: pageFlickable.y + pageFlickable.height + _margins height: pageFlickable.y + pageFlickable.height + _margins
color: qgcPal.window color: qgcPal.window
radius: ScreenTools.defaultFontPixelWidth * 0.5
property var qgcView ///< QGCView to use for showing dialogs property var qgcView ///< QGCView to use for showing dialogs
property real maxHeight ///< Maximum height that should be taken, smaller than this is ok property real maxHeight ///< Maximum height that should be taken, smaller than this is ok

32
src/QmlControls/QmlTest.qml

@ -841,6 +841,38 @@ Rectangle {
text: palette.alertText text: palette.alertText
} }
// missionItemEditor
Loader {
sourceComponent: rowHeader
property var text: "missionItemEditor"
}
ClickableColor {
property var palette: QGCPalette { colorGroupEnabled: false }
color: palette.missionItemEditor
onColorSelected: palette.missionItemEditor = color
}
ClickableColor {
property var palette: QGCPalette { colorGroupEnabled: true }
color: palette.missionItemEditor
onColorSelected: palette.missionItemEditor = color
}
Text {
width: 80
height: 20
color: "black"
horizontalAlignment: Text.AlignHCenter
property var palette: QGCPalette { colorGroupEnabled: false }
text: palette.missionItemEditor
}
Text {
width: 80
height: 20
color: "black"
horizontalAlignment: Text.AlignHCenter
property var palette: QGCPalette { colorGroupEnabled: true }
text: palette.missionItemEditor
}
} }
Column { Column {

7
src/Settings/App.SettingsGroup.json

@ -183,5 +183,12 @@
"shortDescription": "Default firmware type for flashing", "shortDescription": "Default firmware type for flashing",
"type": "uint32", "type": "uint32",
"defaultValue": 12 "defaultValue": 12
},
{
"name": "EnableAirMap",
"shortDescription": "Enable AirMap",
"longDescription": "Enable AirMap Services",
"type": "bool",
"defaultValue": false
} }
] ]

11
src/Settings/AppSettings.cc

@ -37,6 +37,7 @@ const char* AppSettings::mapboxTokenName = "MapboxT
const char* AppSettings::esriTokenName = "EsriToken"; const char* AppSettings::esriTokenName = "EsriToken";
const char* AppSettings::defaultFirmwareTypeName = "DefaultFirmwareType"; const char* AppSettings::defaultFirmwareTypeName = "DefaultFirmwareType";
const char* AppSettings::gstDebugName = "GstreamerDebugLevel"; const char* AppSettings::gstDebugName = "GstreamerDebugLevel";
const char* AppSettings::enableAirMapName = "EnableAirMap";
const char* AppSettings::parameterFileExtension = "params"; const char* AppSettings::parameterFileExtension = "params";
const char* AppSettings::planFileExtension = "plan"; const char* AppSettings::planFileExtension = "plan";
@ -77,6 +78,7 @@ AppSettings::AppSettings(QObject* parent)
, _esriTokenFact(NULL) , _esriTokenFact(NULL)
, _defaultFirmwareTypeFact(NULL) , _defaultFirmwareTypeFact(NULL)
, _gstDebugFact(NULL) , _gstDebugFact(NULL)
, _enableAirMapFact(NULL)
{ {
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership); QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
qmlRegisterUncreatableType<AppSettings>("QGroundControl.SettingsManager", 1, 0, "AppSettings", "Reference only"); qmlRegisterUncreatableType<AppSettings>("QGroundControl.SettingsManager", 1, 0, "AppSettings", "Reference only");
@ -400,3 +402,12 @@ Fact* AppSettings::defaultFirmwareType(void)
return _defaultFirmwareTypeFact; return _defaultFirmwareTypeFact;
} }
Fact* AppSettings::enableAirMap(void)
{
if (!_enableAirMapFact) {
_enableAirMapFact = _createSettingsFact(enableAirMapName);
}
return _enableAirMapFact;
}

6
src/Settings/AppSettings.h

@ -41,6 +41,7 @@ public:
Q_PROPERTY(Fact* esriToken READ esriToken CONSTANT) Q_PROPERTY(Fact* esriToken READ esriToken CONSTANT)
Q_PROPERTY(Fact* defaultFirmwareType READ defaultFirmwareType CONSTANT) Q_PROPERTY(Fact* defaultFirmwareType READ defaultFirmwareType CONSTANT)
Q_PROPERTY(Fact* gstDebug READ gstDebug CONSTANT) Q_PROPERTY(Fact* gstDebug READ gstDebug CONSTANT)
Q_PROPERTY(Fact* enableAirMap READ enableAirMap CONSTANT)
Q_PROPERTY(QString missionSavePath READ missionSavePath NOTIFY savePathsChanged) Q_PROPERTY(QString missionSavePath READ missionSavePath NOTIFY savePathsChanged)
Q_PROPERTY(QString parameterSavePath READ parameterSavePath NOTIFY savePathsChanged) Q_PROPERTY(QString parameterSavePath READ parameterSavePath NOTIFY savePathsChanged)
@ -77,12 +78,13 @@ public:
Fact* esriToken (void); Fact* esriToken (void);
Fact* defaultFirmwareType (void); Fact* defaultFirmwareType (void);
Fact* gstDebug (void); Fact* gstDebug (void);
Fact* enableAirMap (void);
QString missionSavePath (void); QString missionSavePath (void);
QString parameterSavePath (void); QString parameterSavePath (void);
QString telemetrySavePath (void); QString telemetrySavePath (void);
QString logSavePath (void); QString logSavePath (void);
QString videoSavePath (void); QString videoSavePath (void);
static MAV_AUTOPILOT offlineEditingFirmwareTypeFromFirmwareType(MAV_AUTOPILOT firmwareType); static MAV_AUTOPILOT offlineEditingFirmwareTypeFromFirmwareType(MAV_AUTOPILOT firmwareType);
static MAV_TYPE offlineEditingVehicleTypeFromVehicleType(MAV_TYPE vehicleType); static MAV_TYPE offlineEditingVehicleTypeFromVehicleType(MAV_TYPE vehicleType);
@ -110,6 +112,7 @@ public:
static const char* esriTokenName; static const char* esriTokenName;
static const char* defaultFirmwareTypeName; static const char* defaultFirmwareTypeName;
static const char* gstDebugName; static const char* gstDebugName;
static const char* enableAirMapName;
// Application wide file extensions // Application wide file extensions
static const char* parameterFileExtension; static const char* parameterFileExtension;
@ -158,6 +161,7 @@ private:
SettingsFact* _esriTokenFact; SettingsFact* _esriTokenFact;
SettingsFact* _defaultFirmwareTypeFact; SettingsFact* _defaultFirmwareTypeFact;
SettingsFact* _gstDebugFact; SettingsFact* _gstDebugFact;
SettingsFact* _enableAirMapFact;
}; };
#endif #endif

8
src/api/QGCCorePlugin.cc

@ -30,6 +30,7 @@ public:
: pGeneral (NULL) : pGeneral (NULL)
, pCommLinks (NULL) , pCommLinks (NULL)
, pOfflineMaps (NULL) , pOfflineMaps (NULL)
, pAirmap (NULL)
, pMAVLink (NULL) , pMAVLink (NULL)
, pConsole (NULL) , pConsole (NULL)
#if defined(QT_DEBUG) #if defined(QT_DEBUG)
@ -53,6 +54,8 @@ public:
delete pCommLinks; delete pCommLinks;
if(pOfflineMaps) if(pOfflineMaps)
delete pOfflineMaps; delete pOfflineMaps;
if(pAirmap)
delete pAirmap;
if(pMAVLink) if(pMAVLink)
delete pMAVLink; delete pMAVLink;
if(pConsole) if(pConsole)
@ -70,6 +73,7 @@ public:
QmlComponentInfo* pGeneral; QmlComponentInfo* pGeneral;
QmlComponentInfo* pCommLinks; QmlComponentInfo* pCommLinks;
QmlComponentInfo* pOfflineMaps; QmlComponentInfo* pOfflineMaps;
QmlComponentInfo* pAirmap;
QmlComponentInfo* pMAVLink; QmlComponentInfo* pMAVLink;
QmlComponentInfo* pConsole; QmlComponentInfo* pConsole;
#if defined(QT_DEBUG) #if defined(QT_DEBUG)
@ -127,6 +131,10 @@ QVariantList &QGCCorePlugin::settingsPages()
QUrl::fromUserInput("qrc:/qml/OfflineMap.qml"), QUrl::fromUserInput("qrc:/qml/OfflineMap.qml"),
QUrl::fromUserInput("qrc:/res/waves.svg")); QUrl::fromUserInput("qrc:/res/waves.svg"));
_p->settingsList.append(QVariant::fromValue((QmlComponentInfo*)_p->pOfflineMaps)); _p->settingsList.append(QVariant::fromValue((QmlComponentInfo*)_p->pOfflineMaps));
_p->pAirmap = new QmlComponentInfo(tr("AirMap"),
QUrl::fromUserInput("qrc:/qml/AirmapSettings.qml"),
QUrl::fromUserInput(""));
_p->settingsList.append(QVariant::fromValue((QmlComponentInfo*)_p->pAirmap));
_p->pMAVLink = new QmlComponentInfo(tr("MAVLink"), _p->pMAVLink = new QmlComponentInfo(tr("MAVLink"),
QUrl::fromUserInput("qrc:/qml/MavlinkSettings.qml"), QUrl::fromUserInput("qrc:/qml/MavlinkSettings.qml"),
QUrl::fromUserInput("qrc:/res/waves.svg")); QUrl::fromUserInput("qrc:/res/waves.svg"));

13
src/api/QGCOptions.h

@ -121,18 +121,11 @@ class CustomInstrumentWidget : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
//-- Widget Position
enum Pos {
POS_TOP_RIGHT = 0,
POS_CENTER_RIGHT = 1,
POS_BOTTOM_RIGHT = 2,
};
Q_ENUMS(Pos)
CustomInstrumentWidget(QObject* parent = NULL); CustomInstrumentWidget(QObject* parent = NULL);
Q_PROPERTY(QUrl source READ source CONSTANT) Q_PROPERTY(QUrl source READ source CONSTANT)
Q_PROPERTY(Pos widgetPosition READ widgetPosition NOTIFY widgetPositionChanged) Q_PROPERTY(double widgetTopMargin READ widgetTopMargin NOTIFY widgetTopMarginChanged)
virtual QUrl source () { return QUrl(); } virtual QUrl source () { return QUrl(); }
virtual Pos widgetPosition () { return POS_CENTER_RIGHT; } virtual double widgetTopMargin () { return 0.0; }
signals: signals:
void widgetPositionChanged (); void widgetTopMarginChanged();
}; };

Loading…
Cancel
Save