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
3af45747
Commit
3af45747
authored
May 11, 2017
by
Don Gagne
Committed by
GitHub
May 11, 2017
Browse files
Merge pull request #5128 from DonLakeFlyer/CameraMode
Optional camera mode support
parents
f8b54574
eba409e0
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/MissionManager/CameraSection.cc
View file @
3af45747
...
...
@@ -9,6 +9,7 @@
#include
"CameraSection.h"
#include
"SimpleMissionItem.h"
#include
"FirmwarePlugin.h"
QGC_LOGGING_CATEGORY
(
CameraSectionLog
,
"CameraSectionLog"
)
...
...
@@ -402,3 +403,8 @@ void CameraSection::_cameraActionChanged(void)
_setDirtyAndUpdateItemCount
();
_updateSettingsSpecified
();
}
bool
CameraSection
::
cameraModeSupported
(
void
)
const
{
return
_vehicle
->
firmwarePlugin
()
->
supportedMissionCommands
().
contains
(
MAV_CMD_SET_CAMERA_MODE
);
}
src/MissionManager/CameraSection.h
View file @
3af45747
...
...
@@ -38,8 +38,9 @@ public:
Q_PROPERTY
(
Fact
*
cameraAction
READ
cameraAction
CONSTANT
)
Q_PROPERTY
(
Fact
*
cameraPhotoIntervalTime
READ
cameraPhotoIntervalTime
CONSTANT
)
Q_PROPERTY
(
Fact
*
cameraPhotoIntervalDistance
READ
cameraPhotoIntervalDistance
CONSTANT
)
Q_PROPERTY
(
bool
cameraModeSupported
READ
cameraModeSupported
CONSTANT
)
///< true: cameraMode is supported by this vehicle
Q_PROPERTY
(
bool
specifyCameraMode
READ
specifyCameraMode
WRITE
setSpecifyCameraMode
NOTIFY
specifyCameraModeChanged
)
Q_PROPERTY
(
Fact
*
cameraMode
READ
cameraMode
CONSTANT
)
Q_PROPERTY
(
Fact
*
cameraMode
READ
cameraMode
CONSTANT
)
///< MAV_CMD_SET_CAMERA_MODE.param2
bool
specifyGimbal
(
void
)
const
{
return
_specifyGimbal
;
}
Fact
*
gimbalYaw
(
void
)
{
return
&
_gimbalYawFact
;
}
...
...
@@ -47,6 +48,7 @@ public:
Fact
*
cameraAction
(
void
)
{
return
&
_cameraActionFact
;
}
Fact
*
cameraPhotoIntervalTime
(
void
)
{
return
&
_cameraPhotoIntervalTimeFact
;
}
Fact
*
cameraPhotoIntervalDistance
(
void
)
{
return
&
_cameraPhotoIntervalDistanceFact
;
}
bool
cameraModeSupported
(
void
)
const
;
bool
specifyCameraMode
(
void
)
const
{
return
_specifyCameraMode
;
}
Fact
*
cameraMode
(
void
)
{
return
&
_cameraModeFact
;
}
...
...
src/MissionManager/MissionController.cc
View file @
3af45747
...
...
@@ -319,7 +319,7 @@ int MissionController::insertComplexMissionItem(QString itemName, QGeoCoordinate
MissionSettingsItem
*
settingsItem
=
_visualItems
->
value
<
MissionSettingsItem
*>
(
0
);
CameraSection
*
cameraSection
=
settingsItem
->
cameraSection
();
// Set camera to photo mode (leave alone if user already specified)
if
(
!
cameraSection
->
specifyCameraMode
())
{
if
(
cameraSection
->
cameraModeSupported
()
&&
!
cameraSection
->
specifyCameraMode
())
{
cameraSection
->
setSpecifyCameraMode
(
true
);
cameraSection
->
cameraMode
()
->
setRawValue
(
0
);
}
...
...
@@ -382,7 +382,7 @@ void MissionController::removeMissionItem(int index)
cameraSection
->
setSpecifyGimbal
(
false
);
}
}
if
(
cameraSection
->
specifyCameraMode
()
&&
cameraSection
->
cameraMode
()
->
rawValue
().
toInt
()
==
0
)
{
if
(
cameraSection
->
cameraModeSupported
()
&&
cameraSection
->
specifyCameraMode
()
&&
cameraSection
->
cameraMode
()
->
rawValue
().
toInt
()
==
0
)
{
cameraSection
->
setSpecifyCameraMode
(
false
);
}
}
...
...
src/PlanView/CameraSection.qml
View file @
3af45747
...
...
@@ -109,6 +109,7 @@ Column {
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
_camera
.
cameraModeSupported
QGCCheckBox
{
id
:
modeCheckBox
...
...
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