diff --git a/custom-example/custom.pri b/custom-example/custom.pri index 3acd082039051bd3bed9476467786eb6f030ece5..c5325f5537302e5070158246d47085f6b3b29e25 100644 --- a/custom-example/custom.pri +++ b/custom-example/custom.pri @@ -55,14 +55,6 @@ RESOURCES += \ QML_IMPORT_PATH += \ $$PWD/res -LinuxBuild { - - # Our QT_INSTALL_LIBS - QT_LIB_LIST += \ - libQt5VirtualKeyboard.so.5 \ - -} - # Our own, custom sources SOURCES += \ $$PWD/src/CustomPlugin.cc \ diff --git a/custom-example/qgcresources.qrc b/custom-example/qgcresources.qrc index 02caa15f2a8979682fb4f2579bf3ccefaf5bc707..c0b4815c56d504a19adf1fe012304074b6990104 100644 --- a/custom-example/qgcresources.qrc +++ b/custom-example/qgcresources.qrc @@ -22,6 +22,7 @@ ../resources/gear-black.svg ../resources/gear-white.svg ../resources/helicoptericon.svg + ../resources/BingNoTileBytes.dat ../resources/JoystickBezel.png ../resources/JoystickBezelLight.png ../resources/land.svg diff --git a/custom-example/qgroundcontrol.qrc b/custom-example/qgroundcontrol.qrc index 17049b34814054997bfc8a21f9d52288a583d56a..7af3c9352f94219baefe05a30d6392499f0ac3c4 100644 --- a/custom-example/qgroundcontrol.qrc +++ b/custom-example/qgroundcontrol.qrc @@ -9,7 +9,6 @@ ../src/ui/toolbar/GPSRTKIndicator.qml ../src/ui/toolbar/JoystickIndicator.qml ../src/ui/toolbar/LinkIndicator.qml - ../src/ui/toolbar/MainToolBar.qml ../src/ui/toolbar/MainToolBarIndicators.qml ../src/ui/toolbar/MessageIndicator.qml ../src/ui/toolbar/ModeIndicator.qml @@ -50,7 +49,6 @@ ../src/PlanView/FWLandingPatternEditor.qml ../src/ui/preferences/GeneralSettings.qml ../src/AnalyzeView/GeoTagPage.qml - ../src/FlightMap/Widgets/HealthPageWidget.qml ../src/ui/preferences/HelpSettings.qml ../src/VehicleSetup/JoystickConfig.qml ../src/VehicleSetup/JoystickConfigAdvanced.qml @@ -65,6 +63,7 @@ ../src/AnalyzeView/MAVLinkInspectorPage.qml ../src/ui/preferences/MavlinkSettings.qml ../src/Microhard/MicrohardSettings.qml + ../src/MissionManager/MissionCommandTreeEditorTestWindow.qml ../src/PlanView/MissionSettingsEditor.qml ../src/ui/preferences/MockLink.qml ../src/ui/preferences/MockLinkSettings.qml @@ -77,7 +76,6 @@ ../src/VehicleSetup/PX4FlowSensor.qml ../src/FlightMap/Widgets/QGCInstrumentWidget.qml ../src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml - ../src/QmlControls/QGCViewDialogContainer.qml ../src/AnalyzeView/AnalyzePage.qml ../src/QmlControls/AppMessages.qml ../src/QmlControls/AxisMonitor.qml @@ -107,6 +105,8 @@ ../src/QmlControls/JoystickThumbPad.qml ../src/QmlControls/KMLOrSHPFileDialog.qml ../src/QmlControls/LogReplayStatusBar.qml + ../src/ui/toolbar/MainStatusIndicator.qml + ../src/ui/toolbar/MainToolBar.qml ../src/QmlControls/MainWindowSavedState.qml ../src/QmlControls/MAVLinkChart.qml ../src/QmlControls/MAVLinkMessageButton.qml @@ -161,6 +161,7 @@ ../src/QmlControls/QGCToolBarButton.qml ../src/QmlControls/QGCToolInsets.qml ../src/QmlControls/QGCViewDialog.qml + ../src/QmlControls/QGCViewDialogContainer.qml ../src/QmlControls/QGCViewMessage.qml ../src/QmlControls/QGroundControl/Controls/qmldir ../src/PlanView/RallyPointEditorHeader.qml @@ -179,9 +180,10 @@ ../src/PlanView/SurveyMapVisual.qml ../src/PlanView/TerrainStatus.qml ../src/PlanView/TakeoffItemMapVisual.qml - ../src/ui/toolbar/ToolBarBase.qml ../src/QmlControls/ToolStrip.qml ../src/PlanView/TransectStyleComplexItemStats.qml + ../src/PlanView/TransectStyleComplexItemTabBar.qml + ../src/PlanView/TransectStyleComplexItemTerrainFollow.qml ../src/QmlControls/VehicleRotationCal.qml ../src/QmlControls/VehicleSummaryRow.qml ../src/QmlControls/VerticalFactValueGrid.qml @@ -335,5 +337,8 @@ ../src/comm/APMArduSubMockLink.params ../src/comm/PX4MockLink.params + ../src/comm/MockLink.Version.MetaData.json + ../src/comm/MockLink.Version.MetaData.json.gz + ../src/comm/MockLink.Parameter.MetaData.json diff --git a/custom-example/src/CustomPlugin.cc b/custom-example/src/CustomPlugin.cc index ace69a877a3825decb2b52aca92c2c810ccc8565..b386a51424c0b5b9eb5840919645225a060abcf9 100644 --- a/custom-example/src/CustomPlugin.cc +++ b/custom-example/src/CustomPlugin.cc @@ -159,11 +159,11 @@ bool CustomPlugin::adjustSettingMetaData(const QString& settingsGroup, FactMetaD if (settingsGroup == AppSettings::settingsGroup) { // This tells QGC than when you are creating Plans while not connected to a vehicle // the specific firmware/vehicle the plan is for. - if (metaData.name() == AppSettings::offlineEditingFirmwareTypeName) { - metaData.setRawDefaultValue(MAV_AUTOPILOT_PX4); + if (metaData.name() == AppSettings::offlineEditingFirmwareClassName) { + metaData.setRawDefaultValue(QGCMAVLink::FirmwareClassPX4); return false; - } else if (metaData.name() == AppSettings::offlineEditingVehicleTypeName) { - metaData.setRawDefaultValue(MAV_TYPE_QUADROTOR); + } else if (metaData.name() == AppSettings::offlineEditingVehicleClassName) { + metaData.setRawDefaultValue(QGCMAVLink::VehicleClassMultiRotor); return false; } } diff --git a/custom-example/src/FirmwarePlugin/CustomFirmwarePluginFactory.cc b/custom-example/src/FirmwarePlugin/CustomFirmwarePluginFactory.cc index 36ece796fa76ad158dcd78c99b45869e3b404409..cf670a3f89d477d0eabae12b83c6180e74ce9a26 100644 --- a/custom-example/src/FirmwarePlugin/CustomFirmwarePluginFactory.cc +++ b/custom-example/src/FirmwarePlugin/CustomFirmwarePluginFactory.cc @@ -22,11 +22,18 @@ CustomFirmwarePluginFactory::CustomFirmwarePluginFactory() } -QList CustomFirmwarePluginFactory::supportedFirmwareTypes() const +QList CustomFirmwarePluginFactory::supportedFirmwareClasses() const { - QList list; - list.append(MAV_AUTOPILOT_PX4); - return list; + QList firmwareClasses; + firmwareClasses.append(QGCMAVLink::FirmwareClassPX4); + return firmwareClasses; +} + +QList CustomFirmwarePluginFactory::supportedVehicleClasses(void) const +{ + QList vehicleClasses; + vehicleClasses.append(QGCMAVLink::VehicleClassMultiRotor); + return vehicleClasses; } FirmwarePlugin* CustomFirmwarePluginFactory::firmwarePluginForAutopilot(MAV_AUTOPILOT autopilotType, MAV_TYPE /*vehicleType*/) @@ -39,11 +46,3 @@ FirmwarePlugin* CustomFirmwarePluginFactory::firmwarePluginForAutopilot(MAV_AUTO } return nullptr; } - - -QList CustomFirmwarePluginFactory::supportedVehicleTypes(void) const -{ - QList mavTypes; - mavTypes.append(MAV_TYPE_QUADROTOR); - return mavTypes; -} diff --git a/custom-example/src/FirmwarePlugin/CustomFirmwarePluginFactory.h b/custom-example/src/FirmwarePlugin/CustomFirmwarePluginFactory.h index ffe39bea6860b005b0f0f3ad90fe92dd58dbdfcc..8a39a3e29b29f1c199a97a2d1b7de39288d9bbaa 100644 --- a/custom-example/src/FirmwarePlugin/CustomFirmwarePluginFactory.h +++ b/custom-example/src/FirmwarePlugin/CustomFirmwarePluginFactory.h @@ -26,9 +26,9 @@ class CustomFirmwarePluginFactory : public FirmwarePluginFactory Q_OBJECT public: CustomFirmwarePluginFactory(); - QList supportedFirmwareTypes () const final; - FirmwarePlugin* firmwarePluginForAutopilot (MAV_AUTOPILOT autopilotType, MAV_TYPE vehicleType) final; - QList supportedVehicleTypes (void) const final; + QList supportedFirmwareClasses(void) const final; + QList supportedVehicleClasses(void) const final; + FirmwarePlugin* firmwarePluginForAutopilot (MAV_AUTOPILOT autopilotType, MAV_TYPE vehicleType) final; private: CustomFirmwarePlugin* _pluginInstance; diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc index 5c19b2258f1614833cbf3821de72010dcd7b48e4..5a1f2fe6c7eb7bc4f1bbf8ae8bd4449cf266484e 100644 --- a/qgroundcontrol.qrc +++ b/qgroundcontrol.qrc @@ -232,6 +232,7 @@ src/FlightDisplay/PreFlightSoundCheck.qml src/FlightDisplay/PreFlightCheckListShowAction.qml src/FlightDisplay/TerrainProgress.qml + src/FlightDisplay/TelemetryValuesBar.qml src/FlightDisplay/VehicleWarnings.qml src/QmlControls/QGroundControl/FlightDisplay/qmldir src/FlightMap/MapItems/CameraTriggerIndicator.qml diff --git a/src/FlightDisplay/FlyView.qml b/src/FlightDisplay/FlyView.qml index 7323c8cc90cb4a7f011a56b96df78cec97d41f1d..3919c769eff6022cd2fac9a4543b5ea1a7888521 100644 --- a/src/FlightDisplay/FlyView.qml +++ b/src/FlightDisplay/FlyView.qml @@ -52,7 +52,6 @@ Item { property var _guidedController: guidedActionsController property var _guidedActionList: guidedActionList property var _guidedAltSlider: guidedAltSlider - property var _guidedConfirm: guidedActionConfirm property real _toolsMargin: ScreenTools.defaultFontPixelWidth * 0.75 property rect _centerViewport: Qt.rect(0, 0, width, height) property real _rightPanelWidth: ScreenTools.defaultFontPixelWidth * 30 @@ -77,7 +76,6 @@ Item { FlyViewWidgetLayer { id: widgetLayer - anchors.rightMargin: _toolsMargin anchors.top: parent.top anchors.bottom: parent.bottom anchors.left: parent.left @@ -100,12 +98,11 @@ Item { GuidedActionsController { id: guidedActionsController missionController: _missionController - confirmDialog: _guidedConfirm actionList: _guidedActionList altitudeSlider: _guidedAltSlider } - GuidedActionConfirm { + /*GuidedActionConfirm { id: guidedActionConfirm anchors.margins: _margins anchors.bottom: parent.bottom @@ -113,7 +110,7 @@ Item { z: QGroundControl.zOrderTopMost guidedController: _guidedController altitudeSlider: _guidedAltSlider - } + }*/ GuidedActionList { id: guidedActionList @@ -144,7 +141,7 @@ Item { rightPanelWidth: ScreenTools.defaultFontPixelHeight * 9 pipMode: !_mainWindowIsMap toolInsets: customOverlay.totalToolInsets - mapName: "FlightDisplayView" + mapName: "FlightDisplayView" } FlyViewVideo { diff --git a/src/FlightDisplay/FlyViewWidgetLayer.qml b/src/FlightDisplay/FlyViewWidgetLayer.qml index 6ebdd017b4409a5550dac732599118719d8dfda9..4228d2a5c68fa28d5f77d28474cb2c37f3fefdf0 100644 --- a/src/FlightDisplay/FlyViewWidgetLayer.qml +++ b/src/FlightDisplay/FlyViewWidgetLayer.qml @@ -18,6 +18,7 @@ import QtQuick.Window 2.2 import QtQml.Models 2.1 import QGroundControl 1.0 +import QGroundControl.Controls 1.0 import QGroundControl.Airspace 1.0 import QGroundControl.Airmap 1.0 import QGroundControl.Controllers 1.0 @@ -50,18 +51,18 @@ Item { QGCToolInsets { id: _totalToolInsets - leftEdgeCenterInset: toolStrip.leftInset leftEdgeTopInset: toolStrip.leftInset + leftEdgeCenterInset: toolStrip.leftInset leftEdgeBottomInset: parentToolInsets.leftEdgeBottomInset - rightEdgeCenterInset: instrumentPanel.rightInset - rightEdgeTopInset: instrumentPanel.rightInset - rightEdgeBottomInset: instrumentPanel.rightInset - topEdgeCenterInset: parentToolInsets.topEdgeCenterInset + rightEdgeTopInset: parentToolInsets.rightEdgeTopInset + rightEdgeCenterInset: parentToolInsets.rightEdgeCenterInset + rightEdgeBottomInset: parentToolInsets.rightEdgeBottomInset topEdgeLeftInset: parentToolInsets.topEdgeLeftInset + topEdgeCenterInset: parentToolInsets.topEdgeCenterInset topEdgeRightInset: parentToolInsets.topEdgeRightInset - bottomEdgeCenterInset: mapScale.centerInset bottomEdgeLeftInset: parentToolInsets.bottomEdgeLeftInset - bottomEdgeRightInset: parentToolInsets.bottomEdgeRightInset + bottomEdgeCenterInset: mapScale.centerInset + bottomEdgeRightInset: telemetryPanel.bottomInset } FlyViewMissionCompleteDialog { @@ -84,6 +85,30 @@ Item { property real rightInset: visible ? parent.width - x : 0 } + TelemetryValuesBar { + id: telemetryPanel + x: recalcXPosition() + anchors.margins: _toolsMargin + anchors.bottom: parent.bottom + + function recalcXPosition() { + // First try centered + var halfRootWidth = _root.width / 2 + var halfPanelWidth = telemetryPanel.width / 2 + var leftX = (halfRootWidth - halfPanelWidth) - _toolsMargin + var rightX = (halfRootWidth + halfPanelWidth) + _toolsMargin + if (leftX >= parentToolInsets.leftEdgeBottomInset || rightX <= parentToolInsets.rightEdgeBottomInset ) { + // It will fit in the horizontalCenter + return halfRootWidth - halfPanelWidth + } else { + // Anchor to left edge + return parentToolInsets.leftEdgeBottomInset + _toolsMargin + } + } + + property real bottomInset: height + } + //-- Virtual Joystick Loader { id: virtualJoystickMultiTouch @@ -105,11 +130,11 @@ Item { FlyViewToolStrip { id: toolStrip anchors.leftMargin: _toolsMargin + parentToolInsets.leftEdgeCenterInset - anchors.topMargin: _toolsMargin + parentToolInsets.leftEdgeTopInset + anchors.topMargin: _toolsMargin + parentToolInsets.topEdgeLeftInset anchors.left: parent.left anchors.top: parent.top z: QGroundControl.zOrderWidgets - maxHeight: parent.height - y - parentToolInsets.leftEdgeBottomInset - _toolsMargin + maxHeight: parent.height - y - parentToolInsets.bottomEdgeLeftInset - _toolsMargin visible: !QGroundControl.videoManager.fullScreen onDisplayPreFlightChecklist: preFlightChecklistPopup.open() @@ -131,14 +156,13 @@ Item { } MapScale { - id: mapScale - anchors.leftMargin: parentToolInsets.leftEdgeBottomInset + _toolsMargin - anchors.bottomMargin: parentToolInsets.bottomEdgeCenterInset + _toolsMargin - anchors.left: parent.left - anchors.bottom: parent.bottom - mapControl: _mapControl - buttonsOnLeft: true - visible: !ScreenTools.isTinyScreen && QGroundControl.corePlugin.options.flyView.showMapScale && mapControl.pipState.state !== mapControl.pipState.pipState + id: mapScale + anchors.margins: _toolsMargin + anchors.left: toolStrip.right + anchors.top: parent.top + mapControl: _mapControl + buttonsOnLeft: false + visible: !ScreenTools.isTinyScreen && QGroundControl.corePlugin.options.flyView.showMapScale && mapControl.pipState.state !== mapControl.pipState.pipState property real centerInset: visible ? parent.height - y : 0 } diff --git a/src/FlightDisplay/GuidedActionConfirm.qml b/src/FlightDisplay/GuidedActionConfirm.qml index edbe014882974c6331307a099d3c02aae1c6c89f..63272eb48b69a7e907fdc725607e5f52b4eb4c5b 100644 --- a/src/FlightDisplay/GuidedActionConfirm.qml +++ b/src/FlightDisplay/GuidedActionConfirm.qml @@ -7,28 +7,26 @@ * ****************************************************************************/ -import QtQuick 2.3 -import QtQuick.Controls 1.2 +import QtQuick 2.12 +import QtQuick.Controls 2.4 +import QtQuick.Layouts 1.12 import QGroundControl 1.0 import QGroundControl.ScreenTools 1.0 import QGroundControl.Controls 1.0 import QGroundControl.Palette 1.0 -/// Guided actions confirmation dialog Rectangle { - id: _root - width: confirmColumn.width + (_margins * 4) - height: confirmColumn.height + (_margins * 4) - radius: ScreenTools.defaultFontPixelHeight / 2 - color: qgcPal.window - border.color: _emergencyAction ? "red" : qgcPal.windowShade - border.width: _emergencyAction ? 4 : 1 - visible: false + id: _root + Layout.minimumWidth: mainLayout.width + (_margins * 2) + Layout.preferredHeight: mainLayout.height + (_margins * 2) + radius: ScreenTools.defaultFontPixelWidth / 2 + color: qgcPal.windowShadeLight + visible: false property var guidedController property var altitudeSlider - property alias title: titleText.text + property string title // Currently unused property alias message: messageText.text property int action property var actionData @@ -37,9 +35,11 @@ Rectangle { property alias optionText: optionCheckBox.text property alias optionChecked: optionCheckBox.checked - property real _margins: ScreenTools.defaultFontPixelWidth + property real _margins: ScreenTools.defaultFontPixelWidth / 2 property bool _emergencyAction: action === guidedController.actionEmergencyStop + Component.onCompleted: guidedController.confirmDialog = this + onHideTriggerChanged: { if (hideTrigger) { confirmCancelled() @@ -50,7 +50,7 @@ Rectangle { if (immediate) { visible = true } else { - // We delay showing the confirmation for a small amount in order to any other state + // We delay showing the confirmation for a small amount in order for any other state // changes to propogate through the system. This way only the final state shows up. visibleTimer.restart() } @@ -76,76 +76,70 @@ Rectangle { QGCPalette { id: qgcPal } - DeadMouseArea { - anchors.fill: parent - } - - Column { - id: confirmColumn - anchors.margins: _margins - anchors.centerIn: parent - spacing: _margins - - QGCLabel { - id: titleText - anchors.left: slider.left - anchors.right: slider.right - horizontalAlignment: Text.AlignHCenter - font.pointSize: ScreenTools.largeFontPointSize - } + ColumnLayout { + id: mainLayout + anchors.horizontalCenter: parent.horizontalCenter + spacing: _margins QGCLabel { id: messageText - anchors.left: slider.left - anchors.right: slider.right + Layout.fillWidth: true horizontalAlignment: Text.AlignHCenter wrapMode: Text.WordWrap } QGCCheckBox { - id: optionCheckBox - anchors.horizontalCenter: parent.horizontalCenter - text: "" - visible: text !== "" + id: optionCheckBox + Layout.alignment: Qt.AlignHCenter + text: "" + visible: text !== "" } - // Action confirmation control - SliderSwitch { - id: slider - confirmText: qsTr("Slide to confirm") - width: Math.max(implicitWidth, ScreenTools.defaultFontPixelWidth * 30) - - onAccept: { - _root.visible = false - var altitudeChange = 0 - if (altitudeSlider.visible) { - altitudeChange = altitudeSlider.getAltitudeChangeValue() - altitudeSlider.visible = false - } - hideTrigger = false - guidedController.executeAction(_root.action, _root.actionData, altitudeChange, _root.optionChecked) - if (mapIndicator) { - mapIndicator.actionConfirmed() - mapIndicator = undefined + RowLayout { + Layout.alignment: Qt.AlignHCenter + spacing: ScreenTools.defaultFontPixelWidth + + SliderSwitch { + id: slider + confirmText: qsTr("Slide to confirm") + Layout.minimumWidth: Math.max(implicitWidth, ScreenTools.defaultFontPixelWidth * 30) + + onAccept: { + _root.visible = false + var altitudeChange = 0 + if (altitudeSlider.visible) { + altitudeChange = altitudeSlider.getAltitudeChangeValue() + altitudeSlider.visible = false + } + hideTrigger = false + guidedController.executeAction(_root.action, _root.actionData, altitudeChange, _root.optionChecked) + if (mapIndicator) { + mapIndicator.actionConfirmed() + mapIndicator = undefined + } } } - } - } - QGCColoredImage { - anchors.margins: _margins - anchors.top: parent.top - anchors.right: parent.right - width: ScreenTools.defaultFontPixelHeight - height: width - sourceSize.height: width - source: "/res/XDelete.svg" - fillMode: Image.PreserveAspectFit - color: qgcPal.text - - QGCMouseArea { - fillItem: parent - onClicked: confirmCancelled() + Rectangle { + height: slider.height * 0.75 + width: height + radius: height / 2 + color: qgcPal.primaryButton + + QGCColoredImage { + anchors.margins: parent.height / 4 + anchors.fill: parent + source: "/res/XDelete.svg" + fillMode: Image.PreserveAspectFit + color: qgcPal.text + } + + QGCMouseArea { + fillItem: parent + onClicked: confirmCancelled() + } + } } } } + diff --git a/src/FlightDisplay/TelemetryValuesBar.qml b/src/FlightDisplay/TelemetryValuesBar.qml new file mode 100644 index 0000000000000000000000000000000000000000..1f4b1e1f173edc17ff3bd7bf268c328cc918e845 --- /dev/null +++ b/src/FlightDisplay/TelemetryValuesBar.qml @@ -0,0 +1,54 @@ +/**************************************************************************** + * + * (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.12 +import QtQuick.Layouts 1.12 + +import QGroundControl 1.0 +import QGroundControl.ScreenTools 1.0 +import QGroundControl.Vehicle 1.0 +import QGroundControl.Controls 1.0 +import QGroundControl.Palette 1.0 + +Rectangle { + id: telemetryPanel + height: telemetryLayout.height + (_toolsMargin * 2) + width: telemetryLayout.width + (_toolsMargin * 2) + color: Qt.hsla(_baseBGColor.hslHue, _baseBGColor.hslSaturation, _baseBGColor.hslLightness, 0.5) + radius: ScreenTools.defaultFontPixelWidth / 2 + + property color _baseBGColor: qgcPal.window + + DeadMouseArea { anchors.fill: parent } + + ColumnLayout { + id: telemetryLayout + anchors.margins: _toolsMargin + anchors.top: parent.top + anchors.left: parent.left + + HorizontalFactValueGrid { + id: valueArea + userSettingsGroup: telemetryBarUserSettingsGroup + defaultSettingsGroup: telemetryBarDefaultSettingsGroup + + QGCMouseArea { + anchors.fill: parent + visible: !parent.settingsUnlocked + onClicked: parent.settingsUnlocked = true + } + } + + GuidedActionConfirm { + Layout.fillWidth: true + guidedController: _guidedController + altitudeSlider: _guidedAltSlider + } + } +} diff --git a/src/FlightMap/Images/MapAddMission.svg b/src/FlightMap/Images/MapAddMission.svg index 2cbcb9ca21e833160e3c5e9f0ad52e6d3cefdf97..fa1fc752dd31cc20a40e4bde9a13f6051b2df44c 100644 --- a/src/FlightMap/Images/MapAddMission.svg +++ b/src/FlightMap/Images/MapAddMission.svg @@ -6,5 +6,5 @@ - + diff --git a/src/FlightMap/Images/MapCenter.svg b/src/FlightMap/Images/MapCenter.svg index 37f6fc0ef8d55d23f1cf359d4e3244d9a5e9717f..312ff09e5725c07751da8fdc67186e1e5f2401b4 100644 --- a/src/FlightMap/Images/MapCenter.svg +++ b/src/FlightMap/Images/MapCenter.svg @@ -3,10 +3,10 @@ - - - - - + + + + + diff --git a/src/FlightMap/Images/MapDrawShape.svg b/src/FlightMap/Images/MapDrawShape.svg index a73a7ad97a5c57c13230cfe6cbe6c3cb5264613e..bcd0c3b859782db03d16fab9859f5387937f5356 100644 --- a/src/FlightMap/Images/MapDrawShape.svg +++ b/src/FlightMap/Images/MapDrawShape.svg @@ -3,7 +3,7 @@ - + - + diff --git a/src/FlightMap/Images/MapSync.svg b/src/FlightMap/Images/MapSync.svg index 2f90fd148d9e73923f3629570c220cfe1d64de20..8d19283411c89c9f53673fc3afda243814a12574 100644 --- a/src/FlightMap/Images/MapSync.svg +++ b/src/FlightMap/Images/MapSync.svg @@ -2,12 +2,12 @@ - - diff --git a/src/FlightMap/Images/MapSyncChanged.svg b/src/FlightMap/Images/MapSyncChanged.svg index 3d97f89612b34f0a6e4489caa32bcf598a958f39..3b06238e307ea2385e8cd73c2433056dc0a2e724 100644 --- a/src/FlightMap/Images/MapSyncChanged.svg +++ b/src/FlightMap/Images/MapSyncChanged.svg @@ -2,12 +2,12 @@ - - diff --git a/src/FlightMap/Widgets/CameraPageWidget.qml b/src/FlightMap/Widgets/CameraPageWidget.qml index 98be0cf3f1f05eb0e1a8c6b5bb100d92c2144adf..8499d7151928c8b9a9d10f43a0b2755f8accd6eb 100644 --- a/src/FlightMap/Widgets/CameraPageWidget.qml +++ b/src/FlightMap/Widgets/CameraPageWidget.qml @@ -91,7 +91,7 @@ Column { id: camMode width: _hasModes ? ScreenTools.defaultFontPixelWidth * 8 : 0 height: _hasModes ? ScreenTools.defaultFontPixelWidth * 4 : 0 - color: qgcPal.button + color: qgcPal.windowShadeLight radius: height * 0.5 visible: _hasModes anchors.horizontalCenter: parent.horizontalCenter @@ -99,7 +99,7 @@ Column { Rectangle { width: parent.height height: parent.height - color: _cameraVideoMode ? qgcPal.window : qgcPal.button + color: _cameraVideoMode ? qgcPal.window : qgcPal.windowShadeLight radius: height * 0.5 anchors.left: parent.left border.color: qgcPal.text @@ -126,7 +126,7 @@ Column { Rectangle { width: parent.height height: parent.height - color: _cameraPhotoMode ? qgcPal.window : qgcPal.button + color: _cameraPhotoMode ? qgcPal.window : qgcPal.windowShadeLight radius: height * 0.5 anchors.right: parent.right border.color: qgcPal.text diff --git a/src/PlanView/PlanEditToolbar.qml b/src/PlanView/PlanEditToolbar.qml index 983bd0ada594599c4cfe8198be31218592ae782e..1703387d8038b9813b726bb21ce5ef93cc05c08e 100644 --- a/src/PlanView/PlanEditToolbar.qml +++ b/src/PlanView/PlanEditToolbar.qml @@ -43,7 +43,7 @@ Item { Rectangle { anchors.fill: parent radius: _radius - color: qgcPal.globalTheme === QGCPalette.Light ? QGroundControl.corePlugin.options.toolbarBackgroundLight : QGroundControl.corePlugin.options.toolbarBackgroundDark + color: QGroundControl.globalPalette.toolbarBackground } QGCFlickable { diff --git a/src/PlanView/SimpleItemEditor.qml b/src/PlanView/SimpleItemEditor.qml index 4a5a36d9b813fe5a4a9c6c4428ec434425d58b26..b5271d1f62c967632d8cee3c8f24a6bac838eef2 100644 --- a/src/PlanView/SimpleItemEditor.qml +++ b/src/PlanView/SimpleItemEditor.qml @@ -130,7 +130,7 @@ Rectangle { anchors.left: parent.left anchors.right: parent.right height: altColumn.y + altColumn.height + _margin - color: _globalAltModeIsMixed ? qgcPal.windowShade: qgcPal.window + color: _globalAltModeIsMixed ? qgcPal.windowShadeLight : qgcPal.windowShadeDark visible: _specifiesAltitude ColumnLayout { diff --git a/src/QGCPalette.cc b/src/QGCPalette.cc index e06ca739999a193526b7d0bfd244b74d0fab9568..9a595a83f325570a7537182d092c8f88b1acb693 100644 --- a/src/QGCPalette.cc +++ b/src/QGCPalette.cc @@ -51,6 +51,7 @@ void QGCPalette::_buildMap() // Light Dark // Disabled Enabled Disabled Enabled DECLARE_QGC_COLOR(window, "#ffffff", "#ffffff", "#222222", "#222222") + DECLARE_QGC_COLOR(windowShadeLight, "#909090", "#828282", "#707070", "#626262") DECLARE_QGC_COLOR(windowShade, "#d9d9d9", "#d9d9d9", "#333333", "#333333") DECLARE_QGC_COLOR(windowShadeDark, "#bdbdbd", "#bdbdbd", "#282828", "#282828") DECLARE_QGC_COLOR(text, "#9d9d9d", "#000000", "#707070", "#ffffff") @@ -80,11 +81,13 @@ void QGCPalette::_buildMap() DECLARE_QGC_COLOR(statusFailedText, "#9d9d9d", "#000000", "#707070", "#ffffff") DECLARE_QGC_COLOR(statusPassedText, "#9d9d9d", "#000000", "#707070", "#ffffff") DECLARE_QGC_COLOR(statusPendingText, "#9d9d9d", "#000000", "#707070", "#ffffff") + DECLARE_QGC_COLOR(toolbarBackground, "#ffffff", "#ffffff", "#222222", "#222222") // Colors not affecting by theming - // Disabled Enabled - DECLARE_QGC_NONTHEMED_COLOR(brandingPurple, "#4A2C6D", "#4A2C6D") - DECLARE_QGC_NONTHEMED_COLOR(brandingBlue, "#48D6FF", "#6045c5") + // Disabled Enabled + DECLARE_QGC_NONTHEMED_COLOR(brandingPurple, "#4A2C6D", "#4A2C6D") + DECLARE_QGC_NONTHEMED_COLOR(brandingBlue, "#48D6FF", "#6045c5") + DECLARE_QGC_NONTHEMED_COLOR(toolStripFGColor, "#707070", "#ffffff") // Colors not affecting by theming or enable/disable DECLARE_QGC_SINGLE_COLOR(mapWidgetBorderLight, "#ffffff") diff --git a/src/QGCPalette.h b/src/QGCPalette.h index 68f96e9b3a6af58cb2744b216ecace60f1a628bf..e456e5092e25cdff228363613ab32a497bbafcb4 100644 --- a/src/QGCPalette.h +++ b/src/QGCPalette.h @@ -113,6 +113,7 @@ public: Q_PROPERTY(QStringList colors READ colors CONSTANT) DEFINE_QGC_COLOR(window, setWindow) + DEFINE_QGC_COLOR(windowShadeLight, setWindowShadeLight) DEFINE_QGC_COLOR(windowShade, setWindowShade) DEFINE_QGC_COLOR(windowShadeDark, setWindowShadeDark) DEFINE_QGC_COLOR(text, setText) @@ -149,6 +150,8 @@ public: DEFINE_QGC_COLOR(statusPendingText, setstatusPendingText) DEFINE_QGC_COLOR(surveyPolygonInterior, setSurveyPolygonInterior) DEFINE_QGC_COLOR(surveyPolygonTerrainCollision, setSurveyPolygonTerrainCollision) + DEFINE_QGC_COLOR(toolbarBackground, setToolbarBackground) + DEFINE_QGC_COLOR(toolStripFGColor, setToolStripFGColor) QGCPalette(QObject* parent = nullptr); ~QGCPalette(); diff --git a/src/QmlControls/FactValueGrid.cc b/src/QmlControls/FactValueGrid.cc index 3f3b6ab1dde0ff2486f157251ba614dec39bdc29..09f807fb0f3bd7a10b8369bc973ddfd43e6f7976 100644 --- a/src/QmlControls/FactValueGrid.cc +++ b/src/QmlControls/FactValueGrid.cc @@ -51,7 +51,7 @@ FactValueGrid::FactValueGrid(QQuickItem* parent) _iconNames = iconDir.entryList(); } - _connectSignals(); + _init(); } FactValueGrid::FactValueGrid(const QString& defaultSettingsGroup) @@ -59,12 +59,28 @@ FactValueGrid::FactValueGrid(const QString& defaultSettingsGroup) , _defaultSettingsGroup (defaultSettingsGroup) , _rows (new QmlObjectListModel(this)) { - _connectSignals(); + _init(); } -void FactValueGrid::_connectSignals(void) +void FactValueGrid::_init(void) { - connect(this, &FactValueGrid::fontSizeChanged, this, &FactValueGrid::_saveSettings); + Vehicle* offlineVehicle = qgcApp()->toolbox()->multiVehicleManager()->offlineEditingVehicle(); + + connect(offlineVehicle, &Vehicle::vehicleTypeChanged, this, &FactValueGrid::_offlineVehicleTypeChanged); + connect(this, &FactValueGrid::fontSizeChanged, this, &FactValueGrid::_saveSettings); + + _vehicleClass = QGCMAVLink::vehicleClass(offlineVehicle->vehicleType()); +} + +void FactValueGrid::_offlineVehicleTypeChanged(void) +{ + Vehicle* offlineVehicle = qgcApp()->toolbox()->multiVehicleManager()->offlineEditingVehicle(); + QGCMAVLink::VehicleClass_t newVehicleClass = QGCMAVLink::vehicleClass(offlineVehicle->vehicleType()); + + if (newVehicleClass != _vehicleClass) { + _vehicleClass = newVehicleClass; + _loadSettings(); + } } void FactValueGrid::componentComplete(void) @@ -243,14 +259,15 @@ void FactValueGrid::_saveSettings(void) return; } - QSettings settings; + QSettings settings; + QString groupNameFormat("%1-%2"); if (_userSettingsGroup.isEmpty()) { // This means we are setting up default settings - settings.beginGroup(_defaultSettingsGroup); + settings.beginGroup(groupNameFormat.arg(_defaultSettingsGroup).arg(_vehicleClass)); } else { // This means we are saving user modifications - settings.remove(_defaultSettingsGroup); - settings.beginGroup(_userSettingsGroup); + settings.remove(groupNameFormat.arg(_defaultSettingsGroup).arg(_vehicleClass)); + settings.beginGroup(groupNameFormat.arg(_userSettingsGroup).arg(_vehicleClass)); } settings.remove(""); // Remove any previous settings @@ -280,21 +297,25 @@ void FactValueGrid::_saveSettings(void) void FactValueGrid::_loadSettings(void) { + _preventSaveSettings = true; + _rows->deleteLater(); - _rows = new QmlObjectListModel(this); - emit rowsChanged(_rows); - QSettings settings; - if (!settings.childGroups().contains(_userSettingsGroup)) { + _rows = new QmlObjectListModel(this); + _columnCount = 0; + + QSettings settings; + QString groupNameFormat("%1-%2"); + + if (!settings.childGroups().contains(groupNameFormat.arg(_userSettingsGroup).arg(_vehicleClass))) { qgcApp()->toolbox()->corePlugin()->factValueGridCreateDefaultSettings(_defaultSettingsGroup); } - _preventSaveSettings = true; - if (settings.childGroups().contains(_defaultSettingsGroup)) { - settings.beginGroup(_defaultSettingsGroup); + if (settings.childGroups().contains(groupNameFormat.arg(_defaultSettingsGroup).arg(_vehicleClass))) { + settings.beginGroup(groupNameFormat.arg(_defaultSettingsGroup).arg(_vehicleClass)); } else { - settings.beginGroup(_userSettingsGroup); + settings.beginGroup(groupNameFormat.arg(_userSettingsGroup).arg(_vehicleClass)); } int version = settings.value(_versionKey, 0).toInt(); @@ -333,11 +354,7 @@ void FactValueGrid::_loadSettings(void) } settings.endArray(); - _preventSaveSettings = false; + emit rowsChanged(_rows); - // Use defaults if nothing there - if (_rows->count() == 0) { - _rows->deleteLater(); - emit rowsChanged(_rows); - } + _preventSaveSettings = false; } diff --git a/src/QmlControls/FactValueGrid.h b/src/QmlControls/FactValueGrid.h index a382c078833e02ee8fd0e37bf9fc5743eee40019..e7f24ed3d8f5bea8fb16012eda281d4038b85ce6 100644 --- a/src/QmlControls/FactValueGrid.h +++ b/src/QmlControls/FactValueGrid.h @@ -65,8 +65,10 @@ public: Q_INVOKABLE void appendColumn (void); Q_INVOKABLE void deleteLastColumn (void); - FontSize fontSize (void) const { return _fontSize; } - QStringList iconNames (void) const { return _iconNames; } + QmlObjectListModel* rows (void) const { return _rows; } + FontSize fontSize (void) const { return _fontSize; } + QStringList iconNames (void) const { return _iconNames; } + QGCMAVLink::VehicleClass_t vehicleClass(void) const { return _vehicleClass; } void setFontSize(FontSize fontSize); @@ -81,22 +83,25 @@ signals: void columnCountChanged (int columnCount); protected: - Q_DISABLE_COPY(FactValueGrid) - QString _defaultSettingsGroup; // Settings group to read from if the user has not modified from the default settings - QString _userSettingsGroup; // Settings group to read from for user modified settings - Orientation _orientation = VerticalOrientation; - FontSize _fontSize = DefaultFontSize; - bool _preventSaveSettings = false; - QmlObjectListModel* _rows = nullptr; - int _columnCount = 0; + QGCMAVLink::VehicleClass_t _vehicleClass = QGCMAVLink::VehicleClassGeneric; + QString _defaultSettingsGroup; // Settings group to read from if the user has not modified from the default settings + QString _userSettingsGroup; // Settings group to read from for user modified settings + Orientation _orientation = VerticalOrientation; + FontSize _fontSize = DefaultFontSize; + bool _preventSaveSettings = false; + QmlObjectListModel* _rows = nullptr; + int _columnCount = 0; + +private slots: + void _offlineVehicleTypeChanged(void); private: InstrumentValueData* _createNewInstrumentValueWorker (QObject* parent); void _saveSettings (void); void _loadSettings (void); - void _connectSignals (void); + void _init (void); void _connectSaveSignals (InstrumentValueData* value); QString _pascalCase (const QString& text); void _saveValueData (QSettings& settings, InstrumentValueData* value); diff --git a/src/QmlControls/HorizontalFactValueGrid.cc b/src/QmlControls/HorizontalFactValueGrid.cc index 51d2e2b545f0b7ef8f32665e6c2df246452c5172..bedb044230c845396448b59f3e1430fd9776b8bc 100644 --- a/src/QmlControls/HorizontalFactValueGrid.cc +++ b/src/QmlControls/HorizontalFactValueGrid.cc @@ -14,8 +14,8 @@ #include -const QString HorizontalFactValueGrid::_toolbarUserSettingsGroup ("ToolbarUserSettings2"); -const QString HorizontalFactValueGrid::toolbarDefaultSettingsGroup ("ToolbarDefaultSettings2"); +const QString HorizontalFactValueGrid::_toolbarUserSettingsGroup ("TelemetryBarUserSettingsWIP0"); +const QString HorizontalFactValueGrid::telemetryBarDefaultSettingsGroup ("TelemetryBarDefaultSettingsWIP0"); HorizontalFactValueGrid::HorizontalFactValueGrid(QQuickItem* parent) : FactValueGrid(parent) diff --git a/src/QmlControls/HorizontalFactValueGrid.h b/src/QmlControls/HorizontalFactValueGrid.h index cb563ee4009acd5cac1b58ab4366ebc8f1ff8f4e..03763c8b1a22186c59a1aac0041d9e78b7425d02 100644 --- a/src/QmlControls/HorizontalFactValueGrid.h +++ b/src/QmlControls/HorizontalFactValueGrid.h @@ -24,10 +24,10 @@ public: HorizontalFactValueGrid(QQuickItem *parent = nullptr); HorizontalFactValueGrid(const QString& defaultSettingsGroup); - Q_PROPERTY(QString toolbarDefaultSettingsGroup MEMBER toolbarDefaultSettingsGroup CONSTANT) - Q_PROPERTY(QString toolbarUserSettingsGroup MEMBER _toolbarUserSettingsGroup CONSTANT) + Q_PROPERTY(QString telemetryBarDefaultSettingsGroup MEMBER telemetryBarDefaultSettingsGroup CONSTANT) + Q_PROPERTY(QString telemetryBarUserSettingsGroup MEMBER _toolbarUserSettingsGroup CONSTANT) - static const QString toolbarDefaultSettingsGroup; + static const QString telemetryBarDefaultSettingsGroup; private: Q_DISABLE_COPY(HorizontalFactValueGrid) diff --git a/src/QmlControls/HorizontalFactValueGrid.qml b/src/QmlControls/HorizontalFactValueGrid.qml index 2c89391d5015abe8ce3cc0d3524597470883df68..3c9d5155d7bf6fdc50ae2b89713e22227dda6b41 100644 --- a/src/QmlControls/HorizontalFactValueGrid.qml +++ b/src/QmlControls/HorizontalFactValueGrid.qml @@ -25,8 +25,9 @@ import QGroundControl 1.0 // If this becomes a problem I'll implement our own grid layout control T.HorizontalFactValueGrid { - id: _root - width: topLevelRowLayout.width + id: _root + Layout.preferredWidth: topLevelRowLayout.width + Layout.preferredHeight: topLevelRowLayout.height property bool settingsUnlocked: false @@ -39,15 +40,14 @@ T.HorizontalFactValueGrid { QGCPalette { id: qgcPal; colorGroupEnabled: enabled } RowLayout { - id: topLevelRowLayout - height: parent.height + id: topLevelRowLayout Item { - id: lockItem - Layout.fillHeight: true - width: ScreenTools.minTouchPixels - visible: settingsUnlocked - enabled: settingsUnlocked + id: lockItem + Layout.fillHeight: true + Layout.preferredWidth: ScreenTools.minTouchPixels + visible: settingsUnlocked + enabled: settingsUnlocked QGCColoredImage { anchors.centerIn: parent @@ -70,10 +70,9 @@ T.HorizontalFactValueGrid { Layout.fillHeight: true GridLayout { - id: valueGrid - Layout.preferredHeight: _root.height - rows: _root.rows.count - rowSpacing: 0 + id: valueGrid + rows: _root.rows.count + rowSpacing: 0 Repeater { model: _root.rows @@ -86,7 +85,7 @@ T.HorizontalFactValueGrid { InstrumentValueLabel { Layout.row: labelRepeater._index - Layout.column: index * 2 + Layout.column: index * 3 Layout.fillHeight: true Layout.alignment: Qt.AlignRight instrumentValueData: object @@ -105,22 +104,40 @@ T.HorizontalFactValueGrid { InstrumentValueValue { Layout.row: valueRepeater._index - Layout.column: index * 2 + 1 + Layout.column: (index * 3) + 1 Layout.fillHeight: true Layout.alignment: Qt.AlignLeft instrumentValueData: object } } } + + Repeater { + model: _root.rows + + Repeater { + id: spacerRepeater + model: object.count > 1 ? object : 0 + + property real _index: index + + Item { + Layout.row: spacerRepeater._index + Layout.column: (index * 3) + 2 + Layout.preferredWidth: ScreenTools.defaultFontPixelWidth + Layout.preferredHeight: 1 + } + } + } } RowLayout { - id: rowButtons - height: ScreenTools.minTouchPixels / 2 - Layout.fillWidth: true - spacing: 1 - visible: settingsUnlocked - enabled: settingsUnlocked + id: rowButtons + Layout.preferredHeight: ScreenTools.minTouchPixels / 2 + Layout.fillWidth: true + spacing: 1 + visible: settingsUnlocked + enabled: settingsUnlocked QGCButton { Layout.fillWidth: true diff --git a/src/QmlControls/QGroundControl/FlightDisplay/qmldir b/src/QmlControls/QGroundControl/FlightDisplay/qmldir index 662b1b19011e8febbfd51242e67dc8a33e5086a3..e5ea5bff5fc6e625b5d6fb82104afdfab526ccd6 100644 --- a/src/QmlControls/QGroundControl/FlightDisplay/qmldir +++ b/src/QmlControls/QGroundControl/FlightDisplay/qmldir @@ -30,4 +30,5 @@ PreFlightRCCheck 1.0 PreFlightRCCheck.qml PreFlightSensorsHealthCheck 1.0 PreFlightSensorsHealthCheck.qml PreFlightSoundCheck 1.0 PreFlightSoundCheck.qml TerrainProgress 1.0 TerrainProgress.qml +TelemetryValuesBar 1.0 TelemetryValuesBar.qml VehicleWarnings 1.0 VehicleWarnings.qml diff --git a/src/QmlControls/ToolStrip.qml b/src/QmlControls/ToolStrip.qml index 4740836b77b32c429e0310141a4c78378b2fbbcd..3c6b7d8e08cced478621b0e7c0de1db2db42b690 100644 --- a/src/QmlControls/ToolStrip.qml +++ b/src/QmlControls/ToolStrip.qml @@ -17,7 +17,7 @@ import QGroundControl.Controls 1.0 Rectangle { id: _root - color: qgcPal.globalTheme === QGCPalette.Light ? QGroundControl.corePlugin.options.toolbarBackgroundLight : QGroundControl.corePlugin.options.toolbarBackgroundDark + color: qgcPal.toolbarBackground width: _idealWidth < repeater.contentWidth ? repeater.contentWidth : _idealWidth height: Math.min(maxHeight, toolStripColumn.height + (flickable.anchors.margins * 2)) radius: ScreenTools.defaultFontPixelWidth / 2 diff --git a/src/api/QGCCorePlugin.cc b/src/api/QGCCorePlugin.cc index 4e0e365bec11dbffe9d84a6745836ddb33974cd0..b8c36f9a35d678cafd3418ec823a981ca889bea6 100644 --- a/src/api/QGCCorePlugin.cc +++ b/src/api/QGCCorePlugin.cc @@ -97,7 +97,6 @@ public: QmlComponentInfo* pQmlTest = nullptr; #endif - QmlComponentInfo* valuesPageWidgetInfo = nullptr; QmlComponentInfo* cameraPageWidgetInfo = nullptr; QmlComponentInfo* videoPageWidgetInfo = nullptr; QmlComponentInfo* vibrationPageWidgetInfo = nullptr; @@ -191,10 +190,6 @@ void QGCCorePlugin::_autoStreamChanged() void QGCCorePlugin::_resetInstrumentPages() { - if (_p->valuesPageWidgetInfo) { - _p->valuesPageWidgetInfo->deleteLater(); - _p->valuesPageWidgetInfo = nullptr; - } if(_p->cameraPageWidgetInfo) { _p->cameraPageWidgetInfo->deleteLater(); _p->cameraPageWidgetInfo = nullptr; @@ -273,8 +268,7 @@ QVariantList &QGCCorePlugin::settingsPages() QVariantList& QGCCorePlugin::instrumentPages() { - if (!_p->valuesPageWidgetInfo) { - _p->valuesPageWidgetInfo = new QmlComponentInfo(tr("Values"), QUrl::fromUserInput("qrc:/qml/ValuePageWidget.qml")); + if (!_p->cameraPageWidgetInfo) { _p->cameraPageWidgetInfo = new QmlComponentInfo(tr("Camera"), QUrl::fromUserInput("qrc:/qml/CameraPageWidget.qml")); #if defined(QGC_GST_STREAMING) if(!_currentCamera || !_currentCamera->autoStream()) { @@ -284,7 +278,6 @@ QVariantList& QGCCorePlugin::instrumentPages() #endif _p->vibrationPageWidgetInfo = new QmlComponentInfo(tr("Vibration"), QUrl::fromUserInput("qrc:/qml/VibrationPageWidget.qml")); - _p->instrumentPageWidgetList.append(QVariant::fromValue(_p->valuesPageWidgetInfo)); _p->instrumentPageWidgetList.append(QVariant::fromValue(_p->cameraPageWidgetInfo)); #if defined(QGC_GST_STREAMING) _p->instrumentPageWidgetList.append(QVariant::fromValue(_p->videoPageWidgetInfo)); @@ -397,46 +390,75 @@ QString QGCCorePlugin::showAdvancedUIMessage() const void QGCCorePlugin::factValueGridCreateDefaultSettings(const QString& defaultSettingsGroup) { - if (defaultSettingsGroup == VerticalFactValueGrid::valuePageDefaultSettingsGroup) { - VerticalFactValueGrid factValueGrid(defaultSettingsGroup); + HorizontalFactValueGrid factValueGrid(defaultSettingsGroup); - factValueGrid.setFontSize(FactValueGrid::LargeFontSize); + bool includeFWValues = factValueGrid.vehicleClass() == QGCMAVLink::VehicleClassFixedWing || factValueGrid.vehicleClass() == QGCMAVLink::VehicleClassVTOL; - QmlObjectListModel* row = factValueGrid.appendRow(); - InstrumentValueData* value = row->value(0); - value->setFact("Vehicle", "DistanceToHome"); - value->setText(value->fact()->shortDescription()); - value->setShowUnits(true); + factValueGrid.setFontSize(FactValueGrid::LargeFontSize); - row = factValueGrid.appendRow(); - value = row->value(0); - value->setFact("Vehicle", "FlightDistance"); - value->setText(value->fact()->shortDescription()); - value->setShowUnits(true); + factValueGrid.appendRow(); + factValueGrid.appendRow(); + factValueGrid.appendColumn(); + factValueGrid.appendColumn(); + if (includeFWValues) { + factValueGrid.appendColumn(); + } - row = factValueGrid.appendRow(); - value = row->value(0); - value->setFact("Vehicle", "FlightTime"); - value->setText(value->fact()->shortDescription()); - value->setShowUnits(false); - } else if (defaultSettingsGroup == HorizontalFactValueGrid::toolbarDefaultSettingsGroup) { - HorizontalFactValueGrid factValueGrid(defaultSettingsGroup); - - factValueGrid.setFontSize(FactValueGrid::LargeFontSize); - - QmlObjectListModel* row = factValueGrid.appendRow(); - InstrumentValueData* value = row->value(0); - value->setFact("Vehicle", "AltitudeRelative"); - value->setIcon("arrow-thick-up.svg"); - value->setText(value->fact()->shortDescription()); + int colIndex = 0; + QmlObjectListModel* row = factValueGrid.rows()->value(0); + + InstrumentValueData* value = row->value(colIndex++); + value->setFact("Vehicle", "AltitudeRelative"); + value->setIcon("arrow-thick-up.svg"); + value->setText(value->fact()->shortDescription()); + value->setShowUnits(true); + + value = row->value(colIndex++); + value->setFact("Vehicle", "ClimbRate"); + value->setIcon("arrow-simple-up.svg"); + value->setText(value->fact()->shortDescription()); + value->setShowUnits(true); + + if (includeFWValues) { + value = row->value(colIndex++); + value->setFact("Vehicle", "AirSpeed"); + value->setText("AirSpd"); value->setShowUnits(true); + } - row = factValueGrid.appendRow(); - value = row->value(0); - value->setFact("Vehicle", "GroundSpeed"); - value->setIcon("arrow-thick-right.svg"); + value = row->value(colIndex++); + value->setFact("Vehicle", "FlightTime"); + value->setIcon("timer.svg"); + value->setText(value->fact()->shortDescription()); + value->setShowUnits(false); + + colIndex = 0; + row = factValueGrid.rows()->value(1); + + value = row->value(colIndex++); + value->setFact("Vehicle", "DistanceToHome"); + value->setIcon("bookmark copy 3.svg"); + value->setText(value->fact()->shortDescription()); + value->setShowUnits(true); + + value = row->value(colIndex++); + value->setFact("Vehicle", "GroundSpeed"); + value->setIcon("arrow-simple-right.svg"); + value->setText(value->fact()->shortDescription()); + value->setShowUnits(true); + + if (includeFWValues) { + value = row->value(colIndex++); + value->setFact("Vehicle", "ThrottlePct"); + value->setText("Thr"); value->setShowUnits(true); } + + value = row->value(colIndex++); + value->setFact("Vehicle", "FlightDistance"); + value->setIcon("travel-walk.svg"); + value->setText(value->fact()->shortDescription()); + value->setShowUnits(true); } QQmlApplicationEngine* QGCCorePlugin::createQmlApplicationEngine(QObject* parent) diff --git a/src/api/QGCOptions.h b/src/api/QGCOptions.h index 60e0ebf1cd7c3c5893672c27c2a09a0a1dd87ba3..43f01167d0ca670d8cdab06b4cc7ec4403d93895 100644 --- a/src/api/QGCOptions.h +++ b/src/api/QGCOptions.h @@ -55,8 +55,6 @@ public: Q_PROPERTY(double toolbarHeightMultiplier READ toolbarHeightMultiplier CONSTANT) Q_PROPERTY(bool enablePlanViewSelector READ enablePlanViewSelector CONSTANT) Q_PROPERTY(QUrl preFlightChecklistUrl READ preFlightChecklistUrl CONSTANT) - Q_PROPERTY(QColor toolbarBackgroundLight READ toolbarBackgroundLight CONSTANT) - Q_PROPERTY(QColor toolbarBackgroundDark READ toolbarBackgroundDark CONSTANT) Q_PROPERTY(bool showSensorCalibrationCompass READ showSensorCalibrationCompass NOTIFY showSensorCalibrationCompassChanged) Q_PROPERTY(bool showSensorCalibrationGyro READ showSensorCalibrationGyro NOTIFY showSensorCalibrationGyroChanged) Q_PROPERTY(bool showSensorCalibrationAccel READ showSensorCalibrationAccel NOTIFY showSensorCalibrationAccelChanged) diff --git a/src/ui/MainRootWindow.qml b/src/ui/MainRootWindow.qml index 39cff0c82b7f24a0bbb5ddfccb8136711659763a..1443be9dcfc2a4b9cdd3ebd73c873d0a22ee53d4 100644 --- a/src/ui/MainRootWindow.qml +++ b/src/ui/MainRootWindow.qml @@ -375,7 +375,7 @@ ApplicationWindow { id: planButton height: viewSelectDrawer._toolButtonHeight Layout.fillWidth: true - text: qsTr("Plan View") + text: qsTr("Plan Mission") imageResource: "/qmlimages/Plan.svg" imageColor: qgcPal.text onClicked: { diff --git a/src/ui/toolbar/MainToolBar.qml b/src/ui/toolbar/MainToolBar.qml index 2f2152485069115c62fdf4a74edf3fe6b2c66dc7..6793faf27a71ef445620a385a3699e5e987752f3 100644 --- a/src/ui/toolbar/MainToolBar.qml +++ b/src/ui/toolbar/MainToolBar.qml @@ -21,7 +21,7 @@ import QGroundControl.Controllers 1.0 Rectangle { id: _root - color: qgcPal.globalTheme === QGCPalette.Light ? QGroundControl.corePlugin.options.toolbarBackgroundLight : QGroundControl.corePlugin.options.toolbarBackgroundDark + color: qgcPal.toolbarBackground property int currentToolbar: flyViewToolbar @@ -115,39 +115,11 @@ Rectangle { anchors.right: parent.right contentWidth: indicatorLoader.x + indicatorLoader.width flickableDirection: Flickable.HorizontalFlick - clip: !valueArea.settingsUnlocked - - HorizontalFactValueGrid { - id: valueArea - anchors.top: parent.top - anchors.bottom: parent.bottom - userSettingsGroup: toolbarUserSettingsGroup - defaultSettingsGroup: toolbarDefaultSettingsGroup - visible: currentToolbar !== planViewToolbar - - QGCMouseArea { - anchors.fill: parent - visible: !parent.settingsUnlocked - onClicked: parent.settingsUnlocked = true - } - } - - Rectangle { - id: separator2 - anchors.margins: ScreenTools.defaultFontPixelHeight / 2 - anchors.bottomMargin: ScreenTools.defaultFontPixelHeight / 2 - 1 - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.left: valueArea.right - width: 1 - color: qgcPal.text - visible: currentToolbar == flyViewToolbar - } Loader { id: indicatorLoader anchors.leftMargin: currentToolbar !== planViewToolbar ? ScreenTools.defaultFontPixelHeight / 2 : 0 - anchors.left: currentToolbar !== planViewToolbar ? separator2.right : parent.left + anchors.left: parent.left//currentToolbar !== planViewToolbar ? valueArea.right : parent.left anchors.top: parent.top anchors.bottom: parent.bottom source: currentToolbar === flyViewToolbar ?