diff --git a/ios/iOS-Info.plist b/ios/iOS-Info.plist
index cef6abd540b20c6f0c7d9408a8bcd9833c82e148..c53044cc1705913b2e37f25f11a4b9c77f8dfe6b 100644
--- a/ios/iOS-Info.plist
+++ b/ios/iOS-Info.plist
@@ -34,6 +34,10 @@
6.0
ForAppStore
No
+ NSLocationUsageDescription
+ Ground Station Location
+ NSLocationWhenInUseUsageDescription
+ Ground Station Location
UISupportedInterfaceOrientations
UIInterfaceOrientationLandscapeLeft
diff --git a/ios/iOSForAppStore-Info.plist b/ios/iOSForAppStore-Info.plist
index f7da584756cdc10f33111b24736257077139ff77..fa6a00820c75866c770865b0f957a276a624880b 100644
--- a/ios/iOSForAppStore-Info.plist
+++ b/ios/iOSForAppStore-Info.plist
@@ -34,6 +34,10 @@
6.0
ForAppStore
Yes
+ NSLocationUsageDescription
+ Ground Station Location
+ NSLocationWhenInUseUsageDescription
+ Ground Station Location
UISupportedInterfaceOrientations
UIInterfaceOrientationLandscapeLeft
diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro
index ad837923c0724c754703493f694c8e7b9eeded1d..1cc7b603e08aca89b3df794cfe5bab1721c7022a 100644
--- a/qgroundcontrol.pro
+++ b/qgroundcontrol.pro
@@ -54,10 +54,10 @@ CONFIG += qt \
thread
QT += \
- network \
concurrent \
gui \
location \
+ network \
opengl \
positioning \
qml \
diff --git a/src/FlightDisplay/FlightDisplayView.qml b/src/FlightDisplay/FlightDisplayView.qml
index b25ba207898ec4054d9c801397b7c78fcea5a0df..3f0b4cce33212a78b44676a801bfb6740a254312 100644
--- a/src/FlightDisplay/FlightDisplayView.qml
+++ b/src/FlightDisplay/FlightDisplayView.qml
@@ -49,7 +49,7 @@ Item {
property var _activeVehicle: multiVehicleManager.activeVehicle
- readonly property var _defaultVehicleCoordinate: QtPositioning.coordinate(37.803784, -122.462276)
+ readonly property var _defaultVehicleCoordinate: mainWindow.tabletPosition
readonly property real _defaultRoll: 0
readonly property real _defaultPitch: 0
readonly property real _defaultHeading: 0
diff --git a/src/FlightDisplay/FlightDisplayViewMap.qml b/src/FlightDisplay/FlightDisplayViewMap.qml
index 4133640a93c3586426dfba7577f478faea63ddc1..9eaf51791767864560dd9d9774a451f863333a0f 100644
--- a/src/FlightDisplay/FlightDisplayViewMap.qml
+++ b/src/FlightDisplay/FlightDisplayViewMap.qml
@@ -39,8 +39,8 @@ FlightMap {
id: flightMap
anchors.fill: parent
mapName: _mapName
- latitude: root._defaultCoordinate.latitude
- longitude: root._defaultCoordinate.longitude
+ latitude: mainWindow.tabletPosition.latitude
+ longitude: mainWindow.tabletPosition.longitude
property var rootVehicleCoordinate: _vehicleCoordinate
property bool _followVehicle: true
diff --git a/src/FlightMap/FlightMap.qml b/src/FlightMap/FlightMap.qml
index d572ed810635821e5aafec0bece1d7597d65c75b..cf1474a47d5da3a1eca2b1c617d05e91500c47bd 100644
--- a/src/FlightMap/FlightMap.qml
+++ b/src/FlightMap/FlightMap.qml
@@ -43,8 +43,8 @@ import QGroundControl.Mavlink 1.0
Map {
id: _map
- property real latitude: 0
- property real longitude: 0
+ property real latitude: 64.154549 //-- If you find yourself here on startup, something went wrong :)
+ property real longitude: -22.023540
property real heading: 0
property bool interactive: true
property string mapName: 'defaultMap'
diff --git a/src/MissionEditor/MissionEditor.qml b/src/MissionEditor/MissionEditor.qml
index 95ae418d6ff85a9220ef96530cc8cdcab6d87247..b30858c9e714b92654dc9d50014760f7ee2af826 100644
--- a/src/MissionEditor/MissionEditor.qml
+++ b/src/MissionEditor/MissionEditor.qml
@@ -46,7 +46,7 @@ QGCView {
z: QGroundControl.zOrderTopMost
readonly property int _decimalPlaces: 8
- readonly property real _horizontalMargin: ScreenTools.defaultFontPixelWidth / 2
+ readonly property real _horizontalMargin: ScreenTools.defaultFontPixelWidth / 2
readonly property real _margin: ScreenTools.defaultFontPixelHeight / 2
readonly property var _activeVehicle: multiVehicleManager.activeVehicle
readonly property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 16
@@ -103,7 +103,10 @@ QGCView {
MissionController {
id: controller
- Component.onCompleted: start(true /* editMode */)
+ Component.onCompleted: {
+ start(true /* editMode */)
+ }
+
/*
FIXME: autoSync is temporarily disconnected since it's still buggy
@@ -142,8 +145,12 @@ QGCView {
id: editorMap
anchors.fill: parent
mapName: "MissionEditor"
- latitude: tabletPosition.latitude
- longitude: tabletPosition.longitude
+ latitude: mainWindow.tabletPosition.latitude
+ longitude: mainWindow.tabletPosition.longitude
+
+ Component.onCompleted: {
+ console.log("Init coordinate " + mainWindow.tabletPosition.latitude)
+ }
readonly property real animationDuration: 500
@@ -695,6 +702,17 @@ QGCView {
} // Item - Home Position Manager
*/
+ //-- Dismiss Drop Down (if any)
+ MouseArea {
+ anchors.fill: parent
+ enabled: _dropButtonsExclusiveGroup.current != null
+ onClicked: {
+ if(_dropButtonsExclusiveGroup.current)
+ _dropButtonsExclusiveGroup.current.checked = false
+ _dropButtonsExclusiveGroup.current = null
+ }
+ }
+
//-- Help Panel
Loader {
id: helpPanel
@@ -705,169 +723,186 @@ QGCView {
anchors.horizontalCenter: parent.horizontalCenter
}
+ Item {
+ id: toolbarSpacer
+ height: mainWindow.tbHeight
+ width: 1
+ }
- RoundButton {
- id: addMissionItemsButton
- anchors.margins: _margin
- anchors.left: parent.left
- y: (parent.height - (_toolButtonCount * height) - ((_toolButtonCount - 1) * _margin)) / 2
- buttonImage: "/qmlimages/MapAddMission.svg"
- exclusiveGroup: _dropButtonsExclusiveGroup
- z: QGroundControl.zOrderWidgets
+ //-- Vertical Tool Buttons
+ Column {
+ id: toolColumn
+ anchors.margins: ScreenTools.defaultFontPixelHeight
+ anchors.left: parent.left
+ anchors.top: toolbarSpacer.bottom
+ spacing: ScreenTools.defaultFontPixelHeight
+
+ RoundButton {
+ id: addMissionItemsButton
+ buttonImage: "/qmlimages/MapAddMission.svg"
+ z: QGroundControl.zOrderWidgets
+
+ onCheckedChanged: {
+ if (checked) {
+ addMissionItemsButtonAutoOffTimer.start()
+ } else {
+ addMissionItemsButtonAutoOffTimer.stop()
+ }
+ }
- onCheckedChanged: {
- if (checked) {
- addMissionItemsButtonAutoOffTimer.start()
- } else {
- addMissionItemsButtonAutoOffTimer.stop()
+ Timer {
+ id: addMissionItemsButtonAutoOffTimer
+ interval: _addMissionItemsButtonAutoOffTimeout
+ repeat: false
+
+ onTriggered: addMissionItemsButton.checked = false
}
}
- Timer {
- id: addMissionItemsButtonAutoOffTimer
- interval: _addMissionItemsButtonAutoOffTimeout
- repeat: false
+ RoundButton {
+ id: deleteMissionItemButton
+ buttonImage: "/qmlimages/TrashDelete.svg"
+ z: QGroundControl.zOrderWidgets
+ onClicked: {
+ addMissionItemsButton.checked = false
+ itemDragger.clearItem()
+ controller.deleteCurrentMissionItem()
+ checked = false
+ }
+ }
- onTriggered: addMissionItemsButton.checked = false
+ /*
+ Home Position manager temporarily disable
+ RoundButton {
+ id: homePositionManagerButton
+ buttonImage: "/qmlimages/MapHome.svg"
+ //exclusiveGroup: _dropButtonsExclusiveGroup
+ z: QGroundControl.zOrderWidgets
}
- }
+ */
- RoundButton {
- id: deleteMissionItemButton
- anchors.margins: _margin
- anchors.left: parent.left
- anchors.top: addMissionItemsButton.bottom
- buttonImage: "/qmlimages/TrashDelete.svg"
- exclusiveGroup: _dropButtonsExclusiveGroup
- z: QGroundControl.zOrderWidgets
+ DropButton {
+ id: centerMapButton
+ dropDirection: dropRight
+ buttonImage: "/qmlimages/MapCenter.svg"
+ viewportMargins: ScreenTools.defaultFontPixelWidth / 2
+ exclusiveGroup: _dropButtonsExclusiveGroup
+ z: QGroundControl.zOrderWidgets
- onClicked: {
- itemDragger.clearItem()
- controller.deleteCurrentMissionItem()
- checked = false
- }
- }
+ dropDownComponent: Component {
+ Column {
+ QGCLabel { text: "Center map:" }
- /*
- Home Position manager temporarily disable
- RoundButton {
- id: homePositionManagerButton
- anchors.margins: _margin
- anchors.left: parent.left
- anchors.top: deleteMissionItemButton.bottom
- buttonImage: "/qmlimages/MapHome.svg"
- exclusiveGroup: _dropButtonsExclusiveGroup
- z: QGroundControl.zOrderWidgets
- }
- */
+ Row {
+ spacing: ScreenTools.defaultFontPixelWidth
- DropButton {
- id: centerMapButton
- anchors.margins: _margin
- anchors.left: parent.left
- anchors.top: deleteMissionItemButton.bottom
- dropDirection: dropRight
- buttonImage: "/qmlimages/MapCenter.svg"
- viewportMargins: ScreenTools.defaultFontPixelWidth / 2
- exclusiveGroup: _dropButtonsExclusiveGroup
- z: QGroundControl.zOrderWidgets
-
- dropDownComponent: Component {
- Column {
- QGCLabel { text: "Center map:" }
-
- Row {
- spacing: ScreenTools.defaultFontPixelWidth
-
- QGCButton {
- text: "Home"
- enabled: liveHomePositionAvailable
-
- onClicked: {
- centerMapButton.hideDropDown()
- editorMap.center = liveHomePosition
+ QGCButton {
+ text: "Home"
+ enabled: liveHomePositionAvailable
+
+ onClicked: {
+ centerMapButton.hideDropDown()
+ editorMap.center = liveHomePosition
+ }
}
- }
- QGCButton {
- text: "Vehicle"
- enabled: activeVehicle && activeVehicle.latitude != 0 && activeVehicle.longitude != 0
+ QGCButton {
+ text: "Vehicle"
+ enabled: activeVehicle && activeVehicle.latitude != 0 && activeVehicle.longitude != 0
- property var activeVehicle: multiVehicleManager.activeVehicle
+ property var activeVehicle: multiVehicleManager.activeVehicle
- onClicked: {
- centerMapButton.hideDropDown()
- editorMap.latitude = activeVehicle.latitude
- editorMap.longitude = activeVehicle.longitude
+ onClicked: {
+ centerMapButton.hideDropDown()
+ editorMap.latitude = activeVehicle.latitude
+ editorMap.longitude = activeVehicle.longitude
+ }
}
}
}
}
}
- }
-
- DropButton {
- id: syncButton
- anchors.margins: _margin
- anchors.left: parent.left
- anchors.top: centerMapButton.bottom
- dropDirection: dropRight
- buttonImage: _syncNeeded ? "/qmlimages/MapSyncChanged.svg" : "/qmlimages/MapSync.svg"
- viewportMargins: ScreenTools.defaultFontPixelWidth / 2
- exclusiveGroup: _dropButtonsExclusiveGroup
- z: QGroundControl.zOrderWidgets
- dropDownComponent: syncDropDownComponent
- enabled: !_syncInProgress
- }
-
- DropButton {
- id: mapTypeButton
- anchors.margins: _margin
- anchors.left: parent.left
- anchors.top: syncButton.bottom
- dropDirection: dropRight
- buttonImage: "/qmlimages/MapType.svg"
- viewportMargins: ScreenTools.defaultFontPixelWidth / 2
- exclusiveGroup: _dropButtonsExclusiveGroup
- z: QGroundControl.zOrderWidgets
-
- dropDownComponent: Component {
- Column {
- QGCLabel { text: "Map type:" }
- Row {
- spacing: ScreenTools.defaultFontPixelWidth
-
- Repeater {
- model: QGroundControl.flightMapSettings.mapTypes
-
- QGCButton {
- checkable: true
- checked: editorMap.mapType == text
- text: modelData
- exclusiveGroup: _mapTypeButtonsExclusiveGroup
+ DropButton {
+ id: syncButton
+ dropDirection: dropRight
+ buttonImage: _syncNeeded ? "/qmlimages/MapSyncChanged.svg" : "/qmlimages/MapSync.svg"
+ viewportMargins: ScreenTools.defaultFontPixelWidth / 2
+ exclusiveGroup: _dropButtonsExclusiveGroup
+ z: QGroundControl.zOrderWidgets
+ dropDownComponent: syncDropDownComponent
+ enabled: !_syncInProgress
+ }
- onClicked: {
- editorMap.mapType = text
- checked = true
- mapTypeButton.hideDropDown()
+ DropButton {
+ id: mapTypeButton
+ dropDirection: dropRight
+ buttonImage: "/qmlimages/MapType.svg"
+ viewportMargins: ScreenTools.defaultFontPixelWidth / 2
+ exclusiveGroup: _dropButtonsExclusiveGroup
+ z: QGroundControl.zOrderWidgets
+
+ dropDownComponent: Component {
+ Column {
+ QGCLabel { text: "Map type:" }
+
+ Row {
+ spacing: ScreenTools.defaultFontPixelWidth
+
+ Repeater {
+ model: QGroundControl.flightMapSettings.mapTypes
+
+ QGCButton {
+ checkable: true
+ checked: editorMap.mapType == text
+ text: modelData
+ exclusiveGroup: _mapTypeButtonsExclusiveGroup
+
+ onClicked: {
+ editorMap.mapType = text
+ checked = true
+ mapTypeButton.hideDropDown()
+ }
}
}
}
}
}
}
- }
- RoundButton {
- id: helpButton
- anchors.margins: _margin
- anchors.left: parent.left
- anchors.top: mapTypeButton.bottom
- buttonImage: "/qmlimages/Help.svg"
- exclusiveGroup: _dropButtonsExclusiveGroup
- z: QGroundControl.zOrderWidgets
- checked: _showHelp
+ //-- Zoom Map In
+ RoundButton {
+ id: mapZoomPlus
+ visible: !ScreenTools.isTinyScreen && !ScreenTools.isShortScreen
+ buttonImage: "/qmlimages/ZoomPlus.svg"
+ z: QGroundControl.zOrderWidgets
+ onClicked: {
+ if(editorMap)
+ editorMap.zoomLevel += 0.5
+ checked = false
+ }
+ }
+
+ //-- Zoom Map Out
+ RoundButton {
+ id: mapZoomMinus
+ visible: !ScreenTools.isTinyScreen && !ScreenTools.isShortScreen
+ buttonImage: "/qmlimages/ZoomMinus.svg"
+ z: QGroundControl.zOrderWidgets
+ onClicked: {
+ if(editorMap)
+ editorMap.zoomLevel -= 0.5
+ checked = false
+ }
+ }
+
+ RoundButton {
+ id: helpButton
+ buttonImage: "/qmlimages/Help.svg"
+ exclusiveGroup: _dropButtonsExclusiveGroup
+ z: QGroundControl.zOrderWidgets
+ checked: _showHelp
+ }
}
Rectangle {
diff --git a/src/QGCApplication.cc b/src/QGCApplication.cc
index 9f74e768d66f0bb6e89c6c1b6298834ea7c98fdd..94c4025ef558797d18063840d4b0d78ea4e9f2d4 100644
--- a/src/QGCApplication.cc
+++ b/src/QGCApplication.cc
@@ -323,7 +323,6 @@ QGCApplication::~QGCApplication()
if (mainWindow) {
delete mainWindow;
}
-
shutdownVideoStreaming();
delete _toolbox;
}
diff --git a/src/QmlControls/ScreenTools.qml b/src/QmlControls/ScreenTools.qml
index b2c3c4c3902c1bac896696b52be356178a22f740..63ea2e50873339e83098da60ab3a8e72ea6e6600 100644
--- a/src/QmlControls/ScreenTools.qml
+++ b/src/QmlControls/ScreenTools.qml
@@ -31,6 +31,7 @@ Item {
property bool isMobile: ScreenToolsController.isMobile
property bool isDebug: ScreenToolsController.isDebug
property bool isTinyScreen: (Screen.width / Screen.pixelDensity) < 120 // 120mm
+ property bool isShortScreen: (Screen.desktopAvailableHeight / Screen.desktopAvailableWidth) < 0.6 // Nexus 7 for example
function mouseX() {
return ScreenToolsController.mouseX()
diff --git a/src/ui/MainWindow.qml b/src/ui/MainWindow.qml
index edfc0d8ad2dbf709a21e2b693238f31ece5d82c3..d33e39982f2cfcbf3a28d8135ac0fc8b3f077907 100644
--- a/src/ui/MainWindow.qml
+++ b/src/ui/MainWindow.qml
@@ -47,6 +47,9 @@ Item {
property real avaiableHeight: height - tbHeight
property real menuButtonWidth: (tbButtonWidth * 2) + (tbSpacing * 4) + 1
+ property var defaultPosition: QtPositioning.coordinate(37.803784, -122.462276)
+ property var tabletPosition: defaultPosition
+
Connections {
target: controller
@@ -86,17 +89,23 @@ Item {
}
//-- Detect tablet position
- property var tabletPosition: QtPositioning.coordinate(37.803784, -122.462276)
PositionSource {
id: positionSource
updateInterval: 1000
- active: true // ScreenTools.isMobile
-
+ active: false
onPositionChanged: {
- tabletPosition = positionSource.position.coordinate
- flightView.latitude = tabletPosition.latitude
- flightView.longitude = tabletPosition.longitude
- positionSource.active = false
+ if(positionSource.valid) {
+ if(positionSource.position.coordinate.latitude) {
+ if(Math.abs(positionSource.position.coordinate.latitude) > 0.001) {
+ if(positionSource.position.coordinate.longitude) {
+ if(Math.abs(positionSource.position.coordinate.longitude) > 0.001) {
+ tabletPosition = positionSource.position.coordinate
+ }
+ }
+ }
+ }
+ }
+ positionSource.stop()
}
}
@@ -146,20 +155,21 @@ Item {
anchors.fill: parent
avaiableHeight: mainWindow.avaiableHeight
visible: true
+ Component.onCompleted: {
+ positionSource.start()
+ }
}
Loader {
id: planViewLoader
anchors.fill: parent
visible: false
- property var tabletPosition: mainWindow.tabletPosition
}
Loader {
id: setupViewLoader
anchors.fill: parent
visible: false
- property var tabletPosition: mainWindow.tabletPosition
}
}