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
115d986d
Commit
115d986d
authored
Oct 21, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use tablet position for initial Fly/Plan location
parent
77be5c4b
Changes
3
Show 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 @
115d986d
...
@@ -41,6 +41,9 @@ import QGroundControl.Controllers 1.0
...
@@ -41,6 +41,9 @@ import QGroundControl.Controllers 1.0
Item
{
Item
{
id
:
root
id
:
root
property
alias
latitude
:
flightMap
.
latitude
property
alias
longitude
:
flightMap
.
longitude
// Top margin for all widgets. Used to prevent overlap with the toolbar
// Top margin for all widgets. Used to prevent overlap with the toolbar
property
real
topMargin
:
0
property
real
topMargin
:
0
...
@@ -114,7 +117,6 @@ Item {
...
@@ -114,7 +117,6 @@ Item {
QGroundControl
.
flightMapSettings
.
saveMapSetting
(
flightMap
.
mapName
,
_showMapBackgroundKey
,
setBool
(
_showMap
))
QGroundControl
.
flightMapSettings
.
saveMapSetting
(
flightMap
.
mapName
,
_showMapBackgroundKey
,
setBool
(
_showMap
))
}
}
FlightMap
{
FlightMap
{
id
:
flightMap
id
:
flightMap
anchors.fill
:
parent
anchors.fill
:
parent
...
@@ -126,6 +128,8 @@ Item {
...
@@ -126,6 +128,8 @@ Item {
property
var
rootVehicleCoordinate
:
_vehicleCoordinate
property
var
rootVehicleCoordinate
:
_vehicleCoordinate
property
bool
rootLoadCompleted
:
false
property
bool
rootLoadCompleted
:
false
property
bool
_followVehicle
:
true
onRootVehicleCoordinateChanged
:
updateMapPosition
(
false
/* force */
)
onRootVehicleCoordinateChanged
:
updateMapPosition
(
false
/* force */
)
Component.onCompleted
:
flightMapDelayLoader
.
source
=
"
FlightDisplayViewDelayLoadInner.qml
"
Component.onCompleted
:
flightMapDelayLoader
.
source
=
"
FlightDisplayViewDelayLoadInner.qml
"
...
@@ -136,9 +140,6 @@ Item {
...
@@ -136,9 +140,6 @@ Item {
flightMap
.
longitude
=
root
.
_vehicleCoordinate
.
longitude
flightMap
.
longitude
=
root
.
_vehicleCoordinate
.
longitude
}
}
}
}
property
bool
_followVehicle
:
true
// Home position
// Home position
MissionItemIndicator
{
MissionItemIndicator
{
label
:
"
H
"
label
:
"
H
"
...
@@ -194,6 +195,11 @@ Item {
...
@@ -194,6 +195,11 @@ Item {
id
:
flightMapDelayLoader
id
:
flightMapDelayLoader
anchors.fill
:
parent
anchors.fill
:
parent
}
}
// Used to make pinch zoom work
MouseArea
{
anchors.fill
:
parent
}
}
// Flight Map
}
// Flight Map
Loader
{
Loader
{
...
...
src/MissionEditor/MissionEditor.qml
View file @
115d986d
...
@@ -60,10 +60,10 @@ QGCView {
...
@@ -60,10 +60,10 @@ QGCView {
property
var
_homePositionManager
:
QGroundControl
.
homePositionManager
property
var
_homePositionManager
:
QGroundControl
.
homePositionManager
property
string
_homePositionName
:
_homePositionManager
.
homePositions
.
get
(
0
).
name
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
liveHomePosition
:
controller
.
liveHomePosition
property
var
liveHomePositionAvailable
:
controller
.
liveHomePositionAvailable
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
_syncNeeded
:
controller
.
missionItems
.
dirty
property
bool
_syncInProgress
:
_activeVehicle
?
_activeVehicle
.
missionManager
.
inProgress
:
false
property
bool
_syncInProgress
:
_activeVehicle
?
_activeVehicle
.
missionManager
.
inProgress
:
false
...
@@ -103,13 +103,14 @@ QGCView {
...
@@ -103,13 +103,14 @@ QGCView {
}
}
function
updateHomePosition
()
{
function
updateHomePosition
()
{
homePosition
=
liveHomePositionAvailable
?
liveHomePosition
:
offlineHomePosition
if
(
liveHomePositionAvailable
)
{
_missionItems
.
get
(
0
).
coordinate
=
h
omePosition
_missionItems
.
get
(
0
).
coordinate
=
liveH
omePosition
_missionItems
.
get
(
0
).
homePositionValid
=
true
_missionItems
.
get
(
0
).
homePositionValid
=
true
}
}
}
Component.onCompleted
:
updateHomePosition
()
Component.onCompleted
:
updateHomePosition
()
onOfflineHomePositionChanged
:
updateHomePosition
()
//
onOfflineHomePositionChanged: updateHomePosition()
onLiveHomePositionAvailableChanged
:
updateHomePosition
()
onLiveHomePositionAvailableChanged
:
updateHomePosition
()
onLiveHomePositionChanged
:
updateHomePosition
()
onLiveHomePositionChanged
:
updateHomePosition
()
...
@@ -124,11 +125,8 @@ QGCView {
...
@@ -124,11 +125,8 @@ QGCView {
id
:
editorMap
id
:
editorMap
anchors.fill
:
parent
anchors.fill
:
parent
mapName
:
"
MissionEditor
"
mapName
:
"
MissionEditor
"
latitude
:
tabletPosition
.
latitude
Component.onCompleted
:
{
longitude
:
tabletPosition
.
longitude
latitude
=
homePosition
.
latitude
longitude
=
homePosition
.
longitude
}
readonly
property
real
animationDuration
:
500
readonly
property
real
animationDuration
:
500
...
@@ -161,8 +159,8 @@ QGCView {
...
@@ -161,8 +159,8 @@ QGCView {
coordinate
.
latitude
=
coordinate
.
latitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
latitude
=
coordinate
.
latitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
longitude
=
coordinate
.
longitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
longitude
=
coordinate
.
longitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
altitude
=
coordinate
.
altitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
altitude
=
coordinate
.
altitude
.
toFixed
(
_decimalPlaces
)
if
(
homePositionManagerButton
.
checked
)
{
if
(
false
/*homePositionManagerButton.checked*/
)
{
offlineHomePosition
=
coordinate
//
offlineHomePosition = coordinate
}
else
if
(
addMissionItemsButton
.
checked
)
{
}
else
if
(
addMissionItemsButton
.
checked
)
{
var
index
=
controller
.
addMissionItem
(
coordinate
)
var
index
=
controller
.
addMissionItem
(
coordinate
)
addMissionItemsButtonAutoOffTimer
.
start
()
addMissionItemsButtonAutoOffTimer
.
start
()
...
@@ -242,7 +240,7 @@ QGCView {
...
@@ -242,7 +240,7 @@ QGCView {
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
width
:
_rightPanelWidth
width
:
_rightPanelWidth
visible
:
!
homePositionManagerButton
.
checked
&&
_missionItems
.
count
>
1
visible
:
_missionItems
.
count
>
1
opacity
:
_rightPanelOpacity
opacity
:
_rightPanelOpacity
z
:
editorMap
.
zOrderTopMost
z
:
editorMap
.
zOrderTopMost
...
@@ -259,7 +257,8 @@ QGCView {
...
@@ -259,7 +257,8 @@ QGCView {
MissionItemEditor
{
MissionItemEditor
{
missionItem
:
object
missionItem
:
object
width
:
parent
.
width
width
:
parent
.
width
readOnly
:
object
.
sequenceNumber
==
0
&&
liveHomePositionAvailable
readOnly
:
object
.
sequenceNumber
==
0
visible
:
!
readOnly
||
object
.
homePositionValid
onClicked
:
setCurrentItem
(
object
.
sequenceNumber
)
onClicked
:
setCurrentItem
(
object
.
sequenceNumber
)
...
@@ -283,6 +282,9 @@ QGCView {
...
@@ -283,6 +282,9 @@ QGCView {
}
}
}
// Item - Mission Item editor
}
// Item - Mission Item editor
/*
Home Position Manager is commented out for now until a better implementation is completed
// Home Position Manager
// Home Position Manager
Rectangle {
Rectangle {
id: homePositionManager
id: homePositionManager
...
@@ -554,6 +556,7 @@ QGCView {
...
@@ -554,6 +556,7 @@ QGCView {
}
}
} // Column - Online view
} // Column - Online view
} // Item - Home Position Manager
} // Item - Home Position Manager
*/
// Help Panel
// Help Panel
Rectangle
{
Rectangle
{
...
@@ -651,6 +654,9 @@ QGCView {
...
@@ -651,6 +654,9 @@ QGCView {
"
Delete the currently selected mission item.
"
"
Delete the currently selected mission item.
"
}
}
/*
Home Position Manager commented until more complete implementation is done
Image {
Image {
id: homePositionManagerHelpIcon
id: homePositionManagerHelpIcon
anchors.topMargin: ScreenTools.defaultFontPixelHeight
anchors.topMargin: ScreenTools.defaultFontPixelHeight
...
@@ -673,11 +679,12 @@ QGCView {
...
@@ -673,11 +679,12 @@ QGCView {
"When enabled, allows you to select/add/update flying field locations. " +
"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."
"You can save multiple flying field locations for use while creating missions while you are not connected to your vehicle."
}
}
*/
Image
{
Image
{
id
:
mapCenterHelpIcon
id
:
mapCenterHelpIcon
anchors.topMargin
:
ScreenTools
.
defaultFontPixelHeight
anchors.topMargin
:
ScreenTools
.
defaultFontPixelHeight
anchors.top
:
homePositionManager
HelpText
.
bottom
anchors.top
:
delete
HelpText
.
bottom
width
:
ScreenTools
.
defaultFontPixelHeight
*
3
width
:
ScreenTools
.
defaultFontPixelHeight
*
3
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
mipmap
:
true
...
@@ -793,6 +800,9 @@ QGCView {
...
@@ -793,6 +800,9 @@ QGCView {
}
}
}
}
/*
Home Position Manager commented until more complete implementation is done
RoundButton {
RoundButton {
id: homePositionManagerButton
id: homePositionManagerButton
anchors.margins: _margin
anchors.margins: _margin
...
@@ -802,12 +812,13 @@ QGCView {
...
@@ -802,12 +812,13 @@ QGCView {
exclusiveGroup: _dropButtonsExclusiveGroup
exclusiveGroup: _dropButtonsExclusiveGroup
z: editorMap.zOrderWidgets
z: editorMap.zOrderWidgets
}
}
*/
DropButton
{
DropButton
{
id
:
centerMapButton
id
:
centerMapButton
anchors.margins
:
_margin
anchors.margins
:
_margin
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.top
:
homePositionManager
Button
.
bottom
anchors.top
:
deleteMissionItem
Button
.
bottom
dropDirection
:
dropRight
dropDirection
:
dropRight
buttonImage
:
"
/qmlimages/MapCenter.svg
"
buttonImage
:
"
/qmlimages/MapCenter.svg
"
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
...
@@ -823,10 +834,11 @@ QGCView {
...
@@ -823,10 +834,11 @@ QGCView {
QGCButton
{
QGCButton
{
text
:
"
Home
"
text
:
"
Home
"
enabled
:
liveHomePositionAvailable
onClicked
:
{
onClicked
:
{
centerMapButton
.
hideDropDown
()
centerMapButton
.
hideDropDown
()
editorMap
.
center
=
QtPositioning
.
coordinate
(
homePosition
.
latitude
,
homePosition
.
longitude
)
editorMap
.
center
=
liveHomePosition
}
}
}
}
...
...
src/ui/MainWindow.qml
View file @
115d986d
...
@@ -82,6 +82,21 @@ FlightDisplayView {
...
@@ -82,6 +82,21 @@ FlightDisplayView {
toolbarLoader
.
source
=
"
MainToolBar.qml
"
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
{
Loader
{
id
:
toolbarLoader
id
:
toolbarLoader
width
:
parent
.
width
width
:
parent
.
width
...
@@ -98,6 +113,7 @@ FlightDisplayView {
...
@@ -98,6 +113,7 @@ FlightDisplayView {
visible
:
false
visible
:
false
property
real
zOrder
:
_root
.
zOrderTopMost
property
real
zOrder
:
_root
.
zOrderTopMost
property
var
tabletPosition
:
_root
.
tabletPosition
}
}
Loader
{
Loader
{
...
@@ -109,5 +125,6 @@ FlightDisplayView {
...
@@ -109,5 +125,6 @@ FlightDisplayView {
visible
:
false
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