Browse Source

Merge pull request #8173 from DonLakeFlyer/Fixes

Fixes
QGC4.4
Don Gagne 5 years ago committed by GitHub
parent
commit
6fa7ef2d30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/FlightDisplay/FlightDisplayViewMap.qml
  2. 1
      src/QmlControls/ParameterEditor.qml
  3. 6
      src/Settings/FlyView.SettingsGroup.json
  4. 1
      src/Settings/FlyViewSettings.cc
  5. 1
      src/Settings/FlyViewSettings.h
  6. 4
      src/VehicleSetup/SetupView.qml
  7. 8
      src/ui/preferences/GeneralSettings.qml

10
src/FlightDisplay/FlightDisplayViewMap.qml

@ -48,6 +48,8 @@ FlightMap {
property var _activeVehicleCoordinate: activeVehicle ? activeVehicle.coordinate : QtPositioning.coordinate() property var _activeVehicleCoordinate: activeVehicle ? activeVehicle.coordinate : QtPositioning.coordinate()
property real _toolButtonTopMargin: parent.height - mainWindow.height + (ScreenTools.defaultFontPixelHeight / 2) property real _toolButtonTopMargin: parent.height - mainWindow.height + (ScreenTools.defaultFontPixelHeight / 2)
property bool _airspaceEnabled: QGroundControl.airmapSupported ? (QGroundControl.settingsManager.airMapSettings.enableAirMap.rawValue && QGroundControl.airspaceManager.connected): false property bool _airspaceEnabled: QGroundControl.airmapSupported ? (QGroundControl.settingsManager.airMapSettings.enableAirMap.rawValue && QGroundControl.airspaceManager.connected): false
property var _flyViewSettings: QGroundControl.settingsManager.flyViewSettings
property bool _keepMapCenteredOnVehicle: _flyViewSettings.keepMapCenteredOnVehicle.rawValue
property bool _disableVehicleTracking: false property bool _disableVehicleTracking: false
property bool _keepVehicleCentered: mainIsMap ? false : true property bool _keepVehicleCentered: mainIsMap ? false : true
@ -129,7 +131,7 @@ FlightMap {
function updateMapToVehiclePosition() { function updateMapToVehiclePosition() {
// We let FlightMap handle first vehicle position // We let FlightMap handle first vehicle position
if (firstVehiclePositionReceived && _activeVehicleCoordinate.isValid && !_disableVehicleTracking) { if (!_keepMapCenteredOnVehicle && firstVehiclePositionReceived && _activeVehicleCoordinate.isValid && !_disableVehicleTracking) {
if (_keepVehicleCentered) { if (_keepVehicleCentered) {
flightMap.center = _activeVehicleCoordinate flightMap.center = _activeVehicleCoordinate
} else { } else {
@ -140,6 +142,12 @@ FlightMap {
} }
} }
on_ActiveVehicleCoordinateChanged: {
if (_keepMapCenteredOnVehicle && _activeVehicleCoordinate.isValid && !_disableVehicleTracking) {
flightMap.center = _activeVehicleCoordinate
}
}
Timer { Timer {
id: panRecenterTimer id: panRecenterTimer
interval: 10000 interval: 10000

1
src/QmlControls/ParameterEditor.qml

@ -107,7 +107,6 @@ Item {
} }
QGCMenuItem { QGCMenuItem {
text: qsTr("Reset all to firmware's defaults") text: qsTr("Reset all to firmware's defaults")
visible: !activeVehicle.apmFirmware
onTriggered: mainWindow.showComponentDialog(resetToDefaultConfirmComponent, qsTr("Reset All"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Reset) onTriggered: mainWindow.showComponentDialog(resetToDefaultConfirmComponent, qsTr("Reset All"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Reset)
} }
QGCMenuItem { QGCMenuItem {

6
src/Settings/FlyView.SettingsGroup.json

@ -38,6 +38,12 @@
"defaultValue": false "defaultValue": false
}, },
{ {
"name": "keepMapCenteredOnVehicle",
"shortDescription": "Keep map centered on vehicle",
"type": "bool",
"defaultValue": false
},
{
"name": "maxGoToLocationDistance", "name": "maxGoToLocationDistance",
"shortDescription": "Maximum distance allowed for Go To Location.", "shortDescription": "Maximum distance allowed for Go To Location.",
"type": "double", "type": "double",

1
src/Settings/FlyViewSettings.cc

@ -24,3 +24,4 @@ DECLARE_SETTINGSFACT(FlyViewSettings, alternateInstrumentPanel)
DECLARE_SETTINGSFACT(FlyViewSettings, showAdditionalIndicatorsCompass) DECLARE_SETTINGSFACT(FlyViewSettings, showAdditionalIndicatorsCompass)
DECLARE_SETTINGSFACT(FlyViewSettings, lockNoseUpCompass) DECLARE_SETTINGSFACT(FlyViewSettings, lockNoseUpCompass)
DECLARE_SETTINGSFACT(FlyViewSettings, maxGoToLocationDistance) DECLARE_SETTINGSFACT(FlyViewSettings, maxGoToLocationDistance)
DECLARE_SETTINGSFACT(FlyViewSettings, keepMapCenteredOnVehicle)

1
src/Settings/FlyViewSettings.h

@ -26,4 +26,5 @@ public:
DEFINE_SETTINGFACT(showAdditionalIndicatorsCompass) DEFINE_SETTINGFACT(showAdditionalIndicatorsCompass)
DEFINE_SETTINGFACT(lockNoseUpCompass) DEFINE_SETTINGFACT(lockNoseUpCompass)
DEFINE_SETTINGFACT(maxGoToLocationDistance) DEFINE_SETTINGFACT(maxGoToLocationDistance)
DEFINE_SETTINGFACT(keepMapCenteredOnVehicle)
}; };

4
src/VehicleSetup/SetupView.qml

@ -257,7 +257,7 @@ Rectangle {
setupIndicator: false setupIndicator: false
text: qsTr("PX4Flow") text: qsTr("PX4Flow")
Layout.fillWidth: true Layout.fillWidth: true
onClicked: showPX4FlowPanel(this, "PX4FlowSensor.qml") onClicked: showPanel(this, "PX4FlowSensor.qml")
} }
SubMenuButton { SubMenuButton {
@ -268,7 +268,7 @@ Rectangle {
visible: _fullParameterVehicleAvailable && joystickManager.joysticks.length !== 0 visible: _fullParameterVehicleAvailable && joystickManager.joysticks.length !== 0
text: qsTr("Joystick") text: qsTr("Joystick")
Layout.fillWidth: true Layout.fillWidth: true
onClicked: showJoystickPanel(this, "JoystickConfig.qml") onClicked: showPanel(this, "JoystickConfig.qml")
} }
Repeater { Repeater {

8
src/ui/preferences/GeneralSettings.qml

@ -469,6 +469,14 @@ Rectangle {
} }
FactCheckBox { FactCheckBox {
text: qsTr("Keep Map Centered On Vehicle")
fact: _keepMapCenteredOnVehicle
visible: _keepMapCenteredOnVehicle.visible
property Fact _keepMapCenteredOnVehicle: QGroundControl.settingsManager.flyViewSettings.keepMapCenteredOnVehicle
}
FactCheckBox {
text: qsTr("Show Telemetry Log Replay Status Bar") text: qsTr("Show Telemetry Log Replay Status Bar")
fact: _showLogReplayStatusBar fact: _showLogReplayStatusBar
visible: _showLogReplayStatusBar.visible visible: _showLogReplayStatusBar.visible

Loading…
Cancel
Save