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
2de904b7
Unverified
Commit
2de904b7
authored
Jul 30, 2019
by
Gus Grubba
Committed by
GitHub
Jul 30, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7648 from stefandunca/pr-small_improvements
Custom Example: Minor fixes for custom build controls
parents
0720c373
22166a11
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
CustomCameraControl.qml
custom-example/res/CustomCameraControl.qml
+11
-7
CustomFlyView.qml
custom-example/res/CustomFlyView.qml
+5
-2
No files found.
custom-example/res/CustomCameraControl.qml
View file @
2de904b7
...
...
@@ -85,7 +85,7 @@ Item {
//---------------------------------------------------------------------
//-- Quick Thermal Modes
Item
{
id
:
b
ackgroundRect
id
:
thermalB
ackgroundRect
width
:
buttonsRow
.
width
+
(
ScreenTools
.
defaultFontPixelWidth
*
4
)
height
:
buttonsRow
.
height
+
(
ScreenTools
.
defaultFontPixelHeight
)
visible
:
_irPaletteFact
&&
(
QGroundControl
.
videoManager
.
hasThermal
||
_camera
.
vendor
===
"
NextVision
"
)
...
...
@@ -143,14 +143,12 @@ Item {
// Thermal palette options
CustomQuickButton
{
checkable
:
false
enabled
:
thermalFull
.
checked
||
thermalPip
.
checked
width
:
buttonSize
height
:
buttonSize
visible
:
_irPaletteFact
iconSource
:
"
/custom/img/thermal-palette.svg
"
onClicked
:
{
if
(
_irPaletteFact
)
{
thermalPalettes
.
open
()
}
thermalPalettes
.
open
()
}
}
}
...
...
@@ -466,7 +464,7 @@ Item {
visible
:
_hasZoom
mainColor
:
qgcPal
.
window
contentColor
:
qgcPal
.
text
fontPointSize
:
ScreenTools
.
defaultFontPointSize
*
1.
2
5
fontPointSize
:
ScreenTools
.
defaultFontPointSize
*
1.
7
5
zoomLevelVisible
:
false
zoomLevel
:
_hasZoom
?
_camera
.
zoomLevel
:
NaN
anchors.horizontalCenter
:
parent
.
horizontalCenter
...
...
@@ -942,7 +940,7 @@ 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
)
...
...
@@ -986,6 +984,12 @@ Item {
checked
:
index
===
_irPaletteFact
.
value
onClicked
:
{
_irPaletteFact
.
value
=
index
if
(
thermalBackgroundRect
.
visible
)
{
if
(
_camera
.
thermalMode
!==
QGCCameraControl
.
THERMAL_PIP
&&
_camera
.
thermalMode
!==
QGCCameraControl
.
THERMAL_FULL
)
{
_camera
.
thermalMode
=
QGCCameraControl
.
THERMAL_FULL
}
}
thermalPalettes
.
close
()
}
}
...
...
custom-example/res/CustomFlyView.qml
View file @
2de904b7
...
...
@@ -563,8 +563,11 @@ Item {
//console.info("error: " + pitch_angle_error + "; angle_state: " + pitch_angle)
pitch
=
pitch_setpoint
yaw
+=
stick
.
xAxis
*
gimbalControl
.
speedMultiplier
yaw
=
clamp
(
yaw
,
-
180
,
180
)
pitch
=
clamp
(
pitch
,
-
45
,
45
)
pitch
=
clamp
(
pitch
,
-
90
,
45
)
pitch_angle
=
clamp
(
pitch_angle
,
-
90
,
45
)
//console.info("P: " + pitch + "; Y: " + yaw)
activeVehicle
.
gimbalControlValue
(
pitch
,
yaw
);
gimbalControl
.
_currentYaw
=
yaw
...
...
@@ -572,7 +575,7 @@ Item {
gimbalControl
.
time_last_seconds
=
time_current_seconds
}
else
{
yaw
+=
stick
.
xAxis
*
gimbalControl
.
speedMultiplier
var
hackedYaw
=
yaw
+
(
stick
.
xAxis
*
gimbalControl
.
speedMultiplier
*
25
)
var
hackedYaw
=
yaw
+
(
stick
.
xAxis
*
gimbalControl
.
speedMultiplier
*
50
)
pitch
+=
pitch_stick
*
gimbalControl
.
speedMultiplier
hackedYaw
=
clamp
(
hackedYaw
,
-
180
,
180
)
yaw
=
clamp
(
yaw
,
-
180
,
180
)
...
...
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