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