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 {
height
:
mainLayout
.
height
+
(
_margins
*
2
)
color
:
"
#80000000
"
radius
:
_margins
visible
:
!
QGroundControl
.
settingsManager
.
flyViewSettings
.
alternateInstrumentPanel
.
rawValue
&&
(
_camera
||
_anyVideoStreamAvailable
)
&&
multiVehiclePanelSelector
.
showSingleVehiclePanel
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
_cameraManager
:
_activeVehicle
?
_activeVehicle
.
cameraManager
:
null
property
var
_videoManager
:
QGroundControl
.
videoManager
property
bool
_noCameras
:
_cameraManager
?
_cameraManager
.
cameras
.
count
===
0
:
true
property
bool
_multipleCameras
:
_cameraManager
?
_cameraManager
.
cameras
.
count
>
1
:
false
property
bool
_noMavlinkCameraStreams
:
_camera
?
_camera
.
streamLabels
.
length
:
true
property
bool
_multipleMavlinkCameraStreams
:
_camera
?
_camera
.
streamLabels
.
length
>
1
:
false
property
bool
_anyVideoStreamAvailable
:
_videoManager
.
hasVideo
property
int
_curCameraIndex
:
_cameraManager
?
_cameraManager
.
currentCamera
:
-
1
property
int
_curStreamIndex
:
_camera
?
_camera
.
currentStream
:
-
1
property
var
_camera
:
!
_noCameras
?
(
_cameraManager
.
cameras
.
get
(
_curCameraIndex
)
&&
_cameraManager
.
cameras
.
get
(
_curCameraIndex
).
paramComplete
?
_cameraManager
.
cameras
.
get
(
_curCameraIndex
)
:
null
)
:
null
property
string
_cameraName
:
_camera
?
(
_multipleCameras
?
_camera
.
modelName
:
""
)
:
qsTr
(
"
Video Stream
"
)
property
bool
_hasThermalVideoStream
:
_camera
?
_camera
.
thermalStreamInstance
:
false
property
bool
_cameraModeUndefined
:
_camera
?
_camera
.
cameraMode
===
QGCCameraControl
.
CAM_MODE_UNDEFINED
:
true
property
bool
_cameraInVideoMode
:
_camera
?
_camera
.
cameraMode
===
QGCCameraControl
.
CAM_MODE_VIDEO
:
false
property
bool
_cameraInPhotoMode
:
_camera
?
_camera
.
cameraMode
===
QGCCameraControl
.
CAM_MODE_PHOTO
:
false
property
bool
_cameraElapsedMode
:
_camera
&&
_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
:
_camera
&&
_camera
.
hasModes
property
bool
_videoRecording
:
_camera
&&
_camera
.
videoStatus
===
QGCCameraControl
.
VIDEO_CAPTURE_STATUS_RUNNING
property
bool
_photoIdle
:
_camera
&&
(
_camera
.
photoStatus
===
QGCCameraControl
.
PHOTO_CAPTURE_IDLE
||
_camera
.
photoStatus
>=
QGCCameraControl
.
PHOTO_CAPTURE_LAST
)
property
bool
_storageReady
:
_camera
&&
_camera
.
storageStatus
===
QGCCameraControl
.
STORAGE_READY
property
bool
_batteryReady
:
_camera
&&
_camera
.
batteryRemaining
>=
0
property
bool
_storageSupported
:
_camera
&&
_camera
.
storageStatus
===
QGCCameraControl
.
STORAGE_NOT_SUPPORTED
property
bool
_canShoot
:
(
!
_cameraModeUndefined
&&
((
_storageReady
&&
_camera
.
storageFree
>
0
)
||
_storageSupported
))
||
_videoManager
.
streaming
property
bool
_isShooting
:
((
_cameraInVideoMode
&&
_videoRecording
)
||
(
_cameraInPhotoMode
&&
!
_photoIdle
))
||
_videoManager
.
recording
property
var
_videoSettings
:
QGroundControl
.
settingsManager
.
videoSettings
visible
:
!
QGroundControl
.
settingsManager
.
flyViewSettings
.
alternateInstrumentPanel
.
rawValue
&&
(
_mavlinkCamera
||
_videoStreamAvailable
)
&&
multiVehiclePanelSelector
.
showSingleVehiclePanel
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
// The following properties relate to a simple video stream
property
bool
_videoStreamAvailable
:
_videoStreamManager
.
hasVideo
property
var
_videoStreamSettings
:
QGroundControl
.
settingsManager
.
videoSettings
property
var
_videoStreamManager
:
QGroundControl
.
videoManager
property
bool
_videoStreamAllowsPhotoWhileRecording
:
true
property
bool
_videoStreamIsStreaming
:
_videoStreamManager
.
streaming
property
bool
_videoStreamPhotoCaptureIsIdle
:
true
property
bool
_videoStreamRecording
:
_videoStreamManager
.
recording
property
bool
_videoStreamCanShoot
:
_videoStreamIsStreaming
property
bool
_videoStreamIsShootingInCurrentMode
:
_videoStreamInPhotoMode
?
!
_videoStreamPhotoCaptureIsIdle
:
_videoStreamRecording
property
bool
_videoStreamInPhotoMode
:
false
property
bool
_onlyVideoStreamAvailable
:
!
_mavlinkCamera
&&
_videoStreamManager
.
hasVideo
// The following properties relate to a mavlink protocol camera
property
var
_mavlinkCameraManager
:
_activeVehicle
?
_activeVehicle
.
cameraManager
:
null
property
int
_mavlinkCameraManagerCurCameraIndex
:
_mavlinkCameraManager
?
_mavlinkCameraManager
.
currentCamera
:
-
1
property
bool
_noMavlinkCameras
:
_mavlinkCameraManager
?
_mavlinkCameraManager
.
cameras
.
count
===
0
:
true
property
var
_mavlinkCamera
:
!
_noMavlinkCameras
?
(
_mavlinkCameraManager
.
cameras
.
get
(
_mavlinkCameraManagerCurCameraIndex
)
&&
_mavlinkCameraManager
.
cameras
.
get
(
_mavlinkCameraManagerCurCameraIndex
).
paramComplete
?
_mavlinkCameraManager
.
cameras
.
get
(
_mavlinkCameraManagerCurCameraIndex
)
:
null
)
:
null
property
bool
_multipleMavlinkCameras
:
_mavlinkCameraManager
?
_mavlinkCameraManager
.
cameras
.
count
>
1
:
false
property
bool
_noMavlinkCameraStreams
:
_mavlinkCamera
?
_mavlinkCamera
.
streamLabels
.
length
:
true
property
bool
_multipleMavlinkCameraStreams
:
_mavlinkCamera
?
_mavlinkCamera
.
streamLabels
.
length
>
1
:
false
property
int
_mavlinCameraCurStreamIndex
:
_mavlinkCamera
?
_mavlinkCamera
.
currentStream
:
-
1
property
bool
_mavlinkCameraHasThermalVideoStream
:
_mavlinkCamera
?
_mavlinkCamera
.
thermalStreamInstance
:
false
property
bool
_mavlinkCameraModeUndefined
:
_mavlinkCamera
?
_mavlinkCamera
.
cameraMode
===
QGCCameraControl
.
CAM_MODE_UNDEFINED
:
true
property
bool
_mavlinkCameraInVideoMode
:
_mavlinkCamera
?
_mavlinkCamera
.
cameraMode
===
QGCCameraControl
.
CAM_MODE_VIDEO
:
false
property
bool
_mavlinkCameraInPhotoMode
:
_mavlinkCamera
?
_mavlinkCamera
.
cameraMode
===
QGCCameraControl
.
CAM_MODE_PHOTO
:
false
property
bool
_mavlinkCameraElapsedMode
:
_mavlinkCamera
&&
_mavlinkCamera
.
cameraMode
===
QGCCameraControl
.
CAM_MODE_PHOTO
&&
_mavlinkCamera
.
photoMode
===
QGCCameraControl
.
PHOTO_CAPTURE_TIMELAPSE
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
}
...
...
@@ -88,26 +152,28 @@ Rectangle {
anchors.horizontalCenter
:
parent
.
horizontalCenter
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
{
id
:
camMode
Layout.alignment
:
Qt
.
AlignHCenter
width
:
_hasModes
?
ScreenTools
.
defaultFontPixelWidth
*
10
:
0
height
:
_hasModes
?
width
/
2
:
0
width
:
ScreenTools
.
defaultFontPixelWidth
*
1
0
height
:
width
/
2
color
:
qgcPal
.
windowShadeLight
radius
:
height
*
0.5
visible
:
_
hasModes
visible
:
_
showModeIndicator
//-- Video Mode
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
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
{
height
:
parent
.
height
*
0.5
width
:
height
...
...
@@ -115,26 +181,24 @@ Rectangle {
source
:
"
/qmlimages/camera_video.svg
"
fillMode
:
Image
.
PreserveAspectFit
sourceSize.height
:
height
color
:
_
cameraInVideoMode
?
qgcPal
.
colorGreen
:
qgcPal
.
text
color
:
_
modeIndicatorPhotoMode
?
qgcPal
.
text
:
qgcPal
.
colorGreen
MouseArea
{
anchors.fill
:
parent
enabled
:
_cameraInPhotoMode
&&
!
_isShooting
onClicked
:
{
_camera
.
setVideoMode
()
}
enabled
:
_switchToVideoModeAllowed
onClicked
:
setCameraMode
(
false
)
}
}
}
//-- Photo Mode
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
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
{
height
:
parent
.
height
*
0.5
width
:
height
...
...
@@ -142,59 +206,40 @@ Rectangle {
source
:
"
/qmlimages/camera_photo.svg
"
fillMode
:
Image
.
PreserveAspectFit
sourceSize.height
:
height
color
:
_
cameraIn
PhotoMode
?
qgcPal
.
colorGreen
:
qgcPal
.
text
color
:
_
modeIndicator
PhotoMode
?
qgcPal
.
colorGreen
:
qgcPal
.
text
MouseArea
{
anchors.fill
:
parent
enabled
:
_cameraInVideoMode
&&
!
_isShooting
onClicked
:
{
_camera
.
setPhotoMode
()
}
enabled
:
_switchToPhotoModeAllowed
onClicked
:
setCameraMode
(
true
)
}
}
}
}
// 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
{
Layout.alignment
:
Qt
.
AlignHCenter
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0
)
width
:
ScreenTools
.
defaultFontPixelWidth
*
6
height
:
width
radius
:
width
*
0.5
visible
:
_camera
||
_anyVideoStreamAvailable
border.color
:
qgcPal
.
buttonText
border.width
:
3
Rectangle
{
anchors.centerIn
:
parent
width
:
parent
.
width
*
(
_isShooting
?
0.5
:
0.75
)
width
:
parent
.
width
*
(
_isShooting
InCurrentMode
?
0.5
:
0.75
)
height
:
width
radius
:
_isShooting
?
0
:
width
*
0.5
color
:
_canShoot
?
qgcPal
.
colorRed
:
qgcPal
.
colorGrey
radius
:
_isShooting
InCurrentMode
?
0
:
width
*
0.5
color
:
_canShoot
InCurrentMode
?
qgcPal
.
colorRed
:
qgcPal
.
colorGrey
}
MouseArea
{
anchors.fill
:
parent
enabled
:
_canShoot
onClicked
:
{
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
()
}
}
}
enabled
:
_canShootInCurrentMode
onClicked
:
toggleShooting
()
}
}
...
...
@@ -205,32 +250,32 @@ Rectangle {
QGCLabel
{
Layout.alignment
:
Qt
.
AlignHCenter
text
:
_
c
ameraName
visible
:
_
c
ameraName
!==
""
text
:
_
mavlinkC
ameraName
visible
:
_
mavlinkC
ameraName
!==
""
}
QGCLabel
{
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
visible
:
_
c
ameraInVideoMode
visible
:
_
mavlinkC
ameraInVideoMode
}
QGCLabel
{
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
visible
:
_
c
ameraInPhotoMode
visible
:
_
mavlinkC
ameraInPhotoMode
}
QGCLabel
{
Layout.alignment
:
Qt
.
AlignHCenter
text
:
_
camera
?
qsTr
(
"
Free Space:
"
)
+
_c
amera
.
storageFreeStr
:
""
text
:
_
mavlinkCamera
?
qsTr
(
"
Free Space:
"
)
+
_mavlinkC
amera
.
storageFreeStr
:
""
font.pointSize
:
ScreenTools
.
defaultFontPointSize
visible
:
_
s
torageReady
visible
:
_
mavlinkCameraS
torageReady
}
QGCLabel
{
Layout.alignment
:
Qt
.
AlignHCenter
text
:
_
camera
?
qsTr
(
"
Battery:
"
)
+
_c
amera
.
batteryRemainingStr
:
""
text
:
_
mavlinkCamera
?
qsTr
(
"
Battery:
"
)
+
_mavlinkC
amera
.
batteryRemainingStr
:
""
font.pointSize
:
ScreenTools
.
defaultFontPointSize
visible
:
_
b
atteryReady
visible
:
_
mavlinkCameraB
atteryReady
}
}
}
...
...
@@ -248,14 +293,14 @@ Rectangle {
GridLayout
{
id
:
gridLayout
flow
:
GridLayout
.
TopToBottom
rows
:
dynamicRows
+
(
_
camera
?
_c
amera
.
activeSettings
.
length
:
0
)
rows
:
dynamicRows
+
(
_
mavlinkCamera
?
_mavlinkC
amera
.
activeSettings
.
length
:
0
)
property
int
dynamicRows
:
10
// First column
QGCLabel
{
text
:
qsTr
(
"
Camera
"
)
visible
:
_multipleCameras
visible
:
_multiple
Mavlink
Cameras
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
}
...
...
@@ -267,35 +312,34 @@ Rectangle {
QGCLabel
{
text
:
qsTr
(
"
Thermal View Mode
"
)
visible
:
_
h
asThermalVideoStream
visible
:
_
mavlinkCameraH
asThermalVideoStream
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
}
QGCLabel
{
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
}
// Mavlink Camera Protocol active settings
Repeater
{
model
:
_
camera
?
_c
amera
.
activeSettings
:
[]
model
:
_
mavlinkCamera
?
_mavlinkC
amera
.
activeSettings
:
[]
QGCLabel
{
text
:
_
c
amera
.
getFact
(
modelData
).
shortDescription
text
:
_
mavlinkC
amera
.
getFact
(
modelData
).
shortDescription
}
}
QGCLabel
{
text
:
qsTr
(
"
Photo Mode
"
)
visible
:
_
h
asModes
visible
:
_
mavlinkCameraH
asModes
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
}
QGCLabel
{
text
:
qsTr
(
"
Photo Interval (seconds)
"
)
width
:
_labelFieldWidth
visible
:
_cameraInPhotoMode
&&
_camera
.
photoMode
===
QGCCameraControl
.
PHOTO_CAPTURE_TIMELAPSE
visible
:
_mavlinkCameraInPhotoMode
&&
_mavlinkCamera
.
photoMode
===
QGCCameraControl
.
PHOTO_CAPTURE_TIMELAPSE
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
}
...
...
@@ -313,13 +357,13 @@ Rectangle {
QGCLabel
{
text
:
qsTr
(
"
Reset Camera Defaults
"
)
visible
:
_
c
amera
visible
:
_
mavlinkC
amera
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
}
QGCLabel
{
text
:
qsTr
(
"
Storage
"
)
visible
:
_
s
torageSupported
visible
:
_
mavlinkCameraS
torageSupported
onVisibleChanged
:
gridLayout
.
dynamicRows
+=
visible
?
1
:
-
1
}
...
...
@@ -327,49 +371,49 @@ Rectangle {
QGCComboBox
{
Layout.fillWidth
:
true
sizeToContents
:
true
model
:
_
cameraManager
?
_c
ameraManager
.
cameraLabels
:
[]
currentIndex
:
_
c
urCameraIndex
visible
:
_multipleCameras
onActivated
:
_
c
ameraManager
.
currentCamera
=
index
model
:
_
mavlinkCameraManager
?
_mavlinkC
ameraManager
.
cameraLabels
:
[]
currentIndex
:
_
mavlinkCameraManagerC
urCameraIndex
visible
:
_multiple
Mavlink
Cameras
onActivated
:
_
mavlinkC
ameraManager
.
currentCamera
=
index
}
QGCComboBox
{
Layout.fillWidth
:
true
sizeToContents
:
true
model
:
_
camera
?
_c
amera
.
streamLabels
:
[]
currentIndex
:
_
c
urStreamIndex
model
:
_
mavlinkCamera
?
_mavlinkC
amera
.
streamLabels
:
[]
currentIndex
:
_
mavlinCameraC
urStreamIndex
visible
:
_multipleMavlinkCameraStreams
onActivated
:
_
c
amera
.
currentStream
=
index
onActivated
:
_
mavlinkC
amera
.
currentStream
=
index
}
QGCComboBox
{
Layout.fillWidth
:
true
sizeToContents
:
true
model
:
[
qsTr
(
"
Off
"
),
qsTr
(
"
Blend
"
),
qsTr
(
"
Full
"
),
qsTr
(
"
Picture In Picture
"
)
]
currentIndex
:
_
camera
?
_c
amera
.
thermalMode
:
-
1
visible
:
_
h
asThermalVideoStream
onActivated
:
_
c
amera
.
thermalMode
=
index
currentIndex
:
_
mavlinkCamera
?
_mavlinkC
amera
.
thermalMode
:
-
1
visible
:
_
mavlinkCameraH
asThermalVideoStream
onActivated
:
_
mavlinkC
amera
.
thermalMode
=
index
}
QGCSlider
{
Layout.fillWidth
:
true
maximumValue
:
100
minimumValue
:
0
value
:
_
camera
?
_c
amera
.
thermalOpacity
:
0
value
:
_
mavlinkCamera
?
_mavlinkC
amera
.
thermalOpacity
:
0
updateValueWhileDragging
:
true
visible
:
_
hasThermalVideoStream
&&
_c
amera
.
thermalMode
===
QGCCameraControl
.
THERMAL_BLEND
onValueChanged
:
_
c
amera
.
thermalOpacity
=
value
visible
:
_
mavlinkCameraHasThermalVideoStream
&&
_mavlinkC
amera
.
thermalMode
===
QGCCameraControl
.
THERMAL_BLEND
onValueChanged
:
_
mavlinkC
amera
.
thermalOpacity
=
value
}
// Mavlink Camera Protocol active settings
Repeater
{
model
:
_
camera
?
_c
amera
.
activeSettings
:
[]
model
:
_
mavlinkCamera
?
_mavlinkC
amera
.
activeSettings
:
[]
RowLayout
{
Layout.fillWidth
:
true
spacing
:
ScreenTools
.
defaultFontPixelWidth
property
var
_fact
:
_
c
amera
.
getFact
(
modelData
)
property
var
_fact
:
_
mavlinkC
amera
.
getFact
(
modelData
)
property
bool
_isBool
:
_fact
.
typeIsBool
property
bool
_isCombo
:
!
_isBool
&&
_fact
.
enumStrings
.
length
>
0
property
bool
_isSlider
:
_fact
&&
!
isNaN
(
_fact
.
increment
)
...
...
@@ -409,9 +453,9 @@ Rectangle {
Layout.fillWidth
:
true
sizeToContents
:
true
model
:
[
qsTr
(
"
Single
"
),
qsTr
(
"
Time Lapse
"
)
]
currentIndex
:
_
camera
?
_c
amera
.
photoMode
:
0
visible
:
_
h
asModes
onActivated
:
_
c
amera
.
photoMode
=
index
currentIndex
:
_
mavlinkCamera
?
_mavlinkC
amera
.
photoMode
:
0
visible
:
_
mavlinkCameraH
asModes
onActivated
:
_
mavlinkC
amera
.
photoMode
=
index
}
QGCSlider
{
...
...
@@ -419,27 +463,27 @@ Rectangle {
maximumValue
:
60
minimumValue
:
1
stepSize
:
1
value
:
_
camera
?
_c
amera
.
photoLapse
:
5
value
:
_
mavlinkCamera
?
_mavlinkC
amera
.
photoLapse
:
5
displayValue
:
true
updateValueWhileDragging
:
true
visible
:
_
cameraInPhotoMode
&&
_c
amera
.
photoMode
===
QGCCameraControl
.
PHOTO_CAPTURE_TIMELAPSE
visible
:
_
mavlinkCameraInPhotoMode
&&
_mavlinkC
amera
.
photoMode
===
QGCCameraControl
.
PHOTO_CAPTURE_TIMELAPSE
onValueChanged
:
{
if
(
_
c
amera
)
{
_
c
amera
.
photoLapse
=
value
if
(
_
mavlinkC
amera
)
{
_
mavlinkC
amera
.
photoLapse
=
value
}
}
}
QGCSwitch
{
checked
:
_videoSettings
.
gridLines
.
rawValue
checked
:
_videoS
treamS
ettings
.
gridLines
.
rawValue
visible
:
_anyVideoStreamAvailable
onClicked
:
_videoSettings
.
gridLines
.
rawValue
=
checked
?
1
:
0
onClicked
:
_videoS
treamS
ettings
.
gridLines
.
rawValue
=
checked
?
1
:
0
}
FactComboBox
{
Layout.fillWidth
:
true
sizeToContents
:
true
fact
:
_videoSettings
.
videoFit
fact
:
_videoS
treamS
ettings
.
videoFit
indexModel
:
false
visible
:
_anyVideoStreamAvailable
}
...
...
@@ -447,7 +491,7 @@ Rectangle {
QGCButton
{
Layout.fillWidth
:
true
text
:
qsTr
(
"
Reset
"
)
visible
:
_
c
amera
visible
:
_
mavlinkC
amera
onClicked
:
resetPrompt
.
open
()
MessageDialog
{
id
:
resetPrompt
...
...
@@ -456,7 +500,7 @@ Rectangle {
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
onNo
:
resetPrompt
.
close
()
onYes
:
{
_
c
amera
.
resetSettings
()
_
mavlinkC
amera
.
resetSettings
()
resetPrompt
.
close
()
}
}
...
...
@@ -465,7 +509,7 @@ Rectangle {
QGCButton
{
Layout.fillWidth
:
true
text
:
qsTr
(
"
Format
"
)
visible
:
_
s
torageSupported
visible
:
_
mavlinkCameraS
torageSupported
onClicked
:
formatPrompt
.
open
()
MessageDialog
{
id
:
formatPrompt
...
...
@@ -474,7 +518,7 @@ Rectangle {
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
onNo
:
formatPrompt
.
close
()
onYes
:
{
_
c
amera
.
formatCard
()
_
mavlinkC
amera
.
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