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
880ee75d
Commit
880ee75d
authored
Sep 28, 2017
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Camera control tweaks
parent
7e320ebd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
23 deletions
+37
-23
QGCCameraControl.cc
src/Camera/QGCCameraControl.cc
+8
-0
QGCCameraControl.h
src/Camera/QGCCameraControl.h
+1
-1
QGCCameraManager.cc
src/Camera/QGCCameraManager.cc
+1
-1
CameraPageWidget.qml
src/FlightMap/Widgets/CameraPageWidget.qml
+27
-21
No files found.
src/Camera/QGCCameraControl.cc
View file @
880ee75d
...
...
@@ -1434,3 +1434,11 @@ QGCCameraControl::validateParameter(Fact* pFact, QVariant& newValue)
Q_UNUSED
(
newValue
);
return
true
;
}
//-----------------------------------------------------------------------------
QStringList
QGCCameraControl
::
activeSettings
()
{
qCDebug
(
CameraControlLog
)
<<
"Active:"
<<
_activeSettings
;
return
_activeSettings
;
}
src/Camera/QGCCameraControl.h
View file @
880ee75d
...
...
@@ -144,7 +144,7 @@ public:
virtual
VideoStatus
videoStatus
();
virtual
PhotoStatus
photoStatus
();
virtual
CameraMode
cameraMode
()
{
return
_cameraMode
;
}
virtual
QStringList
activeSettings
()
{
return
_activeSettings
;
}
virtual
QStringList
activeSettings
()
;
virtual
quint32
storageFree
()
{
return
_storageFree
;
}
virtual
QString
storageFreeStr
();
virtual
quint32
storageTotal
()
{
return
_storageTotal
;
}
...
...
src/Camera/QGCCameraManager.cc
View file @
880ee75d
...
...
@@ -112,7 +112,7 @@ QGCCameraManager::_handleCameraInfo(const mavlink_message_t& message)
{
mavlink_camera_information_t
info
;
mavlink_msg_camera_information_decode
(
&
message
,
&
info
);
qCDebug
(
CameraManagerLog
)
<<
"_handleCameraInfo:"
<<
(
const
char
*
)(
void
*
)
&
info
.
model_name
[
0
]
<<
(
const
char
*
)(
void
*
)
&
info
.
vendor_name
[
0
];
qCDebug
(
CameraManagerLog
)
<<
"_handleCameraInfo:"
<<
(
const
char
*
)(
void
*
)
&
info
.
model_name
[
0
]
<<
(
const
char
*
)(
void
*
)
&
info
.
vendor_name
[
0
]
<<
"Comp ID:"
<<
message
.
compid
;
QGCCameraControl
*
pCamera
=
_vehicle
->
firmwarePlugin
()
->
createCameraControl
(
&
info
,
_vehicle
,
message
.
compid
,
this
);
if
(
pCamera
)
{
QQmlEngine
::
setObjectOwnership
(
pCamera
,
QQmlEngine
::
CppOwnership
);
...
...
src/FlightMap/Widgets/CameraPageWidget.qml
View file @
880ee75d
...
...
@@ -34,14 +34,15 @@ Column {
property
var
_dynamicCameras
:
_activeVehicle
?
_activeVehicle
.
dynamicCameras
:
null
property
bool
_isCamera
:
_dynamicCameras
?
_dynamicCameras
.
cameras
.
count
>
0
:
false
property
bool
_cameraModeUndefined
:
_isCamera
?
_dynamicCameras
.
cameras
.
get
(
0
).
cameraMode
===
QGCCameraControl
.
CAMERA_MODE_UNDEFINED
:
true
property
bool
_cameraVideoMode
:
_isCamera
?
_dynamicCameras
.
cameras
.
get
(
0
).
cameraMode
===
QGCCameraControl
.
CAMERA_MODE_VIDEO
:
false
property
bool
_cameraPhotoMode
:
_isCamera
?
_dynamicCameras
.
cameras
.
get
(
0
).
cameraMode
===
QGCCameraControl
.
CAMERA_MODE_PHOTO
:
false
property
bool
_cameraVideoMode
:
_isCamera
?
_dynamicCameras
.
cameras
.
get
(
0
).
cameraMode
===
1
:
false
property
bool
_cameraPhotoMode
:
_isCamera
?
_dynamicCameras
.
cameras
.
get
(
0
).
cameraMode
===
0
:
false
property
var
_camera
:
_isCamera
?
_dynamicCameras
.
cameras
.
get
(
0
)
:
null
// Single camera support for the time being
property
real
_spacers
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
property
real
_labelFieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
30
property
real
_editFieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
30
property
bool
_communicationLost
:
_activeVehicle
?
_activeVehicle
.
connectionLost
:
false
property
bool
_hasModes
:
_isCamera
&&
_camera
&&
_camera
.
hasModes
property
bool
_videoRecording
:
_camera
&&
_camera
.
videoStatus
===
QGCCameraControl
.
VIDEO_CAPTURE_STATUS_RUNNING
function
showSettings
()
{
qgcView
.
showDialog
(
cameraSettings
,
_cameraVideoMode
?
qsTr
(
"
Video Settings
"
)
:
qsTr
(
"
Camera Settings
"
),
70
,
StandardButton
.
Ok
)
...
...
@@ -66,23 +67,26 @@ Column {
}
//-- Camera Mode (visible only if camera has modes)
Rectangle
{
width
:
_hasModes
?
ScreenTools
.
defaultFontPixelWidth
*
12
:
0
height
:
_hasModes
?
ScreenTools
.
defaultFontPixelWidth
*
4
:
0
color
:
qgcPal
.
window
width
:
_hasModes
?
ScreenTools
.
defaultFontPixelWidth
*
8
:
0
height
:
_hasModes
?
ScreenTools
.
defaultFontPixelWidth
*
4
:
0
color
:
qgcPal
.
button
radius
:
height
*
0.5
visible
:
_hasModes
anchors.horizontalCenter
:
parent
.
horizontalCenter
//-- Video Mode
Rectangle
{
width
:
parent
.
height
*
0.9
height
:
parent
.
height
*
0.9
color
:
qgcPal
.
windowShadeDark
width
:
parent
.
height
height
:
parent
.
height
color
:
_cameraVideoMode
?
qgcPal
.
window
:
qgcPal
.
button
radius
:
height
*
0.5
anchors.left
:
parent
.
left
anchors.leftMargin
:
4
border.color
:
qgcPal
.
text
border.width
:
_cameraVideoMode
?
1
:
0
anchors.verticalCenter
:
parent
.
verticalCenter
QGCColoredImage
{
anchors.fill
:
parent
height
:
parent
.
height
*
0.5
width
:
height
anchors.centerIn
:
parent
source
:
"
/qmlimages/camera_video.svg
"
fillMode
:
Image
.
PreserveAspectFit
sourceSize.height
:
height
...
...
@@ -98,15 +102,18 @@ Column {
}
//-- Photo Mode
Rectangle
{
width
:
parent
.
height
*
0.9
height
:
parent
.
height
*
0.9
color
:
qgcPal
.
windowShade
width
:
parent
.
height
height
:
parent
.
height
color
:
_cameraPhotoMode
?
qgcPal
.
window
:
qgcPal
.
button
radius
:
height
*
0.5
anchors.right
:
parent
.
right
anchors.rightMargin
:
4
border.color
:
qgcPal
.
text
border.width
:
_cameraPhotoMode
?
1
:
0
anchors.verticalCenter
:
parent
.
verticalCenter
QGCColoredImage
{
anchors.fill
:
parent
height
:
parent
.
height
*
0.5
width
:
height
anchors.centerIn
:
parent
source
:
"
/qmlimages/camera_photo.svg
"
fillMode
:
Image
.
PreserveAspectFit
sourceSize.height
:
height
...
...
@@ -132,9 +139,9 @@ Column {
border.width
:
3
anchors.horizontalCenter
:
parent
.
horizontalCenter
Rectangle
{
width
:
parent
.
width
*
0.75
width
:
parent
.
width
*
(
_videoRecording
?
0.5
:
0.75
)
height
:
width
radius
:
width
*
0.5
radius
:
_videoRecording
?
0
:
width
*
0.5
color
:
_cameraModeUndefined
?
qgcPal
.
colorGrey
:
qgcPal
.
colorRed
anchors.centerIn
:
parent
}
...
...
@@ -143,7 +150,7 @@ Column {
enabled
:
!
_cameraModeUndefined
onClicked
:
{
if
(
_cameraVideoMode
)
{
//-- Start/Stop Video
_camera
.
toggleVideo
()
}
else
{
_camera
.
takePhoto
()
}
...
...
@@ -246,7 +253,7 @@ Column {
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
onNo
:
resetPrompt
.
close
()
onYes
:
{
// TODO
_camera
.
resetSettings
()
resetPrompt
.
close
()
}
}
...
...
@@ -264,7 +271,6 @@ Column {
}
QGCButton
{
text
:
qsTr
(
"
Format
"
)
enabled
:
false
onClicked
:
formatPrompt
.
open
()
width
:
_editFieldWidth
anchors.verticalCenter
:
parent
.
verticalCenter
...
...
@@ -275,7 +281,7 @@ Column {
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
onNo
:
formatPrompt
.
close
()
onYes
:
{
// TODO
_camera
.
formatCard
()
formatPrompt
.
close
()
}
}
...
...
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