diff --git a/src/FlightDisplay/FlightDisplayViewWidgets.qml b/src/FlightDisplay/FlightDisplayViewWidgets.qml index f58e2cc675a2e4c755ba4a5b54457f5cb86b98e7..13b7d54db63604217045809733e7c50a82fc6a47 100644 --- a/src/FlightDisplay/FlightDisplayViewWidgets.qml +++ b/src/FlightDisplay/FlightDisplayViewWidgets.qml @@ -38,6 +38,7 @@ Item { property bool _airspaceEnabled: QGroundControl.airmapSupported ? QGroundControl.settingsManager.airMapSettings.enableAirMap.rawValue : false readonly property real _margins: ScreenTools.defaultFontPixelHeight * 0.5 + readonly property bool _useAlternateInstrumentPanel: QGroundControl.settingsManager.flyViewSettings.alternateInstrumentPanel.value QGCMapPalette { id: mapPal; lightColors: useLightColors } @@ -74,12 +75,21 @@ Item { break; } } else { - instrumentsLoader.source = "qrc:/qml/QGCInstrumentWidget.qml" + if(_useAlternateInstrumentPanel){ + instrumentsLoader.source = "qrc:/qml/QGCInstrumentWidgetAlternate.qml" + } + else{ + instrumentsLoader.source = "qrc:/qml/QGCInstrumentWidget.qml" + } } } else { instrumentsLoader.source = "" } } + Connections { + target: QGroundControl.settingsManager.flyViewSettings.alternateInstrumentPanel + onValueChanged: _setInstrumentWidget() + } Connections { target: QGroundControl.settingsManager.appSettings.virtualJoystick diff --git a/src/Settings/FlyView.SettingsGroup.json b/src/Settings/FlyView.SettingsGroup.json index 4e861daa46f19b7e7465017bbcd6ff9c020f6e4b..794b8fa9fe333496d1b41e776d094af0e203c16c 100644 --- a/src/Settings/FlyView.SettingsGroup.json +++ b/src/Settings/FlyView.SettingsGroup.json @@ -18,5 +18,11 @@ "shortDescription": "Show/Hide Log Replay status bar", "type": "bool", "defaultValue": false +}, +{ + "name": "alternateInstrumentPanel", + "shortDescription": "Use Alternate Instrument Panel instead of the default one", + "type": "bool", + "defaultValue": false } ] diff --git a/src/Settings/FlyViewSettings.cc b/src/Settings/FlyViewSettings.cc index 68ef5dc807a7dd2827b228a9ec517eeda3ba6ee3..2d3d1f8fa2d723d9b2aa7b0e2530bb0e4558f118 100644 --- a/src/Settings/FlyViewSettings.cc +++ b/src/Settings/FlyViewSettings.cc @@ -20,3 +20,4 @@ DECLARE_SETTINGGROUP(FlyView, "FlyView") DECLARE_SETTINGSFACT(FlyViewSettings, guidedMinimumAltitude) DECLARE_SETTINGSFACT(FlyViewSettings, guidedMaximumAltitude) DECLARE_SETTINGSFACT(FlyViewSettings, showLogReplayStatusBar) +DECLARE_SETTINGSFACT(FlyViewSettings, alternateInstrumentPanel) diff --git a/src/Settings/FlyViewSettings.h b/src/Settings/FlyViewSettings.h index a6dda7be1c00ece306640f1e573f0c85048c309e..ee12163b25d8949299fcffb5b5ec4958eec37e91 100644 --- a/src/Settings/FlyViewSettings.h +++ b/src/Settings/FlyViewSettings.h @@ -22,4 +22,5 @@ public: DEFINE_SETTINGFACT(guidedMinimumAltitude) DEFINE_SETTINGFACT(guidedMaximumAltitude) DEFINE_SETTINGFACT(showLogReplayStatusBar) + DEFINE_SETTINGFACT(alternateInstrumentPanel) }; diff --git a/src/ui/preferences/GeneralSettings.qml b/src/ui/preferences/GeneralSettings.qml index add796374c6b5a8caacc1f4f02546228df99f805..8a07958cefa2d3f186f1f3182d0480b30d66ed12 100644 --- a/src/ui/preferences/GeneralSettings.qml +++ b/src/ui/preferences/GeneralSettings.qml @@ -461,6 +461,13 @@ Rectangle { property Fact _virtualJoystickCentralized: QGroundControl.settingsManager.appSettings.virtualJoystickCentralized } + FactCheckBox { + text: qsTr("Use Alternate Instrument Panel") + visible: _alternateInstrumentPanel.visible + fact: _alternateInstrumentPanel + + property Fact _alternateInstrumentPanel: QGroundControl.settingsManager.flyViewSettings.alternateInstrumentPanel + } GridLayout { columns: 2