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
a6f9d722
Commit
a6f9d722
authored
Oct 10, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Center tool support
- Follow Vehicle - Center map on vehicle
parent
f0028d0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
14 deletions
+78
-14
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+78
-14
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
a6f9d722
...
...
@@ -70,6 +70,10 @@ Item {
property
bool
_showMap
:
getBool
(
QGroundControl
.
flightMapSettings
.
loadMapSetting
(
flightMap
.
mapName
,
_showMapBackgroundKey
,
"
1
"
))
ExclusiveGroup
{
id
:
_dropButtonsExclusiveGroup
}
// Validate _showMap setting
Component.onCompleted
:
_setShowMap
(
_showMap
)
...
...
@@ -90,10 +94,25 @@ Item {
id
:
flightMap
anchors.fill
:
parent
mapName
:
_mapName
latitude
:
parent
.
_latitude
longitude
:
parent
.
_longitude
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
MissionItemIndicator
{
label
:
"
H
"
...
...
@@ -145,21 +164,65 @@ Item {
}
QGCCompassWidget
{
x
:
ScreenTools
.
defaultFontPixelSize
*
(
7.1
)
y
:
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
size
:
ScreenTools
.
defaultFontPixelSize
*
(
13.3
)
heading
:
_heading
active
:
multiVehicleManager
.
activeVehicleAvailable
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
size
:
ScreenTools
.
defaultFontPixelSize
*
(
13.3
)
heading
:
_heading
active
:
multiVehicleManager
.
activeVehicleAvailable
}
QGCAttitudeWidget
{
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelSize
*
(
7.1
)
anchors.right
:
parent
.
right
y
:
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
size
:
ScreenTools
.
defaultFontPixelSize
*
(
13.3
)
rollAngle
:
_roll
pitchAngle
:
_pitch
active
:
multiVehicleManager
.
activeVehicleAvailable
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.left
:
parent
.
left
anchors.bottom
:
parent
.
bottom
size
:
ScreenTools
.
defaultFontPixelSize
*
(
13.3
)
rollAngle
:
_roll
pitchAngle
:
_pitch
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
{
...
...
@@ -170,6 +233,7 @@ Item {
dropDirection
:
dropDown
buttonImage
:
"
/qmlimages/MapType.svg
"
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
exclusiveGroup
:
_dropButtonsExclusiveGroup
dropDownComponent
:
Component
{
Row
{
...
...
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