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
438f76f2
Commit
438f76f2
authored
Apr 15, 2017
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Auto-Dismiss guided confirm dialog it state changes
parent
d2ef6d01
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
45 deletions
+61
-45
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+1
-8
GuidedActionConfirm.qml
src/FlightDisplay/GuidedActionConfirm.qml
+11
-0
GuidedActionsController.qml
src/FlightDisplay/GuidedActionsController.qml
+49
-37
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
438f76f2
...
...
@@ -510,6 +510,7 @@ QGCView {
GuidedActionsController
{
id
:
guidedActionsController
missionController
:
flyMissionController
confirmDialog
:
guidedActionConfirm
z
:
_flightVideoPipControl
.
z
+
1
onShowStartMissionChanged
:
{
...
...
@@ -523,14 +524,6 @@ QGCView {
confirmAction
(
actionResumeMission
)
}
}
onShowConfirmAction
:
{
guidedActionConfirm
.
title
=
title
guidedActionConfirm
.
message
=
message
guidedActionConfirm
.
action
=
action
guidedActionConfirm
.
actionData
=
actionData
guidedActionConfirm
.
visible
=
true
}
}
GuidedActionConfirm
{
...
...
src/FlightDisplay/GuidedActionConfirm.qml
View file @
438f76f2
...
...
@@ -34,9 +34,18 @@ Rectangle {
property
alias
message
:
messageText
.
text
property
int
action
property
var
actionData
property
bool
hideTrigger
:
false
property
real
_margins
:
ScreenTools
.
defaultFontPixelWidth
onHideTriggerChanged
:
{
if
(
hideTrigger
)
{
hideTrigger
=
false
altitudeSlider
.
visible
=
false
visible
=
false
}
}
QGCPalette
{
id
:
qgcPal
}
Column
{
...
...
@@ -74,12 +83,14 @@ Rectangle {
_root
.
actionData
=
altitudeSlider
.
getValue
()
altitudeSlider
.
visible
=
false
}
hideTrigger
=
false
guidedController
.
executeAction
(
_root
.
action
,
_root
.
actionData
)
}
onReject
:
{
altitudeSlider
.
visible
=
false
_root
.
visible
=
false
hideTrigger
=
false
}
}
}
...
...
src/FlightDisplay/GuidedActionsController.qml
View file @
438f76f2
...
...
@@ -28,8 +28,7 @@ Item {
id
:
_root
property
var
missionController
signal
showConfirmAction
(
string
title
,
string
message
,
int
action
,
var
actionData
)
property
var
confirmDialog
readonly
property
string
emergencyStopTitle
:
qsTr
(
"
Emergency Stop
"
)
readonly
property
string
armTitle
:
qsTr
(
"
Arm
"
)
...
...
@@ -79,6 +78,7 @@ Item {
readonly
property
int
actionPause
:
15
property
bool
showEmergenyStop
:
!
_hideEmergenyStop
&&
_activeVehicle
&&
_vehicleArmed
&&
_activeVehicle
.
flying
property
bool
showArm
:
_activeVehicle
&&
!
_vehicleArmed
property
bool
showDisarm
:
_activeVehicle
&&
_vehicleArmed
&&
!
_activeVehicle
.
flying
property
bool
showRTL
:
_activeVehicle
&&
_vehicleArmed
&&
_activeVehicle
.
guidedModeSupported
&&
_activeVehicle
.
flying
&&
!
_vehicleInRTLMode
property
bool
showTakeoff
:
_activeVehicle
&&
_activeVehicle
.
guidedModeSupported
&&
!
_activeVehicle
.
flying
&&
!
_activeVehicle
.
fixedWing
...
...
@@ -91,8 +91,6 @@ Item {
property
bool
showLandAbort
:
_activeVehicle
&&
_activeVehicle
.
flying
&&
_activeVehicle
.
fixedWing
property
bool
showGotoLocation
:
_activeVehicle
&&
_activeVehicle
.
guidedMode
&&
_activeVehicle
.
flying
onShowStartMissionChanged
:
console
.
log
(
showStartMission
,
_activeVehicle
,
_missionAvailable
,
_missionActive
,
_vehicleArmed
,
_vehicleInLandMode
,
_vehicleInRTLMode
)
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
string
_flightMode
:
_activeVehicle
?
_activeVehicle
.
flightMode
:
""
property
bool
_missionAvailable
:
missionController
.
containsItems
...
...
@@ -116,81 +114,95 @@ Item {
// Called when an action is about to be executed in order to confirm
function
confirmAction
(
actionCode
,
actionData
)
{
var
titl
e
var
message
confirmDialog
.
action
=
actionCod
e
confirmDialog
.
actionData
=
actionData
_actionData
=
actionData
switch
(
actionCode
)
{
case
actionArm
:
if
(
_activeVehicle
.
flying
)
{
return
}
title
=
armTitle
message
=
armMessage
confirmDialog
.
title
=
armTitle
confirmDialog
.
message
=
armMessage
confirmDialog
.
hideTrigger
=
Qt
.
binding
(
function
()
{
return
!
showArm
})
break
;
case
actionDisarm
:
if
(
_activeVehicle
.
flying
)
{
return
}
title
=
disarmTitle
message
=
disarmMessage
confirmDialog
.
title
=
disarmTitle
confirmDialog
.
message
=
disarmMessage
confirmDialog
.
hideTrigger
=
Qt
.
binding
(
function
()
{
return
!
showDisarm
})
break
;
case
actionEmergencyStop
:
title
=
emergencyStopTitle
message
=
emergencyStopMessage
confirmDialog
.
title
=
emergencyStopTitle
confirmDialog
.
message
=
emergencyStopMessage
confirmDialog
.
hideTrigger
=
Qt
.
binding
(
function
()
{
return
!
showEmergenyStop
})
break
;
case
actionTakeoff
:
title
=
takeoffTitle
message
=
takeoffMessage
confirmDialog
.
title
=
takeoffTitle
confirmDialog
.
message
=
takeoffMessage
confirmDialog
.
hideTrigger
=
Qt
.
binding
(
function
()
{
return
!
showTakeoff
})
break
;
case
actionStartMission
:
title
=
startMissionTitle
message
=
startMissionMessage
confirmDialog
.
title
=
startMissionTitle
confirmDialog
.
message
=
startMissionMessage
confirmDialog
.
hideTrigger
=
Qt
.
binding
(
function
()
{
return
!
showStartMission
})
break
;
case
actionResumeMission
:
title
=
resumeMissionTitle
message
=
resumeMissionMessage
confirmDialog
.
title
=
resumeMissionTitle
confirmDialog
.
message
=
resumeMissionMessage
confirmDialog
.
hideTrigger
=
Qt
.
binding
(
function
()
{
return
!
showResumeMission
})
break
;
case
actionResumeMissionReady
:
title
=
resumeMissionTitle
message
=
resumeMissionReadyMessage
confirmDialog
.
title
=
resumeMissionTitle
confirmDialog
.
message
=
resumeMissionReadyMessage
confirmDialog
.
hideTrigger
=
false
break
;
case
actionLand
:
title
=
landTitle
message
=
landMessage
confirmDialog
.
title
=
landTitle
confirmDialog
.
message
=
landMessage
confirmDialog
.
hideTrigger
=
Qt
.
binding
(
function
()
{
return
!
showLand
})
break
;
case
actionRTL
:
title
=
rtlTitle
message
=
rtlMessage
confirmDialog
.
title
=
rtlTitle
confirmDialog
.
message
=
rtlMessage
confirmDialog
.
hideTrigger
=
Qt
.
binding
(
function
()
{
return
!
showRTL
})
break
;
case
actionChangeAlt
:
title
=
changeAltTitle
message
=
changeAltMessage
confirmDialog
.
title
=
changeAltTitle
confirmDialog
.
message
=
changeAltMessage
confirmDialog
.
hideTrigger
=
Qt
.
binding
(
function
()
{
return
!
showChangeAlt
})
break
;
case
actionGoto
:
title
=
gotoTitle
message
=
gotoMessage
confirmDialog
.
title
=
gotoTitle
confirmDialog
.
message
=
gotoMessage
confirmDialog
.
hideTrigger
=
Qt
.
binding
(
function
()
{
return
!
showGotoLocation
})
break
;
case
actionSetWaypoint
:
title
=
setWaypointTitle
message
=
setWaypointMessage
confirmDialog
.
title
=
setWaypointTitle
confirmDialog
.
message
=
setWaypointMessage
break
;
case
actionOrbit
:
title
=
orbitTitle
message
=
orbitMessage
confirmDialog
.
title
=
orbitTitle
confirmDialog
.
message
=
orbitMessage
confirmDialog
.
hideTrigger
=
Qt
.
binding
(
function
()
{
return
!
showOrbit
})
break
;
case
actionLandAbort
:
title
=
landAbortTitle
message
=
landAbortMessage
confirmDialog
.
title
=
landAbortTitle
confirmDialog
.
message
=
landAbortMessage
confirmDialog
.
hideTrigger
=
Qt
.
binding
(
function
()
{
return
!
showLandAbort
})
break
;
case
actionPause
:
title
=
pauseTitle
message
=
pauseMessage
confirmDialog
.
title
=
pauseTitle
confirmDialog
.
message
=
pauseMessage
confirmDialog
.
hideTrigger
=
Qt
.
binding
(
function
()
{
return
!
showPause
})
break
;
default
:
console
.
warn
(
"
Unknown actionCode
"
,
actionCode
)
return
}
showConfirmAction
(
title
,
message
,
actionCode
,
actionData
)
confirmDialog
.
visible
=
true
}
// Executes the specified action
...
...
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