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
a12cefae
Commit
a12cefae
authored
Oct 22, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2071 from DonLakeFlyer/TabletPosition
Use tablet position for initial Fly/Plan location
parents
3eca3cca
115d986d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
25 deletions
+60
-25
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+10
-4
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+31
-19
MainWindow.qml
src/ui/MainWindow.qml
+19
-2
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
a12cefae
...
...
@@ -41,6 +41,9 @@ import QGroundControl.Controllers 1.0
Item
{
id
:
root
property
alias
latitude
:
flightMap
.
latitude
property
alias
longitude
:
flightMap
.
longitude
// Top margin for all widgets. Used to prevent overlap with the toolbar
property
real
topMargin
:
0
...
...
@@ -114,7 +117,6 @@ Item {
QGroundControl
.
flightMapSettings
.
saveMapSetting
(
flightMap
.
mapName
,
_showMapBackgroundKey
,
setBool
(
_showMap
))
}
FlightMap
{
id
:
flightMap
anchors.fill
:
parent
...
...
@@ -126,6 +128,8 @@ Item {
property
var
rootVehicleCoordinate
:
_vehicleCoordinate
property
bool
rootLoadCompleted
:
false
property
bool
_followVehicle
:
true
onRootVehicleCoordinateChanged
:
updateMapPosition
(
false
/* force */
)
Component.onCompleted
:
flightMapDelayLoader
.
source
=
"
FlightDisplayViewDelayLoadInner.qml
"
...
...
@@ -136,9 +140,6 @@ Item {
flightMap
.
longitude
=
root
.
_vehicleCoordinate
.
longitude
}
}
property
bool
_followVehicle
:
true
// Home position
MissionItemIndicator
{
label
:
"
H
"
...
...
@@ -194,6 +195,11 @@ Item {
id
:
flightMapDelayLoader
anchors.fill
:
parent
}
// Used to make pinch zoom work
MouseArea
{
anchors.fill
:
parent
}
}
// Flight Map
Loader
{
...
...
src/MissionEditor/MissionEditor.qml
View file @
a12cefae
...
...
@@ -60,10 +60,10 @@ QGCView {
property
var
_homePositionManager
:
QGroundControl
.
homePositionManager
property
string
_homePositionName
:
_homePositionManager
.
homePositions
.
get
(
0
).
name
property
var
offlineHomePosition
:
_homePositionManager
.
homePositions
.
get
(
0
).
coordinate
//
property var offlineHomePosition: _homePositionManager.homePositions.get(0).coordinate
property
var
liveHomePosition
:
controller
.
liveHomePosition
property
var
liveHomePositionAvailable
:
controller
.
liveHomePositionAvailable
property
var
homePosition
:
offlineHomePosition
// live or offline depending on state
//
property var homePosition: offlineHomePosition // live or offline depending on state
property
bool
_syncNeeded
:
controller
.
missionItems
.
dirty
property
bool
_syncInProgress
:
_activeVehicle
?
_activeVehicle
.
missionManager
.
inProgress
:
false
...
...
@@ -103,13 +103,14 @@ QGCView {
}
function
updateHomePosition
()
{
homePosition
=
liveHomePositionAvailable
?
liveHomePosition
:
offlineHomePosition
_missionItems
.
get
(
0
).
coordinate
=
homePosition
_missionItems
.
get
(
0
).
homePositionValid
=
true
if
(
liveHomePositionAvailable
)
{
_missionItems
.
get
(
0
).
coordinate
=
liveHomePosition
_missionItems
.
get
(
0
).
homePositionValid
=
true
}
}
Component.onCompleted
:
updateHomePosition
()
onOfflineHomePositionChanged
:
updateHomePosition
()
//
onOfflineHomePositionChanged: updateHomePosition()
onLiveHomePositionAvailableChanged
:
updateHomePosition
()
onLiveHomePositionChanged
:
updateHomePosition
()
...
...
@@ -124,11 +125,8 @@ QGCView {
id
:
editorMap
anchors.fill
:
parent
mapName
:
"
MissionEditor
"
Component.onCompleted
:
{
latitude
=
homePosition
.
latitude
longitude
=
homePosition
.
longitude
}
latitude
:
tabletPosition
.
latitude
longitude
:
tabletPosition
.
longitude
readonly
property
real
animationDuration
:
500
...
...
@@ -161,8 +159,8 @@ QGCView {
coordinate
.
latitude
=
coordinate
.
latitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
longitude
=
coordinate
.
longitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
altitude
=
coordinate
.
altitude
.
toFixed
(
_decimalPlaces
)
if
(
homePositionManagerButton
.
checked
)
{
offlineHomePosition
=
coordinate
if
(
false
/*homePositionManagerButton.checked*/
)
{
//
offlineHomePosition = coordinate
}
else
if
(
addMissionItemsButton
.
checked
)
{
var
index
=
controller
.
addMissionItem
(
coordinate
)
addMissionItemsButtonAutoOffTimer
.
start
()
...
...
@@ -242,7 +240,7 @@ QGCView {
anchors.bottom
:
parent
.
bottom
anchors.right
:
parent
.
right
width
:
_rightPanelWidth
visible
:
!
homePositionManagerButton
.
checked
&&
_missionItems
.
count
>
1
visible
:
_missionItems
.
count
>
1
opacity
:
_rightPanelOpacity
z
:
editorMap
.
zOrderTopMost
...
...
@@ -259,7 +257,8 @@ QGCView {
MissionItemEditor
{
missionItem
:
object
width
:
parent
.
width
readOnly
:
object
.
sequenceNumber
==
0
&&
liveHomePositionAvailable
readOnly
:
object
.
sequenceNumber
==
0
visible
:
!
readOnly
||
object
.
homePositionValid
onClicked
:
setCurrentItem
(
object
.
sequenceNumber
)
...
...
@@ -283,6 +282,9 @@ QGCView {
}
}
// Item - Mission Item editor
/*
Home Position Manager is commented out for now until a better implementation is completed
// Home Position Manager
Rectangle {
id: homePositionManager
...
...
@@ -554,6 +556,7 @@ QGCView {
}
} // Column - Online view
} // Item - Home Position Manager
*/
// Help Panel
Rectangle
{
...
...
@@ -652,6 +655,9 @@ QGCView {
"
Delete the currently selected mission item.
"
}
/*
Home Position Manager commented until more complete implementation is done
Image {
id: homePositionManagerHelpIcon
anchors.topMargin: ScreenTools.defaultFontPixelHeight
...
...
@@ -674,11 +680,12 @@ QGCView {
"When enabled, allows you to select/add/update flying field locations. " +
"You can save multiple flying field locations for use while creating missions while you are not connected to your vehicle."
}
*/
Image
{
id
:
mapCenterHelpIcon
anchors.topMargin
:
ScreenTools
.
defaultFontPixelHeight
anchors.top
:
homePositionManager
HelpText
.
bottom
anchors.top
:
delete
HelpText
.
bottom
width
:
ScreenTools
.
defaultFontPixelHeight
*
3
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
...
...
@@ -795,6 +802,9 @@ QGCView {
}
}
/*
Home Position Manager commented until more complete implementation is done
RoundButton {
id: homePositionManagerButton
anchors.margins: _margin
...
...
@@ -804,12 +814,13 @@ QGCView {
exclusiveGroup: _dropButtonsExclusiveGroup
z: editorMap.zOrderWidgets
}
*/
DropButton
{
id
:
centerMapButton
anchors.margins
:
_margin
anchors.left
:
parent
.
left
anchors.top
:
homePositionManager
Button
.
bottom
anchors.top
:
deleteMissionItem
Button
.
bottom
dropDirection
:
dropRight
buttonImage
:
"
/qmlimages/MapCenter.svg
"
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
...
...
@@ -824,11 +835,12 @@ QGCView {
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCButton
{
text
:
"
Home
"
text
:
"
Home
"
enabled
:
liveHomePositionAvailable
onClicked
:
{
centerMapButton
.
hideDropDown
()
editorMap
.
center
=
QtPositioning
.
coordinate
(
homePosition
.
latitude
,
homePosition
.
longitude
)
editorMap
.
center
=
liveHomePosition
}
}
...
...
src/ui/MainWindow.qml
View file @
a12cefae
...
...
@@ -84,6 +84,21 @@ Item {
toolbarLoader
.
source
=
"
MainToolBar.qml
"
}
// Detect tablet position
property
var
tabletPosition
:
QtPositioning
.
coordinate
(
37.803784
,
-
122.462276
)
PositionSource
{
id
:
positionSource
updateInterval
:
1000
active
:
ScreenTools
.
isMobile
onPositionChanged
:
{
tabletPosition
=
positionSource
.
position
.
coordinate
_root
.
latitude
=
tabletPosition
.
latitude
_root
.
longitude
=
tabletPosition
.
longitude
positionSource
.
active
=
false
}
}
Loader
{
id
:
toolbarLoader
width
:
parent
.
width
...
...
@@ -110,7 +125,8 @@ Item {
anchors.bottom
:
parent
.
bottom
visible
:
false
property
real
zOrder
:
_root
.
zOrderTopMost
property
real
zOrder
:
_root
.
zOrderTopMost
property
var
tabletPosition
:
_root
.
tabletPosition
}
Loader
{
...
...
@@ -121,6 +137,7 @@ Item {
anchors.bottom
:
parent
.
bottom
visible
:
false
property
real
zOrder
:
_root
.
zOrderTopMost
property
real
zOrder
:
_root
.
zOrderTopMost
property
var
tabletPosition
:
_root
.
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