QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
VideoSourceStats.qml
Go to the documentation of this file.
1pragma ComponentBehavior: Bound
2
3import QtQuick
4import QtQuick.Layouts
5
6import QGroundControl
7import QGroundControl.Controls
8
9// The health of the video sources, one group for each that is measured, or a note that none is.
10ColumnLayout {
11 id: root
12
13 /// The manager whose sources are shown.
14 property VideoManager videoManager: QGroundControl.videoManager
15
16 spacing: ScreenTools.defaultFontPixelHeight / 4
17
18 Repeater {
19 model: root.videoManager.sources
20
21 Loader {
22 id: groupLoader
23
24 required property VideoStreamController modelData
25
26 // The loader of a group that hides itself would still take a row.
27 visible: groupLoader.modelData.stats.valid
28 sourceComponent: groupLoader.modelData.role === VideoSourceRole.Camera ? cameraGroupComponent
29 : streamGroupComponent
30 Layout.fillWidth: true
31
32 Component {
33 id: streamGroupComponent
34
35 VideoStreamStatsGroup {
36 // A stream in a tile goes by its name.
37 heading: groupLoader.modelData.tile ? groupLoader.modelData.displayName
38 : (groupLoader.modelData.role === VideoSourceRole.Thermal ? qsTr("Thermal")
39 : qsTr("Video"))
40 stream: groupLoader.modelData
41 }
42 }
43
44 Component {
45 id: cameraGroupComponent
46
47 UVCStatsGroup {
48 monitor: root.videoManager.uvcCamera.monitor
49 cameraName: groupLoader.modelData.displayName
50 }
51 }
52 }
53 }
54
55 QGCLabel {
56 text: qsTr("No video stream")
57 visible: !root.videoManager.measuredSource.stats.valid
58 }
59}