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
c817fe77
Commit
c817fe77
authored
Aug 19, 2020
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
477602f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
180 additions
and
136 deletions
+180
-136
PhotoVideoControl.qml
src/FlightMap/Widgets/PhotoVideoControl.qml
+180
-136
No files found.
src/FlightMap/Widgets/PhotoVideoControl.qml
View file @
c817fe77
...
@@ -27,39 +27,103 @@ Rectangle {
...
@@ -27,39 +27,103 @@ Rectangle {
height
:
mainLayout
.
height
+
(
_margins
*
2
)
height
:
mainLayout
.
height
+
(
_margins
*
2
)
color
:
"
#80000000
"
color
:
"
#80000000
"
radius
:
_margins
radius
:
_margins
visible
:
!
QGroundControl
.
settingsManager
.
flyViewSettings
.
alternateInstrumentPanel
.
rawValue
&&
(
_camera
||
_anyVideoStreamAvailable
)
&&
multiVehiclePanelSelector
.
showSingleVehiclePanel
visible
:
!
QGroundControl
.
settingsManager
.
flyViewSettings
.
alternateInstrumentPanel
.
rawValue
&&
(
_mavlinkCamera
||
_videoStreamAvailable
)
&&
multiVehiclePanelSelector
.
showSingleVehiclePanel
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
_cameraManager
:
_activeVehicle
?
_activeVehicle
.
cameraManager
:
null
property
var
_videoManager
:
QGroundControl
.
videoManager
// The following properties relate to a simple video stream
property
bool
_noCameras
:
_cameraManager
?
_cameraManager
.
cameras
.
count
===
0
:
true
property
bool
_videoStreamAvailable
:
_videoStreamManager
.
hasVideo
property
bool
_multipleCameras
:
_cameraManager
?
_cameraManager
.
cameras
.
count
>
1
:
false
property
var
_videoStreamSettings
:
QGroundControl
.
settingsManager
.
videoSettings
property
bool
_noMavlinkCameraStreams
:
_camera
?
_camera
.
streamLabels
.
length
:
true
property
var
_videoStreamManager
:
QGroundControl
.
videoManager
property
bool
_multipleMavlinkCameraStreams
:
_camera
?
_camera
.
streamLabels
.
length
>
1
:
false
property
bool
_videoStreamAllowsPhotoWhileRecording
:
true
property
bool
_anyVideoStreamAvailable
:
_videoManager
.
hasVideo
property
bool
_videoStreamIsStreaming
:
_videoStreamManager
.
streaming
property
int
_curCameraIndex
:
_cameraManager
?
_cameraManager
.
currentCamera
:
-
1
property
bool
_videoStreamPhotoCaptureIsIdle
:
true
property
int
_curStreamIndex
:
_camera
?
_camera
.
currentStream
:
-
1
property
bool
_videoStreamRecording
:
_videoStreamManager
.
recording
property
var
_camera
:
!
_noCameras
?
(
_cameraManager
.
cameras
.
get
(
_curCameraIndex
)
&&
_cameraManager
.
cameras
.
get
(
_curCameraIndex
).
paramComplete
?
_cameraManager
.
cameras
.
get
(
_curCameraIndex
)
:
null
)
:
null
property
bool
_videoStreamCanShoot
:
_videoStreamIsStreaming
property
string
_cameraName
:
_camera
?
(
_multipleCameras
?
_camera
.
modelName
:
""
)
:
qsTr
(
"
Video Stream
"
)
property
bool
_videoStreamIsShootingInCurrentMode
:
_videoStreamInPhotoMode
?
!
_videoStreamPhotoCaptureIsIdle
:
_videoStreamRecording
property
bool
_hasThermalVideoStream
:
_camera
?
_camera
.
thermalStreamInstance
:
false
property
bool
_videoStreamInPhotoMode
:
false
property
bool
_cameraModeUndefined
:
_camera
?
_camera
.
cameraMode
===
QGCCameraControl
.
CAM_MODE_UNDEFINED
:
true
property
bool
_onlyVideoStreamAvailable
:
!
_mavlinkCamera
&&
_videoStreamManager
.
hasVideo
property
bool
_cameraInVideoMode
:
_camera
?
_camera
.
cameraMode
===
QGCCameraControl
.
CAM_MODE_VIDEO
:
false
property
bool
_cameraInPhotoMode
:
_camera
?
_camera
.
cameraMode
===
QGCCameraControl
.
CAM_MODE_PHOTO
:
false
// The following properties relate to a mavlink protocol camera
property
bool
_cameraElapsedMode
:
_camera
&&
_camera
.
cameraMode
===
QGCCameraControl
.
CAM_MODE_PHOTO
&&
_camera
.
photoMode
===
QGCCameraControl
.
PHOTO_CAPTURE_TIMELAPSE
property
var
_mavlinkCameraManager
:
_activeVehicle
?
_activeVehicle
.
cameraManager
:
null
property
real
_spacers
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
property
int
_mavlinkCameraManagerCurCameraIndex
:
_mavlinkCameraManager
?
_mavlinkCameraManager
.
currentCamera
:
-
1
property
real
_labelFieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
30
property
bool
_noMavlinkCameras
:
_mavlinkCameraManager
?
_mavlinkCameraManager
.
cameras
.
count
===
0
:
true
property
real
_editFieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
30
property
var
_mavlinkCamera
:
!
_noMavlinkCameras
?
(
_mavlinkCameraManager
.
cameras
.
get
(
_mavlinkCameraManagerCurCameraIndex
)
&&
_mavlinkCameraManager
.
cameras
.
get
(
_mavlinkCameraManagerCurCameraIndex
).
paramComplete
?
_mavlinkCameraManager
.
cameras
.
get
(
_mavlinkCameraManagerCurCameraIndex
)
:
null
)
:
null
property
bool
_communicationLost
:
_activeVehicle
?
_activeVehicle
.
connectionLost
:
false
property
bool
_multipleMavlinkCameras
:
_mavlinkCameraManager
?
_mavlinkCameraManager
.
cameras
.
count
>
1
:
false
property
bool
_hasModes
:
_camera
&&
_camera
.
hasModes
property
bool
_noMavlinkCameraStreams
:
_mavlinkCamera
?
_mavlinkCamera
.
streamLabels
.
length
:
true
property
bool
_videoRecording
:
_camera
&&
_camera
.
videoStatus
===
QGCCameraControl
.
VIDEO_CAPTURE_STATUS_RUNNING
property
bool
_multipleMavlinkCameraStreams
:
_mavlinkCamera
?
_mavlinkCamera
.
streamLabels
.
length
>
1
:
false
property
bool
_photoIdle
:
_camera
&&
(
_camera
.
photoStatus
===
QGCCameraControl
.
PHOTO_CAPTURE_IDLE
||
_camera
.
photoStatus
>=
QGCCameraControl
.
PHOTO_CAPTURE_LAST
)
property
int
_mavlinCameraCurStreamIndex
:
_mavlinkCamera
?
_mavlinkCamera
.
currentStream
:
-
1
property
bool
_storageReady
:
_camera
&&
_camera
.
storageStatus
===
QGCCameraControl
.
STORAGE_READY
property
bool
_mavlinkCameraHasThermalVideoStream
:
_mavlinkCamera
?
_mavlinkCamera
.
thermalStreamInstance
:
false
property
bool
_batteryReady
:
_camera
&&
_camera
.
batteryRemaining
>=
0
property
bool
_mavlinkCameraModeUndefined
:
_mavlinkCamera
?
_mavlinkCamera
.
cameraMode
===
QGCCameraControl
.
CAM_MODE_UNDEFINED
:
true
property
bool
_storageSupported
:
_camera
&&
_camera
.
storageStatus
===
QGCCameraControl
.
STORAGE_NOT_SUPPORTED
property
bool
_mavlinkCameraInVideoMode
:
_mavlinkCamera
?
_mavlinkCamera
.
cameraMode
===
QGCCameraControl
.
CAM_MODE_VIDEO
:
false
property
bool
_canShoot
:
(
!
_cameraModeUndefined
&&
((
_storageReady
&&
_camera
.
storageFree
>
0
)
||
_storageSupported
))
||
_videoManager
.
streaming
property
bool
_mavlinkCameraInPhotoMode
:
_mavlinkCamera
?
_mavlinkCamera
.
cameraMode
===
QGCCameraControl
.
CAM_MODE_PHOTO
:
false
property
bool
_isShooting
:
((
_cameraInVideoMode
&&
_videoRecording
)
||
(
_cameraInPhotoMode
&&
!
_photoIdle
))
||
_videoManager
.
recording
property
bool
_mavlinkCameraElapsedMode
:
_mavlinkCamera
&&
_mavlinkCamera
.
cameraMode
===
QGCCameraControl
.
CAM_MODE_PHOTO
&&
_mavlinkCamera
.
photoMode
===
QGCCameraControl
.
PHOTO_CAPTURE_TIMELAPSE
property
var
_videoSettings
:
QGroundControl
.
settingsManager
.
videoSettings
property
bool
_mavlinkCameraHasModes
:
_mavlinkCamera
&&
_mavlinkCamera
.
hasModes
property
bool
_mavlinkCameraVideoIsRecording
:
_mavlinkCamera
&&
_mavlinkCamera
.
videoStatus
===
QGCCameraControl
.
VIDEO_CAPTURE_STATUS_RUNNING
property
bool
_mavlinkCameraPhotoCaptureIsIdle
:
_mavlinkCamera
&&
(
_mavlinkCamera
.
photoStatus
===
QGCCameraControl
.
PHOTO_CAPTURE_IDLE
||
_mavlinkCamera
.
photoStatus
>=
QGCCameraControl
.
PHOTO_CAPTURE_LAST
)
property
bool
_mavlinkCameraStorageReady
:
_mavlinkCamera
&&
_mavlinkCamera
.
storageStatus
===
QGCCameraControl
.
STORAGE_READY
property
bool
_mavlinkCameraBatteryReady
:
_mavlinkCamera
&&
_mavlinkCamera
.
batteryRemaining
>=
0
property
bool
_mavlinkCameraStorageSupported
:
_mavlinkCamera
&&
_mavlinkCamera
.
storageStatus
===
QGCCameraControl
.
STORAGE_NOT_SUPPORTED
property
bool
_mavlinkCameraAllowsPhotoWhileRecording
:
false
property
bool
_mavlinkCameraCanShoot
:
(
!
_mavlinkCameraModeUndefined
&&
((
_mavlinkCameraStorageReady
&&
_mavlinkCamera
.
storageFree
>
0
)
||
_mavlinkCameraStorageSupported
))
||
_videoStreamManager
.
streaming
property
bool
_mavlinkCameraIsShooting
:
((
_mavlinkCameraInVideoMode
&&
_mavlinkCameraVideoIsRecording
)
||
(
_mavlinkCameraInPhotoMode
&&
!
_mavlinkCameraPhotoCaptureIsIdle
))
||
_videoStreamManager
.
recording
// The following settings and functions unify between a mavlink camera and a simple video stream for simple access
property
bool
_anyVideoStreamAvailable
:
_videoStreamManager
.
hasVideo
property
string
_mavlinkCameraName
:
_mavlinkCamera
?
(
_multipleMavlinkCameras
?
_mavlinkCamera
.
modelName
:
""
)
:
qsTr
(
"
Video Stream
"
)
property
bool
_showModeIndicator
:
_mavlinkCamera
?
_mavlinkCameraHasModes
:
_onlyVideoStreamAvailable
property
bool
_modeIndicatorPhotoMode
:
_mavlinkCamera
?
_mavlinkCameraInPhotoMode
:
_videoStreamInPhotoMode
property
bool
_allowsPhotoWhileRecording
:
_mavlinkCamera
?
_mavlinkCameraAllowsPhotoWhileRecording
:
_videoStreamAllowsPhotoWhileRecording
property
bool
_switchToPhotoModeAllowed
:
!
_modeIndicatorPhotoMode
&&
(
_mavlinkCamera
?
!
_mavlinkCameraIsShooting
:
true
)
property
bool
_switchToVideoModeAllowed
:
_modeIndicatorPhotoMode
&&
(
_mavlinkCamera
?
!
_mavlinkCameraIsShooting
:
true
)
property
bool
_videoIsRecording
:
_mavlinkCamera
?
_mavlinkCameraIsShooting
:
_videoStreamRecording
property
bool
_canShootInCurrentMode
:
_mavlinkCamera
?
_mavlinkCameraCanShoot
:
_videoStreamCanShoot
property
bool
_isShootingInCurrentMode
:
_mavlinkCamera
?
_mavlinkCameraIsShooting
:
_videoStreamIsShootingInCurrentMode
function
setCameraMode
(
photoMode
)
{
_videoStreamInPhotoMode
=
photoMode
if
(
_mavlinkCamera
)
{
if
(
_mavlinkCameraInPhotoMode
)
{
_mavlinkCamera
.
setVideoMode
()
}
else
{
_mavlinkCamera
.
setPhotoMode
()
}
}
}
function
toggleShooting
()
{
if
(
_mavlinkCamera
)
{
if
(
_mavlinkCameraInVideoMode
)
{
_mavlinkCamera
.
toggleVideo
()
}
else
{
if
(
_mavlinkCameraInPhotoMode
&&
!
_mavlinkCameraPhotoCaptureIsIdle
&&
_mavlinkCameraElapsedMode
)
{
_mavlinkCamera
.
stopTakePhoto
()
}
else
{
_mavlinkCamera
.
takePhoto
()
}
}
}
else
{
if
(
_videoStreamInPhotoMode
)
{
_videoStreamPhotoCaptureIsIdle
=
false
_videoStreamManager
.
grabImage
()
videoStreamPhotoCaptureTimer
.
start
()
}
else
{
if
(
_videoStreamManager
.
recording
)
{
_videoStreamManager
.
stopRecording
()
}
else
{
_videoStreamManager
.
startRecording
()
}
}
}
}
Timer
{
id
:
videoStreamPhotoCaptureTimer
interval
:
500
onTriggered
:
_videoStreamPhotoCaptureIsIdle
=
true
}
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
...
@@ -88,26 +152,28 @@ Rectangle {
...
@@ -88,26 +152,28 @@ Rectangle {
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
spacing
:
ScreenTools
.
defaultFontPixelHeight
/
2
spacing
:
ScreenTools
.
defaultFontPixelHeight
/
2
//-- Photo/Video Mode Selector (Mavlink Cameras only)
// Photo/Video Mode Selector
// IMPORTANT: This control supports both mavlink cameras and simple video streams. Do no reference anything here which is not
// using the unified properties/functions.
Rectangle
{
Rectangle
{
id
:
camMode
Layout.alignment
:
Qt
.
AlignHCenter
Layout.alignment
:
Qt
.
AlignHCenter
width
:
_hasModes
?
ScreenTools
.
defaultFontPixelWidth
*
10
:
0
width
:
ScreenTools
.
defaultFontPixelWidth
*
1
0
height
:
_hasModes
?
width
/
2
:
0
height
:
width
/
2
color
:
qgcPal
.
windowShadeLight
color
:
qgcPal
.
windowShadeLight
radius
:
height
*
0.5
radius
:
height
*
0.5
visible
:
_
hasModes
visible
:
_
showModeIndicator
//-- Video Mode
//-- Video Mode
Rectangle
{
Rectangle
{
width
:
parent
.
height
height
:
parent
.
height
color
:
_cameraInVideoMode
?
qgcPal
.
window
:
qgcPal
.
windowShadeLight
radius
:
height
*
0.5
anchors.left
:
parent
.
left
border.color
:
qgcPal
.
text
border.width
:
_cameraInVideoMode
?
1
:
0
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
width
:
parent
.
height
height
:
parent
.
height
color
:
_modeIndicatorPhotoMode
?
qgcPal
.
windowShadeLight
:
qgcPal
.
window
radius
:
height
*
0.5
anchors.left
:
parent
.
left
border.color
:
qgcPal
.
text
border.width
:
_modeIndicatorPhotoMode
?
0
:
1
QGCColoredImage
{
QGCColoredImage
{
height
:
parent
.
height
*
0.5
height
:
parent
.
height
*
0.5
width
:
height
width
:
height
...
@@ -115,26 +181,24 @@ Rectangle {
...
@@ -115,26 +181,24 @@ Rectangle {
source
:
"
/qmlimages/camera_video.svg
"
source
:
"
/qmlimages/camera_video.svg
"
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
sourceSize.height
:
height
sourceSize.height
:
height
color
:
_
cameraInVideoMode
?
qgcPal
.
colorGreen
:
qgcPal
.
text
color
:
_
modeIndicatorPhotoMode
?
qgcPal
.
text
:
qgcPal
.
colorGreen
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
enabled
:
_cameraInPhotoMode
&&
!
_isShooting
enabled
:
_switchToVideoModeAllowed
onClicked
:
{
onClicked
:
setCameraMode
(
false
)
_camera
.
setVideoMode
()
}
}
}
}
}
}
}
//-- Photo Mode
//-- Photo Mode
Rectangle
{
Rectangle
{
width
:
parent
.
height
height
:
parent
.
height
color
:
_cameraInPhotoMode
?
qgcPal
.
window
:
qgcPal
.
windowShadeLight
radius
:
height
*
0.5
anchors.right
:
parent
.
right
border.color
:
qgcPal
.
text
border.width
:
_cameraInPhotoMode
?
1
:
0
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
width
:
parent
.
height
height
:
parent
.
height
color
:
_modeIndicatorPhotoMode
?
qgcPal
.
window
:
qgcPal
.
windowShadeLight
radius
:
height
*
0.5
anchors.right
:
parent
.
right
border.color
:
qgcPal
.
text
border.width
:
_modeIndicatorPhotoMode
?
1
:
0
QGCColoredImage
{
QGCColoredImage
{
height
:
parent
.
height
*
0.5
height
:
parent
.
height
*
0.5
width
:
height
width
:
height
...
@@ -142,59 +206,40 @@ Rectangle {
...
@@ -142,59 +206,40 @@ Rectangle {
source
:
"
/qmlimages/camera_photo.svg
"
source
:
"
/qmlimages/camera_photo.svg
"
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
sourceSize.height
:
height
sourceSize.height
:
height
color
:
_
cameraIn
PhotoMode
?
qgcPal
.
colorGreen
:
qgcPal
.
text
color
:
_
modeIndicator
PhotoMode
?
qgcPal
.
colorGreen
:
qgcPal
.
text
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
enabled
:
_cameraInVideoMode
&&
!
_isShooting
enabled
:
_switchToPhotoModeAllowed
onClicked
:
{
onClicked
:
setCameraMode
(
true
)
_camera
.
setPhotoMode
()
}
}
}
}
}
}
}
}
}
// Take Photo, Start/Stop Video button
// Take Photo, Start/Stop Video button
// IMPORTANT: This control supports both mavlink cameras and simple video streams. Do no reference anything here which is not
// using the unified properties/functions.
Rectangle
{
Rectangle
{
Layout.alignment
:
Qt
.
AlignHCenter
Layout.alignment
:
Qt
.
AlignHCenter
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0
)
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0
)
width
:
ScreenTools
.
defaultFontPixelWidth
*
6
width
:
ScreenTools
.
defaultFontPixelWidth
*
6
height
:
width
height
:
width
radius
:
width
*
0.5
radius
:
width
*
0.5
visible
:
_camera
||
_anyVideoStreamAvailable
border.color
:
qgcPal
.
buttonText
border.color
:
qgcPal
.
buttonText
border.width
:
3
border.width
:
3
Rectangle
{
Rectangle
{
anchors.centerIn
:
parent
anchors.centerIn
:
parent
width
:
parent
.
width
*
(
_isShooting
?
0.5
:
0.75
)
width
:
parent
.
width
*
(
_isShooting
InCurrentMode
?
0.5
:
0.75
)
height
:
width
height
:
width
radius
:
_isShooting
?
0
:
width
*
0.5
radius
:
_isShooting
InCurrentMode
?
0
:
width
*
0.5
color
:
_canShoot
?
qgcPal
.
colorRed
:
qgcPal
.
colorGrey
color
:
_canShoot
InCurrentMode
?
qgcPal
.
colorRed
:
qgcPal
.
colorGrey
}
}
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
enabled
:
_canShoot
enabled
:
_canShootInCurrentMode
onClicked
:
{
onClicked
:
toggleShooting
()
if
(
_camera
)
{
if
(
_cameraInVideoMode
)
{
_camera
.
toggleVideo
()
}
else
{
if
(
_cameraInPhotoMode
&&
!
_photoIdle
&&
_cameraElapsedMode
)
{
_camera
.
stopTakePhoto
()
}
else
{
_camera
.
takePhoto
()
}
}
}
else
{
if
(
_videoManager
.
recording
)
{
_videoManager
.
stopRecording
()
}
else
{
_videoManager
.
startRecording
()
}
}
}
}
}
}
}
...
@@ -205,32 +250,32 @@ Rectangle {
...
@@ -205,32 +250,32 @@ Rectangle {
QGCLabel
{
QGCLabel
{
Layout.alignment
:
Qt
.
AlignHCenter
Layout.alignment
:
Qt
.
AlignHCenter
text
:
_
c
ameraName
text
:
_
mavlinkC
ameraName
visible
:
_
c
ameraName
!==
""
visible
:
_
mavlinkC
ameraName
!==
""
}
}
QGCLabel
{
QGCLabel
{
Layout.alignment
:
Qt
.
AlignHCenter
Layout.alignment
:
Qt
.
AlignHCenter
text
:
(
_
cameraInVideoMode
&&
_camera
.
videoStatus
===
QGCCameraControl
.
VIDEO_CAPTURE_STATUS_RUNNING
)
?
_c
amera
.
recordTimeStr
:
"
00:00:00
"
text
:
(
_
mavlinkCameraInVideoMode
&&
_mavlinkCamera
.
videoStatus
===
QGCCameraControl
.
VIDEO_CAPTURE_STATUS_RUNNING
)
?
_mavlinkC
amera
.
recordTimeStr
:
"
00:00:00
"
font.pointSize
:
ScreenTools
.
largeFontPointSize
font.pointSize
:
ScreenTools
.
largeFontPointSize
visible
:
_
c
ameraInVideoMode
visible
:
_
mavlinkC
ameraInVideoMode
}
}
QGCLabel
{
QGCLabel
{
Layout.alignment
:
Qt
.
AlignHCenter
Layout.alignment
:
Qt
.
AlignHCenter
text
:
_activeVehicle
&&
_
cameraInPhotoMode
?
(
'
00000
'
+
_activeVehicle
.
cameraTriggerPoints
.
count
).
slice
(
-
5
)
:
"
0000_c
ameraPhotoMode0
"
text
:
_activeVehicle
&&
_
mavlinkCameraInPhotoMode
?
(
'
00000
'
+
_activeVehicle
.
cameraTriggerPoints
.
count
).
slice
(
-
5
)
:
"
0000_mavlinkC
ameraPhotoMode0
"
font.pointSize
:
ScreenTools
.
largeFontPointSize
font.pointSize
:
ScreenTools
.
largeFontPointSize
visible
:
_
c
ameraInPhotoMode
visible
:
_
mavlinkC
ameraInPhotoMode
}
}
QGCLabel
{
QGCLabel
{
Layout.alignment
:
Qt
.
AlignHCenter
Layout.alignment
:
Qt
.
AlignHCenter
text
:
_
camera
?
qsTr
(
"
Free Space:
"
)
+
_c
amera
.
storageFreeStr
:
""
text
:
_
mavlinkCamera
?
qsTr
(
"
Free Space:
"
)
+
_mavlinkC
amera
.
storageFreeStr
:
""
font.pointSize
:
ScreenTools
.
defaultFontPointSize
font.pointSize
:
ScreenTools
.
defaultFontPointSize
visible
:
_
s
torageReady
visible
:
_
mavlinkCameraS
torageReady
}
}
QGCLabel
{
QGCLabel
{
Layout.alignment
:
Qt
.
AlignHCenter
Layout.alignment
:
Qt
.
AlignHCenter
text
:
_
camera
?
qsTr
(
"
Battery:
"
)
+
_c
amera
.
batteryRemainingStr
:
""
text
:
_
mavlinkCamera
?
qsTr
(
"
Battery:
"
)
+
_mavlinkC
amera
.
batteryRemainingStr
:
""
font.pointSize
:
ScreenTools
.
defaultFontPointSize
font.pointSize
:
ScreenTools
.
defaultFontPointSize
visible
:
_
b
atteryReady
visible
:
_
mavlinkCameraB
atteryReady
}
}
}
}
}
}
...
@@ -248,14 +293,14 @@ Rectangle {
...
@@ -248,14 +293,14 @@ Rectangle {
GridLayout
{
GridLayout
{
id
:
gridLayout
id
:
gridLayout
flow
:
GridLayout
.
TopToBottom
flow
:
GridLayout
.
TopToBottom
rows
:
dynamicRows
+
(
_
camera
?
_c
amera
.
activeSettings
.
length
:
0
)
rows
:
dynamicRows
+
(
_
mavlinkCamera
?
_mavlinkC
amera
.
activeSettings
.
length
:
0
)
property
int
dynamicRows
:
10
property
int
dynamicRows
:
10
// First column
// First column
QGCLabel
{
QGCLabel
{
text
:
qsTr
(
"
Camera
"
)
text
:
qsTr
(
"
Camera
"
)
visible
:
_multipleCameras
visible
:
_multiple
Mavlink
Cameras
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
}
}
...
@@ -267,35 +312,34 @@ Rectangle {
...
@@ -267,35 +312,34 @@ Rectangle {
QGCLabel
{
QGCLabel
{
text
:
qsTr
(
"
Thermal View Mode
"
)
text
:
qsTr
(
"
Thermal View Mode
"
)
visible
:
_
h
asThermalVideoStream
visible
:
_
mavlinkCameraH
asThermalVideoStream
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
}
}
QGCLabel
{
QGCLabel
{
text
:
qsTr
(
"
Blend Opacity
"
)
text
:
qsTr
(
"
Blend Opacity
"
)
visible
:
_
hasThermalVideoStream
&&
_c
amera
.
thermalMode
===
QGCCameraControl
.
THERMAL_BLEND
visible
:
_
mavlinkCameraHasThermalVideoStream
&&
_mavlinkC
amera
.
thermalMode
===
QGCCameraControl
.
THERMAL_BLEND
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
}
}
// Mavlink Camera Protocol active settings
// Mavlink Camera Protocol active settings
Repeater
{
Repeater
{
model
:
_
camera
?
_c
amera
.
activeSettings
:
[]
model
:
_
mavlinkCamera
?
_mavlinkC
amera
.
activeSettings
:
[]
QGCLabel
{
QGCLabel
{
text
:
_
c
amera
.
getFact
(
modelData
).
shortDescription
text
:
_
mavlinkC
amera
.
getFact
(
modelData
).
shortDescription
}
}
}
}
QGCLabel
{
QGCLabel
{
text
:
qsTr
(
"
Photo Mode
"
)
text
:
qsTr
(
"
Photo Mode
"
)
visible
:
_
h
asModes
visible
:
_
mavlinkCameraH
asModes
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
}
}
QGCLabel
{
QGCLabel
{
text
:
qsTr
(
"
Photo Interval (seconds)
"
)
text
:
qsTr
(
"
Photo Interval (seconds)
"
)
width
:
_labelFieldWidth
visible
:
_mavlinkCameraInPhotoMode
&&
_mavlinkCamera
.
photoMode
===
QGCCameraControl
.
PHOTO_CAPTURE_TIMELAPSE
visible
:
_cameraInPhotoMode
&&
_camera
.
photoMode
===
QGCCameraControl
.
PHOTO_CAPTURE_TIMELAPSE
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
}
}
...
@@ -313,13 +357,13 @@ Rectangle {
...
@@ -313,13 +357,13 @@ Rectangle {
QGCLabel
{
QGCLabel
{
text
:
qsTr
(
"
Reset Camera Defaults
"
)
text
:
qsTr
(
"
Reset Camera Defaults
"
)
visible
:
_
c
amera
visible
:
_
mavlinkC
amera
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
}
}
QGCLabel
{
QGCLabel
{
text
:
qsTr
(
"
Storage
"
)
text
:
qsTr
(
"
Storage
"
)
visible
:
_
s
torageSupported
visible
:
_
mavlinkCameraS
torageSupported
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
}
}
...
@@ -327,49 +371,49 @@ Rectangle {
...
@@ -327,49 +371,49 @@ Rectangle {
QGCComboBox
{
QGCComboBox
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
sizeToContents
:
true
sizeToContents
:
true
model
:
_
cameraManager
?
_c
ameraManager
.
cameraLabels
:
[]
model
:
_
mavlinkCameraManager
?
_mavlinkC
ameraManager
.
cameraLabels
:
[]
currentIndex
:
_
c
urCameraIndex
currentIndex
:
_
mavlinkCameraManagerC
urCameraIndex
visible
:
_multipleCameras
visible
:
_multiple
Mavlink
Cameras
onActivated
:
_
c
ameraManager
.
currentCamera
=
index
onActivated
:
_
mavlinkC
ameraManager
.
currentCamera
=
index
}
}
QGCComboBox
{
QGCComboBox
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
sizeToContents
:
true
sizeToContents
:
true
model
:
_
camera
?
_c
amera
.
streamLabels
:
[]
model
:
_
mavlinkCamera
?
_mavlinkC
amera
.
streamLabels
:
[]
currentIndex
:
_
c
urStreamIndex
currentIndex
:
_
mavlinCameraC
urStreamIndex
visible
:
_multipleMavlinkCameraStreams
visible
:
_multipleMavlinkCameraStreams
onActivated
:
_
c
amera
.
currentStream
=
index
onActivated
:
_
mavlinkC
amera
.
currentStream
=
index
}
}
QGCComboBox
{
QGCComboBox
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
sizeToContents
:
true
sizeToContents
:
true
model
:
[
qsTr
(
"
Off
"
),
qsTr
(
"
Blend
"
),
qsTr
(
"
Full
"
),
qsTr
(
"
Picture In Picture
"
)
]
model
:
[
qsTr
(
"
Off
"
),
qsTr
(
"
Blend
"
),
qsTr
(
"
Full
"
),
qsTr
(
"
Picture In Picture
"
)
]
currentIndex
:
_
camera
?
_c
amera
.
thermalMode
:
-
1
currentIndex
:
_
mavlinkCamera
?
_mavlinkC
amera
.
thermalMode
:
-
1
visible
:
_
h
asThermalVideoStream
visible
:
_
mavlinkCameraH
asThermalVideoStream
onActivated
:
_
c
amera
.
thermalMode
=
index
onActivated
:
_
mavlinkC
amera
.
thermalMode
=
index
}
}
QGCSlider
{
QGCSlider
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
maximumValue
:
100
maximumValue
:
100
minimumValue
:
0
minimumValue
:
0
value
:
_
camera
?
_c
amera
.
thermalOpacity
:
0
value
:
_
mavlinkCamera
?
_mavlinkC
amera
.
thermalOpacity
:
0
updateValueWhileDragging
:
true
updateValueWhileDragging
:
true
visible
:
_
hasThermalVideoStream
&&
_c
amera
.
thermalMode
===
QGCCameraControl
.
THERMAL_BLEND
visible
:
_
mavlinkCameraHasThermalVideoStream
&&
_mavlinkC
amera
.
thermalMode
===
QGCCameraControl
.
THERMAL_BLEND
onValueChanged
:
_
c
amera
.
thermalOpacity
=
value
onValueChanged
:
_
mavlinkC
amera
.
thermalOpacity
=
value
}
}
// Mavlink Camera Protocol active settings
// Mavlink Camera Protocol active settings
Repeater
{
Repeater
{
model
:
_
camera
?
_c
amera
.
activeSettings
:
[]
model
:
_
mavlinkCamera
?
_mavlinkC
amera
.
activeSettings
:
[]
RowLayout
{
RowLayout
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
spacing
:
ScreenTools
.
defaultFontPixelWidth
spacing
:
ScreenTools
.
defaultFontPixelWidth
property
var
_fact
:
_
c
amera
.
getFact
(
modelData
)
property
var
_fact
:
_
mavlinkC
amera
.
getFact
(
modelData
)
property
bool
_isBool
:
_fact
.
typeIsBool
property
bool
_isBool
:
_fact
.
typeIsBool
property
bool
_isCombo
:
!
_isBool
&&
_fact
.
enumStrings
.
length
>
0
property
bool
_isCombo
:
!
_isBool
&&
_fact
.
enumStrings
.
length
>
0
property
bool
_isSlider
:
_fact
&&
!
isNaN
(
_fact
.
increment
)
property
bool
_isSlider
:
_fact
&&
!
isNaN
(
_fact
.
increment
)
...
@@ -409,9 +453,9 @@ Rectangle {
...
@@ -409,9 +453,9 @@ Rectangle {
Layout.fillWidth
:
true
Layout.fillWidth
:
true
sizeToContents
:
true
sizeToContents
:
true
model
:
[
qsTr
(
"
Single
"
),
qsTr
(
"
Time Lapse
"
)
]
model
:
[
qsTr
(
"
Single
"
),
qsTr
(
"
Time Lapse
"
)
]
currentIndex
:
_
camera
?
_c
amera
.
photoMode
:
0
currentIndex
:
_
mavlinkCamera
?
_mavlinkC
amera
.
photoMode
:
0
visible
:
_
h
asModes
visible
:
_
mavlinkCameraH
asModes
onActivated
:
_
c
amera
.
photoMode
=
index
onActivated
:
_
mavlinkC
amera
.
photoMode
=
index
}
}
QGCSlider
{
QGCSlider
{
...
@@ -419,27 +463,27 @@ Rectangle {
...
@@ -419,27 +463,27 @@ Rectangle {
maximumValue
:
60
maximumValue
:
60
minimumValue
:
1
minimumValue
:
1
stepSize
:
1
stepSize
:
1
value
:
_
camera
?
_c
amera
.
photoLapse
:
5
value
:
_
mavlinkCamera
?
_mavlinkC
amera
.
photoLapse
:
5
displayValue
:
true
displayValue
:
true
updateValueWhileDragging
:
true
updateValueWhileDragging
:
true
visible
:
_
cameraInPhotoMode
&&
_c
amera
.
photoMode
===
QGCCameraControl
.
PHOTO_CAPTURE_TIMELAPSE
visible
:
_
mavlinkCameraInPhotoMode
&&
_mavlinkC
amera
.
photoMode
===
QGCCameraControl
.
PHOTO_CAPTURE_TIMELAPSE
onValueChanged
:
{
onValueChanged
:
{
if
(
_
c
amera
)
{
if
(
_
mavlinkC
amera
)
{
_
c
amera
.
photoLapse
=
value
_
mavlinkC
amera
.
photoLapse
=
value
}
}
}
}
}
}
QGCSwitch
{
QGCSwitch
{
checked
:
_videoSettings
.
gridLines
.
rawValue
checked
:
_videoS
treamS
ettings
.
gridLines
.
rawValue
visible
:
_anyVideoStreamAvailable
visible
:
_anyVideoStreamAvailable
onClicked
:
_videoSettings
.
gridLines
.
rawValue
=
checked
?
1
:
0
onClicked
:
_videoS
treamS
ettings
.
gridLines
.
rawValue
=
checked
?
1
:
0
}
}
FactComboBox
{
FactComboBox
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
sizeToContents
:
true
sizeToContents
:
true
fact
:
_videoSettings
.
videoFit
fact
:
_videoS
treamS
ettings
.
videoFit
indexModel
:
false
indexModel
:
false
visible
:
_anyVideoStreamAvailable
visible
:
_anyVideoStreamAvailable
}
}
...
@@ -447,7 +491,7 @@ Rectangle {
...
@@ -447,7 +491,7 @@ Rectangle {
QGCButton
{
QGCButton
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
text
:
qsTr
(
"
Reset
"
)
text
:
qsTr
(
"
Reset
"
)
visible
:
_
c
amera
visible
:
_
mavlinkC
amera
onClicked
:
resetPrompt
.
open
()
onClicked
:
resetPrompt
.
open
()
MessageDialog
{
MessageDialog
{
id
:
resetPrompt
id
:
resetPrompt
...
@@ -456,7 +500,7 @@ Rectangle {
...
@@ -456,7 +500,7 @@ Rectangle {
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
onNo
:
resetPrompt
.
close
()
onNo
:
resetPrompt
.
close
()
onYes
:
{
onYes
:
{
_
c
amera
.
resetSettings
()
_
mavlinkC
amera
.
resetSettings
()
resetPrompt
.
close
()
resetPrompt
.
close
()
}
}
}
}
...
@@ -465,7 +509,7 @@ Rectangle {
...
@@ -465,7 +509,7 @@ Rectangle {
QGCButton
{
QGCButton
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
text
:
qsTr
(
"
Format
"
)
text
:
qsTr
(
"
Format
"
)
visible
:
_
s
torageSupported
visible
:
_
mavlinkCameraS
torageSupported
onClicked
:
formatPrompt
.
open
()
onClicked
:
formatPrompt
.
open
()
MessageDialog
{
MessageDialog
{
id
:
formatPrompt
id
:
formatPrompt
...
@@ -474,7 +518,7 @@ Rectangle {
...
@@ -474,7 +518,7 @@ Rectangle {
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
onNo
:
formatPrompt
.
close
()
onNo
:
formatPrompt
.
close
()
onYes
:
{
onYes
:
{
_
c
amera
.
formatCard
()
_
mavlinkC
amera
.
formatCard
()
formatPrompt
.
close
()
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