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 required property var missionItem
12
13 property alias buttonGroup: cameraSectionHeader.buttonGroup
14 property alias showSpacer: cameraSectionHeader.showSpacer
15 property alias checked: cameraSectionHeader.checked
16 property bool showSectionHeader: true
17
18 spacing: _margin
19
20 property var _camera: missionItem.cameraSection
21 property real _fieldWidth: ScreenTools.defaultFontPixelWidth * 16
22 property real _margin: ScreenTools.defaultFontPixelWidth / 2
23
24 SectionHeader {
25 id: cameraSectionHeader
26 width: parent.width
27 text: qsTr("Camera")
28 checked: false
29 visible: showSectionHeader
30 }
31
32 Column {
33 width: parent.width
34 spacing: _margin
35 visible: !showSectionHeader || cameraSectionHeader.checked
36
37 LabelledFactComboBox {
38 id: cameraActionCombo
39 width: parent.width
40 label: qsTr("Action")
41 fact: _camera.cameraAction
42 indexModel: false
43 }
44
45 LabelledFactTextField {
46 width: parent.width
47 label: qsTr("Time")
48 fact: _camera.cameraPhotoIntervalTime
49 visible: _camera.cameraAction.rawValue === 1
50 }
51
52 LabelledFactTextField {
53 width: parent.width
54 label: qsTr("Distance")
55 fact: _camera.cameraPhotoIntervalDistance
56 visible: _camera.cameraAction.rawValue === 2
57 }
58
59 RowLayout {
60 width: parent.width
61 spacing: ScreenTools.defaultFontPixelWidth
62 visible: _camera.cameraModeSupported
63
64 QGCCheckBox {
65 id: modeCheckBox
66 text: qsTr("Mode")
67 checked: _camera.specifyCameraMode
68 onClicked: _camera.specifyCameraMode = checked
69 }
70
71 FactComboBox {
72 fact: _camera.cameraMode
73 indexModel: false
74 enabled: modeCheckBox.checked
75 Layout.fillWidth: true
76 }
77 }
78
79 QGCCheckBox {
80 id: gimbalCheckBox
81 text: qsTr("Gimbal")
82 checked: _camera.specifyGimbal
83 onClicked: _camera.specifyGimbal = checked
84 }
85
86 FactTextFieldSlider {
87 width: parent.width
88 label: qsTr("Pitch")
89 fact: _camera.gimbalPitch
90 enabled: gimbalCheckBox.checked
91 }
92
93 FactTextFieldSlider {
94 width: parent.width
95 label: qsTr("Yaw")
96 fact: _camera.gimbalYaw
97 enabled: gimbalCheckBox.checked
98 }
99 }
100}