Commit 54e85068 authored by Don Gagne's avatar Don Gagne

Merge pull request #1945 from DonLakeFlyer/FlightMapCenterTool

Flight map center tool
parents e485007a 8f8d5569
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -70,6 +70,10 @@ Item { ...@@ -70,6 +70,10 @@ Item {
property bool _showMap: getBool(QGroundControl.flightMapSettings.loadMapSetting(flightMap.mapName, _showMapBackgroundKey, "1")) property bool _showMap: getBool(QGroundControl.flightMapSettings.loadMapSetting(flightMap.mapName, _showMapBackgroundKey, "1"))
ExclusiveGroup {
id: _dropButtonsExclusiveGroup
}
// Validate _showMap setting // Validate _showMap setting
Component.onCompleted: _setShowMap(_showMap) Component.onCompleted: _setShowMap(_showMap)
...@@ -90,10 +94,25 @@ Item { ...@@ -90,10 +94,25 @@ Item {
id: flightMap id: flightMap
anchors.fill: parent anchors.fill: parent
mapName: _mapName mapName: _mapName
latitude: parent._latitude
longitude: parent._longitude
visible: _showMap visible: _showMap
property real rootLatitude: root._latitude
property real rootLongitude: root._longitude
Component.onCompleted: updateMapPosition(true /* force */)
onRootLatitudeChanged: updateMapPosition(false /* force */)
onRootLongitudeChanged: updateMapPosition(false /* force */)
function updateMapPosition(force) {
if (_followVehicle || force) {
latitude = root._latitude
longitude = root._longitude
}
}
property bool _followVehicle: true
// Home position // Home position
MissionItemIndicator { MissionItemIndicator {
label: "H" label: "H"
...@@ -145,21 +164,65 @@ Item { ...@@ -145,21 +164,65 @@ Item {
} }
QGCCompassWidget { QGCCompassWidget {
x: ScreenTools.defaultFontPixelSize * (7.1) anchors.margins: ScreenTools.defaultFontPixelHeight
y: ScreenTools.defaultFontPixelSize * (0.42) anchors.left: parent.left
size: ScreenTools.defaultFontPixelSize * (13.3) anchors.top: parent.top
heading: _heading size: ScreenTools.defaultFontPixelSize * (13.3)
active: multiVehicleManager.activeVehicleAvailable heading: _heading
active: multiVehicleManager.activeVehicleAvailable
} }
QGCAttitudeWidget { QGCAttitudeWidget {
anchors.rightMargin: ScreenTools.defaultFontPixelSize * (7.1) anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.right: parent.right anchors.left: parent.left
y: ScreenTools.defaultFontPixelSize * (0.42) anchors.bottom: parent.bottom
size: ScreenTools.defaultFontPixelSize * (13.3) size: ScreenTools.defaultFontPixelSize * (13.3)
rollAngle: _roll rollAngle: _roll
pitchAngle: _pitch pitchAngle: _pitch
active: multiVehicleManager.activeVehicleAvailable active: multiVehicleManager.activeVehicleAvailable
}
DropButton {
id: centerMapDropButton
anchors.rightMargin: ScreenTools.defaultFontPixelHeight
anchors.right: mapTypeButton.left
anchors.top: mapTypeButton.top
dropDirection: dropDown
buttonImage: "/qmlimages/MapCenter.svg"
viewportMargins: ScreenTools.defaultFontPixelWidth / 2
exclusiveGroup: _dropButtonsExclusiveGroup
dropDownComponent: Component {
Row {
spacing: ScreenTools.defaultFontPixelWidth
QGCCheckBox {
id: followVehicleCheckBox
text: "Follow Vehicle"
checked: flightMap._followVehicle
anchors.baseline: centerMapButton.baseline
onClicked: {
centerMapDropButton.hideDropDown()
flightMap._followVehicle = !flightMap._followVehicle
}
}
QGCButton {
id: centerMapButton
text: "Center map on Vehicle"
enabled: _activeVehicle && !followVehicleCheckBox.checked
property var activeVehicle: multiVehicleManager.activeVehicle
onClicked: {
centerMapDropButton.hideDropDown()
flightMap.latitude = activeVehicle.latitude
flightMap.longitude = activeVehicle.longitude
}
}
}
}
} }
DropButton { DropButton {
...@@ -170,6 +233,7 @@ Item { ...@@ -170,6 +233,7 @@ Item {
dropDirection: dropDown dropDirection: dropDown
buttonImage: "/qmlimages/MapType.svg" buttonImage: "/qmlimages/MapType.svg"
viewportMargins: ScreenTools.defaultFontPixelWidth / 2 viewportMargins: ScreenTools.defaultFontPixelWidth / 2
exclusiveGroup: _dropButtonsExclusiveGroup
dropDownComponent: Component { dropDownComponent: Component {
Row { Row {
......
...@@ -198,8 +198,12 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) ...@@ -198,8 +198,12 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
#ifdef __mobile__ #ifdef __mobile__
QLoggingCategory::setFilterRules(QStringLiteral("*Log.debug=false")); QLoggingCategory::setFilterRules(QStringLiteral("*Log.debug=false"));
#else #else
QString filterRules;
// Turn off bogus ssl warning
filterRules += "qt.network.ssl.warning=false\n";
if (logging) { if (logging) {
QString filterRules;
QStringList logList = loggingOptions.split(","); QStringList logList = loggingOptions.split(",");
if (logList[0] == "full") { if (logList[0] == "full") {
...@@ -219,9 +223,6 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) ...@@ -219,9 +223,6 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
// We need to turn off these warnings until the firmware meta data is cleaned up // We need to turn off these warnings until the firmware meta data is cleaned up
filterRules += "PX4ParameterLoaderLog.warning=false\n"; filterRules += "PX4ParameterLoaderLog.warning=false\n";
} }
qDebug() << "Filter rules" << filterRules;
QLoggingCategory::setFilterRules(filterRules);
} else { } else {
if (_runningUnitTests) { if (_runningUnitTests) {
// We need to turn off these warnings until the firmware meta data is cleaned up // We need to turn off these warnings until the firmware meta data is cleaned up
...@@ -266,6 +267,9 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) ...@@ -266,6 +267,9 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
} }
} }
} }
qDebug() << "Filter rules" << filterRules;
QLoggingCategory::setFilterRules(filterRules);
#endif #endif
// Set up timer for delayed missing fact display // Set up timer for delayed missing fact display
......
...@@ -140,6 +140,8 @@ void LogReplayLink::run(void) ...@@ -140,6 +140,8 @@ void LogReplayLink::run(void)
// Run normal event loop until exit // Run normal event loop until exit
exec(); exec();
_readTickTimer.stop();
} }
void LogReplayLink::_replayError(const QString& errorMsg) void LogReplayLink::_replayError(const QString& errorMsg)
......
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