Commit 4a39f75a authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #3734 from DonLakeFlyer/SmallFixes

Center hdop in toolbar, fix goto enabled state handling
parents d276f239 4210e759
...@@ -126,11 +126,13 @@ FlightMap { ...@@ -126,11 +126,13 @@ FlightMap {
onClicked: { onClicked: {
if (_activeVehicle) { if (_activeVehicle) {
if (_activeVehicle.guidedMode && flightWidgets.guidedModeBar.state == "Shown") { if (flightWidgets.guidedModeBar.state != "Shown") {
_gotoHereCoordinate = flightMap.toCoordinate(Qt.point(mouse.x, mouse.y))
flightWidgets.guidedModeBar.confirmAction(flightWidgets.guidedModeBar.confirmGoTo)
} else {
flightWidgets.guidedModeBar.state = "Shown" flightWidgets.guidedModeBar.state = "Shown"
} else {
if (flightWidgets.gotoEnabled) {
_gotoHereCoordinate = flightMap.toCoordinate(Qt.point(mouse.x, mouse.y))
flightWidgets.guidedModeBar.confirmAction(flightWidgets.guidedModeBar.confirmGoTo)
}
} }
} }
} }
......
...@@ -25,7 +25,8 @@ import QGroundControl.FlightMap 1.0 ...@@ -25,7 +25,8 @@ import QGroundControl.FlightMap 1.0
Item { Item {
id: _root id: _root
property alias guidedModeBar: _guidedModeBar property alias guidedModeBar: _guidedModeBar
property bool gotoEnabled: _activeVehicle && _activeVehicle.guidedMode && _activeVehicle.flying
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _isSatellite: _mainIsMap ? (_flightMap ? _flightMap.isSatelliteMap : true) : true property bool _isSatellite: _mainIsMap ? (_flightMap ? _flightMap.isSatelliteMap : true) : true
...@@ -444,7 +445,7 @@ Item { ...@@ -444,7 +445,7 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
color: _lightWidgetBorders ? qgcPal.mapWidgetBorderDark : qgcPal.mapWidgetBorderLight color: _lightWidgetBorders ? qgcPal.mapWidgetBorderDark : qgcPal.mapWidgetBorderLight
text: "Click in map to move vehicle" text: "Click in map to move vehicle"
visible: _activeVehicle && _activeVehicle.guidedMode && _activeVehicle.flying visible: gotoEnabled
} }
Row { Row {
......
...@@ -521,7 +521,7 @@ void Vehicle::_handleExtendedSysState(mavlink_message_t& message) ...@@ -521,7 +521,7 @@ void Vehicle::_handleExtendedSysState(mavlink_message_t& message)
mavlink_msg_extended_sys_state_decode(&message, &extendedState); mavlink_msg_extended_sys_state_decode(&message, &extendedState);
switch (extendedState.landed_state) { switch (extendedState.landed_state) {
case MAV_LANDED_STATE_UNDEFINED: case MAV_LANDED_STATE_UNDEFINED:
break; break;
case MAV_LANDED_STATE_ON_GROUND: case MAV_LANDED_STATE_ON_GROUND:
setFlying(false); setFlying(false);
......
...@@ -139,12 +139,14 @@ Row { ...@@ -139,12 +139,14 @@ Row {
anchors.left: gpsIcon.right anchors.left: gpsIcon.right
QGCLabel { QGCLabel {
anchors.horizontalCenter: hdopValue.horizontalCenter
visible: activeVehicle && !isNaN(activeVehicle.gps.hdop.value) visible: activeVehicle && !isNaN(activeVehicle.gps.hdop.value)
color: qgcPal.buttonText color: qgcPal.buttonText
text: activeVehicle ? activeVehicle.gps.count.valueString : "" text: activeVehicle ? activeVehicle.gps.count.valueString : ""
} }
QGCLabel { QGCLabel {
id: hdopValue
visible: activeVehicle && !isNaN(activeVehicle.gps.hdop.value) visible: activeVehicle && !isNaN(activeVehicle.gps.hdop.value)
color: qgcPal.buttonText color: qgcPal.buttonText
text: activeVehicle ? activeVehicle.gps.hdop.value.toFixed(1) : "" text: activeVehicle ? activeVehicle.gps.hdop.value.toFixed(1) : ""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment