Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
128ff820
Commit
128ff820
authored
Oct 28, 2015
by
dogmaphobic
Browse files
Adding button to close PIP
parent
7d3cb138
Changes
5
Show whitespace changes
Inline
Side-by-side
qgcresources.qrc
View file @
128ff820
...
@@ -50,6 +50,7 @@
...
@@ -50,6 +50,7 @@
<file alias="compassInstrumentAirplane.svg">src/FlightMap/Images/compassInstrumentAirplane.svg</file>
<file alias="compassInstrumentAirplane.svg">src/FlightMap/Images/compassInstrumentAirplane.svg</file>
<file alias="compassInstrumentDial.svg">src/FlightMap/Images/compassInstrumentDial.svg</file>
<file alias="compassInstrumentDial.svg">src/FlightMap/Images/compassInstrumentDial.svg</file>
<file alias="crossHair.svg">src/FlightMap/Images/crossHair.svg</file>
<file alias="crossHair.svg">src/FlightMap/Images/crossHair.svg</file>
<file alias="PIP.svg">src/FlightMap/Images/PIP.svg</file>
<file alias="rollDialWhite.svg">src/FlightMap/Images/rollDialWhite.svg</file>
<file alias="rollDialWhite.svg">src/FlightMap/Images/rollDialWhite.svg</file>
<file alias="rollPointerWhite.svg">src/FlightMap/Images/rollPointerWhite.svg</file>
<file alias="rollPointerWhite.svg">src/FlightMap/Images/rollPointerWhite.svg</file>
<file alias="scale.png">src/FlightMap/Images/scale.png</file>
<file alias="scale.png">src/FlightMap/Images/scale.png</file>
...
...
src/FlightDisplay/FlightDisplayView.qml
View file @
128ff820
...
@@ -57,8 +57,10 @@ Item {
...
@@ -57,8 +57,10 @@ Item {
readonly
property
string
_mapName
:
"
FlightDisplayView
"
readonly
property
string
_mapName
:
"
FlightDisplayView
"
readonly
property
string
_showMapBackgroundKey
:
"
/showMapBackground
"
readonly
property
string
_showMapBackgroundKey
:
"
/showMapBackground
"
readonly
property
string
_mainIsMapKey
:
"
MainFlyWindowIsMap
"
readonly
property
string
_mainIsMapKey
:
"
MainFlyWindowIsMap
"
readonly
property
string
_PIPVisibleKey
:
"
IsPIPVisible
"
property
bool
_mainIsMap
:
QGroundControl
.
loadBoolGlobalSetting
(
_mainIsMapKey
,
true
)
property
bool
_mainIsMap
:
QGroundControl
.
loadBoolGlobalSetting
(
_mainIsMapKey
,
true
)
property
bool
_isPipVisible
:
QGroundControl
.
loadBoolGlobalSetting
(
_PIPVisibleKey
,
true
)
property
real
_roll
:
_activeVehicle
?
(
isNaN
(
_activeVehicle
.
roll
)
?
_defaultRoll
:
_activeVehicle
.
roll
)
:
_defaultRoll
property
real
_roll
:
_activeVehicle
?
(
isNaN
(
_activeVehicle
.
roll
)
?
_defaultRoll
:
_activeVehicle
.
roll
)
:
_defaultRoll
property
real
_pitch
:
_activeVehicle
?
(
isNaN
(
_activeVehicle
.
pitch
)
?
_defaultPitch
:
_activeVehicle
.
pitch
)
:
_defaultPitch
property
real
_pitch
:
_activeVehicle
?
(
isNaN
(
_activeVehicle
.
pitch
)
?
_defaultPitch
:
_activeVehicle
.
pitch
)
:
_defaultPitch
...
@@ -71,6 +73,9 @@ Item {
...
@@ -71,6 +73,9 @@ Item {
property
real
_airSpeed
:
_activeVehicle
?
_activeVehicle
.
airSpeed
:
_defaultAirSpeed
property
real
_airSpeed
:
_activeVehicle
?
_activeVehicle
.
airSpeed
:
_defaultAirSpeed
property
real
_climbRate
:
_activeVehicle
?
_activeVehicle
.
climbRate
:
_defaultClimbRate
property
real
_climbRate
:
_activeVehicle
?
_activeVehicle
.
climbRate
:
_defaultClimbRate
property
bool
_isBackgroundDark
:
_mainIsMap
?
(
_flightMap
?
_flightMap
.
isSatelliteMap
:
true
)
:
true
property
var
_flightMap
:
null
property
var
_flightMap
:
null
property
var
_flightVideo
:
null
property
var
_flightVideo
:
null
property
var
_savedZoomLevel
:
0
property
var
_savedZoomLevel
:
0
...
@@ -123,7 +128,7 @@ Item {
...
@@ -123,7 +128,7 @@ Item {
//-- PIP Window
//-- PIP Window
Rectangle
{
Rectangle
{
id
:
pip
id
:
pip
visible
:
_controller
.
hasVideo
visible
:
_controller
.
hasVideo
&&
_isPipVisible
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
...
@@ -132,12 +137,7 @@ Item {
...
@@ -132,12 +137,7 @@ Item {
color
:
"
#000010
"
color
:
"
#000010
"
border.width
:
4
border.width
:
4
radius
:
4
radius
:
4
border.color
:
{
border.color
:
_isBackgroundDark
?
Qt
.
rgba
(
1
,
1
,
1
,
0.75
)
:
Qt
.
rgba
(
0
,
0
,
0
,
0.75
)
if
(
_mainIsMap
&&
_flightMap
!=
null
)
return
_flightMap
.
isSatelliteMap
?
Qt
.
rgba
(
1
,
1
,
1
,
0.75
)
:
Qt
.
rgba
(
0
,
0
,
0
,
0.75
)
else
return
Qt
.
rgba
(
0
,
0
,
0
,
0.75
)
}
Loader
{
Loader
{
id
:
pipLoader
id
:
pipLoader
anchors.fill
:
parent
anchors.fill
:
parent
...
@@ -160,6 +160,52 @@ Item {
...
@@ -160,6 +160,52 @@ Item {
QGroundControl
.
saveBoolGlobalSetting
(
_mainIsMapKey
,
_mainIsMap
)
QGroundControl
.
saveBoolGlobalSetting
(
_mainIsMapKey
,
_mainIsMap
)
}
}
}
}
Image
{
id
:
closePIP
source
:
"
/qmlimages/PIP.svg
"
mipmap
:
true
fillMode
:
Image
.
PreserveAspectFit
anchors.left
:
parent
.
left
anchors.bottom
:
parent
.
bottom
height
:
ScreenTools
.
defaultFontPixelSize
*
2.5
width
:
ScreenTools
.
defaultFontPixelSize
*
2.5
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
_isPipVisible
=
false
QGroundControl
.
saveBoolGlobalSetting
(
_PIPVisibleKey
,
false
)
}
}
}
}
//-- Show PIP
Rectangle
{
id
:
openPIP
anchors.left
:
parent
.
left
anchors.bottom
:
parent
.
bottom
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
height
:
ScreenTools
.
defaultFontPixelSize
*
2
width
:
ScreenTools
.
defaultFontPixelSize
*
2
radius
:
ScreenTools
.
defaultFontPixelSize
/
3
visible
:
_controller
.
hasVideo
&&
!
_isPipVisible
color
:
_isBackgroundDark
?
Qt
.
rgba
(
1
,
1
,
1
,
0.5
)
:
Qt
.
rgba
(
0
,
0
,
0
,
0.5
)
Image
{
width
:
parent
.
width
*
0.75
height
:
parent
.
height
*
0.75
source
:
"
/qmlimages/buttonRight.svg
"
mipmap
:
true
fillMode
:
Image
.
PreserveAspectFit
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
_isPipVisible
=
true
QGroundControl
.
saveBoolGlobalSetting
(
_PIPVisibleKey
,
true
)
}
}
}
}
//-- Widgets
//-- Widgets
...
...
src/FlightDisplay/FlightDisplayViewWidgets.qml
View file @
128ff820
...
@@ -39,6 +39,10 @@ import QGroundControl.FlightMap 1.0
...
@@ -39,6 +39,10 @@ import QGroundControl.FlightMap 1.0
/// FlightDisplayViewControl.
/// FlightDisplayViewControl.
Item
{
Item
{
readonly
property
string
_InstrumentVisibleKey
:
"
IsInstrumentPanelVisible
"
property
bool
_isInstrumentVisible
:
QGroundControl
.
loadBoolGlobalSetting
(
_InstrumentVisibleKey
,
true
)
ExclusiveGroup
{
ExclusiveGroup
{
id
:
_dropButtonsExclusiveGroup
id
:
_dropButtonsExclusiveGroup
}
}
...
@@ -74,11 +78,12 @@ Item {
...
@@ -74,11 +78,12 @@ Item {
}
}
}
}
//-- Instrument Pan
n
el
//-- Instrument Panel
QGCInstrumentWidget
{
QGCInstrumentWidget
{
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
visible
:
_isInstrumentVisible
size
:
ScreenTools
.
defaultFontPixelSize
*
(
9
)
size
:
ScreenTools
.
defaultFontPixelSize
*
(
9
)
active
:
_activeVehicle
!=
null
active
:
_activeVehicle
!=
null
heading
:
_heading
heading
:
_heading
...
@@ -89,6 +94,39 @@ Item {
...
@@ -89,6 +94,39 @@ Item {
airSpeed
:
_airSpeed
airSpeed
:
_airSpeed
isSatellite
:
_mainIsMap
?
_flightMap
?
_flightMap
.
isSatelliteMap
:
true
:
true
isSatellite
:
_mainIsMap
?
_flightMap
?
_flightMap
.
isSatelliteMap
:
true
:
true
z
:
QGroundControl
.
zOrderWidgets
z
:
QGroundControl
.
zOrderWidgets
onClicked
:
{
_isInstrumentVisible
=
false
QGroundControl
.
saveBoolGlobalSetting
(
_InstrumentVisibleKey
,
false
)
}
}
//-- Show (Hidden) Instrument Panel
Rectangle
{
id
:
openButton
anchors.right
:
parent
.
right
anchors.bottom
:
parent
.
bottom
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
height
:
ScreenTools
.
defaultFontPixelSize
*
2
width
:
ScreenTools
.
defaultFontPixelSize
*
2
radius
:
ScreenTools
.
defaultFontPixelSize
/
3
visible
:
!
_isInstrumentVisible
color
:
_isBackgroundDark
?
Qt
.
rgba
(
1
,
1
,
1
,
0.5
)
:
Qt
.
rgba
(
0
,
0
,
0
,
0.5
)
Image
{
width
:
parent
.
width
*
0.75
height
:
parent
.
height
*
0.75
source
:
"
/qmlimages/buttonLeft.svg
"
mipmap
:
true
fillMode
:
Image
.
PreserveAspectFit
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
_isInstrumentVisible
=
true
QGroundControl
.
saveBoolGlobalSetting
(
_InstrumentVisibleKey
,
false
)
}
}
}
}
//-- Vertical Tool Buttons
//-- Vertical Tool Buttons
...
...
src/FlightMap/Images/PiP.svg
View file @
128ff820
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version=
"1.1"
id=
"Layer_1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
x=
"0px"
y=
"0px"
<svg
version=
"1.1"
id=
"Layer_1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
x=
"0px"
y=
"0px"
viewBox=
"0 0 72 72"
enable-background=
"new 0 0 72 72"
xml:space=
"preserve"
>
viewBox=
"0 0 72 72"
enable-background=
"new 0 0 72 72"
xml:space=
"preserve"
>
<path
opacity=
"0.
8
5"
d=
"M0,
72V0l72,0C72,39.797
,39.797,
72
,0,
72
z"
/>
<path
opacity=
"0.5"
d=
"M0,
0v72h72C72,32.203
,39.797,
0
,0,
0
z"
/>
<g>
<g>
<rect
x=
"14.4"
y=
"
15.401
"
stroke=
"#FFFFFF"
stroke-width=
"2"
stroke-miterlimit=
"10"
width=
"36"
height=
"27"
/>
<rect
x=
"14.4"
y=
"
29.599
"
stroke=
"#FFFFFF"
stroke-width=
"2"
stroke-miterlimit=
"10"
width=
"36"
height=
"27"
/>
<rect
x=
"5.4"
y=
"
6.401
"
stroke=
"#FFFFFF"
stroke-width=
"2"
stroke-miterlimit=
"10"
width=
"36"
height=
"27"
/>
<rect
x=
"5.4"
y=
"
38.599
"
stroke=
"#FFFFFF"
stroke-width=
"2"
stroke-miterlimit=
"10"
width=
"36"
height=
"27"
/>
</g>
</g>
</svg>
</svg>
src/FlightMap/Widgets/QGCInstrumentWidget.qml
View file @
128ff820
...
@@ -36,6 +36,8 @@ Item {
...
@@ -36,6 +36,8 @@ Item {
id
:
root
id
:
root
height
:
size
height
:
size
signal
clicked
property
alias
heading
:
compass
.
heading
property
alias
heading
:
compass
.
heading
property
alias
rollAngle
:
attitude
.
rollAngle
property
alias
rollAngle
:
attitude
.
rollAngle
property
alias
pitchAngle
:
attitude
.
pitchAngle
property
alias
pitchAngle
:
attitude
.
pitchAngle
...
@@ -48,9 +50,9 @@ Item {
...
@@ -48,9 +50,9 @@ Item {
property
bool
_isVisible
:
true
property
bool
_isVisible
:
true
//-- Instrument Pan
n
el
//-- Instrument Panel
Rectangle
{
Rectangle
{
id
:
instrumentPan
n
el
id
:
instrumentPanel
height
:
instruments
.
height
+
ScreenTools
.
defaultFontPixelSize
height
:
instruments
.
height
+
ScreenTools
.
defaultFontPixelSize
width
:
root
.
size
width
:
root
.
size
radius
:
root
.
size
/
2
radius
:
root
.
size
/
2
...
@@ -162,36 +164,8 @@ Item {
...
@@ -162,36 +164,8 @@ Item {
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
onClicked
:
{
onClicked
:
{
_isVisible
=
!
_isVisible
onClicked
:
root
.
clicked
()
}
}
}
}
}
//-- Show Instruments
Rectangle
{
id
:
openButton
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
height
:
ScreenTools
.
defaultFontPixelSize
*
2
width
:
ScreenTools
.
defaultFontPixelSize
*
2
radius
:
ScreenTools
.
defaultFontPixelSize
/
3
visible
:
!
_isVisible
color
:
isSatellite
?
Qt
.
rgba
(
1
,
1
,
1
,
0.5
)
:
Qt
.
rgba
(
0
,
0
,
0
,
0.5
)
Image
{
width
:
parent
.
width
*
0.75
height
:
parent
.
height
*
0.75
source
:
"
/qmlimages/buttonLeft.svg
"
mipmap
:
true
fillMode
:
Image
.
PreserveAspectFit
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
_isVisible
=
!
_isVisible
}
}
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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