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
20a51dfe
Commit
20a51dfe
authored
Mar 24, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3064 from DonLakeFlyer/AutoHide
Auto-Hide guided mode bar
parents
3b00e145
9e301d51
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
56 deletions
+100
-56
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+7
-3
FlightDisplayViewWidgets.qml
src/FlightDisplay/FlightDisplayViewWidgets.qml
+93
-53
No files found.
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
20a51dfe
...
...
@@ -128,9 +128,13 @@ FlightMap {
anchors.fill
:
parent
onClicked
:
{
if
(
_activeVehicle
&&
_activeVehicle
.
guidedMode
)
{
_gotoHereCoordinate
=
flightMap
.
toCoordinate
(
Qt
.
point
(
mouse
.
x
,
mouse
.
y
))
flightWidgets
.
guidedModeBar
.
confirmAction
(
flightWidgets
.
guidedModeBar
.
confirmGoTo
)
if
(
_activeVehicle
)
{
if
(
_activeVehicle
.
guidedMode
&&
flightWidgets
.
guidedModeBar
.
state
==
"
Shown
"
)
{
_gotoHereCoordinate
=
flightMap
.
toCoordinate
(
Qt
.
point
(
mouse
.
x
,
mouse
.
y
))
flightWidgets
.
guidedModeBar
.
confirmAction
(
flightWidgets
.
guidedModeBar
.
confirmGoTo
)
}
else
{
flightWidgets
.
guidedModeBar
.
state
=
"
Shown
"
}
}
}
}
...
...
src/FlightDisplay/FlightDisplayViewWidgets.qml
View file @
20a51dfe
...
...
@@ -71,7 +71,7 @@ Item {
model
:
QGroundControl
.
multiVehicleManager
.
vehicles
delegate
:
QGCLabel
{
QGCLabel
{
width
:
gpsLockColumn
.
width
horizontalAlignment
:
Text
.
AlignHCenter
visible
:
!
object
.
coordinateValid
...
...
@@ -268,15 +268,56 @@ Item {
//-- Guided mode buttons
Rectangle
{
id
:
_guidedModeBar
anchors.margins
:
_
margins
anchors.margins
:
_
barMargin
anchors.bottom
:
parent
.
bottom
anchors.horizontalCenter
:
parent
.
horizontalCenter
width
:
guidedModeButtons
.
width
+
(
_margins
*
2
)
height
:
guidedModeButtons
.
height
+
(
_margins
*
2
)
width
:
guidedModeColumn
.
width
+
(
_margins
*
2
)
height
:
guidedModeColumn
.
height
+
(
_margins
*
2
)
radius
:
_margins
color
:
qgcPal
.
window
visible
:
_activeVehicle
opacity
:
0.9
z
:
QGroundControl
.
zOrderWidgets
state
:
"
Shown
"
states
:
[
State
{
name
:
"
Shown
"
PropertyChanges
{
target
:
showAnimation
;
running
:
true
}
PropertyChanges
{
target
:
guidedModeHideTimer
;
running
:
true
}
},
State
{
name
:
"
Hidden
"
PropertyChanges
{
target
:
hideAnimation
;
running
:
true
}
}
]
PropertyAnimation
{
id
:
hideAnimation
target
:
_guidedModeBar
property
:
"
_barMargin
"
duration
:
1000
easing.type
:
Easing
.
InOutQuad
from
:
_guidedModeBar
.
_showMargin
to
:
_guidedModeBar
.
_hideMargin
}
PropertyAnimation
{
id
:
showAnimation
target
:
_guidedModeBar
property
:
"
_barMargin
"
duration
:
250
easing.type
:
Easing
.
InOutQuad
from
:
_guidedModeBar
.
_hideMargin
to
:
_guidedModeBar
.
_showMargin
}
Timer
{
id
:
guidedModeHideTimer
interval
:
7000
running
:
true
onTriggered
:
_guidedModeBar
.
state
=
"
Hidden
"
}
readonly
property
int
confirmHome
:
1
readonly
property
int
confirmLand
:
2
...
...
@@ -289,6 +330,9 @@ Item {
readonly
property
int
confirmRetask
:
9
property
int
confirmActionCode
property
real
_showMargin
:
_margins
property
real
_hideMargin
:
_margins
-
_guidedModeBar
.
height
property
real
_barMargin
:
_showMargin
function
actionConfirmed
()
{
switch
(
confirmActionCode
)
{
...
...
@@ -335,9 +379,11 @@ Item {
guidedModeBar
.
visible
=
true
altitudeSlider
.
visible
=
false
_flightMap
.
_gotoHereCoordinate
=
QtPositioning
.
coordinate
()
guidedModeHideTimer
.
restart
()
}
function
confirmAction
(
actionCode
)
{
guidedModeHideTimer
.
stop
()
confirmActionCode
=
actionCode
switch
(
confirmActionCode
)
{
case
confirmArm
:
...
...
@@ -357,6 +403,9 @@ Item {
case
confirmLand
:
guidedModeConfirm
.
confirmText
=
"
land
"
break
;
case
confirmHome
:
guidedModeConfirm
.
confirmText
=
"
return to launch
"
break
;
case
confirmChangeAlt
:
altitudeSlider
.
visible
=
true
altitudeSlider
.
setInitialValueAppSettingsDistanceUnits
(
_activeVehicle
.
altitudeAMSL
.
value
)
...
...
@@ -373,78 +422,70 @@ Item {
guidedModeConfirm
.
visible
=
true
}
Row
{
id
:
guidedMode
Buttons
Column
{
id
:
guidedMode
Column
anchors.margins
:
_margins
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
spacing
:
_margins
QGCButton
{
text
:
_activeVehicle
?
(
_activeVehicle
.
armed
?
(
_activeVehicle
.
flying
?
"
Emergency Stop
"
:
"
Disarm
"
)
:
"
Arm
"
)
:
""
onClicked
:
{
if
(
_activeVehicle
)
{
_guidedModeBar
.
confirmAction
(
_activeVehicle
.
armed
?
(
_activeVehicle
.
flying
?
_guidedModeBar
.
confirmEmergencyStop
:
_guidedModeBar
.
confirmDisarm
)
:
_guidedModeBar
.
confirmArm
)
}
Row
{
spacing
:
_margins
QGCButton
{
text
:
_activeVehicle
.
armed
?
(
_activeVehicle
.
flying
?
"
Emergency Stop
"
:
"
Disarm
"
)
:
"
Arm
"
onClicked
:
_guidedModeBar
.
confirmAction
(
_activeVehicle
.
armed
?
(
_activeVehicle
.
flying
?
_guidedModeBar
.
confirmEmergencyStop
:
_guidedModeBar
.
confirmDisarm
)
:
_guidedModeBar
.
confirmArm
)
}
}
QGCButton
{
text
:
"
RTL
"
visible
:
_activeVehicle
&&
_activeVehicle
.
guidedModeSupported
&&
_activeVehicle
.
flying
onClicked
:
{
if
(
_activeVehicle
)
{
_guidedModeBar
.
confirmAction
(
_guidedModeBar
.
confirmHome
)
}
QGCButton
{
text
:
"
RTL
"
visible
:
_activeVehicle
.
guidedModeSupported
&&
_activeVehicle
.
flying
onClicked
:
_guidedModeBar
.
confirmAction
(
_guidedModeBar
.
confirmHome
)
}
}
QGCButton
{
text
:
_activeVehicle
?
(
_activeVehicle
.
flying
?
"
Land
"
:
"
Takeoff
"
)
:
""
visible
:
_activeVehicle
&&
_activeVehicle
.
guidedModeSupported
&&
_activeVehicle
.
armed
onClicked
:
{
if
(
_activeVehicle
)
{
_guidedModeBar
.
confirmAction
(
_activeVehicle
.
flying
?
_guidedModeBar
.
confirmLand
:
_guidedModeBar
.
confirmTakeoff
)
}
QGCButton
{
text
:
_activeVehicle
.
flying
?
"
Land
"
:
"
Takeoff
"
visible
:
_activeVehicle
.
guidedModeSupported
&&
_activeVehicle
.
armed
onClicked
:
_guidedModeBar
.
confirmAction
(
_activeVehicle
.
flying
?
_guidedModeBar
.
confirmLand
:
_guidedModeBar
.
confirmTakeoff
)
}
}
QGCButton
{
text
:
"
Pause
"
visible
:
_activeVehicle
&&
_activeVehicle
.
pauseVehicleSupported
&&
_activeVehicle
.
flying
onClicked
:
{
if
(
_activeVehicle
)
{
QGCButton
{
text
:
"
Pause
"
visible
:
_activeVehicle
.
pauseVehicleSupported
&&
_activeVehicle
.
flying
onClicked
:
{
guidedModeHideTimer
.
restart
()
_activeVehicle
.
pauseVehicle
()
}
}
}
QGCButton
{
text
:
"
Change Altitude
"
visible
:
_activeVehicle
&&
_activeVehicle
.
guidedModeSupported
&&
_activeVehicle
.
armed
onClicked
:
{
if
(
_activeVehicle
)
{
_guidedModeBar
.
confirmAction
(
_guidedModeBar
.
confirmChangeAlt
)
}
QGCButton
{
text
:
"
Change Altitude
"
visible
:
_activeVehicle
.
guidedModeSupported
&&
_activeVehicle
.
armed
onClicked
:
_guidedModeBar
.
confirmAction
(
_guidedModeBar
.
confirmChangeAlt
)
}
}
// Row
QGCLabel
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
text
:
"
Click in map to move vehicle
"
visible
:
_activeVehicle
&&
_activeVehicle
.
guidedMode
&&
_activeVehicle
.
flying
}
}
}
// Column
}
// Rectangle - Guided mode buttons
MouseArea
{
anchors.fill
:
parent
enabled
:
guidedModeConfirm
.
visible
onClicked
:
{
_guidedModeBar
.
rejectGuidedModeConfirm
()
}
anchors.fill
:
parent
enabled
:
guidedModeConfirm
.
visible
onClicked
:
_guidedModeBar
.
rejectGuidedModeConfirm
()
}
// Action confirmation control
SliderSwitch
{
id
:
guidedModeConfirm
anchors.
top
:
_guidedModeBar
.
top
anchors.bottom
:
_guidedModeBar
.
bottom
anchors.
bottomMargin
:
_margins
anchors.bottom
:
parent
.
bottom
anchors.horizontalCenter
:
parent
.
horizontalCenter
height
:
ScreenTools
.
defaultFontPixelHeight
*
3
visible
:
false
z
:
QGroundControl
.
zOrderWidgets
...
...
@@ -453,11 +494,10 @@ Item {
guidedModeBar
.
visible
=
true
_guidedModeBar
.
actionConfirmed
()
altitudeSlider
.
visible
=
false
guidedModeHideTimer
.
restart
()
}
onReject
:
{
_guidedModeBar
.
rejectGuidedModeConfirm
()
}
onReject
:
_guidedModeBar
.
rejectGuidedModeConfirm
()
}
//-- Altitude slider
...
...
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