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
6bf85ada
Commit
6bf85ada
authored
Feb 18, 2017
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use ToolStrip on fly view
parent
e36b3dd2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
123 deletions
+78
-123
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+78
-123
No files found.
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
6bf85ada
...
...
@@ -71,151 +71,106 @@ FlightMap {
Component.onCompleted
:
start
(
false
/* editMode */
)
}
QGCMapLabel
{
id
:
flyLabel
map
:
flightMap
text
:
qsTr
(
"
Fly
"
)
visible
:
!
ScreenTools
.
isShortScreen
anchors.topMargin
:
_toolButtonTopMargin
anchors.horizontalCenter
:
centerMapDropButton
.
horizontalCenter
anchors.top
:
parent
.
top
}
//-- Vertical Tool Buttons
ExclusiveGroup
{
id
:
drop
ButtonsExclusiveGroup
id
:
_mapType
ButtonsExclusiveGroup
}
ExclusiveGroup
{
id
:
mapTypeButtonsExclusiveGroup
}
ToolStrip
{
id
:
toolStrip
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
parent
.
left
anchors.topMargin
:
_toolButtonTopMargin
anchors.top
:
parent
.
top
color
:
qgcPal
.
window
title
:
qsTr
(
"
Fly
"
)
z
:
QGroundControl
.
zOrderWidgets
buttonVisible
:
[
true
,
true
,
_showZoom
,
_showZoom
]
property
bool
_showZoom
:
!
ScreenTools
.
isShortScreen
model
:
[
{
name
:
"
Center
"
,
iconSource
:
"
/qmlimages/MapCenter.svg
"
,
dropPanelComponent
:
centerMapDropPanel
},
{
name
:
"
Map
"
,
iconSource
:
"
/qmlimages/MapType.svg
"
,
dropPanelComponent
:
mapTypeDropPanel
},
{
name
:
"
In
"
,
iconSource
:
"
/qmlimages/ZoomPlus.svg
"
},
{
name
:
"
Out
"
,
iconSource
:
"
/qmlimages/ZoomMinus.svg
"
}
]
//-- Dismiss Drop Down (if any)
MouseArea
{
anchors.fill
:
parent
enabled
:
dropButtonsExclusiveGroup
.
current
!=
null
onClicked
:
{
if
(
dropButtonsExclusiveGroup
.
current
)
{
dropButtonsExclusiveGroup
.
current
.
checked
=
false
switch
(
index
)
{
case
2
:
_flightMap
.
zoomLevel
+=
0.5
break
case
3
:
_flightMap
.
zoomLevel
-=
0.5
break
}
dropButtonsExclusiveGroup
.
current
=
null
}
}
// IMPORTANT NOTE: Drop Buttons must be parented directly to the map. If they are placed in a Column for example the drop control positioning
// will not work correctly.
//-- Map Center Control
CenterMapDropButton
{
id
:
centerMapDropButton
anchors.topMargin
:
flyLabel
.
visible
?
ScreenTools
.
defaultFontPixelHeight
/
2
:
_toolButtonTopMargin
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelHeight
anchors.left
:
parent
.
left
anchors.top
:
flyLabel
.
visible
?
flyLabel
.
bottom
:
parent
.
top
z
:
QGroundControl
.
zOrderWidgets
exclusiveGroup
:
dropButtonsExclusiveGroup
map
:
_flightMap
mapFitViewport
:
Qt
.
rect
(
leftToolWidth
,
_toolButtonTopMargin
,
flightMap
.
width
-
leftToolWidth
-
rightPanelWidth
,
flightMap
.
height
-
_toolButtonTopMargin
)
usePlannedHomePosition
:
false
geoFenceController
:
geoFenceController
missionController
:
missionController
rallyPointController
:
rallyPointController
showFollowVehicle
:
true
followVehicle
:
_followVehicle
onFollowVehicleChanged
:
_followVehicle
=
followVehicle
property
real
leftToolWidth
:
centerMapDropButton
.
x
+
centerMapDropButton
.
width
}
// Toolstrip drop panel compomnents
//-- Map Type Control
DropButton
{
id
:
mapTypeButton
anchors.topMargin
:
ScreenTools
.
defaultFontPixelHeight
anchors.top
:
centerMapDropButton
.
bottom
anchors.left
:
centerMapDropButton
.
left
dropDirection
:
dropRight
buttonImage
:
"
/qmlimages/MapType.svg
"
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
exclusiveGroup
:
dropButtonsExclusiveGroup
z
:
QGroundControl
.
zOrderWidgets
lightBorders
:
isSatelliteMap
MapFitFunctions
{
id
:
mapFitFunctions
map
:
_flightMap
mapFitViewport
:
Qt
.
rect
(
leftToolWidth
,
_toolButtonTopMargin
,
flightMap
.
width
-
leftToolWidth
-
rightPanelWidth
,
flightMap
.
height
-
_toolButtonTopMargin
)
usePlannedHomePosition
:
false
mapMissionController
:
missionController
mapGeoFenceController
:
geoFenceController
mapRallyPointController
:
rallyPointController
dropDownComponent
:
Component
{
Column
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
property
real
leftToolWidth
:
toolStrip
.
x
+
toolStrip
.
width
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
Component
{
id
:
centerMapDropPanel
Repeater
{
model
:
QGroundControl
.
flightMapSettings
.
mapTypes
CenterMapDropPanel
{
map
:
_flightMap
fitFunctions
:
mapFitFunctions
}
}
QGCButton
{
checkable
:
true
checked
:
QGroundControl
.
flightMapSettings
.
mapType
===
text
text
:
modelData
width
:
clearButton
.
width
exclusiveGroup
:
mapTypeButtonsExclusiveGroup
Component
{
id
:
mapTypeDropPanel
onClicked
:
{
QGroundControl
.
flightMapSettings
.
mapType
=
text
checked
=
true
dropButtonsExclusiveGroup
.
current
=
null
}
}
}
}
Column
{
spacing
:
ScreenTools
.
defaultFontPixelHeight
/
2
QGCButton
{
id
:
clearButton
text
:
qsTr
(
"
Clear Flight Trails
"
)
enabled
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
onClicked
:
{
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
clearTrajectoryPoints
()
dropButtonsExclusiveGroup
.
current
=
null
QGCLabel
{
text
:
qsTr
(
"
Map type:
"
)
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
Repeater
{
model
:
QGroundControl
.
flightMapSettings
.
mapTypes
QGCButton
{
checkable
:
true
checked
:
QGroundControl
.
flightMapSettings
.
mapType
===
text
text
:
modelData
exclusiveGroup
:
_mapTypeButtonsExclusiveGroup
onClicked
:
{
QGroundControl
.
flightMapSettings
.
mapType
=
text
dropPanel
.
hide
()
}
}
}
}
}
}
//-- Zoom Map In
RoundButton
{
id
:
mapZoomPlus
anchors.topMargin
:
ScreenTools
.
defaultFontPixelHeight
anchors.top
:
mapTypeButton
.
bottom
anchors.left
:
mapTypeButton
.
left
visible
:
!
ScreenTools
.
isTinyScreen
&&
_mainIsMap
buttonImage
:
"
/qmlimages/ZoomPlus.svg
"
exclusiveGroup
:
dropButtonsExclusiveGroup
z
:
QGroundControl
.
zOrderWidgets
lightBorders
:
isSatelliteMap
onClicked
:
{
if
(
_flightMap
)
_flightMap
.
zoomLevel
+=
0.5
checked
=
false
}
}
//-- Zoom Map Out
RoundButton
{
id
:
mapZoomMinus
anchors.topMargin
:
ScreenTools
.
defaultFontPixelHeight
anchors.top
:
mapZoomPlus
.
bottom
anchors.left
:
mapZoomPlus
.
left
visible
:
!
ScreenTools
.
isTinyScreen
&&
_mainIsMap
buttonImage
:
"
/qmlimages/ZoomMinus.svg
"
exclusiveGroup
:
dropButtonsExclusiveGroup
z
:
QGroundControl
.
zOrderWidgets
lightBorders
:
isSatelliteMap
onClicked
:
{
if
(
_flightMap
)
_flightMap
.
zoomLevel
-=
0.5
checked
=
false
}
}
// Add trajectory points to the map
MapItemView
{
model
:
_mainIsMap
?
_activeVehicle
?
_activeVehicle
.
trajectoryPoints
:
0
:
0
...
...
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