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
eba409e0
Commit
eba409e0
authored
May 10, 2017
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optional camera mode support
parent
4fc1047b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
3 deletions
+12
-3
CameraSection.cc
src/MissionManager/CameraSection.cc
+6
-0
CameraSection.h
src/MissionManager/CameraSection.h
+3
-1
MissionController.cc
src/MissionManager/MissionController.cc
+2
-2
CameraSection.qml
src/PlanView/CameraSection.qml
+1
-0
No files found.
src/MissionManager/CameraSection.cc
View file @
eba409e0
...
...
@@ -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 @
eba409e0
...
...
@@ -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 @
eba409e0
...
...
@@ -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 @
eba409e0
...
...
@@ -109,6 +109,7 @@ Column {
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
_camera
.
cameraModeSupported
QGCCheckBox
{
id
:
modeCheckBox
...
...
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