Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
26139748
Commit
26139748
authored
Nov 14, 2015
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed starting map coordinates.
parent
e855eb08
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
207 additions
and
154 deletions
+207
-154
iOS-Info.plist
ios/iOS-Info.plist
+4
-0
iOSForAppStore-Info.plist
ios/iOSForAppStore-Info.plist
+4
-0
qgroundcontrol.pro
qgroundcontrol.pro
+1
-1
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+1
-1
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+2
-2
FlightMap.qml
src/FlightMap/FlightMap.qml
+2
-2
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+173
-138
QGCApplication.cc
src/QGCApplication.cc
+0
-1
ScreenTools.qml
src/QmlControls/ScreenTools.qml
+1
-0
MainWindow.qml
src/ui/MainWindow.qml
+19
-9
No files found.
ios/iOS-Info.plist
View file @
26139748
...
...
@@ -34,6 +34,10 @@
<string>
6.0
</string>
<key>
ForAppStore
</key>
<string>
No
</string>
<key>
NSLocationUsageDescription
</key>
<string>
Ground Station Location
</string>
<key>
NSLocationWhenInUseUsageDescription
</key>
<string>
Ground Station Location
</string>
<key>
UISupportedInterfaceOrientations
</key>
<array>
<string>
UIInterfaceOrientationLandscapeLeft
</string>
...
...
ios/iOSForAppStore-Info.plist
View file @
26139748
...
...
@@ -34,6 +34,10 @@
<string>
6.0
</string>
<key>
ForAppStore
</key>
<string>
Yes
</string>
<key>
NSLocationUsageDescription
</key>
<string>
Ground Station Location
</string>
<key>
NSLocationWhenInUseUsageDescription
</key>
<string>
Ground Station Location
</string>
<key>
UISupportedInterfaceOrientations
</key>
<array>
<string>
UIInterfaceOrientationLandscapeLeft
</string>
...
...
qgroundcontrol.pro
View file @
26139748
...
...
@@ -54,10 +54,10 @@ CONFIG += qt \
thread
QT
+=
\
network
\
concurrent
\
gui
\
location
\
network
\
opengl
\
positioning
\
qml
\
...
...
src/FlightDisplay/FlightDisplayView.qml
View file @
26139748
...
...
@@ -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
...
...
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
26139748
...
...
@@ -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
...
...
src/FlightMap/FlightMap.qml
View file @
26139748
...
...
@@ -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.02354
0
property
real
heading
:
0
property
bool
interactive
:
true
property
string
mapName
:
'
defaultMap
'
...
...
src/MissionEditor/MissionEditor.qml
View file @
26139748
...
...
@@ -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
{
...
...
src/QGCApplication.cc
View file @
26139748
...
...
@@ -323,7 +323,6 @@ QGCApplication::~QGCApplication()
if
(
mainWindow
)
{
delete
mainWindow
;
}
shutdownVideoStreaming
();
delete
_toolbox
;
}
...
...
src/QmlControls/ScreenTools.qml
View file @
26139748
...
...
@@ -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
()
...
...
src/ui/MainWindow.qml
View file @
26139748
...
...
@@ -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
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment