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
dc3f80bc
Unverified
Commit
dc3f80bc
authored
Jul 31, 2019
by
Gus Grubba
Committed by
GitHub
Jul 31, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7652 from stefandunca/pr-vertical_gimbal_indicator
Fix gimbal indicator display
parents
6ebae0ae
439ff491
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
31 deletions
+61
-31
ZoomControl.qml
custom-example/res/Custom/Camera/ZoomControl.qml
+30
-14
CustomCameraControl.qml
custom-example/res/CustomCameraControl.qml
+31
-17
No files found.
custom-example/res/Custom/Camera/ZoomControl.qml
View file @
dc3f80bc
...
...
@@ -12,12 +12,18 @@ Item {
property
real
zoomLevel
:
NaN
property
alias
zoomLevelVisible
:
zoomStatusItem
.
visible
property
bool
showZoomPrecision
:
true
property
bool
onlyContinousZoom
:
false
signal
zoomIn
()
signal
zoomOut
()
signal
continuousZoomStart
(
var
zoomIn
)
signal
continuousZoomStop
()
//
// Beware the buttons were switched
//
//
height
:
zoomStatusTextItem
.
height
*
2
width
:
(
zoomLevelVisible
?
(
zoomStatusItem
.
width
-
zoomInButton
.
width
/
2
)
:
0
)
+
zoomInButton
.
width
+
zoomOutButton
.
width
...
...
@@ -69,7 +75,12 @@ Item {
property
bool
holding
:
false
onPressed
:
{
_root
.
zoomIn
()
if
(
onlyContinousZoom
)
{
holding
=
true
}
else
{
_root
.
zoomOut
()
}
}
onPressAndHold
:
{
...
...
@@ -82,7 +93,7 @@ Item {
background
:
Rectangle
{
anchors.fill
:
zoomInButton
radius
:
zoomInButton
.
width
/
2
radius
:
zoomInButton
.
width
/
10
color
:
_root
.
mainColor
}
...
...
@@ -96,14 +107,6 @@ Item {
width
:
zoomInButton
.
width
*
0.4
height
:
zoomInButton
.
height
*
0.05
color
:
_root
.
contentColor
}
Rectangle
{
anchors.centerIn
:
parent
width
:
zoomInMinusRectangle
.
height
height
:
zoomInMinusRectangle
.
width
color
:
_root
.
contentColor
}
}
...
...
@@ -140,7 +143,12 @@ Item {
property
bool
holding
:
false
onPressed
:
{
_root
.
zoomOut
()
if
(
onlyContinousZoom
)
{
holding
=
true
}
else
{
_root
.
zoomIn
()
}
}
onPressAndHold
:
{
...
...
@@ -153,7 +161,7 @@ Item {
background
:
Rectangle
{
anchors.fill
:
zoomOutButton
radius
:
zoomOutButton
.
width
/
2
radius
:
zoomOutButton
.
width
/
10
color
:
_root
.
mainColor
}
...
...
@@ -167,6 +175,14 @@ Item {
width
:
zoomInMinusRectangle
.
width
height
:
zoomInMinusRectangle
.
height
color
:
_root
.
contentColor
}
Rectangle
{
anchors.centerIn
:
parent
width
:
zoomOutMinusRectangle
.
height
height
:
zoomOutMinusRectangle
.
width
color
:
_root
.
contentColor
}
}
...
...
@@ -203,11 +219,11 @@ Item {
},
State
{
name
:
"
ZoomingIn
"
when
:
zoom
In
Button
.
holding
===
true
when
:
zoom
Out
Button
.
holding
===
true
},
State
{
name
:
"
ZoomingOut
"
when
:
zoom
Out
Button
.
holding
===
true
when
:
zoom
In
Button
.
holding
===
true
}
]
}
custom-example/res/CustomCameraControl.qml
View file @
dc3f80bc
...
...
@@ -13,6 +13,7 @@ import QtQuick 2.11
import
QtQuick
.
Controls
2.4
import
QtQuick
.
Layouts
1.11
import
QtQuick
.
Dialogs
1.3
import
QtGraphicalEffects
1.0
import
QtMultimedia
5.9
import
QtPositioning
5.2
...
...
@@ -31,6 +32,7 @@ import Custom.Widgets 1.0
import
Custom
.
Camera
1.0
Item
{
id
:
_root
height
:
mainColumn
.
height
width
:
mainColumn
.
width
+
(
ScreenTools
.
defaultFontPixelWidth
*
2
)
visible
:
!
QGroundControl
.
videoManager
.
fullScreen
...
...
@@ -399,10 +401,11 @@ Item {
}
//-- Gimbal Indicator
Rectangle
{
id
:
gimbalBackground
width
:
_hasGimbal
?
ScreenTools
.
defaultFontPixelWidth
*
6
:
0
height
:
_hasGimbal
?
(
gimbalCol
.
height
+
(
ScreenTools
.
defaultFontPixelHeight
*
2
))
:
0
visible
:
_hasGimbal
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.5
)
color
:
Qt
.
rgba
(
qgcPal
.
window
.
r
,
qgcPal
.
window
.
g
,
qgcPal
.
window
.
b
,
0.5
)
radius
:
ScreenTools
.
defaultFontPixelWidth
*
0.5
anchors.verticalCenter
:
cameraRect
.
verticalCenter
Column
{
...
...
@@ -410,6 +413,7 @@ Item {
spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.75
anchors.centerIn
:
parent
Image
{
id
:
gimbalIcon
source
:
"
/custom/img/gimbal_icon.svg
"
width
:
ScreenTools
.
defaultFontPixelWidth
*
2
height
:
width
...
...
@@ -418,7 +422,7 @@ Item {
antialiasing
:
true
fillMode
:
Image
.
PreserveAspectFit
sourceSize.width
:
width
anchors.horizontalCenter
:
parent
.
horizontalCenter
z
:
stickItem
.
z
+
1
}
Image
{
id
:
pitchScale
...
...
@@ -429,34 +433,42 @@ Item {
smooth
:
true
mipmap
:
true
antialiasing
:
true
anchors.horizontalCenter
:
parent
.
horizontalCenter
Image
{
id
:
yawIndicator
width
:
ScreenTools
.
defaultFontPixelWidth
*
4
source
:
"
/custom/img/gimbal_position.svg
"
fillMode
:
Image
.
PreserveAspectFit
sourceSize.width
:
width
y
:
(
parent
.
height
*
_pitch
/
105
)
x
:
pitchScale
.
width
/
2
y
:
(
pitchScale
.
height
*
pitchScale
.
scaleRatio
)
+
(
pitchScale
.
_pitch
/
pitchScale
.
rangeValue
)
*
pitchScale
.
height
smooth
:
true
mipmap
:
true
anchors.horizontalCenter
:
parent
.
horizontalCenter
transform
:
Rotation
{
origin.x
:
yawIndicator
.
width
/
2
origin.y
:
yawIndicator
.
height
/
2
angle
:
_gimbalYaw
}
property
real
_pitch
:
_gimbalPitch
<
-
15
?
-
15
:
(
_gimbalPitch
>
90
?
90
:
_gimbalPitch
)
transform
:
[
Translate
{
x
:
-
yawIndicator
.
width
/
2
y
:
-
yawIndicator
.
height
/
2
},
Rotation
{
angle
:
_gimbalYaw
}
]
}
readonly
property
real
minValue
:
-
15
readonly
property
real
centerValue
:
0
readonly
property
real
maxValue
:
90
readonly
property
real
rangeValue
:
maxValue
-
minValue
readonly
property
real
scaleRatio
:
1
/
7
property
real
_pitch
:
_gimbalPitch
<
minValue
?
minValue
:
(
_gimbalPitch
>
maxValue
?
maxValue
:
_gimbalPitch
)
}
QGCLabel
{
id
:
gimbalLabel
text
:
_gimbalPitch
?
_gimbalP
itch
.
toFixed
(
0
)
:
0
text
:
_gimbalPitch
?
pitchScale
.
_p
itch
.
toFixed
(
0
)
:
0
color
:
"
#FFF
"
font.pointSize
:
ScreenTools
.
smallFontPointSize
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
}
}
}
// Gimbal Indicator
}
//-- Zoom Buttons
ZoomControl
{
...
...
@@ -468,6 +480,7 @@ Item {
zoomLevelVisible
:
false
zoomLevel
:
_hasZoom
?
_camera
.
zoomLevel
:
NaN
anchors.horizontalCenter
:
parent
.
horizontalCenter
onlyContinousZoom
:
true
onZoomIn
:
{
_camera
.
stepZoom
(
1
)
}
...
...
@@ -940,18 +953,18 @@ Item {
id
:
thermalPalettes
width
:
Math
.
min
(
mainWindow
.
width
*
0.666
,
ScreenTools
.
defaultFontPixelWidth
*
40
)
height
:
mainWindow
.
height
*
0.5
//
modal: true
modal
:
true
focus
:
true
parent
:
Overlay
.
overlay
x
:
Math
.
round
((
mainWindow
.
width
-
width
)
*
0.5
)
y
:
Math
.
round
((
mainWindow
.
height
-
height
)
*
0.5
)
closePolicy
:
Popup
.
CloseOnEscape
|
Popup
.
CloseOnPressOutside
property
int
selectedIndex
:
0
background
:
Rectangle
{
anchors.fill
:
parent
color
:
qgcPal
.
globalTheme
===
QGCPalette
.
Light
?
Qt
.
rgba
(
1
,
1
,
1
,
0.95
)
:
Qt
.
rgba
(
0
,
0
,
0
,
0.75
)
border.color
:
qgcPal
.
text
radius
:
ScreenTools
.
defaultFontPixelWidth
radius
:
ScreenTools
.
defaultFontPixelWidth
*
0.5
}
Item
{
anchors.fill
:
parent
...
...
@@ -987,6 +1000,7 @@ Item {
if
(
thermalBackgroundRect
.
visible
)
{
if
(
_camera
.
thermalMode
!==
QGCCameraControl
.
THERMAL_PIP
&&
_camera
.
thermalMode
!==
QGCCameraControl
.
THERMAL_FULL
)
{
_camera
.
thermalMode
=
QGCCameraControl
.
THERMAL_FULL
thermalFull
.
checked
=
true
}
}
...
...
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