QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
UVCStatsGroup.qml
Go to the documentation of this file.
1import QtQuick
2
3import QGroundControl
4import QGroundControl.Controls
5
6import "VideoStreamFormat.js" as VideoStreamFormat
7
8// The health of the USB camera on display, from its monitor; shown only while the camera is measured.
9QGCGroupBox {
10 id: root
11
12 required property UVCStreamMonitor monitor
13 /// The camera's name; no row for an empty one.
14 property string cameraName
15
16 readonly property videoStreamStats _stats: monitor.stats
17 readonly property size _videoSize: monitor.videoSize
18 readonly property real _cameraFps: monitor.cameraFrameRate
19 readonly property string _fpsText: qsTr("%1 fps").arg(_stats.fps.toFixed(1))
20
21 heading: qsTr("USB Camera")
22 visible: _stats.valid
23
24 LabelledLabel {
25 label: qsTr("Camera")
26 labelText: root.cameraName
27 visible: labelText !== ""
28 }
29
30 LabelledLabel {
31 label: qsTr("Frame rate")
32 labelText: root._cameraFps > 0 ? qsTr("%1 (camera %2 fps)").arg(root._fpsText).arg(root._cameraFps.toFixed(0))
33 : root._fpsText
34 }
35
36 LabelledLabel {
37 label: qsTr("Video")
38 labelText: qsTr("%1 × %2 %3").arg(root._videoSize.width).arg(root._videoSize.height).arg(root._stats.codec)
39 visible: root._videoSize.width > 0
40 }
41
42 LabelledLabel {
43 label: qsTr("Display path")
44 labelText: root._stats.gpuPath
45 }
46
47 LabelledLabel {
48 label: qsTr("Uptime")
49 labelText: VideoStreamFormat.durationText(root._stats.uptimeMs)
50 }
51}