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
ce588588
Commit
ce588588
authored
Jul 30, 2019
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Process Start/Stop zoom within camera manager.
parent
5e75d2d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
8 deletions
+36
-8
QGCCameraManager.cc
src/Camera/QGCCameraManager.cc
+34
-8
QGCCameraManager.h
src/Camera/QGCCameraManager.h
+2
-0
No files found.
src/Camera/QGCCameraManager.cc
View file @
ce588588
...
...
@@ -379,6 +379,8 @@ QGCCameraManager::_activeJoystickChanged(Joystick* joystick)
qCDebug
(
CameraManagerLog
)
<<
"Joystick changed"
;
if
(
_activeJoystick
)
{
disconnect
(
_activeJoystick
,
&
Joystick
::
stepZoom
,
this
,
&
QGCCameraManager
::
_stepZoom
);
disconnect
(
_activeJoystick
,
&
Joystick
::
startContinuousZoom
,
this
,
&
QGCCameraManager
::
_startZoom
);
disconnect
(
_activeJoystick
,
&
Joystick
::
stopContinuousZoom
,
this
,
&
QGCCameraManager
::
_stopZoom
);
disconnect
(
_activeJoystick
,
&
Joystick
::
stepCamera
,
this
,
&
QGCCameraManager
::
_stepCamera
);
disconnect
(
_activeJoystick
,
&
Joystick
::
stepStream
,
this
,
&
QGCCameraManager
::
_stepStream
);
disconnect
(
_activeJoystick
,
&
Joystick
::
triggerCamera
,
this
,
&
QGCCameraManager
::
_triggerCamera
);
...
...
@@ -388,13 +390,15 @@ QGCCameraManager::_activeJoystickChanged(Joystick* joystick)
}
_activeJoystick
=
joystick
;
if
(
_activeJoystick
)
{
connect
(
_activeJoystick
,
&
Joystick
::
stepZoom
,
this
,
&
QGCCameraManager
::
_stepZoom
);
connect
(
_activeJoystick
,
&
Joystick
::
stepCamera
,
this
,
&
QGCCameraManager
::
_stepCamera
);
connect
(
_activeJoystick
,
&
Joystick
::
stepStream
,
this
,
&
QGCCameraManager
::
_stepStream
);
connect
(
_activeJoystick
,
&
Joystick
::
triggerCamera
,
this
,
&
QGCCameraManager
::
_triggerCamera
);
connect
(
_activeJoystick
,
&
Joystick
::
startVideoRecord
,
this
,
&
QGCCameraManager
::
_startVideoRecording
);
connect
(
_activeJoystick
,
&
Joystick
::
stopVideoRecord
,
this
,
&
QGCCameraManager
::
_stopVideoRecording
);
connect
(
_activeJoystick
,
&
Joystick
::
toggleVideoRecord
,
this
,
&
QGCCameraManager
::
_toggleVideoRecording
);
connect
(
_activeJoystick
,
&
Joystick
::
stepZoom
,
this
,
&
QGCCameraManager
::
_stepZoom
);
connect
(
_activeJoystick
,
&
Joystick
::
startContinuousZoom
,
this
,
&
QGCCameraManager
::
_startZoom
);
connect
(
_activeJoystick
,
&
Joystick
::
stopContinuousZoom
,
this
,
&
QGCCameraManager
::
_stopZoom
);
connect
(
_activeJoystick
,
&
Joystick
::
stepCamera
,
this
,
&
QGCCameraManager
::
_stepCamera
);
connect
(
_activeJoystick
,
&
Joystick
::
stepStream
,
this
,
&
QGCCameraManager
::
_stepStream
);
connect
(
_activeJoystick
,
&
Joystick
::
triggerCamera
,
this
,
&
QGCCameraManager
::
_triggerCamera
);
connect
(
_activeJoystick
,
&
Joystick
::
startVideoRecord
,
this
,
&
QGCCameraManager
::
_startVideoRecording
);
connect
(
_activeJoystick
,
&
Joystick
::
stopVideoRecord
,
this
,
&
QGCCameraManager
::
_stopVideoRecording
);
connect
(
_activeJoystick
,
&
Joystick
::
toggleVideoRecord
,
this
,
&
QGCCameraManager
::
_toggleVideoRecording
);
}
}
...
...
@@ -442,7 +446,7 @@ QGCCameraManager::_toggleVideoRecording()
void
QGCCameraManager
::
_stepZoom
(
int
direction
)
{
if
(
_lastZoomChange
.
elapsed
()
>
25
0
)
{
if
(
_lastZoomChange
.
elapsed
()
>
4
0
)
{
_lastZoomChange
.
start
();
qCDebug
(
CameraManagerLog
)
<<
"Step Camera Zoom"
<<
direction
;
QGCCameraControl
*
pCamera
=
currentCameraInstance
();
...
...
@@ -452,6 +456,28 @@ QGCCameraManager::_stepZoom(int direction)
}
}
//-----------------------------------------------------------------------------
void
QGCCameraManager
::
_startZoom
(
int
direction
)
{
qCDebug
(
CameraManagerLog
)
<<
"Start Camera Zoom"
<<
direction
;
QGCCameraControl
*
pCamera
=
currentCameraInstance
();
if
(
pCamera
)
{
pCamera
->
startZoom
(
direction
);
}
}
//-----------------------------------------------------------------------------
void
QGCCameraManager
::
_stopZoom
()
{
qCDebug
(
CameraManagerLog
)
<<
"Stop Camera Zoom"
;
QGCCameraControl
*
pCamera
=
currentCameraInstance
();
if
(
pCamera
)
{
pCamera
->
stopZoom
();
}
}
//-----------------------------------------------------------------------------
void
QGCCameraManager
::
_stepCamera
(
int
direction
)
...
...
src/Camera/QGCCameraManager.h
View file @
ce588588
...
...
@@ -57,6 +57,8 @@ protected slots:
virtual
void
_mavlinkMessageReceived
(
const
mavlink_message_t
&
message
);
virtual
void
_activeJoystickChanged
(
Joystick
*
joystick
);
virtual
void
_stepZoom
(
int
direction
);
virtual
void
_startZoom
(
int
direction
);
virtual
void
_stopZoom
();
virtual
void
_stepCamera
(
int
direction
);
virtual
void
_stepStream
(
int
direction
);
virtual
void
_cameraTimeout
();
...
...
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