QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
CameraSection.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Layouts
4
5import QGroundControl
6import QGroundControl.Controls
7import QGroundControl.FactControls
8
9// Camera section for mission item editors
10Column {
11 property alias buttonGroup: cameraSectionHeader.buttonGroup
12 property alias showSpacer: cameraSectionHeader.showSpacer
13 property alias checked: cameraSectionHeader.checked
14 property bool showSectionHeader: true
15
16 spacing: _margin
17
18 property var _camera: missionItem.cameraSection
19 property real _fieldWidth: ScreenTools.defaultFontPixelWidth * 16
20 property real _margin: ScreenTools.defaultFontPixelWidth / 2
21
22 SectionHeader {
23 id: cameraSectionHeader
24 width: parent.width
25 text: qsTr("Camera")
26 checked: false
27 visible: showSectionHeader
28 }
29
30 Column {
31 width: parent.width
32 spacing: _margin
33 visible: !showSectionHeader || cameraSectionHeader.checked
34
35 LabelledFactComboBox {
36 id: cameraActionCombo
37 width: parent.width
38 label: qsTr("Action")
39 fact: _camera.cameraAction
40 indexModel: false
41 }
42
43 LabelledFactTextField {
44 width: parent.width
45 label: qsTr("Time")
46 fact: _camera.cameraPhotoIntervalTime
47 visible: _camera.cameraAction.rawValue === 1
48 }
49
50 LabelledFactTextField {
51 width: parent.width
52 label: qsTr("Distance")
53 fact: _camera.cameraPhotoIntervalDistance
54 visible: _camera.cameraAction.rawValue === 2
55 }
56
57 RowLayout {
58 width: parent.width
59 spacing: ScreenTools.defaultFontPixelWidth
60 visible: _camera.cameraModeSupported
61
62 QGCCheckBox {
63 id: modeCheckBox
64 text: qsTr("Mode")
65 checked: _camera.specifyCameraMode
66 onClicked: _camera.specifyCameraMode = checked
67 }
68
69 FactComboBox {
70 fact: _camera.cameraMode
71 indexModel: false
72 enabled: modeCheckBox.checked
73 Layout.fillWidth: true
74 }
75 }
76
77 QGCCheckBox {
78 id: gimbalCheckBox
79 text: qsTr("Gimbal")
80 checked: _camera.specifyGimbal
81 onClicked: _camera.specifyGimbal = checked
82 }
83
84 FactTextFieldSlider {
85 width: parent.width
86 label: qsTr("Pitch")
87 fact: _camera.gimbalPitch
88 enabled: gimbalCheckBox.checked
89 }
90
91 FactTextFieldSlider {
92 width: parent.width
93 label: qsTr("Yaw")
94 fact: _camera.gimbalYaw
95 enabled: gimbalCheckBox.checked
96 }
97 }
98}