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
6dafc13c
Commit
6dafc13c
authored
Feb 07, 2018
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Time lapse [ci skip]
parent
ad57d68f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
8 deletions
+94
-8
CameraPageWidget.qml
src/FlightMap/Widgets/CameraPageWidget.qml
+85
-7
QGCSlider.qml
src/QmlControls/QGCSlider.qml
+9
-1
No files found.
src/FlightMap/Widgets/CameraPageWidget.qml
View file @
6dafc13c
...
...
@@ -26,23 +26,26 @@ import QGroundControl.FactControls 1.0
/// Camera page for Instrument Panel PageView
Column
{
width
:
pageWidth
spacing
:
ScreenTools
.
defaultFontPixelHeight
spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.25
property
bool
showSettingsIcon
:
_camera
!==
null
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
_dynamicCameras
:
_activeVehicle
?
_activeVehicle
.
dynamicCameras
:
null
property
bool
_isCamera
:
_dynamicCameras
?
_dynamicCameras
.
cameras
.
count
>
0
:
false
property
var
_camera
:
_isCamera
?
_dynamicCameras
.
cameras
.
get
(
0
)
:
null
// Single camera support for the time being
property
bool
_cameraModeUndefined
:
_isCamera
?
_dynamicCameras
.
cameras
.
get
(
0
).
cameraMode
===
QGCCameraControl
.
CAMERA_MODE_UNDEFINED
:
true
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
bool
_cameraPhotoIdle
:
_isCamera
&&
_camera
.
photoStatus
===
QGCCameraControl
.
PHOTO_CAPTURE_IDLE
property
bool
_cameraElapsedMode
:
_isCamera
&&
_camera
.
cameraMode
===
QGCCameraControl
.
CAM_MODE_PHOTO
&&
_camera
.
photoMode
===
QGCCameraControl
.
PHOTO_CAPTURE_TIMELAPSE
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
property
bool
_noStorage
:
_camera
&&
_camera
.
storageTotal
===
0
function
showSettings
()
{
qgcView
.
showDialog
(
cameraSettings
,
_cameraVideoMode
?
qsTr
(
"
Video Settings
"
)
:
qsTr
(
"
Camera Settings
"
),
70
,
StandardButton
.
Ok
)
...
...
@@ -60,13 +63,21 @@ Column {
//-- Actual controller
QGCLabel
{
id
:
cameraLabel
text
:
_isCamera
?
_
dynamicCameras
.
cameras
.
get
(
0
)
.
modelName
:
qsTr
(
"
Camera
"
)
text
:
_isCamera
?
_
camera
.
modelName
:
qsTr
(
"
Camera
"
)
visible
:
_isCamera
font.pointSize
:
ScreenTools
.
smallFontPointSize
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
QGCLabel
{
text
:
_camera
?
qsTr
(
"
Free Space:
"
)
+
_camera
.
storageFreeStr
:
""
font.pointSize
:
ScreenTools
.
smallFontPointSize
anchors.horizontalCenter
:
parent
.
horizontalCenter
visible
:
_camera
&&
!
_noStorage
}
//-- Camera Mode (visible only if camera has modes)
Item
{
width
:
1
;
height
:
ScreenTools
.
defaultFontPixelHeight
*
0.75
;
visible
:
camMode
.
visible
;
}
Rectangle
{
id
:
camMode
width
:
_hasModes
?
ScreenTools
.
defaultFontPixelWidth
*
8
:
0
height
:
_hasModes
?
ScreenTools
.
defaultFontPixelWidth
*
4
:
0
color
:
qgcPal
.
button
...
...
@@ -129,19 +140,21 @@ Column {
}
}
//-- Shutter
Item
{
width
:
1
;
height
:
ScreenTools
.
defaultFontPixelHeight
*
0.75
;
visible
:
camShutter
.
visible
;
}
Rectangle
{
id
:
camShutter
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0
)
width
:
ScreenTools
.
defaultFontPixelWidth
*
6
height
:
width
radius
:
width
*
0.5
visible
:
_isCamera
visible
:
_isCamera
border.color
:
qgcPal
.
buttonText
border.width
:
3
anchors.horizontalCenter
:
parent
.
horizontalCenter
Rectangle
{
width
:
parent
.
width
*
(
_videoRecording
?
0.5
:
0.75
)
width
:
parent
.
width
*
(
_videoRecording
||
(
_cameraPhotoMode
&&
!
_cameraPhotoIdle
&&
_cameraElapsedMode
)
?
0.5
:
0.75
)
height
:
width
radius
:
_videoRecording
?
0
:
width
*
0.5
radius
:
_videoRecording
||
(
_cameraPhotoMode
&&
!
_cameraPhotoIdle
&&
_cameraElapsedMode
)
?
0
:
width
*
0.5
color
:
_cameraModeUndefined
?
qgcPal
.
colorGrey
:
qgcPal
.
colorRed
anchors.centerIn
:
parent
}
...
...
@@ -152,11 +165,28 @@ Column {
if
(
_cameraVideoMode
)
{
_camera
.
toggleVideo
()
}
else
{
_camera
.
takePhoto
()
if
(
_cameraPhotoMode
&&
!
_cameraPhotoIdle
&&
_cameraElapsedMode
)
{
_camera
.
stopTakePhoto
()
}
else
{
_camera
.
takePhoto
()
}
}
}
}
}
Item
{
width
:
1
;
height
:
ScreenTools
.
defaultFontPixelHeight
*
0.75
;
visible
:
_isCamera
;
}
QGCLabel
{
text
:
(
_cameraVideoMode
&&
_camera
.
videoStatus
===
QGCCameraControl
.
VIDEO_CAPTURE_STATUS_RUNNING
)
?
_camera
.
recordTimeStr
:
"
00:00:00
"
font.pointSize
:
ScreenTools
.
smallFontPointSize
visible
:
_cameraVideoMode
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
QGCLabel
{
text
:
_activeVehicle
&&
_cameraPhotoMode
?
(
'
00000
'
+
_activeVehicle
.
cameraTriggerPoints
.
count
).
slice
(
-
5
)
:
"
00000
"
font.pointSize
:
ScreenTools
.
smallFontPointSize
visible
:
_cameraPhotoMode
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
Item
{
width
:
1
;
height
:
ScreenTools
.
defaultFontPixelHeight
;
visible
:
_isCamera
;
}
Component
{
id
:
cameraSettings
...
...
@@ -232,6 +262,54 @@ Column {
}
}
//-------------------------------------------
//-- Time Lapse
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
anchors.horizontalCenter
:
parent
.
horizontalCenter
visible
:
_cameraPhotoMode
property
var
photoModes
:
[
qsTr
(
"
Single
"
),
qsTr
(
"
Time Lapse
"
)]
QGCLabel
{
text
:
qsTr
(
"
Photo Mode
"
)
width
:
_labelFieldWidth
anchors.verticalCenter
:
parent
.
verticalCenter
}
QGCComboBox
{
id
:
photoModeCombo
width
:
_editFieldWidth
model
:
parent
.
photoModes
currentIndex
:
_camera
?
_camera
.
photoMode
:
0
onActivated
:
_camera
.
photoMode
=
index
}
}
//-------------------------------------------
//-- Time Lapse Interval
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
anchors.horizontalCenter
:
parent
.
horizontalCenter
visible
:
_cameraPhotoMode
&&
_camera
.
photoMode
===
QGCCameraControl
.
PHOTO_CAPTURE_TIMELAPSE
QGCLabel
{
text
:
qsTr
(
"
Photo Interval (seconds)
"
)
width
:
_labelFieldWidth
anchors.verticalCenter
:
parent
.
verticalCenter
}
Item
{
height
:
photoModeCombo
.
height
width
:
_editFieldWidth
QGCSlider
{
maximumValue
:
60
minimumValue
:
1
stepSize
:
1
value
:
_camera
?
_camera
.
photoLapse
:
5
displayValue
:
true
updateValueWhileDragging
:
true
anchors.fill
:
parent
onValueChanged
:
{
_camera
.
photoLapse
=
value
}
}
}
}
//-------------------------------------------
//-- Reset Camera
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
...
...
src/QmlControls/QGCSlider.qml
View file @
6dafc13c
...
...
@@ -21,6 +21,7 @@ Slider {
// Value indicator starts display from zero instead of min value
property
bool
zeroCentered
:
false
property
bool
displayValue
:
false
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
...
...
@@ -67,8 +68,15 @@ Slider {
implicitWidth
:
_radius
*
2
implicitHeight
:
_radius
*
2
radius
:
_radius
property
real
_radius
:
Math
.
round
(
ScreenTools
.
defaultFontPixelHeight
*
0.75
)
Label
{
text
:
_root
.
value
.
toFixed
(
0
)
visible
:
_root
.
displayValue
anchors.centerIn
:
parent
font.family
:
ScreenTools
.
normalFontFamily
font.pointSize
:
ScreenTools
.
smallFontPointSize
color
:
qgcPal
.
buttonText
}
}
}
}
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