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
3081cb60
Commit
3081cb60
authored
Dec 11, 2019
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
c9d3aa72
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
106 additions
and
90 deletions
+106
-90
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+17
-16
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+3
-4
FlightDisplayViewWidgets.qml
src/FlightDisplay/FlightDisplayViewWidgets.qml
+3
-3
PlanView.qml
src/PlanView/PlanView.qml
+33
-29
ToolStrip.qml
src/QmlControls/ToolStrip.qml
+50
-38
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
3081cb60
...
...
@@ -54,6 +54,7 @@ Item {
property
real
_pipSize
:
mainWindow
.
width
*
0.2
property
alias
_guidedController
:
guidedActionsController
property
alias
_altitudeSlider
:
altitudeSlider
property
real
_toolsMargin
:
ScreenTools
.
defaultFontPixelWidth
*
0.75
readonly
property
var
_dynamicCameras
:
activeVehicle
?
activeVehicle
.
dynamicCameras
:
null
readonly
property
bool
_isCamera
:
_dynamicCameras
?
_dynamicCameras
.
cameras
.
count
>
0
:
false
...
...
@@ -357,7 +358,7 @@ Item {
// Do anchors again after popup
anchors
.
left
=
_mapAndVideo
.
left
anchors
.
bottom
=
_mapAndVideo
.
bottom
anchors
.
margins
=
ScreenTools
.
defaultFontPixelHeight
anchors
.
margins
=
_toolsMargin
}
}
...
...
@@ -365,8 +366,8 @@ Item {
State
{
name
:
"
pipMode
"
PropertyChanges
{
target
:
_flightVideo
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
target
:
_flightVideo
anchors.margins
:
_toolsMargin
}
PropertyChanges
{
target
:
_flightVideoPipControl
...
...
@@ -376,12 +377,12 @@ Item {
State
{
name
:
"
fullMode
"
PropertyChanges
{
target
:
_flightVideo
target
:
_flightVideo
anchors.margins
:
0
}
PropertyChanges
{
target
:
_flightVideoPipControl
inPopup
:
false
target
:
_flightVideoPipControl
inPopup
:
false
}
},
State
{
...
...
@@ -404,9 +405,9 @@ Item {
ParentChange
{
target
:
_flightVideo
parent
:
videoItem
x
:
0
y
:
0
width
:
videoItem
.
width
x
:
0
y
:
0
width
:
videoItem
.
width
height
:
videoItem
.
height
}
},
...
...
@@ -473,8 +474,8 @@ Item {
Row
{
id
:
singleMultiSelector
anchors.topMargin
:
ScreenTools
.
toolbarHeight
+
_
margins
anchors.rightMargin
:
_
margins
anchors.topMargin
:
ScreenTools
.
toolbarHeight
+
_
toolsMargin
anchors.rightMargin
:
_
toolsMargin
anchors.right
:
parent
.
right
spacing
:
ScreenTools
.
defaultFontPixelWidth
z
:
_mapAndVideo
.
z
+
4
...
...
@@ -496,7 +497,7 @@ Item {
FlightDisplayViewWidgets
{
id
:
flightDisplayViewWidgets
z
:
_mapAndVideo
.
z
+
4
height
:
availableHeight
-
(
singleMultiSelector
.
visible
?
singleMultiSelector
.
height
+
_
margins
:
0
)
-
(
ScreenTools
.
defaultFontPixelHeight
*
0.5
)
height
:
availableHeight
-
(
singleMultiSelector
.
visible
?
singleMultiSelector
.
height
+
_
toolsMargin
:
0
)
-
_toolsMargin
anchors.left
:
parent
.
left
anchors.right
:
altitudeSlider
.
visible
?
altitudeSlider
.
left
:
parent
.
right
anchors.bottom
:
parent
.
bottom
...
...
@@ -519,7 +520,7 @@ Item {
}
MultiVehicleList
{
anchors.margins
:
_
margins
anchors.margins
:
_
toolsMargin
anchors.top
:
singleMultiSelector
.
bottom
anchors.right
:
parent
.
right
anchors.bottom
:
parent
.
bottom
...
...
@@ -554,14 +555,14 @@ Item {
visible
:
(
activeVehicle
?
activeVehicle
.
guidedModeSupported
:
true
)
&&
!
QGroundControl
.
videoManager
.
fullScreen
id
:
toolStrip
anchors.leftMargin
:
isInstrumentRight
()
?
ScreenTools
.
defaultFontPixelWidth
*
2
:
undefined
anchors.leftMargin
:
isInstrumentRight
()
?
_toolsMargin
:
undefined
anchors.left
:
isInstrumentRight
()
?
_mapAndVideo
.
left
:
undefined
anchors.rightMargin
:
isInstrumentRight
()
?
undefined
:
ScreenTools
.
defaultFontPixelWidth
anchors.right
:
isInstrumentRight
()
?
undefined
:
_mapAndVideo
.
right
anchors.topMargin
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
anchors.topMargin
:
_toolsMargin
anchors.top
:
parent
.
top
z
:
_mapAndVideo
.
z
+
4
maxHeight
:
(
_flightVideo
.
visible
?
_flightVideo
.
y
:
parent
.
height
)
-
toolStrip
.
y
maxHeight
:
parent
.
height
-
toolStrip
.
y
+
(
_flightVideo
.
visible
?
(
_flightVideo
.
y
-
parent
.
height
)
:
0
)
property
bool
_anyActionAvailable
:
_guidedController
.
showStartMission
||
_guidedController
.
showResumeMission
||
_guidedController
.
showChangeAlt
||
_guidedController
.
showLandAbort
property
var
_actionModel
:
[
...
...
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
3081cb60
...
...
@@ -478,12 +478,11 @@ FlightMap {
MapScale
{
id
:
mapScale
anchors.right
:
parent
.
right
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
(
0.33
)
anchors.topMargin
:
ScreenTools
.
defaultFontPixelHeight
*
(
0.33
)
+
state
===
"
bottomMode
"
?
0
:
ScreenTools
.
toolbarHeight
anchors.bottomMargin
:
ScreenTools
.
defaultFontPixelHeight
*
(
0.33
)
anchors.margins
:
_toolsMargin
anchors.topMargin
:
_toolsMargin
+
state
===
"
bottomMode
"
?
0
:
ScreenTools
.
toolbarHeight
mapControl
:
flightMap
buttonsOnLeft
:
false
visible
:
!
ScreenTools
.
isTinyScreen
&&
QGroundControl
.
corePlugin
.
options
.
enableMapScale
visible
:
!
ScreenTools
.
isTinyScreen
&&
QGroundControl
.
corePlugin
.
options
.
enableMapScale
&&
mainIsMap
state
:
"
bottomMode
"
states
:
[
State
{
...
...
src/FlightDisplay/FlightDisplayViewWidgets.qml
View file @
3081cb60
...
...
@@ -170,8 +170,8 @@ Item {
id
:
instrumentsColumn
spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.25
anchors.top
:
parent
.
top
anchors.topMargin
:
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
?
(
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
.
widgetTopMargin
+
(
ScreenTools
.
defaultFontPixelHeight
*
0.5
)
)
:
0
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
anchors.topMargin
:
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
?
(
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
.
widgetTopMargin
+
_toolsMargin
)
:
0
anchors.margins
:
_toolsMargin
anchors.right
:
parent
.
right
//-------------------------------------------------------
// Airmap Airspace Control
...
...
@@ -185,7 +185,7 @@ Item {
//-- Instrument Panel
Loader
{
id
:
instrumentsLoader
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
anchors.margins
:
_toolsMargin
property
real
maxHeight
:
widgetRoot
?
widgetRoot
.
height
-
instrumentsColumn
.
y
-
airspaceControl
.
height
-
(
ScreenTools
.
defaultFontPixelHeight
*
4
)
:
0
states
:
[
State
{
...
...
src/PlanView/PlanView.qml
View file @
3081cb60
...
...
@@ -34,7 +34,7 @@ Item {
readonly
property
int
_decimalPlaces
:
8
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
readonly
property
real
_tools
TopMargin
:
ScreenTools
.
defaultFontPixelHeight
*
0.
5
readonly
property
real
_tools
Margin
:
ScreenTools
.
defaultFontPixelWidth
*
0.7
5
readonly
property
real
_radius
:
ScreenTools
.
defaultFontPixelWidth
*
0.5
readonly
property
real
_rightPanelWidth
:
Math
.
min
(
parent
.
width
/
3
,
ScreenTools
.
defaultFontPixelWidth
*
30
)
readonly
property
var
_defaultVehicleCoordinate
:
QtPositioning
.
coordinate
(
37.803784
,
-
122.462276
)
...
...
@@ -367,7 +367,7 @@ Item {
planView
:
true
// This is the center rectangle of the map which is not obscured by tools
property
rect
centerViewport
:
Qt
.
rect
(
_leftToolWidth
+
_margin
,
_tools
TopMargin
,
editorMap
.
width
-
_leftToolWidth
-
_rightToolWidth
-
(
_margin
*
2
),
mapScale
.
y
-
_margin
-
_toolsTop
Margin
)
property
rect
centerViewport
:
Qt
.
rect
(
_leftToolWidth
+
_margin
,
_tools
Margin
,
editorMap
.
width
-
_leftToolWidth
-
_rightToolWidth
-
(
_margin
*
2
),
mapScale
.
y
-
_margin
-
_tools
Margin
)
property
real
_leftToolWidth
:
toolStrip
.
x
+
toolStrip
.
width
property
real
_rightToolWidth
:
rightPanel
.
width
+
rightPanel
.
anchors
.
rightMargin
...
...
@@ -536,12 +536,11 @@ Item {
// Left tool strip
ToolStrip
{
id
:
toolStrip
anchors.
leftMargin
:
ScreenTools
.
defaultFontPixelWidth
*
2
anchors.
margins
:
_toolsMargin
anchors.left
:
parent
.
left
anchors.topMargin
:
_toolsTopMargin
anchors.top
:
parent
.
top
z
:
QGroundControl
.
zOrderWidgets
maxHeight
:
mapScale
.
y
-
toolStrip
.
y
maxHeight
:
parent
.
height
-
toolStrip
.
y
readonly
property
int
flyButtonIndex
:
0
readonly
property
int
fileButtonIndex
:
1
...
...
@@ -638,11 +637,16 @@ Item {
}
break
case
roiButtonIndex
:
allAddClickBoolsOff
()
if
(
_missionController
.
isROIActive
)
{
insertCancelROIAfterCurrent
(
)
if
(
_addROIOnClick
)
{
allAddClickBoolsOff
()
setChecked
(
index
,
false
)
}
else
{
_addROIOnClick
=
checked
allAddClickBoolsOff
()
if
(
_missionController
.
isROIActive
)
{
insertCancelROIAfterCurrent
()
}
else
{
_addROIOnClick
=
checked
}
}
break
case
patternButtonIndex
:
...
...
@@ -673,13 +677,13 @@ Item {
opacity
:
planExpanded
.
visible
?
0.2
:
0
anchors.bottom
:
parent
.
bottom
anchors.right
:
parent
.
right
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.rightMargin
:
_toolsMargin
}
//-------------------------------------------------------
// Right Panel Controls
Item
{
anchors.fill
:
rightPanel
anchors.topMargin
:
_tools
Top
Margin
anchors.topMargin
:
_toolsMargin
DeadMouseArea
{
anchors.fill
:
parent
}
...
...
@@ -857,28 +861,15 @@ Item {
}
}
MapScale
{
id
:
mapScale
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
(
0.66
)
anchors.bottom
:
waypointValuesDisplay
.
visible
?
waypointValuesDisplay
.
top
:
parent
.
bottom
anchors.left
:
parent
.
left
mapControl
:
editorMap
buttonsOnLeft
:
true
terrainButtonVisible
:
_editingLayer
===
_layerMission
visible
:
_toolStripBottom
<
y
terrainButtonChecked
:
waypointValuesDisplay
.
visible
onTerrainButtonClicked
:
waypointValuesDisplay
.
toggleVisible
()
}
MissionItemStatus
{
id
:
waypointValuesDisplay
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
parent
.
left
anchors.margins
:
_toolsMargin
anchors.left
:
toolStrip
.
right
anchors.bottom
:
mapScale
.
top
height
:
ScreenTools
.
defaultFontPixelHeight
*
7
maxWidth
:
parent
.
width
-
rightPanel
.
width
-
x
anchors.bottom
:
parent
.
bottom
maxWidth
:
rightPanel
.
x
-
x
-
anchors
.
margins
missionItems
:
_missionController
.
visualItems
visible
:
_internalVisible
&&
_editingLayer
===
_layerMission
&&
(
_toolStripBottom
+
mapScale
.
height
)
<
y
&&
QGroundControl
.
corePlugin
.
options
.
showMissionStatus
visible
:
_internalVisible
&&
_editingLayer
===
_layerMission
&&
QGroundControl
.
corePlugin
.
options
.
showMissionStatus
property
bool
_internalVisible
:
false
...
...
@@ -886,6 +877,19 @@ Item {
_internalVisible
=
!
_internalVisible
}
}
MapScale
{
id
:
mapScale
anchors.margins
:
_toolsMargin
anchors.bottom
:
parent
.
bottom
anchors.left
:
toolStrip
.
right
mapControl
:
editorMap
buttonsOnLeft
:
true
terrainButtonVisible
:
_editingLayer
===
_layerMission
terrainButtonChecked
:
waypointValuesDisplay
.
visible
onTerrainButtonClicked
:
waypointValuesDisplay
.
toggleVisible
()
}
}
Component
{
...
...
src/QmlControls/ToolStrip.qml
View file @
3081cb60
...
...
@@ -19,7 +19,7 @@ Rectangle {
id
:
_root
color
:
qgcPal
.
globalTheme
===
QGCPalette
.
Light
?
QGroundControl
.
corePlugin
.
options
.
toolbarBackgroundLight
:
QGroundControl
.
corePlugin
.
options
.
toolbarBackgroundDark
width
:
_idealWidth
<
repeater
.
contentWidth
?
repeater
.
contentWidth
:
_idealWidth
height
:
toolStripColumn
.
height
+
(
toolStripColumn
.
anchors
.
margins
*
2
)
height
:
Math
.
min
(
maxHeight
,
toolStripColumn
.
height
+
(
toolStripColumn
.
anchors
.
margins
*
2
)
)
radius
:
ScreenTools
.
defaultFontPixelWidth
/
2
property
alias
model
:
repeater
.
model
...
...
@@ -51,48 +51,60 @@ Rectangle {
buttons
:
toolStripColumn
.
children
}
Column
{
id
:
toolStripColumn
DeadMouseArea
{
anchors.fill
:
parent
}
QGCFlickable
{
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
*
0.4
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
spacing
:
ScreenTools
.
defaultFontPixelWidth
*
0.25
Repeater
{
id
:
repeater
QGCHoverButton
{
id
:
buttonTemplate
anchors.left
:
toolStripColumn
.
left
anchors.right
:
toolStripColumn
.
right
height
:
width
radius
:
ScreenTools
.
defaultFontPixelWidth
/
2
fontPointSize
:
ScreenTools
.
smallFontPointSize
autoExclusive
:
true
enabled
:
modelData
.
buttonEnabled
visible
:
modelData
.
buttonVisible
imageSource
:
modelData
.
showAlternateIcon
?
modelData
.
alternateIconSource
:
modelData
.
iconSource
text
:
modelData
.
name
checked
:
modelData
.
checked
!==
undefined
?
modelData
.
checked
:
checked
ButtonGroup.group
:
buttonGroup
// Only drop panel and toggleable are checkable
checkable
:
modelData
.
dropPanelComponent
!==
undefined
||
(
modelData
.
toggle
!==
undefined
&&
modelData
.
toggle
)
onClicked
:
{
dropPanel
.
hide
()
// DropPanel will call hide on "lastClickedButton"
if
(
modelData
.
dropPanelComponent
===
undefined
)
{
_root
.
clicked
(
index
,
checked
)
}
else
if
(
checked
)
{
var
panelEdgeTopPoint
=
mapToItem
(
_root
,
width
,
0
)
dropPanel
.
show
(
panelEdgeTopPoint
,
height
,
modelData
.
dropPanelComponent
)
_root
.
dropped
(
index
)
height
:
parent
.
height
contentHeight
:
toolStripColumn
.
height
flickableDirection
:
Flickable
.
VerticalFlick
Column
{
id
:
toolStripColumn
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
spacing
:
ScreenTools
.
defaultFontPixelWidth
*
0.25
Repeater
{
id
:
repeater
QGCHoverButton
{
id
:
buttonTemplate
anchors.left
:
toolStripColumn
.
left
anchors.right
:
toolStripColumn
.
right
height
:
width
radius
:
ScreenTools
.
defaultFontPixelWidth
/
2
fontPointSize
:
ScreenTools
.
smallFontPointSize
autoExclusive
:
true
enabled
:
modelData
.
buttonEnabled
visible
:
modelData
.
buttonVisible
imageSource
:
modelData
.
showAlternateIcon
?
modelData
.
alternateIconSource
:
modelData
.
iconSource
text
:
modelData
.
name
checked
:
modelData
.
checked
!==
undefined
?
modelData
.
checked
:
checked
ButtonGroup.group
:
buttonGroup
// Only drop panel and toggleable are checkable
checkable
:
modelData
.
dropPanelComponent
!==
undefined
||
(
modelData
.
toggle
!==
undefined
&&
modelData
.
toggle
)
onClicked
:
{
dropPanel
.
hide
()
// DropPanel will call hide on "lastClickedButton"
if
(
modelData
.
dropPanelComponent
===
undefined
)
{
_root
.
clicked
(
index
,
checked
)
}
else
if
(
checked
)
{
var
panelEdgeTopPoint
=
mapToItem
(
_root
,
width
,
0
)
dropPanel
.
show
(
panelEdgeTopPoint
,
height
,
modelData
.
dropPanelComponent
)
_root
.
dropped
(
index
)
}
if
(
_root
&&
buttonTemplate
)
_root
.
lastClickedButton
=
buttonTemplate
}
if
(
_root
&&
buttonTemplate
)
_root
.
lastClickedButton
=
buttonTemplate
}
}
}
...
...
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