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
ce588588
Commit
ce588588
authored
Jul 30, 2019
by
Gus Grubba
Browse files
Process Start/Stop zoom within camera manager.
parent
5e75d2d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
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
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