From 6929d26958198bf8ffc17edeab06b301d7e4b203 Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Sat, 20 Jan 2018 09:13:35 -0500 Subject: [PATCH 1/6] Initial Mockup --- qgcresources.qrc | 6 + qgroundcontrol.qrc | 3 + resources/waypoint.svg | 10 ++ src/Airmap/AirspaceControl.qml | 237 ++++++++++++++++++++++++++++++++ src/Airmap/AirspaceRegulation.qml | 58 ++++++++ src/Airmap/QGroundControl.Airmap.qmldir | 4 + src/Airmap/images/advisory-icon.svg | 21 +++ src/Airmap/images/pencil.svg | 17 +++ src/PlanView/PlanView.qml | 194 +++++++------------------- 9 files changed, 404 insertions(+), 146 deletions(-) create mode 100644 resources/waypoint.svg create mode 100644 src/Airmap/AirspaceControl.qml create mode 100644 src/Airmap/AirspaceRegulation.qml create mode 100644 src/Airmap/QGroundControl.Airmap.qmldir create mode 100644 src/Airmap/images/advisory-icon.svg create mode 100644 src/Airmap/images/pencil.svg diff --git a/qgcresources.qrc b/qgcresources.qrc index 5b6fa54..c50d5ac 100644 --- a/qgcresources.qrc +++ b/qgcresources.qrc @@ -171,6 +171,11 @@ src/FirmwarePlugin/APM/APMBrandImageSub.png src/FirmwarePlugin/PX4/PX4BrandImage.png src/FlightMap/Images/sub.png + src/Airmap/images/advisory-icon.svg + + + src/Airmap/images/advisory-icon.svg + src/Airmap/images/pencil.svg resources/action.svg @@ -207,6 +212,7 @@ resources/wind-rose-arrow.svg resources/XDelete.svg resources/XDeleteBlack.svg + resources/waypoint.svg resources/icons/qgroundcontrol.ico diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc index 3668172..23b6816 100644 --- a/qgroundcontrol.qrc +++ b/qgroundcontrol.qrc @@ -15,6 +15,9 @@ src/ui/toolbar/JoystickIndicator.qml + src/Airmap/QGroundControl.Airmap.qmldir + src/Airmap/AirspaceControl.qml + src/Airmap/AirspaceRegulation.qml src/AnalyzeView/AnalyzeView.qml src/ui/AppSettings.qml src/ui/preferences/BluetoothSettings.qml diff --git a/resources/waypoint.svg b/resources/waypoint.svg new file mode 100644 index 0000000..257fb71 --- /dev/null +++ b/resources/waypoint.svg @@ -0,0 +1,10 @@ + + + + + + diff --git a/src/Airmap/AirspaceControl.qml b/src/Airmap/AirspaceControl.qml new file mode 100644 index 0000000..62e1b52 --- /dev/null +++ b/src/Airmap/AirspaceControl.qml @@ -0,0 +1,237 @@ +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 var colapsed: 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 + } + } + 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 + } + } + } + MouseArea { + anchors.fill: parent + enabled: !colapsed + 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 + 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 AIRMAP") + color: _colorWhite + font.pointSize: ScreenTools.smallFontPointSize + anchors.horizontalCenter: parent.horizontalCenter + } + } + } +} diff --git a/src/Airmap/AirspaceRegulation.qml b/src/Airmap/AirspaceRegulation.qml new file mode 100644 index 0000000..91a0af1 --- /dev/null +++ b/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 + } + } +} diff --git a/src/Airmap/QGroundControl.Airmap.qmldir b/src/Airmap/QGroundControl.Airmap.qmldir new file mode 100644 index 0000000..116917d --- /dev/null +++ b/src/Airmap/QGroundControl.Airmap.qmldir @@ -0,0 +1,4 @@ +Module QGroundControl.Airmap + +AirspaceControl 1.0 AirspaceControl.qml +AirspaceRegulation 1.0 AirspaceRegulation.qml diff --git a/src/Airmap/images/advisory-icon.svg b/src/Airmap/images/advisory-icon.svg new file mode 100644 index 0000000..9141d18 --- /dev/null +++ b/src/Airmap/images/advisory-icon.svg @@ -0,0 +1,21 @@ + + + + +Page 1 +Created with Sketch. + + + + + + diff --git a/src/Airmap/images/pencil.svg b/src/Airmap/images/pencil.svg new file mode 100644 index 0000000..2b98ce6 --- /dev/null +++ b/src/Airmap/images/pencil.svg @@ -0,0 +1,17 @@ + + + + + + diff --git a/src/PlanView/PlanView.qml b/src/PlanView/PlanView.qml index 53c2c2d..ef8c4a1 100644 --- a/src/PlanView/PlanView.qml +++ b/src/PlanView/PlanView.qml @@ -25,6 +25,7 @@ import QGroundControl.FactControls 1.0 import QGroundControl.Palette 1.0 import QGroundControl.Mavlink 1.0 import QGroundControl.Controllers 1.0 +import QGroundControl.Airmap 1.0 /// Mission Editor @@ -34,8 +35,9 @@ QGCView { z: QGroundControl.zOrderTopMost 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 _radius: ScreenTools.defaultFontPixelWidth * 0.5 readonly property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle readonly property real _rightPanelWidth: Math.min(parent.width / 3, ScreenTools.defaultFontPixelWidth * 30) readonly property real _toolButtonTopMargin: parent.height - ScreenTools.availableHeight + (ScreenTools.defaultFontPixelHeight / 2) @@ -303,7 +305,7 @@ QGCView { planView: true // 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 _statusHeight: waypointValuesDisplay.visible ? editorMap.height - waypointValuesDisplay.y : 0 @@ -480,165 +482,65 @@ QGCView { } } } - } // FlightMap - + } + //----------------------------------------------------------- // Right pane for mission editing controls Rectangle { id: rightPanel - anchors.bottom: parent.bottom - anchors.right: parent.right height: ScreenTools.availableHeight width: _rightPanelWidth color: qgcPal.window opacity: 0.2 + anchors.bottom: parent.bottom + anchors.right: parent.right + anchors.rightMargin: ScreenTools.defaultFontPixelWidth } - Item { - anchors.fill: rightPanel - - // Plan Element selector (Mission/Fence/Rally) - Row { - id: planElementSelectorRow - anchors.topMargin: Math.round(ScreenTools.defaultFontPixelHeight / 3) - anchors.top: parent.top + anchors.fill: rightPanel + Column { + id: rightControls + spacing: ScreenTools.defaultFontPixelHeight * 0.25 anchors.left: parent.left anchors.right: parent.right - spacing: _horizontalMargin - visible: QGroundControl.corePlugin.options.enablePlanViewSelector - - readonly property real _buttonRadius: ScreenTools.defaultFontPixelHeight * 0.75 - - 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 - color: mapPal.text - textStyle: Text.Outline - textStyleColor: mapPal.textOutline - } - - Item { height: 1; width: 1 } - - QGCRadioButton { - id: planElementGeoFence - exclusiveGroup: planElementSelectorGroup - text: qsTr("Fence") - color: mapPal.text - textStyle: Text.Outline - textStyleColor: mapPal.textOutline - } - - Item { height: 1; width: 1 } - - QGCRadioButton { - id: planElementRallyPoints - exclusiveGroup: planElementSelectorGroup - text: qsTr("Rally") - color: mapPal.text - textStyle: Text.Outline - textStyleColor: mapPal.textOutline + anchors.top: parent.top + anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.25 + //------------------------------------------------------- + // Airmap Airspace Control + AirspaceControl { + width: parent.width } - } // Row - Plan Element Selector - - // Mission Item Editor - Item { - id: missionItemEditor - anchors.topMargin: ScreenTools.defaultFontPixelHeight / 2 - anchors.top: planElementSelectorRow.visible ? planElementSelectorRow.bottom : planElementSelectorRow.top - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - visible: _editingLayer == _layerMission - - QGCListView { - id: missionItemEditorListView - anchors.fill: parent - spacing: _margin / 2 - orientation: ListView.Vertical - model: _missionController.visualItems - cacheBuffer: Math.max(height * 2, 0) - clip: true - currentIndex: _missionController.currentPlanViewIndex - highlightMoveDuration: 250 - - delegate: MissionItemEditor { - map: editorMap - masterController: _planMasterController - missionItem: object - width: parent.width - readOnly: false - rootQgcView: _qgcView - - onClicked: _missionController.setCurrentPlanViewIndex(object.sequenceNumber, false) - - onRemove: { - var removeIndex = index - _missionController.removeMissionItem(removeIndex) - if (removeIndex >= _missionController.visualItems.count) { - removeIndex-- - } - _missionController.setCurrentPlanViewIndex(removeIndex, true) + //------------------------------------------------------- + // Mission Controls (Colapsed) + Rectangle { + id: planColapsed + width: parent.width + height: colapsedRow.height + ScreenTools.defaultFontPixelHeight + color: qgcPal.missionItemEditor + radius: _radius + 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:/res/waypoint.svg" + color: qgcPal.text + anchors.verticalCenter: parent.verticalCenter + } + QGCLabel { + id: colapsedPlanLabel + text: qsTr("Plan") + color: qgcPal.text + anchors.verticalCenter: parent.verticalCenter } - - onInsertWaypoint: insertSimpleMissionItem(editorMap.center, index) - onInsertComplexItem: insertComplexMissionItem(complexItemName, editorMap.center, index) } - } // QGCListView - } // Item - Mission Item editor - - // GeoFence Editor - GeoFenceEditor { - anchors.topMargin: ScreenTools.defaultFontPixelHeight / 2 - anchors.top: planElementSelectorRow.bottom - anchors.left: parent.left - anchors.right: parent.right - availableHeight: ScreenTools.availableHeight - myGeoFenceController: _geoFenceController - flightMap: editorMap - visible: _editingLayer == _layerGeoFence - } - - // Rally Point Editor - - RallyPointEditorHeader { - id: rallyPointHeader - anchors.topMargin: ScreenTools.defaultFontPixelHeight / 2 - anchors.top: planElementSelectorRow.bottom - anchors.left: parent.left - anchors.right: parent.right - visible: _editingLayer == _layerRallyPoints - controller: _rallyPointController - } - - RallyPointItemEditor { - id: rallyPointEditor - anchors.topMargin: ScreenTools.defaultFontPixelHeight / 2 - anchors.top: rallyPointHeader.bottom - anchors.left: parent.left - anchors.right: parent.right - visible: _editingLayer == _layerRallyPoints && _rallyPointController.points.count - rallyPoint: _rallyPointController.currentRallyPoint - controller: _rallyPointController + } } - } // Right panel + } MapScale { id: mapScale From bbde40eb938055b428acb2cae43228baf5b962f3 Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Sat, 20 Jan 2018 12:53:35 -0500 Subject: [PATCH 2/6] Expand/Colapse Controllers Adjust colors Remove unused image --- qgcresources.qrc | 2 + src/Airmap/AirspaceControl.qml | 17 ++- src/FlightMap/Images/HomeBlack.svg | 9 -- src/PlanView/GeoFenceEditor.qml | 2 +- src/PlanView/MissionItemEditor.qml | 137 +++++++++++------------ src/PlanView/PlanView.qml | 192 +++++++++++++++++++++++++++++++- src/PlanView/RallyPointEditorHeader.qml | 1 - src/PlanView/RallyPointItemEditor.qml | 12 +- src/QGCPalette.cc | 4 +- src/QmlControls/QmlTest.qml | 32 ++++++ 10 files changed, 304 insertions(+), 104 deletions(-) delete mode 100644 src/FlightMap/Images/HomeBlack.svg diff --git a/qgcresources.qrc b/qgcresources.qrc index c50d5ac..5cf8cb3 100644 --- a/qgcresources.qrc +++ b/qgcresources.qrc @@ -123,6 +123,7 @@ src/FlightMap/Images/ZoomPlus.svg src/FlightMap/Images/ZoomMinus.svg src/FlightMap/Images/Help.svg + src/FlightMap/Images/Home.svg src/FlightMap/Images/HelpBlack.svg src/FlightMap/Images/MapAddMission.svg src/FlightMap/Images/MapAddMissionBlack.svg @@ -175,6 +176,7 @@ src/Airmap/images/advisory-icon.svg + src/Airmap/images/expand.svg src/Airmap/images/pencil.svg diff --git a/src/Airmap/AirspaceControl.qml b/src/Airmap/AirspaceControl.qml index 62e1b52..5cbd651 100644 --- a/src/Airmap/AirspaceControl.qml +++ b/src/Airmap/AirspaceControl.qml @@ -63,6 +63,16 @@ Item { 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 @@ -115,11 +125,6 @@ Item { } } } - MouseArea { - anchors.fill: parent - enabled: !colapsed - onClicked: colapsed = true - } } //-- Contents (Brown Box) Rectangle { @@ -189,7 +194,7 @@ Item { } Rectangle { id: regButton - height: regLabel.height + ScreenTools.defaultFontPixelHeight + height: regLabel.height + ScreenTools.defaultFontPixelHeight * 0.5 radius: 2 color: _colorMidBrown Layout.fillWidth: true diff --git a/src/FlightMap/Images/HomeBlack.svg b/src/FlightMap/Images/HomeBlack.svg deleted file mode 100644 index ae78ea2..0000000 --- a/src/FlightMap/Images/HomeBlack.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/src/PlanView/GeoFenceEditor.qml b/src/PlanView/GeoFenceEditor.qml index dd592b5..094e418 100644 --- a/src/PlanView/GeoFenceEditor.qml +++ b/src/PlanView/GeoFenceEditor.qml @@ -42,7 +42,7 @@ QGCFlickable { anchors.left: parent.left anchors.top: parent.top text: qsTr("GeoFence") - color: "black" + anchors.leftMargin: ScreenTools.defaultFontPixelWidth } Rectangle { diff --git a/src/PlanView/MissionItemEditor.qml b/src/PlanView/MissionItemEditor.qml index dd64358..2eb46f0 100644 --- a/src/PlanView/MissionItemEditor.qml +++ b/src/PlanView/MissionItemEditor.qml @@ -15,7 +15,7 @@ import QGroundControl.Palette 1.0 /// Mission item edit control Rectangle { 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 radius: _radius @@ -33,15 +33,14 @@ Rectangle { property var _masterController: masterController property var _missionController: _masterController.missionController property bool _currentItem: missionItem.isCurrentItem - property color _outerTextColor: _currentItem ? qgcPal.primaryButtonText : qgcPal.text property bool _noMissionItemsAdded: ListView.view.model.count === 1 property real _sectionSpacer: ScreenTools.defaultFontPixelWidth / 2 // spacing between section headings property bool _singleComplexItem: _missionController.complexMissionItemNames.length === 1 readonly property real _editFieldWidth: Math.min(width - _margin * 2, ScreenTools.defaultFontPixelWidth * 12) - readonly property real _margin: ScreenTools.defaultFontPixelWidth / 2 - readonly property real _radius: ScreenTools.defaultFontPixelWidth / 2 - readonly property real _hamburgerSize: commandPicker.height * 0.75 + readonly property real _margin: ScreenTools.defaultFontPixelWidth * 0.5 + readonly property real _radius: ScreenTools.defaultFontPixelWidth * 0.5 + readonly property real _hamburgerSize: header.height * 0.75 readonly property bool _waypointsOnlyMode: QGroundControl.corePlugin.options.missionWaypointsOnly QGCPalette { @@ -52,7 +51,6 @@ Rectangle { FocusScope { id: currentItemScope anchors.fill: parent - MouseArea { anchors.fill: parent onClicked: { @@ -62,38 +60,76 @@ Rectangle { } } + //-- Dialog Component { id: editPositionDialog - EditPositionDialog { coordinate: missionItem.coordinate onCoordinateChanged: missionItem.coordinate = coordinate } } - - QGCLabel { - id: label - anchors.verticalCenter: commandPicker.verticalCenter - anchors.leftMargin: _margin + //-- Header + Row { + id: header + spacing: ScreenTools.defaultFontPixelWidth + height: ScreenTools.defaultFontPixelHeight * 3 + anchors.verticalCenter: editorLoader.visible ? undefined : parent.verticalCenter anchors.left: parent.left - text: missionItem.homePosition ? "H" : missionItem.sequenceNumber - color: _outerTextColor + anchors.leftMargin: ScreenTools.defaultFontPixelWidth + 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 { id: hamburger anchors.rightMargin: ScreenTools.defaultFontPixelWidth anchors.right: parent.right - anchors.verticalCenter: commandPicker.verticalCenter + anchors.verticalCenter: header.verticalCenter width: _hamburgerSize height: _hamburgerSize sourceSize.height: _hamburgerSize source: "qrc:/qmlimages/Hamburger.svg" - visible: missionItem.isCurrentItem && missionItem.sequenceNumber != 0 - color: qgcPal.windowShade - + visible: missionItem.isCurrentItem && missionItem.sequenceNumber !== 0 + color: qgcPal.text } - + //-- Hamburger Menu QGCMouseArea { fillItem: hamburger visible: hamburger.visible @@ -101,67 +137,54 @@ Rectangle { currentItemScope.focus = true hamburgerMenu.popup() } - Menu { id: hamburgerMenu - MenuItem { text: qsTr("Insert waypoint") onTriggered: insertWaypoint() } - Menu { id: patternMenu title: qsTr("Insert pattern") visible: !_singleComplexItem - Instantiator { model: _missionController.complexMissionItemNames - onObjectAdded: patternMenu.insertItem(index, object) onObjectRemoved: patternMenu.removeItem(object) - MenuItem { text: modelData onTriggered: insertComplexItem(modelData) } } } - MenuItem { text: qsTr("Insert ") + _missionController.complexMissionItemNames[0] visible: _singleComplexItem onTriggered: insertComplexItem(_missionController.complexMissionItemNames[0]) } - MenuItem { text: qsTr("Delete") onTriggered: remove() } - MenuItem { text: qsTr("Change command...") onTriggered: commandPicker.clicked() visible: !_waypointsOnlyMode } - MenuItem { text: qsTr("Edit position...") visible: missionItem.specifiesCoordinate onTriggered: qgcView.showDialog(editPositionDialog, qsTr("Edit Position"), qgcView.showDialogDefaultWidth, StandardButton.Cancel) } - MenuSeparator { visible: missionItem.isSimpleItem && !_waypointsOnlyMode } - MenuItem { - text: qsTr("Show all values") - checkable: true - checked: missionItem.isSimpleItem ? missionItem.rawEdit : false - visible: missionItem.isSimpleItem && !_waypointsOnlyMode - - onTriggered: { + text: qsTr("Show all values") + checkable: true + checked: missionItem.isSimpleItem ? missionItem.rawEdit : false + visible: missionItem.isSimpleItem && !_waypointsOnlyMode + onTriggered: { if (missionItem.rawEdit) { if (missionItem.friendlyEditAllowed) { missionItem.rawEdit = false @@ -176,48 +199,16 @@ Rectangle { } } } - - 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 - } - + //-- Editor Content Loader { id: editorLoader anchors.leftMargin: _margin - anchors.topMargin: _margin anchors.left: parent.left - anchors.top: commandPicker.bottom + anchors.top: header.bottom source: missionItem.editorQml visible: _currentItem - property var masterController: _masterController property real availableWidth: _root.width - (_margin * 2) ///< How wide the editor should be property var editorRoot: _root } -} // Rectangle +} diff --git a/src/PlanView/PlanView.qml b/src/PlanView/PlanView.qml index ef8c4a1..da6cbec 100644 --- a/src/PlanView/PlanView.qml +++ b/src/PlanView/PlanView.qml @@ -34,6 +34,8 @@ QGCView { viewPanel: panel z: QGroundControl.zOrderTopMost + property bool planControlColapsed: false + readonly property int _decimalPlaces: 8 readonly property real _horizontalMargin: ScreenTools.defaultFontPixelWidth * 0.5 readonly property real _margin: ScreenTools.defaultFontPixelHeight * 0.5 @@ -495,11 +497,13 @@ QGCView { anchors.right: parent.right anchors.rightMargin: ScreenTools.defaultFontPixelWidth } + //------------------------------------------------------- + // Right Panel Controls Item { anchors.fill: rightPanel Column { id: rightControls - spacing: ScreenTools.defaultFontPixelHeight * 0.25 + spacing: ScreenTools.defaultFontPixelHeight * 0.5 anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top @@ -507,16 +511,23 @@ QGCView { //------------------------------------------------------- // Airmap Airspace Control AirspaceControl { + id: airspaceControl width: parent.width + onColapsedChanged: { + if(!airspaceControl.colasped) { + planControlColapsed = true + } + } } //------------------------------------------------------- // Mission Controls (Colapsed) Rectangle { id: planColapsed width: parent.width - height: colapsedRow.height + ScreenTools.defaultFontPixelHeight + height: planControlColapsed ? colapsedRow.height + ScreenTools.defaultFontPixelHeight : 0 color: qgcPal.missionItemEditor radius: _radius + visible: planControlColapsed Row { id: colapsedRow spacing: ScreenTools.defaultFontPixelWidth @@ -532,13 +543,186 @@ QGCView { anchors.verticalCenter: parent.verticalCenter } QGCLabel { - id: colapsedPlanLabel 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: _colorWhite + anchors.right: parent.right + anchors.rightMargin: ScreenTools.defaultFontPixelWidth + anchors.verticalCenter: parent.verticalCenter + } + MouseArea { + anchors.fill: parent + onClicked: { + airspaceControl.colapsed = true + planControlColapsed = false + } + } } + //------------------------------------------------------- + // Mission Controls (Expanded) + Rectangle { + id: planExpanded + width: parent.width + height: !planControlColapsed ? expandedCol.height + ScreenTools.defaultFontPixelHeight : 0 + color: qgcPal.missionItemEditor + radius: _radius + visible: !planControlColapsed + 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 + } + } + } + } + } + } + //------------------------------------------------------- + // Mission Item Editor + Item { + id: missionItemEditor + anchors.left: parent.left + anchors.right: parent.right + anchors.top: rightControls.bottom + anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.5 + anchors.bottom: parent.bottom + anchors.bottomMargin: ScreenTools.defaultFontPixelHeight * 0.25 + visible: _editingLayer == _layerMission && !planControlColapsed + QGCListView { + id: missionItemEditorListView + anchors.fill: parent + spacing: ScreenTools.defaultFontPixelHeight * 0.5 + orientation: ListView.Vertical + model: _missionController.visualItems + cacheBuffer: Math.max(height * 2, 0) + clip: true + currentIndex: _missionController.currentPlanViewIndex + highlightMoveDuration: 250 + visible: _editingLayer == _layerMission && !planControlColapsed + //-- List Elements + delegate: MissionItemEditor { + map: editorMap + masterController: _planMasterController + missionItem: object + width: parent.width + readOnly: false + rootQgcView: _qgcView + onClicked: _missionController.setCurrentPlanViewIndex(object.sequenceNumber, false) + onRemove: { + var removeIndex = index + _missionController.removeMissionItem(removeIndex) + if (removeIndex >= _missionController.visualItems.count) { + removeIndex-- + } + _missionController.setCurrentPlanViewIndex(removeIndex, true) + } + onInsertWaypoint: insertSimpleMissionItem(editorMap.center, index) + onInsertComplexItem: insertComplexMissionItem(complexItemName, editorMap.center, index) + } + } + } + // GeoFence Editor + GeoFenceEditor { + anchors.top: rightControls.bottom + anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.5 + anchors.left: parent.left + anchors.right: parent.right + availableHeight: ScreenTools.availableHeight + myGeoFenceController: _geoFenceController + flightMap: editorMap + visible: _editingLayer == _layerGeoFence + } + // Rally Point Editor + RallyPointEditorHeader { + id: rallyPointHeader + anchors.top: rightControls.bottom + anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.5 + anchors.left: parent.left + anchors.right: parent.right + visible: _editingLayer == _layerRallyPoints + controller: _rallyPointController + } + RallyPointItemEditor { + id: rallyPointEditor + anchors.top: rallyPointHeader.bottom + anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.5 + anchors.left: parent.left + anchors.right: parent.right + visible: _editingLayer == _layerRallyPoints && _rallyPointController.points.count + rallyPoint: _rallyPointController.currentRallyPoint + controller: _rallyPointController } } @@ -561,7 +745,7 @@ QGCView { missionItems: _missionController.visualItems visible: _editingLayer === _layerMission && (ScreenTools.isMobile ? height < Screen.height * 0.25 : true) } - } // QGCViewPanel + } Component { id: syncLoadFromVehicleOverwrite diff --git a/src/PlanView/RallyPointEditorHeader.qml b/src/PlanView/RallyPointEditorHeader.qml index ff0a862..0c5d677 100644 --- a/src/PlanView/RallyPointEditorHeader.qml +++ b/src/PlanView/RallyPointEditorHeader.qml @@ -28,7 +28,6 @@ QGCFlickable { anchors.left: parent.left anchors.top: parent.top text: qsTr("Rally Points") - color: "black" } Rectangle { diff --git a/src/PlanView/RallyPointItemEditor.qml b/src/PlanView/RallyPointItemEditor.qml index 775f322..9151301 100644 --- a/src/PlanView/RallyPointItemEditor.qml +++ b/src/PlanView/RallyPointItemEditor.qml @@ -17,8 +17,7 @@ Rectangle { property var rallyPoint ///< RallyPoint object associated with editor property var controller ///< RallyPointController - property bool _currentItem: rallyPoint ? rallyPoint == controller.currentRallyPoint : false - property color _outerTextColor: _currentItem ? "black" : qgcPal.text + property bool _currentItem: rallyPoint ? rallyPoint === controller.currentRallyPoint : false readonly property real _margin: ScreenTools.defaultFontPixelWidth / 2 readonly property real _radius: ScreenTools.defaultFontPixelWidth / 2 @@ -47,10 +46,9 @@ Rectangle { anchors.left: indicator.right anchors.verticalCenter: parent.verticalCenter text: qsTr("Rally Point") - color: _outerTextColor } - Image { + QGCColoredImage { id: hamburger anchors.rightMargin: _margin anchors.right: parent.right @@ -59,14 +57,12 @@ Rectangle { height: width sourceSize.height: height source: "qrc:/qmlimages/Hamburger.svg" - + color: qgcPal.text MouseArea { anchors.fill: parent onClicked: hamburgerMenu.popup() - Menu { id: hamburgerMenu - MenuItem { text: qsTr("Delete") onTriggered: controller.removePoint(rallyPoint) @@ -74,7 +70,7 @@ Rectangle { } } } - } // Item - titleBar + } Rectangle { id: valuesRect diff --git a/src/QGCPalette.cc b/src/QGCPalette.cc index ec5ac8f..5af46e3 100644 --- a/src/QGCPalette.cc +++ b/src/QGCPalette.cc @@ -73,13 +73,13 @@ void QGCPalette::_buildMap(void) DECLARE_QGC_COLOR(alertBackground, "#eecc44", "#eecc44", "#eecc44", "#eecc44") DECLARE_QGC_COLOR(alertBorder, "#808080", "#808080", "#808080", "#808080") DECLARE_QGC_COLOR(alertText, "#000000", "#000000", "#000000", "#000000") - DECLARE_QGC_COLOR(missionItemEditor, "#585858", "#8cb3be", "#585858", "#8cb3be") + DECLARE_QGC_COLOR(missionItemEditor, "#585858", "#a39fd3", "#585858", "#4e4480") // Colors are not affecting by theming DECLARE_QGC_COLOR(mapWidgetBorderLight, "#ffffff", "#ffffff", "#ffffff", "#ffffff") DECLARE_QGC_COLOR(mapWidgetBorderDark, "#000000", "#000000", "#000000", "#000000") 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) diff --git a/src/QmlControls/QmlTest.qml b/src/QmlControls/QmlTest.qml index 92193f7..7ff8acb 100644 --- a/src/QmlControls/QmlTest.qml +++ b/src/QmlControls/QmlTest.qml @@ -841,6 +841,38 @@ Rectangle { 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 { From ff661fa7d30b85da9308c4f554e247d6678a2ff1 Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Sat, 20 Jan 2018 12:53:48 -0500 Subject: [PATCH 3/6] Add expand icon --- src/Airmap/images/expand.svg | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/Airmap/images/expand.svg diff --git a/src/Airmap/images/expand.svg b/src/Airmap/images/expand.svg new file mode 100644 index 0000000..196447d --- /dev/null +++ b/src/Airmap/images/expand.svg @@ -0,0 +1,9 @@ + + + + + + From 365c6d7156d62c4a237e0bd8e832c8548276b802 Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Sat, 20 Jan 2018 14:44:08 -0500 Subject: [PATCH 4/6] Control on Fly View Eliminated flight widget "states" Define flight widget top margin (plugin options) --- qgcresources.qrc | 1 + src/Airmap/AirspaceControl.qml | 19 ++++- src/Airmap/images/colapse.svg | 9 +++ src/FlightDisplay/FlightDisplayViewWidgets.qml | 89 ++++++++-------------- .../Widgets/QGCInstrumentWidgetAlternate.qml | 1 + src/PlanView/PlanView.qml | 5 +- src/QGCPalette.cc | 2 +- src/QmlControls/PageView.qml | 1 + src/api/QGCOptions.h | 13 +--- 9 files changed, 69 insertions(+), 71 deletions(-) create mode 100644 src/Airmap/images/colapse.svg diff --git a/qgcresources.qrc b/qgcresources.qrc index 5cf8cb3..019dfa2 100644 --- a/qgcresources.qrc +++ b/qgcresources.qrc @@ -176,6 +176,7 @@ src/Airmap/images/advisory-icon.svg + src/Airmap/images/colapse.svg src/Airmap/images/expand.svg src/Airmap/images/pencil.svg diff --git a/src/Airmap/AirspaceControl.qml b/src/Airmap/AirspaceControl.qml index 5cbd651..dea3cdd 100644 --- a/src/Airmap/AirspaceControl.qml +++ b/src/Airmap/AirspaceControl.qml @@ -18,7 +18,8 @@ Item { width: parent.width height: colapsed ? colapsedRect.height : expandedRect.height - property var colapsed: true + property bool colapsed: true + property bool showColapse: true readonly property real _radius: ScreenTools.defaultFontPixelWidth * 0.5 readonly property color _colorOrange: "#d75e0d" @@ -125,6 +126,22 @@ Item { } } } + 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 { diff --git a/src/Airmap/images/colapse.svg b/src/Airmap/images/colapse.svg new file mode 100644 index 0000000..bf33cf0 --- /dev/null +++ b/src/Airmap/images/colapse.svg @@ -0,0 +1,9 @@ + + + + + + diff --git a/src/FlightDisplay/FlightDisplayViewWidgets.qml b/src/FlightDisplay/FlightDisplayViewWidgets.qml index 4d61d87..b83ad86 100644 --- a/src/FlightDisplay/FlightDisplayViewWidgets.qml +++ b/src/FlightDisplay/FlightDisplayViewWidgets.qml @@ -15,19 +15,21 @@ import QtLocation 5.3 import QtPositioning 5.3 import QtQuick.Layouts 1.2 -import QGroundControl 1.0 -import QGroundControl.ScreenTools 1.0 -import QGroundControl.Controls 1.0 -import QGroundControl.Palette 1.0 -import QGroundControl.Vehicle 1.0 -import QGroundControl.FlightMap 1.0 +import QGroundControl 1.0 +import QGroundControl.ScreenTools 1.0 +import QGroundControl.Controls 1.0 +import QGroundControl.Palette 1.0 +import QGroundControl.Vehicle 1.0 +import QGroundControl.FlightMap 1.0 +import QGroundControl.Airmap 1.0 Item { - id: _root + id: widgetRoot property var qgcView property bool useLightColors property var missionController + property bool showValues: true property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property bool _isSatellite: _mainIsMap ? (_flightMap ? _flightMap.isSatelliteMap : true) : true @@ -51,28 +53,14 @@ Item { if(QGroundControl.corePlugin.options.instrumentWidget) { if(QGroundControl.corePlugin.options.instrumentWidget.source.toString().length) { 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 { // 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. var useAlternateInstruments = true//QGroundControl.settingsManager.appSettings.virtualJoystick.value || ScreenTools.isTinyScreen if(useAlternateInstruments) { instrumentsLoader.source = "qrc:/qml/QGCInstrumentWidgetAlternate.qml" - instrumentsLoader.state = "topMode" } else { instrumentsLoader.source = "qrc:/qml/QGCInstrumentWidget.qml" - instrumentsLoader.state = QGroundControl.settingsManager.appSettings.showLargeCompass.value == 1 ? "centerMode" : "topMode" } } } else { @@ -130,43 +118,30 @@ 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." } } - - //-- Instrument Panel - Loader { - id: instrumentsLoader - anchors.margins: ScreenTools.defaultFontPixelHeight / 2 + Column { + id: instrumentsColumn + spacing: ScreenTools.defaultFontPixelHeight * 0.25 + anchors.top: parent.top + anchors.topMargin: QGroundControl.corePlugin.options.instrumentWidget.widgetTopMargin + (ScreenTools.defaultFontPixelHeight * 0.5) + anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5 anchors.right: parent.right - z: QGroundControl.zOrderWidgets - property var qgcView: _root.qgcView - property real maxHeight:parent.height - (anchors.margins * 2) - states: [ - State { - name: "topMode" - AnchorChanges { - target: instrumentsLoader - anchors.verticalCenter: undefined - 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 - } + //------------------------------------------------------- + // Airmap Airspace Control + AirspaceControl { + id: airspaceControl + width: getPreferredInstrumentWidth() + anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5 + onColapsedChanged: { + widgetRoot.showValues = colapsed } - ] + } + //------------------------------------------------------- + //-- 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 + } } } diff --git a/src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml b/src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml index 290fec8..93ebc49 100644 --- a/src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml +++ b/src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml @@ -66,6 +66,7 @@ Rectangle { anchors.top: parent.bottom width: parent.width height: _valuesWidget.height + visible: widgetRoot.showValues Rectangle { anchors.fill: _valuesWidget diff --git a/src/PlanView/PlanView.qml b/src/PlanView/PlanView.qml index bac7574..fc6c4d4 100644 --- a/src/PlanView/PlanView.qml +++ b/src/PlanView/PlanView.qml @@ -512,8 +512,9 @@ QGCView { //------------------------------------------------------- // Airmap Airspace Control AirspaceControl { - id: airspaceControl - width: parent.width + id: airspaceControl + width: parent.width + showColapse: false onColapsedChanged: { if(!airspaceControl.colasped) { planControlColapsed = true diff --git a/src/QGCPalette.cc b/src/QGCPalette.cc index 5af46e3..70a6098 100644 --- a/src/QGCPalette.cc +++ b/src/QGCPalette.cc @@ -73,7 +73,7 @@ void QGCPalette::_buildMap(void) DECLARE_QGC_COLOR(alertBackground, "#eecc44", "#eecc44", "#eecc44", "#eecc44") DECLARE_QGC_COLOR(alertBorder, "#808080", "#808080", "#808080", "#808080") DECLARE_QGC_COLOR(alertText, "#000000", "#000000", "#000000", "#000000") - DECLARE_QGC_COLOR(missionItemEditor, "#585858", "#a39fd3", "#585858", "#4e4480") + DECLARE_QGC_COLOR(missionItemEditor, "#585858", "#dbfef8", "#585858", "#585d83") // Colors are not affecting by theming DECLARE_QGC_COLOR(mapWidgetBorderLight, "#ffffff", "#ffffff", "#ffffff", "#ffffff") diff --git a/src/QmlControls/PageView.qml b/src/QmlControls/PageView.qml index 6dfdc6c..6dda299 100644 --- a/src/QmlControls/PageView.qml +++ b/src/QmlControls/PageView.qml @@ -10,6 +10,7 @@ Rectangle { id: _root height: pageFlickable.y + pageFlickable.height + _margins color: qgcPal.window + radius: ScreenTools.defaultFontPixelWidth * 0.5 property var qgcView ///< QGCView to use for showing dialogs property real maxHeight ///< Maximum height that should be taken, smaller than this is ok diff --git a/src/api/QGCOptions.h b/src/api/QGCOptions.h index 9d06d00..3e26074 100644 --- a/src/api/QGCOptions.h +++ b/src/api/QGCOptions.h @@ -121,18 +121,11 @@ class CustomInstrumentWidget : public QObject { Q_OBJECT public: - //-- Widget Position - enum Pos { - POS_TOP_RIGHT = 0, - POS_CENTER_RIGHT = 1, - POS_BOTTOM_RIGHT = 2, - }; - Q_ENUMS(Pos) CustomInstrumentWidget(QObject* parent = NULL); 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 Pos widgetPosition () { return POS_CENTER_RIGHT; } + virtual double widgetTopMargin () { return 0.0; } signals: - void widgetPositionChanged (); + void widgetTopMarginChanged(); }; From 8a641e2d21a808c1d52f585cc5915b340b7ac177 Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Sat, 20 Jan 2018 16:17:00 -0500 Subject: [PATCH 5/6] AirMap Settings --- qgroundcontrol.qrc | 1 + src/Airmap/AirmapSettings.qml | 195 +++++++++++++++++++++++++ src/FlightDisplay/FlightDisplayViewWidgets.qml | 2 + src/PlanView/PlanView.qml | 38 +++-- src/Settings/App.SettingsGroup.json | 7 + src/Settings/AppSettings.cc | 11 ++ src/Settings/AppSettings.h | 6 +- src/api/QGCCorePlugin.cc | 8 + 8 files changed, 252 insertions(+), 16 deletions(-) create mode 100644 src/Airmap/AirmapSettings.qml diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc index 23b6816..b1d47d0 100644 --- a/qgroundcontrol.qrc +++ b/qgroundcontrol.qrc @@ -18,6 +18,7 @@ src/Airmap/QGroundControl.Airmap.qmldir src/Airmap/AirspaceControl.qml src/Airmap/AirspaceRegulation.qml + src/Airmap/AirmapSettings.qml src/AnalyzeView/AnalyzeView.qml src/ui/AppSettings.qml src/ui/preferences/BluetoothSettings.qml diff --git a/src/Airmap/AirmapSettings.qml b/src/Airmap/AirmapSettings.qml new file mode 100644 index 0000000..89f2340 --- /dev/null +++ b/src/Airmap/AirmapSettings.qml @@ -0,0 +1,195 @@ +/**************************************************************************** + * + * (c) 2009-2016 QGROUNDCONTROL PROJECT + * + * 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") } + } + } + } + } + } +} diff --git a/src/FlightDisplay/FlightDisplayViewWidgets.qml b/src/FlightDisplay/FlightDisplayViewWidgets.qml index b83ad86..e51bed6 100644 --- a/src/FlightDisplay/FlightDisplayViewWidgets.qml +++ b/src/FlightDisplay/FlightDisplayViewWidgets.qml @@ -34,6 +34,7 @@ Item { property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property bool _isSatellite: _mainIsMap ? (_flightMap ? _flightMap.isSatelliteMap : true) : true property bool _lightWidgetBorders: _isSatellite + property bool _enableAirMap: QGroundControl.settingsManager.appSettings.enableAirMap.rawValue readonly property real _margins: ScreenTools.defaultFontPixelHeight * 0.5 @@ -130,6 +131,7 @@ Item { AirspaceControl { id: airspaceControl width: getPreferredInstrumentWidth() + visible: _enableAirMap anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5 onColapsedChanged: { widgetRoot.showValues = colapsed diff --git a/src/PlanView/PlanView.qml b/src/PlanView/PlanView.qml index fc6c4d4..94ae533 100644 --- a/src/PlanView/PlanView.qml +++ b/src/PlanView/PlanView.qml @@ -46,18 +46,19 @@ QGCView { readonly property var _defaultVehicleCoordinate: QtPositioning.coordinate(37.803784, -122.462276) readonly property bool _waypointsOnlyMode: QGroundControl.corePlugin.options.missionWaypointsOnly - property var _planMasterController: masterController - property var _missionController: _planMasterController.missionController - property var _geoFenceController: _planMasterController.geoFenceController - property var _rallyPointController: _planMasterController.rallyPointController - property var _visualItems: _missionController.visualItems - property bool _lightWidgetBorders: editorMap.isSatelliteMap - property bool _addWaypointOnClick: false - property bool _addROIOnClick: false - property bool _singleComplexItem: _missionController.complexMissionItemNames.length === 1 - property real _toolbarHeight: _qgcView.height - ScreenTools.availableHeight - property int _editingLayer: _layerMission - property int _toolStripBottom: toolStrip.height + toolStrip.y + property bool _enableAirMap: QGroundControl.settingsManager.appSettings.enableAirMap.rawValue + property var _planMasterController: masterController + property var _missionController: _planMasterController.missionController + property var _geoFenceController: _planMasterController.geoFenceController + property var _rallyPointController: _planMasterController.rallyPointController + property var _visualItems: _missionController.visualItems + property bool _lightWidgetBorders: editorMap.isSatelliteMap + property bool _addWaypointOnClick: false + property bool _addROIOnClick: false + property bool _singleComplexItem: _missionController.complexMissionItemNames.length === 1 + property real _toolbarHeight: _qgcView.height - ScreenTools.availableHeight + property int _editingLayer: _layerMission + property int _toolStripBottom: toolStrip.height + toolStrip.y readonly property int _layerMission: 1 readonly property int _layerGeoFence: 2 @@ -94,6 +95,12 @@ QGCView { planMasterController: _planMasterController } + on_EnableAirMapChanged: { + if(!_enableAirMap) { + planControlColapsed = false + } + } + Connections { target: QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude @@ -267,7 +274,7 @@ QGCView { function accept() { var toIndex = toCombo.currentIndex - if (toIndex == 0) { + if (toIndex === 0) { toIndex = 1 } _missionController.moveMissionItem(_moveDialogMissionItemIndex, toIndex) @@ -514,6 +521,7 @@ QGCView { AirspaceControl { id: airspaceControl width: parent.width + visible: _enableAirMap showColapse: false onColapsedChanged: { if(!airspaceControl.colasped) { @@ -529,7 +537,7 @@ QGCView { height: planControlColapsed ? colapsedRow.height + ScreenTools.defaultFontPixelHeight : 0 color: qgcPal.missionItemEditor radius: _radius - visible: planControlColapsed + visible: planControlColapsed && _enableAirMap Row { id: colapsedRow spacing: ScreenTools.defaultFontPixelWidth @@ -576,7 +584,7 @@ QGCView { height: !planControlColapsed ? expandedCol.height + ScreenTools.defaultFontPixelHeight : 0 color: qgcPal.missionItemEditor radius: _radius - visible: !planControlColapsed + visible: !planControlColapsed || !_enableAirMap Item { height: expandedCol.height anchors.left: parent.left diff --git a/src/Settings/App.SettingsGroup.json b/src/Settings/App.SettingsGroup.json index 5b9bd15..00148e3 100644 --- a/src/Settings/App.SettingsGroup.json +++ b/src/Settings/App.SettingsGroup.json @@ -176,5 +176,12 @@ "shortDescription": "Default firmware type for flashing", "type": "uint32", "defaultValue": 12 +}, +{ + "name": "EnableAirMap", + "shortDescription": "Enable AirMap", + "longDescription": "Enable AirMap Services", + "type": "bool", + "defaultValue": false } ] diff --git a/src/Settings/AppSettings.cc b/src/Settings/AppSettings.cc index 65068ef..72a8603 100644 --- a/src/Settings/AppSettings.cc +++ b/src/Settings/AppSettings.cc @@ -36,6 +36,7 @@ const char* AppSettings::autoLoadMissionsName = "AutoLoa const char* AppSettings::mapboxTokenName = "MapboxToken"; const char* AppSettings::esriTokenName = "EsriToken"; const char* AppSettings::defaultFirmwareTypeName = "DefaultFirmwareType"; +const char* AppSettings::enableAirMapName = "EnableAirMap"; const char* AppSettings::parameterFileExtension = "params"; const char* AppSettings::planFileExtension = "plan"; @@ -75,6 +76,7 @@ AppSettings::AppSettings(QObject* parent) , _mapboxTokenFact(NULL) , _esriTokenFact(NULL) , _defaultFirmwareTypeFact(NULL) + , _enableAirMapFact(NULL) { QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership); qmlRegisterUncreatableType("QGroundControl.SettingsManager", 1, 0, "AppSettings", "Reference only"); @@ -389,3 +391,12 @@ Fact* AppSettings::defaultFirmwareType(void) return _defaultFirmwareTypeFact; } + +Fact* AppSettings::enableAirMap(void) +{ + if (!_enableAirMapFact) { + _enableAirMapFact = _createSettingsFact(enableAirMapName); + } + + return _enableAirMapFact; +} diff --git a/src/Settings/AppSettings.h b/src/Settings/AppSettings.h index 5b29ac3..f97fb4b 100644 --- a/src/Settings/AppSettings.h +++ b/src/Settings/AppSettings.h @@ -40,6 +40,7 @@ public: Q_PROPERTY(Fact* mapboxToken READ mapboxToken CONSTANT) Q_PROPERTY(Fact* esriToken READ esriToken CONSTANT) Q_PROPERTY(Fact* defaultFirmwareType READ defaultFirmwareType CONSTANT) + Q_PROPERTY(Fact* enableAirMap READ enableAirMap CONSTANT) Q_PROPERTY(QString missionSavePath READ missionSavePath NOTIFY savePathsChanged) Q_PROPERTY(QString parameterSavePath READ parameterSavePath NOTIFY savePathsChanged) @@ -75,12 +76,13 @@ public: Fact* mapboxToken (void); Fact* esriToken (void); Fact* defaultFirmwareType (void); + Fact* enableAirMap (void); QString missionSavePath (void); QString parameterSavePath (void); QString telemetrySavePath (void); QString logSavePath (void); - QString videoSavePath (void); + QString videoSavePath (void); static MAV_AUTOPILOT offlineEditingFirmwareTypeFromFirmwareType(MAV_AUTOPILOT firmwareType); static MAV_TYPE offlineEditingVehicleTypeFromVehicleType(MAV_TYPE vehicleType); @@ -107,6 +109,7 @@ public: static const char* mapboxTokenName; static const char* esriTokenName; static const char* defaultFirmwareTypeName; + static const char* enableAirMapName; // Application wide file extensions static const char* parameterFileExtension; @@ -154,6 +157,7 @@ private: SettingsFact* _mapboxTokenFact; SettingsFact* _esriTokenFact; SettingsFact* _defaultFirmwareTypeFact; + SettingsFact* _enableAirMapFact; }; #endif diff --git a/src/api/QGCCorePlugin.cc b/src/api/QGCCorePlugin.cc index 58b0683..a2e2519 100644 --- a/src/api/QGCCorePlugin.cc +++ b/src/api/QGCCorePlugin.cc @@ -30,6 +30,7 @@ public: : pGeneral (NULL) , pCommLinks (NULL) , pOfflineMaps (NULL) + , pAirmap (NULL) , pMAVLink (NULL) , pConsole (NULL) #if defined(QT_DEBUG) @@ -53,6 +54,8 @@ public: delete pCommLinks; if(pOfflineMaps) delete pOfflineMaps; + if(pAirmap) + delete pAirmap; if(pMAVLink) delete pMAVLink; if(pConsole) @@ -70,6 +73,7 @@ public: QmlComponentInfo* pGeneral; QmlComponentInfo* pCommLinks; QmlComponentInfo* pOfflineMaps; + QmlComponentInfo* pAirmap; QmlComponentInfo* pMAVLink; QmlComponentInfo* pConsole; #if defined(QT_DEBUG) @@ -127,6 +131,10 @@ QVariantList &QGCCorePlugin::settingsPages() QUrl::fromUserInput("qrc:/qml/OfflineMap.qml"), QUrl::fromUserInput("qrc:/res/waves.svg")); _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"), QUrl::fromUserInput("qrc:/qml/MavlinkSettings.qml"), QUrl::fromUserInput("qrc:/res/waves.svg")); From 890cb5e6d15e41ea2d82a7c9a15c4950a0a52627 Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Sat, 20 Jan 2018 17:55:37 -0500 Subject: [PATCH 6/6] Restore expanded state when enabling AirMap --- src/PlanView/PlanView.qml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/PlanView/PlanView.qml b/src/PlanView/PlanView.qml index 94ae533..e19564e 100644 --- a/src/PlanView/PlanView.qml +++ b/src/PlanView/PlanView.qml @@ -96,7 +96,10 @@ QGCView { } on_EnableAirMapChanged: { - if(!_enableAirMap) { + if(_enableAirMap) { + planControlColapsed = true + airspaceControl.colapsed = false + } else { planControlColapsed = false } } @@ -563,7 +566,7 @@ QGCView { height: ScreenTools.defaultFontPixelWidth * 2.5 sourceSize.height: height source: "qrc:/airmap/expand.svg" - color: _colorWhite + color: "white" anchors.right: parent.right anchors.rightMargin: ScreenTools.defaultFontPixelWidth anchors.verticalCenter: parent.verticalCenter