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
272dbda6
Commit
272dbda6
authored
Mar 21, 2017
by
Don Gagne
Committed by
GitHub
Mar 21, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4811 from DonLakeFlyer/FollowVehicleChange
Fly: Changed follow vehicle user model
parents
a25626fd
531a6362
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
12 deletions
+41
-12
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+41
-12
No files found.
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
272dbda6
...
...
@@ -27,35 +27,64 @@ FlightMap {
anchors.fill
:
parent
mapName
:
_mapName
gesture.acceptedGestures
:
_followVehicle
?
MapGestureArea
.
PinchGesture
:
MapGestureArea
.
PinchGesture
|
MapGestureArea
.
PanGesture
|
MapGestureArea
.
FlickGesture
property
alias
missionController
:
missionController
property
var
flightWidgets
property
var
rightPanelWidth
property
bool
_followVehicle
:
true
property
bool
_followVehicleSetting
:
true
///< User facing setting for follow vehicle
property
bool
_followVehicle
:
_followVehicleSetting
&&
_activeVehicleCoordinateValid
///< Control map follow vehicle functionality
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
_activeVehicleCoordinateValid
:
_activeVehicle
?
_activeVehicle
.
coordinateValid
:
false
property
var
activeVehicleCoordinate
:
_activeVehicle
?
_activeVehicle
.
coordinate
:
QtPositioning
.
coordinate
()
property
var
_gotoHereCoordinate
:
QtPositioning
.
coordinate
()
property
int
_retaskSequence
:
0
property
real
_toolButtonTopMargin
:
parent
.
height
-
ScreenTools
.
availableHeight
+
(
ScreenTools
.
defaultFontPixelHeight
/
2
)
property
bool
followVehicleConnection
:
_followVehicle
///< Only use to create connection on
property
bool
_firstVehicleCoordinate
:
false
property
bool
_centerUpdateFromTimer
:
true
Component.onCompleted
:
{
QGroundControl
.
flightMapPosition
=
center
QGroundControl
.
flightMapZoom
=
zoomLevel
}
onCenterChanged
:
QGroundControl
.
flightMapPosition
=
center
onZoomLevelChanged
:
QGroundControl
.
flightMapZoom
=
zoomLevel
onCenterChanged
:
{
if
(
_centerUpdateFromTimer
)
{
_centerUpdateFromTimer
=
false
}
else
{
vehicleCenterTimer
.
restart
()
}
QGroundControl
.
flightMapPosition
=
center
}
onActiveVehicleCoordinateChanged
:
{
if
(
_followVehicle
&&
_activeVehicleCoordinateValid
&&
activeVehicleCoordinate
.
isValid
)
{
if
(
!
_firstVehicleCoordinate
&&
_activeVehicleCoordinateValid
)
{
_firstVehicleCoordinate
=
true
updateMapToVehiclePosition
()
}
}
function
updateMapToVehiclePosition
()
{
if
(
_followVehicle
)
{
_initialMapPositionSet
=
true
flightMap
.
center
=
activeVehicleCoordinate
_firstVehicleCoordinate
=
true
_centerUpdateFromTimer
=
true
flightMap
.
center
=
activeVehicleCoordinate
}
}
Timer
{
id
:
vehicleCenterTimer
interval
:
5000
running
:
true
triggeredOnStart
:
true
repeat
:
true
onTriggered
:
{
triggeredOnStart
=
false
updateMapToVehiclePosition
()
}
}
...
...
@@ -149,9 +178,9 @@ FlightMap {
map
:
_flightMap
fitFunctions
:
mapFitFunctions
showFollowVehicle
:
true
followVehicle
:
_followVehicle
followVehicle
:
_followVehicle
Setting
onFollowVehicleChanged
:
_followVehicle
=
followVehicle
onFollowVehicleChanged
:
_followVehicle
Setting
=
followVehicle
}
}
...
...
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