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
2167fdb6
Commit
2167fdb6
authored
Jul 30, 2020
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move GuidedActionsController references to global
parent
a07ec8aa
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
89 additions
and
110 deletions
+89
-110
FlyView.qml
src/FlightDisplay/FlyView.qml
+12
-12
FlyViewInstrumentPanel.qml
src/FlightDisplay/FlyViewInstrumentPanel.qml
+3
-5
FlyViewMap.qml
src/FlightDisplay/FlyViewMap.qml
+8
-9
FlyViewMissionCompleteDialog.qml
src/FlightDisplay/FlyViewMissionCompleteDialog.qml
+4
-5
FlyViewToolStrip.qml
src/FlightDisplay/FlyViewToolStrip.qml
+0
-3
FlyViewToolStripActionList.qml
src/FlightDisplay/FlyViewToolStripActionList.qml
+8
-18
FlyViewWidgetLayer.qml
src/FlightDisplay/FlyViewWidgetLayer.qml
+9
-12
GuidedActionActionList.qml
src/FlightDisplay/GuidedActionActionList.qml
+3
-3
GuidedActionLand.qml
src/FlightDisplay/GuidedActionLand.qml
+6
-6
GuidedActionPause.qml
src/FlightDisplay/GuidedActionPause.qml
+5
-5
GuidedActionRTL.qml
src/FlightDisplay/GuidedActionRTL.qml
+5
-5
GuidedActionTakeoff.qml
src/FlightDisplay/GuidedActionTakeoff.qml
+5
-5
GuidedToolStripAction.qml
src/FlightDisplay/GuidedToolStripAction.qml
+4
-3
MultiVehicleList.qml
src/FlightDisplay/MultiVehicleList.qml
+7
-8
MultiVehiclePanel.qml
src/FlightDisplay/MultiVehiclePanel.qml
+5
-7
PlanMapItems.qml
src/FlightMap/MapItems/PlanMapItems.qml
+2
-1
MainRootWindow.qml
src/ui/MainRootWindow.qml
+3
-3
No files found.
src/FlightDisplay/FlyView.qml
View file @
2167fdb6
...
...
@@ -32,13 +32,14 @@ import QGroundControl.Vehicle 1.0
Item
{
id
:
_root
// These should only be used by MainRootWindow
property
var
planController
:
_planController
property
var
guidedController
:
_guidedController
PlanMasterController
{
id
:
_planController
flyView
:
true
Component.onCompleted
:
{
start
()
mainWindow
.
planMasterControllerFlyView
=
_planController
}
id
:
_planController
flyView
:
true
Component.onCompleted
:
start
()
}
property
bool
_mainWindowIsMap
:
mapControl
.
pipState
.
state
===
mapControl
.
pipState
.
fullState
...
...
@@ -138,12 +139,11 @@ Item {
}
FlyViewMap
{
id
:
mapControl
guidedActionsController
:
_guidedController
planMasterController
:
_planController
rightPanelWidth
:
ScreenTools
.
defaultFontPixelHeight
*
9
pipMode
:
!
_mainWindowIsMap
toolInsets
:
customOverlay
.
totalToolInsets
id
:
mapControl
planMasterController
:
_planController
rightPanelWidth
:
ScreenTools
.
defaultFontPixelHeight
*
9
pipMode
:
!
_mainWindowIsMap
toolInsets
:
customOverlay
.
totalToolInsets
mapName
:
"
FlightDisplayView
"
}
...
...
src/FlightDisplay/FlyViewInstrumentPanel.qml
View file @
2167fdb6
...
...
@@ -22,13 +22,11 @@ Column {
z
:
QGroundControl
.
zOrderWidgets
property
real
availableHeight
property
var
guidedActionsController
MultiVehiclePanel
{
id
:
multiVehiclePanel
width
:
parent
.
width
availableHeight
:
parent
.
height
-
y
guidedActionsController
:
_root
.
guidedActionsController
id
:
multiVehiclePanel
width
:
parent
.
width
availableHeight
:
parent
.
height
-
y
}
AirspaceControl
{
...
...
src/FlightDisplay/FlyViewMap.qml
View file @
2167fdb6
...
...
@@ -38,7 +38,6 @@ FlightMap {
isDark
:
_isFullWindowItemDark
}
property
var
guidedActionsController
property
var
rightPanelWidth
property
var
planMasterController
property
bool
pipMode
:
false
// true: map is shown in a small pip mode
...
...
@@ -433,7 +432,7 @@ FlightMap {
return
_mapCircle
.
radius
.
rawValue
}
Component
.
onCompleted
:
guidedActionsController
.
orbitMapCircle
=
orbitMapCircle
Component
.
onCompleted
:
mainWindow
.
guidedControllerFlyView
.
orbitMapCircle
=
orbitMapCircle
QGCMapCircle
{
id
:
_mapCircle
...
...
@@ -503,35 +502,35 @@ FlightMap {
property
var
coord
QGCMenuItem
{
text
:
qsTr
(
"
Go to location
"
)
visible
:
guidedActionsController
.
showGotoLocation
visible
:
mainWindow
.
guidedControllerFlyView
.
showGotoLocation
onTriggered
:
{
gotoLocationItem
.
show
(
clickMenu
.
coord
)
guidedActionsController
.
confirmAction
(
guidedActionsController
.
actionGoto
,
clickMenu
.
coord
,
gotoLocationItem
)
mainWindow
.
guidedControllerFlyView
.
confirmAction
(
mainWindow
.
guidedControllerFlyView
.
actionGoto
,
clickMenu
.
coord
,
gotoLocationItem
)
}
}
QGCMenuItem
{
text
:
qsTr
(
"
Orbit at location
"
)
visible
:
guidedActionsController
.
showOrbit
visible
:
mainWindow
.
guidedControllerFlyView
.
showOrbit
onTriggered
:
{
orbitMapCircle
.
show
(
clickMenu
.
coord
)
guidedActionsController
.
confirmAction
(
guidedActionsController
.
actionOrbit
,
clickMenu
.
coord
,
orbitMapCircle
)
mainWindow
.
guidedControllerFlyView
.
confirmAction
(
mainWindow
.
guidedControllerFlyView
.
actionOrbit
,
clickMenu
.
coord
,
orbitMapCircle
)
}
}
QGCMenuItem
{
text
:
qsTr
(
"
ROI at location
"
)
visible
:
guidedActionsController
.
showROI
visible
:
mainWindow
.
guidedControllerFlyView
.
showROI
onTriggered
:
{
roiLocationItem
.
show
(
clickMenu
.
coord
)
guidedActionsController
.
confirmAction
(
guidedActionsController
.
actionROI
,
clickMenu
.
coord
,
roiLocationItem
)
mainWindow
.
guidedControllerFlyView
.
confirmAction
(
mainWindow
.
guidedControllerFlyView
.
actionROI
,
clickMenu
.
coord
,
roiLocationItem
)
}
}
}
onClicked
:
{
if
(
!
guidedActionsController
.
guidedUIVisible
&&
(
guidedActionsController
.
showGotoLocation
||
guidedActionsController
.
showOrbit
||
guidedActionsController
.
showROI
))
{
if
(
!
mainWindow
.
guidedControllerFlyView
.
guidedUIVisible
&&
(
mainWindow
.
guidedControllerFlyView
.
showGotoLocation
||
mainWindow
.
guidedControllerFlyView
.
showOrbit
||
mainWindow
.
guidedControllerFlyView
.
showROI
))
{
orbitMapCircle
.
hide
()
gotoLocationItem
.
hide
()
var
clickCoord
=
_root
.
toCoordinate
(
Qt
.
point
(
mouse
.
x
,
mouse
.
y
),
false
/* clipToViewPort */
)
...
...
src/FlightDisplay/FlyViewMissionCompleteDialog.qml
View file @
2167fdb6
...
...
@@ -24,7 +24,6 @@ Item {
property
var
missionController
property
var
geoFenceController
property
var
rallyPointController
property
var
guidedController
// The following code is used to track vehicle states for showing the mission complete dialog
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
...
...
@@ -109,15 +108,15 @@ Item {
ColumnLayout
{
Layout.fillWidth
:
true
spacing
:
ScreenTools
.
defaultFontPixelHeight
visible
:
!
_activeVehicle
.
connectionLost
&&
guidedController
.
showResumeMission
visible
:
!
_activeVehicle
.
connectionLost
&&
mainWindow
.
guidedControllerFlyView
.
showResumeMission
QGCButton
{
Layout.fillWidth
:
true
Layout.alignment
:
Qt
.
AlignHCenter
text
:
qsTr
(
"
Resume Mission From Waypoint %1
"
).
arg
(
guidedController
.
_resumeMissionIndex
)
text
:
qsTr
(
"
Resume Mission From Waypoint %1
"
).
arg
(
mainWindow
.
guidedControllerFlyView
.
_resumeMissionIndex
)
onClicked
:
{
guidedController
.
executeAction
(
guidedController
.
actionResumeMission
,
null
,
null
)
mainWindow
.
guidedControllerFlyView
.
executeAction
(
mainWindow
.
guidedControllerFlyView
.
actionResumeMission
,
null
,
null
)
hideDialog
()
}
}
...
...
@@ -134,7 +133,7 @@ Item {
wrapMode
:
Text
.
WordWrap
color
:
qgcPal
.
warningText
text
:
qsTr
(
"
If you are changing batteries for Resume Mission do not disconnect from the vehicle.
"
)
visible
:
guidedController
.
showResumeMission
visible
:
mainWindow
.
guidedControllerFlyView
.
showResumeMission
}
}
}
...
...
src/FlightDisplay/FlyViewToolStrip.qml
View file @
2167fdb6
...
...
@@ -17,9 +17,6 @@ ToolStrip {
id
:
_root
title
:
qsTr
(
"
Fly
"
)
property
var
guidedActionsController
property
var
guidedActionList
signal
displayPreFlightChecklist
FlyViewToolStripActionList
{
...
...
src/FlightDisplay/FlyViewToolStripActionList.qml
View file @
2167fdb6
...
...
@@ -13,26 +13,16 @@ import QGroundControl 1.0
import
QGroundControl
.
Controls
1.0
ToolStripActionList
{
id
:
_root
signal
displayPreFlightChecklist
model
:
[
PreFlightCheckListShowAction
{
onTriggered
:
displayPreFlightChecklist
()
},
GuidedActionTakeoff
{
guidedController
:
guidedActionsController
},
GuidedActionLand
{
guidedController
:
guidedActionsController
},
GuidedActionRTL
{
guidedController
:
guidedActionsController
},
GuidedActionPause
{
guidedController
:
guidedActionsController
},
GuidedActionActionList
{
guidedController
:
guidedActionsController
}
PreFlightCheckListShowAction
{
onTriggered
:
displayPreFlightChecklist
()
},
GuidedActionTakeoff
{
},
GuidedActionLand
{
},
GuidedActionRTL
{
},
GuidedActionPause
{
},
GuidedActionActionList
{
}
]
}
src/FlightDisplay/FlyViewWidgetLayer.qml
View file @
2167fdb6
...
...
@@ -42,6 +42,7 @@ Item {
property
var
_missionController
:
_planMasterController
.
missionController
property
var
_geoFenceController
:
_planMasterController
.
geoFenceController
property
var
_rallyPointController
:
_planMasterController
.
rallyPointController
property
var
_guidedController
:
mainWindow
.
guidedControllerFlyView
property
real
_margins
:
ScreenTools
.
defaultFontPixelWidth
/
2
property
real
_toolsMargin
:
ScreenTools
.
defaultFontPixelWidth
*
0.75
property
rect
_centerViewport
:
Qt
.
rect
(
0
,
0
,
width
,
height
)
...
...
@@ -67,7 +68,6 @@ Item {
missionController
:
_missionController
geoFenceController
:
_geoFenceController
rallyPointController
:
_rallyPointController
guidedController
:
_root
.
guidedActionsController
}
FlyViewInstrumentPanel
{
...
...
@@ -79,7 +79,6 @@ Item {
width
:
_rightPanelWidth
spacing
:
_toolsMargin
visible
:
QGroundControl
.
corePlugin
.
options
.
flyView
.
showInstrumentPanel
guidedActionsController
:
_guidedController
availableHeight
:
parent
.
height
-
y
-
_toolsMargin
property
real
rightInset
:
visible
?
parent
.
width
-
x
:
0
...
...
@@ -104,16 +103,14 @@ Item {
}
FlyViewToolStrip
{
id
:
toolStrip
anchors.leftMargin
:
_toolsMargin
+
parentToolInsets
.
leftEdgeCenterInset
anchors.topMargin
:
_toolsMargin
+
parentToolInsets
.
leftEdgeTopInset
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
z
:
QGroundControl
.
zOrderWidgets
maxHeight
:
parent
.
height
-
y
-
parentToolInsets
.
leftEdgeBottomInset
-
_toolsMargin
guidedActionsController
:
_guidedController
guidedActionList
:
_guidedActionList
visible
:
!
QGroundControl
.
videoManager
.
fullScreen
id
:
toolStrip
anchors.leftMargin
:
_toolsMargin
+
parentToolInsets
.
leftEdgeCenterInset
anchors.topMargin
:
_toolsMargin
+
parentToolInsets
.
leftEdgeTopInset
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
z
:
QGroundControl
.
zOrderWidgets
maxHeight
:
parent
.
height
-
y
-
parentToolInsets
.
leftEdgeBottomInset
-
_toolsMargin
visible
:
!
QGroundControl
.
videoManager
.
fullScreen
onDisplayPreFlightChecklist
:
preFlightChecklistPopup
.
open
()
...
...
src/FlightDisplay/GuidedActionActionList.qml
View file @
2167fdb6
...
...
@@ -10,9 +10,9 @@
import
QGroundControl
.
FlightDisplay
1.0
GuidedToolStripAction
{
text
:
guidedController
.
actionListTitle
text
:
_
guidedController
.
actionListTitle
iconSource
:
"
/res/action.svg
"
visible
:
guidedController
.
showActionList
visible
:
_
guidedController
.
showActionList
enabled
:
true
actionID
:
guidedController
.
actionActionList
actionID
:
_
guidedController
.
actionActionList
}
src/FlightDisplay/GuidedActionLand.qml
View file @
2167fdb6
...
...
@@ -10,10 +10,10 @@
import
QGroundControl
.
FlightDisplay
1.0
GuidedToolStripAction
{
text
:
guidedController
.
landTitle
message
:
guidedController
.
landMessage
iconSource
:
"
/res/land.svg
"
visible
:
guidedController
.
showLand
&&
!
guidedController
.
showTakeoff
enabled
:
guidedController
.
showLand
actionID
:
guidedController
.
actionLand
text
:
_
guidedController
.
landTitle
message
:
_
guidedController
.
landMessage
iconSource
:
"
/res/land.svg
"
visible
:
_guidedController
.
showLand
&&
!
_
guidedController
.
showTakeoff
enabled
:
_
guidedController
.
showLand
actionID
:
_
guidedController
.
actionLand
}
src/FlightDisplay/GuidedActionPause.qml
View file @
2167fdb6
...
...
@@ -10,9 +10,9 @@
import
QGroundControl
.
FlightDisplay
1.0
GuidedToolStripAction
{
text
:
guidedController
.
pauseTitle
iconSource
:
"
/res/pause-mission.svg
"
visible
:
guidedController
.
showPause
enabled
:
guidedController
.
showPause
actionID
:
guidedController
.
actionPause
text
:
_
guidedController
.
pauseTitle
iconSource
:
"
/res/pause-mission.svg
"
visible
:
_
guidedController
.
showPause
enabled
:
_
guidedController
.
showPause
actionID
:
_
guidedController
.
actionPause
}
src/FlightDisplay/GuidedActionRTL.qml
View file @
2167fdb6
...
...
@@ -10,9 +10,9 @@
import
QGroundControl
.
FlightDisplay
1.0
GuidedToolStripAction
{
text
:
guidedController
.
rtlTitle
iconSource
:
"
/res/rtl.svg
"
visible
:
true
enabled
:
guidedController
.
showRTL
actionID
:
guidedController
.
actionRTL
text
:
_
guidedController
.
rtlTitle
iconSource
:
"
/res/rtl.svg
"
visible
:
true
enabled
:
_
guidedController
.
showRTL
actionID
:
_
guidedController
.
actionRTL
}
src/FlightDisplay/GuidedActionTakeoff.qml
View file @
2167fdb6
...
...
@@ -10,9 +10,9 @@
import
QGroundControl
.
FlightDisplay
1.0
GuidedToolStripAction
{
text
:
guidedController
.
takeoffTitle
iconSource
:
"
/res/takeoff.svg
"
visible
:
guidedController
.
showTakeoff
||
!
guidedController
.
showLand
enabled
:
guidedController
.
showTakeoff
actionID
:
guidedController
.
actionTakeoff
text
:
_
guidedController
.
takeoffTitle
iconSource
:
"
/res/takeoff.svg
"
visible
:
_guidedController
.
showTakeoff
||
!
_
guidedController
.
showLand
enabled
:
_
guidedController
.
showTakeoff
actionID
:
_
guidedController
.
actionTakeoff
}
src/FlightDisplay/GuidedToolStripAction.qml
View file @
2167fdb6
...
...
@@ -10,12 +10,13 @@
import
QGroundControl
.
Controls
1.0
ToolStripAction
{
property
var
guidedController
property
int
actionID
property
string
message
property
var
_guidedController
:
mainWindow
.
guidedControllerFlyView
onTriggered
:
{
guidedActions
Controller
.
closeAll
()
guidedController
.
confirmAction
(
actionID
)
_guided
Controller
.
closeAll
()
_
guidedController
.
confirmAction
(
actionID
)
}
}
src/FlightDisplay/MultiVehicleList.qml
View file @
2167fdb6
...
...
@@ -19,12 +19,11 @@ import QGroundControl.Vehicle 1.0
import
QGroundControl
.
FlightMap
1.0
Item
{
property
var
guidedActionsController
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
property
real
_widgetHeight
:
ScreenTools
.
defaultFontPixelHeight
*
3
property
color
_textColor
:
"
black
"
property
real
_rectOpacity
:
0.8
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
property
real
_widgetHeight
:
ScreenTools
.
defaultFontPixelHeight
*
3
property
color
_textColor
:
"
black
"
property
real
_rectOpacity
:
0.8
property
var
_guidedController
:
mainWindow
.
guidedControllerFlyView
QGCPalette
{
id
:
qgcPal
}
...
...
@@ -63,12 +62,12 @@ Item {
QGCButton
{
text
:
"
Pause
"
onClicked
:
guidedActionsController
.
confirmAction
(
guidedActions
Controller
.
actionMVPause
)
onClicked
:
_guidedController
.
confirmAction
(
_guided
Controller
.
actionMVPause
)
}
QGCButton
{
text
:
"
Start Mission
"
onClicked
:
guidedActionsController
.
confirmAction
(
guidedActions
Controller
.
actionMVStartMission
)
onClicked
:
_guidedController
.
confirmAction
(
_guided
Controller
.
actionMVStartMission
)
}
}
}
...
...
src/FlightDisplay/MultiVehiclePanel.qml
View file @
2167fdb6
...
...
@@ -25,7 +25,6 @@ Item {
property
alias
singleVehiclePanel
:
singleVehicleView
.
checked
property
real
availableHeight
property
var
guidedActionsController
QGCMapPalette
{
id
:
mapPal
;
lightColors
:
true
}
...
...
@@ -47,11 +46,10 @@ Item {
}
MultiVehicleList
{
anchors.topMargin
:
ScreenTools
.
defaultFontPixelHeight
/
2
anchors.top
:
selectorRow
.
bottom
anchors.bottom
:
parent
.
bottom
width
:
parent
.
width
visible
:
!
singleVehiclePanel
&&
!
QGroundControl
.
videoManager
.
fullScreen
&&
QGroundControl
.
corePlugin
.
options
.
showMultiVehicleList
guidedActionsController
:
_root
.
guidedActionsController
anchors.topMargin
:
ScreenTools
.
defaultFontPixelHeight
/
2
anchors.top
:
selectorRow
.
bottom
anchors.bottom
:
parent
.
bottom
width
:
parent
.
width
visible
:
!
singleVehiclePanel
&&
!
QGroundControl
.
videoManager
.
fullScreen
&&
QGroundControl
.
corePlugin
.
options
.
showMultiVehicleList
}
}
src/FlightMap/MapItems/PlanMapItems.qml
View file @
2167fdb6
...
...
@@ -30,6 +30,7 @@ Item {
property
var
_missionController
:
masterController
.
missionController
property
var
_geoFenceController
:
masterController
.
geoFenceController
property
var
_rallyPointController
:
masterController
.
rallyPointController
property
var
_guidedController
:
mainWindow
.
guidedControllerFlyView
property
var
_missionLineViewComponent
property
bool
_isActiveVehicle
:
vehicle
.
active
...
...
@@ -42,7 +43,7 @@ Item {
delegate
:
MissionItemMapVisual
{
map
:
_map
vehicle
:
_vehicle
onClicked
:
guidedActionsController
.
confirmAction
(
guidedActions
Controller
.
actionSetWaypoint
,
Math
.
max
(
object
.
sequenceNumber
,
1
))
onClicked
:
_guidedController
.
confirmAction
(
_guided
Controller
.
actionSetWaypoint
,
Math
.
max
(
object
.
sequenceNumber
,
1
))
}
}
...
...
src/ui/MainRootWindow.qml
View file @
2167fdb6
...
...
@@ -75,15 +75,15 @@ ApplicationWindow {
//-------------------------------------------------------------------------
//-- Global Scope Variables
/// Current active Vehicle
property
var
activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
string
formatedMessage
:
activeVehicle
?
activeVehicle
.
formatedMessage
:
""
/// Indicates usable height between toolbar and footer
property
real
availableHeight
:
mainWindow
.
height
-
mainWindow
.
header
.
height
-
mainWindow
.
footer
.
height
property
var
currentPlanMissionItem
:
planMasterControllerPlanView
?
planMasterControllerPlanView
.
missionController
.
currentPlanViewItem
:
null
property
var
planMasterControllerPlanView
:
null
property
var
planMasterControllerFlyView
:
null
property
var
currentPlanMissionItem
:
planMasterControllerPlanView
?
planMasterControllerPlanView
.
missionController
.
currentPlanViewItem
:
null
property
var
planMasterControllerFlyView
:
flightView
.
planController
property
var
guidedControllerFlyView
:
flightView
.
guidedController
readonly
property
string
navButtonWidth
:
ScreenTools
.
defaultFontPixelWidth
*
24
readonly
property
real
defaultTextHeight
:
ScreenTools
.
defaultFontPixelHeight
...
...
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