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
2814c345
Commit
2814c345
authored
Feb 21, 2020
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vertical ToolStrip.qml feature added
parent
b750c08c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
119 additions
and
23 deletions
+119
-23
.directory
resources/.directory
+4
-0
.directory
resources/mavs/.directory
+3
-0
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+2
-0
ToolStrip.qml
src/QmlControls/ToolStrip.qml
+109
-23
Vehicle.cc
src/Vehicle/Vehicle.cc
+1
-0
No files found.
resources/.directory
0 → 100644
View file @
2814c345
[Dolphin]
PreviewsShown=true
Timestamp=2020,2,21,14,47,12
Version=4
resources/mavs/.directory
0 → 100644
View file @
2814c345
[Dolphin]
Timestamp=2020,2,21,14,48,2
Version=4
src/FlightDisplay/FlightDisplayView.qml
View file @
2814c345
...
...
@@ -679,6 +679,8 @@ QGCView {
maxHeight
:
(
_flightVideo
.
visible
?
_flightVideo
.
y
:
parent
.
height
)
-
toolStrip
.
y
buttonVisible
:
[
_useChecklist
,
_guidedController
.
showTakeoff
||
!
_guidedController
.
showLand
,
_guidedController
.
showLand
&&
!
_guidedController
.
showTakeoff
,
true
,
true
,
true
]
buttonEnabled
:
[
_useChecklist
&&
_activeVehicle
,
_guidedController
.
showTakeoff
,
_guidedController
.
showLand
,
_guidedController
.
showRTL
,
_guidedController
.
showPause
,
_anyActionAvailable
]
horizontal
:
true
enableSwitchButton
:
true
property
bool
_anyActionAvailable
:
_guidedController
.
showStartMission
||
_guidedController
.
showResumeMission
||
_guidedController
.
showChangeAlt
||
_guidedController
.
showLandAbort
property
var
_actionModel
:
[
...
...
src/QmlControls/ToolStrip.qml
View file @
2814c345
...
...
@@ -9,6 +9,7 @@
import
QtQuick
2.11
import
QtQuick
.
Controls
1.4
import
QtQuick
.
Layouts
1.11
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Palette
1.0
...
...
@@ -16,8 +17,8 @@ import QGroundControl.Palette 1.0
Rectangle
{
id
:
_root
color
:
qgcPal
.
window
width
:
ScreenTools
.
isMobile
?
ScreenTools
.
minTouchPixels
:
ScreenTools
.
defaultFontPixelWidth
*
7
height
:
toolStrip
Column
.
height
+
(
toolStripColumn
.
anchors
.
margins
*
2
)
width
:
toolStripGrid
.
width
+
(
toolStripGrid
.
anchors
.
margins
*
2
)
height
:
toolStrip
Grid
.
height
+
(
toolStripGrid
.
anchors
.
margins
*
2
)
radius
:
_radius
border.width
:
1
border.color
:
qgcPal
.
globalTheme
===
QGCPalette
.
Light
?
Qt
.
rgba
(
0
,
0
,
0
,
0.35
)
:
Qt
.
rgba
(
1
,
1
,
1
,
0.35
)
...
...
@@ -30,6 +31,11 @@ Rectangle {
property
var
buttonEnabled
///< List of bool values, one for each button in strip - true: button enabled, false: button disabled
property
var
buttonVisible
///< List of bool values, one for each button in strip - true: button visible, false: button invisible
property
real
maxHeight
///< Maximum height for control, determines whether text is hidden to make control shorter
property
bool
horizontal
:
false
/// toolstrip horizontal or vertical ?
property
bool
enableSwitchButton
:
false
/// enable horizontal vertical button ?
property
real
_horizontal
:
horizontal
signal
clicked
(
int
index
,
bool
checked
)
...
...
@@ -37,6 +43,8 @@ Rectangle {
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_buttonSpacing
:
ScreenTools
.
defaultFontPixelHeight
/
4
readonly
property
real
_imageWidthHeight
:
ScreenTools
.
isMobile
?
ScreenTools
.
minTouchPixels
:
ScreenTools
.
defaultFontPixelWidth
*
5
QGCPalette
{
id
:
qgcPal
}
ExclusiveGroup
{
id
:
dropButtonsExclusiveGroup
}
...
...
@@ -54,40 +62,46 @@ Rectangle {
anchors.fill
:
parent
}
Column
{
id
:
toolStrip
Column
GridLayout
{
id
:
toolStrip
Grid
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
/
2
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
spacing
:
_buttonSpacing
columnSpacing
:
_buttonSpacing
rowSpacing
:
_buttonSpacing
rows
:
_horizontal
?
1
:
model
.
length
columns
:
_horizontal
?
model
.
length
:
1
QGCLabel
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
text
:
title
font.pointSize
:
ScreenTools
.
mobile
?
ScreenTools
.
smallFontPointSize
:
ScreenTools
.
defaultFontPointSize
Layout.alignment
:
_horizontal
?
Qt
.
AlignVCenter
:
Qt
.
AlignHCenter
}
// separator
Rectangle
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
height
:
1
height
:
_horizontal
?
undefined
:
1
width
:
_horizontal
?
1
:
undefined
Layout.fillWidth
:
_horizontal
?
false
:
true
Layout.fillHeight
:
_horizontal
?
true
:
false
color
:
qgcPal
.
text
}
Column
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
spacing
:
_buttonSpacing
GridLayout
{
rows
:
_horizontal
?
1
:
model
.
length
columns
:
_horizontal
?
model
.
length
:
1
columnSpacing
:
_buttonSpacing
rowSpacing
:
_buttonSpacing
Repeater
{
id
:
repeater
delegate
:
FocusScope
{
id
:
scope
width
:
toolStripColumn
.
width
width
:
buttonRect
.
width
height
:
buttonRect
.
height
visible
:
_root
.
buttonVisible
?
_root
.
buttonVisible
[
index
]
:
true
Layout.alignment
:
_horizontal
?
Qt
.
AlignVCenter
:
Qt
.
AlignHCenter
property
bool
checked
:
false
property
ExclusiveGroup
exclusiveGroup
:
dropButtonsExclusiveGroup
...
...
@@ -130,21 +144,21 @@ Rectangle {
Rectangle
{
id
:
buttonRect
anchors.left
:
parent
.
left
anchors.
right
:
parent
.
right
anchors.
top
:
parent
.
top
height
:
buttonColumn
.
height
width
:
buttonColumn
.
width
color
:
_showHighlight
?
_repeaterPal
.
buttonHighlight
:
_repeaterPal
.
window
Column
{
id
:
buttonColumn
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
spacing
:
-
buttonImage
.
height
/
8
spacing
:
_buttonSpacing
QGCColoredImage
{
id
:
buttonImage
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
height
:
width
*
0.8
height
:
_imageWidthHeight
width
:
_imageWidthHeight
//anchors.centerIn: parent
source
:
_source
sourceSize.height
:
height
...
...
@@ -217,9 +231,81 @@ Rectangle {
}
}
// Rectangle
}
// FocusScope
}
}
// Repeater
}
// GridLayout
// separator
Rectangle
{
height
:
_horizontal
?
undefined
:
1
width
:
_horizontal
?
1
:
undefined
Layout.fillWidth
:
_horizontal
?
false
:
true
Layout.fillHeight
:
_horizontal
?
true
:
false
color
:
qgcPal
.
text
visible
:
enableSwitchButton
}
}
// switch button, tool strip horizontal <-> vertical
Rectangle
{
id
:
switchButtonRect
height
:
switchButtonColumn
.
height
width
:
switchButtonColumn
.
width
color
:
_showHighlight
?
_switchButtonPal
.
buttonHighlight
:
_switchButtonPal
.
window
visible
:
enableSwitchButton
property
bool
_hovered
:
false
property
bool
_showHighlight
:
(
enableSwitchButton
&&
_hovered
)
QGCPalette
{
id
:
_switchButtonPal
;
colorGroupEnabled
:
enableSwitchButton
}
Column
{
id
:
switchButtonColumn
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
spacing
:
_buttonSpacing
QGCColoredImage
{
id
:
switchButtonImage
height
:
_imageWidthHeight
width
:
_imageWidthHeight
//anchors.centerIn: parent
source
:
"
/res/clockwise-arrow.svg
"
sourceSize.height
:
height
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
color
:
switchButtonRect
.
_showHighlight
?
_switchButtonPal
.
buttonHighlightText
:
_switchButtonPal
.
text
}
QGCLabel
{
id
:
switchButtonLabel
anchors.horizontalCenter
:
parent
.
horizontalCenter
font.pointSize
:
ScreenTools
.
smallFontPointSize
text
:
_horizontal
?
"
Vert
"
:
"
Hor
"
color
:
switchButtonRect
.
_showHighlight
?
_switchButtonPal
.
buttonHighlightText
:
_switchButtonPal
.
text
enabled
:
enableSwitchButton
}
}
// Column
QGCMouseArea
{
anchors.fill
:
parent
visible
:
enableSwitchButton
hoverEnabled
:
true
preventStealing
:
true
onContainsMouseChanged
:
switchButtonRect
.
_hovered
=
containsMouse
onContainsPressChanged
:
switchButtonRect
.
_hovered
=
containsPress
onClicked
:
{
dropPanel
.
hide
()
// hide affects checked, so this needs to be duplicated inside not outside if
if
(
_root
.
_horizontal
===
true
)
{
_root
.
_horizontal
=
false
}
else
{
_root
.
_horizontal
=
true
}
}
}
}
// switchButton Rectangle
}
// GridLayout
DropPanel
{
id
:
dropPanel
...
...
src/Vehicle/Vehicle.cc
View file @
2814c345
...
...
@@ -1425,6 +1425,7 @@ void Vehicle::_handleExtendedSysState(mavlink_message_t& message)
mavlink_extended_sys_state_t
extendedState
;
mavlink_msg_extended_sys_state_decode
(
&
message
,
&
extendedState
);
qWarning
()
<<
"Vehicle::_handleExtendedSysState: land_state: "
<<
extendedState
.
landed_state
;
switch
(
extendedState
.
landed_state
)
{
case
MAV_LANDED_STATE_ON_GROUND
:
_setFlying
(
false
);
...
...
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