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
865a47fe
Commit
865a47fe
authored
Apr 04, 2017
by
Gus Grubba
Committed by
GitHub
Apr 04, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4920 from dogmaphobic/flyviewOverlay
Flyview overlay
parents
799780bd
6b431672
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
133 additions
and
52 deletions
+133
-52
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+15
-0
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+25
-3
FlightDisplayViewWidgets.qml
src/FlightDisplay/FlightDisplayViewWidgets.qml
+25
-21
PlanToolBar.qml
src/PlanView/PlanToolBar.qml
+14
-8
ScreenTools.qml
src/QmlControls/ScreenTools.qml
+1
-1
OfflineMap.qml
src/QtLocationPlugin/QMLControl/OfflineMap.qml
+3
-3
QGCOptions.h
src/api/QGCOptions.h
+4
-1
MainWindowInner.qml
src/ui/MainWindowInner.qml
+46
-15
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
865a47fe
...
...
@@ -114,6 +114,9 @@ QGCView {
Component.onCompleted
:
{
setStates
()
px4JoystickCheck
()
if
(
QGroundControl
.
corePlugin
.
options
.
flyViewOverlay
.
toString
().
length
)
{
flyViewOverlay
.
source
=
QGroundControl
.
corePlugin
.
options
.
flyViewOverlay
}
}
QGCMapPalette
{
id
:
mapPal
;
lightColors
:
_mainIsMap
?
_flightMap
.
isSatelliteMap
:
true
}
...
...
@@ -157,6 +160,7 @@ QGCView {
flightWidgets
:
flightDisplayViewWidgets
rightPanelWidth
:
ScreenTools
.
defaultFontPixelHeight
*
9
qgcView
:
root
scaleState
:
(
_mainIsMap
&&
flyViewOverlay
.
item
)
?
(
flyViewOverlay
.
item
.
scaleState
?
flyViewOverlay
.
item
.
scaleState
:
"
bottomMode
"
)
:
"
bottomMode
"
}
}
...
...
@@ -259,6 +263,17 @@ QGCView {
visible
:
singleVehicleView
.
checked
}
//-------------------------------------------------------------------------
//-- Loader helper for plugins to overlay elements over the fly view
Loader
{
id
:
flyViewOverlay
z
:
flightDisplayViewWidgets
.
z
+
1
height
:
ScreenTools
.
availableHeight
anchors.left
:
parent
.
left
anchors.right
:
altitudeSlider
.
visible
?
altitudeSlider
.
left
:
parent
.
right
anchors.bottom
:
parent
.
bottom
}
// Button to start/stop video recording
Item
{
z
:
_flightVideoPipControl
.
z
+
1
...
...
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
865a47fe
...
...
@@ -30,6 +30,8 @@ FlightMap {
allowGCSLocationCenter
:
!
userPanned
allowVehicleLocationCenter
:
!
_keepVehicleCentered
property
alias
scaleState
:
mapScale
.
state
property
var
missionController
property
var
guidedActionsController
property
var
flightWidgets
...
...
@@ -299,11 +301,31 @@ FlightMap {
}
MapScale
{
anchors.bottomMargin
:
ScreenTools
.
defaultFontPixelHeight
*
(
0.66
)
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelHeight
*
(
0.33
)
anchors.bottom
:
parent
.
bottom
id
:
mapScale
anchors.right
:
parent
.
right
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
(
0.33
)
anchors.topMargin
:
ScreenTools
.
defaultFontPixelHeight
*
(
0.33
)
+
state
===
"
bottomMode
"
?
0
:
ScreenTools
.
toolbarHeight
anchors.bottomMargin
:
ScreenTools
.
defaultFontPixelHeight
*
(
0.33
)
mapControl
:
flightMap
visible
:
!
ScreenTools
.
isTinyScreen
state
:
"
bottomMode
"
states
:
[
State
{
name
:
"
topMode
"
AnchorChanges
{
target
:
mapScale
anchors.top
:
parent
.
top
anchors.bottom
:
undefined
}
},
State
{
name
:
"
bottomMode
"
AnchorChanges
{
target
:
mapScale
anchors.top
:
undefined
anchors.bottom
:
parent
.
bottom
}
}
]
}
}
src/FlightDisplay/FlightDisplayViewWidgets.qml
View file @
865a47fe
...
...
@@ -47,29 +47,33 @@ Item {
}
function
_setInstrumentWidget
()
{
if
(
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
.
source
.
toString
().
length
)
{
instrumentsLoader
.
source
=
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
.
source
switch
(
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
.
widgetPosition
)
{
case
CustomInstrumentWidget.POS_TOP_RIGHT
:
instrumentsLoader
.
state
=
"
topMode
"
break
;
case
CustomInstrumentWidget.POS_BOTTOM_RIGHT
:
instrumentsLoader
.
state
=
"
bottomMode
"
break
;
case
CustomInstrumentWidget.POS_CENTER_RIGHT
:
default
:
instrumentsLoader
.
state
=
"
centerMode
"
break
;
}
}
else
{
var
useAlternateInstruments
=
QGroundControl
.
settingsManager
.
appSettings
.
virtualJoystick
.
value
||
ScreenTools
.
isTinyScreen
if
(
useAlternateInstruments
)
{
instrumentsLoader
.
source
=
"
qrc:/qml/QGCInstrumentWidgetAlternate.qml
"
instrumentsLoader
.
state
=
"
topMode
"
if
(
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
)
{
if
(
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
.
source
.
toString
().
length
)
{
instrumentsLoader
.
source
=
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
.
source
switch
(
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
.
widgetPosition
)
{
case
CustomInstrumentWidget.POS_TOP_RIGHT
:
instrumentsLoader
.
state
=
"
topMode
"
break
;
case
CustomInstrumentWidget.POS_BOTTOM_RIGHT
:
instrumentsLoader
.
state
=
"
bottomMode
"
break
;
case
CustomInstrumentWidget.POS_CENTER_RIGHT
:
default
:
instrumentsLoader
.
state
=
"
centerMode
"
break
;
}
}
else
{
instrumentsLoader
.
source
=
"
qrc:/qml/QGCInstrumentWidget.qml
"
instrumentsLoader
.
state
=
QGroundControl
.
settingsManager
.
appSettings
.
showLargeCompass
.
value
==
1
?
"
centerMode
"
:
"
topMode
"
var
useAlternateInstruments
=
QGroundControl
.
settingsManager
.
appSettings
.
virtualJoystick
.
value
||
ScreenTools
.
isTinyScreen
if
(
useAlternateInstruments
)
{
instrumentsLoader
.
source
=
"
qrc:/qml/QGCInstrumentWidgetAlternate.qml
"
instrumentsLoader
.
state
=
"
topMode
"
}
else
{
instrumentsLoader
.
source
=
"
qrc:/qml/QGCInstrumentWidget.qml
"
instrumentsLoader
.
state
=
QGroundControl
.
settingsManager
.
appSettings
.
showLargeCompass
.
value
==
1
?
"
centerMode
"
:
"
topMode
"
}
}
}
else
{
instrumentsLoader
.
source
=
""
}
}
...
...
src/PlanView/PlanToolBar.qml
View file @
865a47fe
...
...
@@ -19,6 +19,7 @@ Rectangle {
z
:
toolBar
.
z
+
1
color
:
qgcPal
.
globalTheme
===
QGCPalette
.
Light
?
Qt
.
rgba
(
1
,
1
,
1
,
0.8
)
:
Qt
.
rgba
(
0
,
0
,
0
,
0.75
)
visible
:
false
anchors.bottomMargin
:
1
signal
showFlyView
...
...
@@ -79,13 +80,11 @@ Rectangle {
onReleased
:
{
mouse
.
accepted
=
true
;
}
}
RowLayout
{
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.left
:
parent
.
left
anchors.right
:
uploadButton
.
visible
?
uploadButton
.
left
:
uploadButton
.
right
spacing
:
ScreenTools
.
defaultFontPixelWidth
*
2
Row
{
anchors.bottomMargin
:
1
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
QGCToolBarButton
{
id
:
settingsButton
anchors.top
:
parent
.
top
...
...
@@ -93,7 +92,6 @@ Rectangle {
source
:
"
/qmlimages/PaperPlane.svg
"
logo
:
true
checked
:
false
onClicked
:
{
checked
=
false
if
(
missionController
.
uploadOnSwitch
())
{
...
...
@@ -101,6 +99,14 @@ Rectangle {
}
}
}
}
Row
{
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
spacing
:
_margins
*
2
anchors.horizontalCenter
:
parent
.
horizontalCenter
GridLayout
{
anchors.verticalCenter
:
parent
.
verticalCenter
...
...
src/QmlControls/ScreenTools.qml
View file @
865a47fe
...
...
@@ -70,7 +70,7 @@ Item {
property
real
implicitTextFieldHeight
:
Math
.
round
(
defaultFontPixelHeight
*
(
isMobile
?
2.0
:
1.6
))
property
real
implicitComboBoxHeight
:
Math
.
round
(
defaultFontPixelHeight
*
(
isMobile
?
2.0
:
1.6
))
property
real
implicitComboBoxWidth
:
Math
.
round
(
defaultFontPixelWidth
*
(
isMobile
?
7.0
:
5.0
))
property
real
implicitSliderHeight
:
isMobile
?
Math
.
M
ax
(
defaultFontPixelHeight
,
minTouchPixels
)
:
defaultFontPixelHeight
property
real
implicitSliderHeight
:
isMobile
?
Math
.
m
ax
(
defaultFontPixelHeight
,
minTouchPixels
)
:
defaultFontPixelHeight
readonly
property
string
normalFontFamily
:
"
opensans
"
readonly
property
string
demiboldFontFamily
:
"
opensans-demibold
"
...
...
src/QtLocationPlugin/QMLControl/OfflineMap.qml
View file @
865a47fe
...
...
@@ -1043,8 +1043,8 @@ QGCView {
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
BusyIndicator
{
visible
:
QGroundControl
.
mapEngineManager
.
exporting
running
:
QGroundControl
.
mapEngineManager
.
exporting
visible
:
QGroundControl
.
mapEngineManager
?
QGroundControl
.
mapEngineManager
.
exporting
:
false
running
:
QGroundControl
.
mapEngineManager
?
QGroundControl
.
mapEngineManager
.
exporting
:
false
width
:
exportCloseButton
.
height
height
:
exportCloseButton
.
height
anchors.horizontalCenter
:
parent
.
horizontalCenter
...
...
@@ -1072,7 +1072,7 @@ QGCView {
color
:
"
black
"
anchors.centerIn
:
parent
Rectangle
{
width
:
parent
.
width
*
0.
4
5
width
:
parent
.
width
*
0.5
height
:
importCol
.
height
*
1.5
radius
:
ScreenTools
.
defaultFontPixelWidth
color
:
qgcPal
.
windowShadeDark
...
...
src/api/QGCOptions.h
View file @
865a47fe
...
...
@@ -28,6 +28,7 @@ public:
Q_PROPERTY
(
double
toolbarHeightMultiplier
READ
toolbarHeightMultiplier
CONSTANT
)
Q_PROPERTY
(
bool
enablePlanViewSelector
READ
enablePlanViewSelector
CONSTANT
)
Q_PROPERTY
(
CustomInstrumentWidget
*
instrumentWidget
READ
instrumentWidget
CONSTANT
)
Q_PROPERTY
(
QUrl
flyViewOverlay
READ
flyViewOverlay
CONSTANT
)
Q_PROPERTY
(
bool
showSensorCalibrationCompass
READ
showSensorCalibrationCompass
NOTIFY
showSensorCalibrationCompassChanged
)
Q_PROPERTY
(
bool
showSensorCalibrationGyro
READ
showSensorCalibrationGyro
NOTIFY
showSensorCalibrationGyroChanged
)
Q_PROPERTY
(
bool
showSensorCalibrationAccel
READ
showSensorCalibrationAccel
NOTIFY
showSensorCalibrationAccelChanged
)
...
...
@@ -56,6 +57,8 @@ public:
/// @return An alternate widget (see QGCInstrumentWidget.qml, the default widget)
virtual
CustomInstrumentWidget
*
instrumentWidget
();
/// Allows access to the full fly view window
virtual
QUrl
flyViewOverlay
()
const
{
return
QUrl
();
}
/// By returning false you can hide the following sensor calibration pages
virtual
bool
showSensorCalibrationCompass
()
const
{
return
true
;
}
virtual
bool
showSensorCalibrationGyro
()
const
{
return
true
;
}
...
...
@@ -82,7 +85,7 @@ signals:
void
showSensorCalibrationLevelChanged
(
bool
show
);
void
showSensorCalibrationAirspeedChanged
(
bool
show
);
void
showFirmwareUpgradeChanged
(
bool
show
);
void
guidedBarShowEmergencyStopChanged
(
bool
show
);
void
guidedBarShowEmergencyStopChanged
(
bool
show
);
void
guidedBarShowOrbitChanged
(
bool
show
);
private:
...
...
src/ui/MainWindowInner.qml
View file @
865a47fe
...
...
@@ -47,6 +47,14 @@ Item {
}
}
function
disableToolbar
()
{
toolbarBlocker
.
enabled
=
true
}
function
enableToolbar
()
{
toolbarBlocker
.
enabled
=
false
}
function
hideAllViews
()
{
for
(
var
i
=
0
;
i
<
_viewList
.
length
;
i
++
)
{
_viewList
[
i
].
visible
=
false
...
...
@@ -55,6 +63,7 @@ Item {
}
function
showSettingsView
()
{
rootLoader
.
sourceComponent
=
null
if
(
currentPopUp
)
{
currentPopUp
.
close
()
}
...
...
@@ -69,6 +78,7 @@ Item {
}
function
showSetupView
()
{
rootLoader
.
sourceComponent
=
null
if
(
currentPopUp
)
{
currentPopUp
.
close
()
}
...
...
@@ -83,6 +93,7 @@ Item {
}
function
showPlanView
()
{
rootLoader
.
sourceComponent
=
null
if
(
currentPopUp
)
{
currentPopUp
.
close
()
}
...
...
@@ -96,6 +107,7 @@ Item {
}
function
showFlyView
()
{
rootLoader
.
sourceComponent
=
null
if
(
currentPopUp
)
{
currentPopUp
.
close
()
}
...
...
@@ -106,6 +118,7 @@ Item {
}
function
showAnalyzeView
()
{
rootLoader
.
sourceComponent
=
null
if
(
currentPopUp
)
{
currentPopUp
.
close
()
}
...
...
@@ -206,30 +219,40 @@ Item {
}
function
showMessageArea
()
{
rootLoader
.
sourceComponent
=
null
var
currentlyVisible
=
messageArea
.
visible
if
(
currentPopUp
)
{
currentPopUp
.
close
()
}
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicleAvailable
)
{
messageText
.
text
=
formatMessage
(
activeVehicle
.
formatedMessages
)
//-- Hack to scroll to last message
for
(
var
i
=
0
;
i
<
activeVehicle
.
messageCount
;
i
++
)
messageFlick
.
flick
(
0
,
-
5000
)
activeVehicle
.
resetMessages
()
}
else
{
messageText
.
text
=
qsTr
(
"
No Messages
"
)
if
(
!
currentlyVisible
)
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicleAvailable
)
{
messageText
.
text
=
formatMessage
(
activeVehicle
.
formatedMessages
)
//-- Hack to scroll to last message
for
(
var
i
=
0
;
i
<
activeVehicle
.
messageCount
;
i
++
)
messageFlick
.
flick
(
0
,
-
5000
)
activeVehicle
.
resetMessages
()
}
else
{
messageText
.
text
=
qsTr
(
"
No Messages
"
)
}
currentPopUp
=
messageArea
messageArea
.
visible
=
true
}
currentPopUp
=
messageArea
messageArea
.
visible
=
true
}
function
showPopUp
(
dropItem
,
centerX
)
{
rootLoader
.
sourceComponent
=
null
var
oldIndicator
=
indicatorDropdown
.
sourceComponent
if
(
currentPopUp
)
{
currentPopUp
.
close
()
}
indicatorDropdown
.
centerX
=
centerX
indicatorDropdown
.
sourceComponent
=
dropItem
indicatorDropdown
.
visible
=
true
currentPopUp
=
indicatorDropdown
if
(
oldIndicator
!==
dropItem
)
{
console
.
log
(
oldIndicator
)
console
.
log
(
dropItem
)
indicatorDropdown
.
centerX
=
centerX
indicatorDropdown
.
sourceComponent
=
dropItem
indicatorDropdown
.
visible
=
true
currentPopUp
=
indicatorDropdown
}
}
//-- Main UI
...
...
@@ -242,13 +265,21 @@ Item {
anchors.top
:
parent
.
top
opacity
:
planToolBar
.
visible
?
0
:
1
z
:
QGroundControl
.
zOrderTopMost
Component.onCompleted
:
ScreenTools
.
availableHeight
=
parent
.
height
-
toolBar
.
height
onShowSettingsView
:
mainWindow
.
showSettingsView
()
onShowSetupView
:
mainWindow
.
showSetupView
()
onShowPlanView
:
mainWindow
.
showPlanView
()
onShowFlyView
:
mainWindow
.
showFlyView
()
onShowAnalyzeView
:
mainWindow
.
showAnalyzeView
()
//-- Entire tool bar area disable on cammand
MouseArea
{
id
:
toolbarBlocker
anchors.fill
:
parent
enabled
:
false
onWheel
:
{
wheel
.
accepted
=
true
;
}
onPressed
:
{
mouse
.
accepted
=
true
;
}
onReleased
:
{
mouse
.
accepted
=
true
;
}
}
}
PlanToolBar
{
...
...
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