QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
CameraCalcGrid.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 calculator "Grid" section for mission item editors
10Column {
11 spacing: _margin
12
13 property var cameraCalc
14 property bool vehicleFlightIsFrontal: true
15 property string distanceToSurfaceLabel
16 property string frontalDistanceLabel
17 property string sideDistanceLabel
18
19 property real _margin: ScreenTools.defaultFontPixelWidth / 2
20 property real _fieldWidth: ScreenTools.defaultFontPixelWidth * 10.5
21 property var _vehicle: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle : QGroundControl.multiVehicleManager.offlineEditingVehicle
22 property bool _cameraComboFilled: false
23
24 readonly property int _gridTypeManual: 0
25 readonly property int _gridTypeCustomCamera: 1
26 readonly property int _gridTypeCamera: 2
27
28 QGCPalette { id: qgcPal; colorGroupEnabled: true }
29
30 Column {
31 anchors.left: parent.left
32 anchors.right: parent.right
33 spacing: _margin
34 visible: !cameraCalc.isManualCamera
35
36 RowLayout {
37 anchors.left: parent.left
38 anchors.right: parent.right
39 spacing: _margin
40 Item { Layout.fillWidth: true }
41 QGCLabel {
42 Layout.preferredWidth: _root._fieldWidth
43 text: qsTr("Front Lap")
44 }
45 QGCLabel {
46 Layout.preferredWidth: _root._fieldWidth
47 text: qsTr("Side Lap")
48 }
49 }
50
51 RowLayout {
52 anchors.left: parent.left
53 anchors.right: parent.right
54 spacing: _margin
55 QGCLabel { text: qsTr("Overlap"); Layout.fillWidth: true }
56 FactTextField {
57 Layout.preferredWidth: _root._fieldWidth
58 fact: cameraCalc.frontalOverlap
59 }
60 FactTextField {
61 Layout.preferredWidth: _root._fieldWidth
62 fact: cameraCalc.sideOverlap
63 }
64 }
65
66 QGCLabel {
67 wrapMode: Text.WordWrap
68 text: qsTr("Select one:")
69 Layout.preferredWidth: parent.width
70 Layout.columnSpan: 2
71 }
72
73 GridLayout {
74 anchors.left: parent.left
75 anchors.right: parent.right
76 columnSpacing: _margin
77 rowSpacing: _margin
78 columns: 2
79
80 QGCRadioButton {
81 id: fixedDistanceRadio
82 leftPadding: 0
83 text: distanceToSurfaceLabel
84 checked: !!cameraCalc.valueSetIsDistance.value
85 onClicked: cameraCalc.valueSetIsDistance.value = 1
86 }
87
88 AltitudeFactTextField {
89 fact: cameraCalc.distanceToSurface
90 altitudeMode: cameraCalc.distanceMode
91 enabled: fixedDistanceRadio.checked
92 Layout.fillWidth: true
93 }
94
95 QGCRadioButton {
96 id: fixedImageDensityRadio
97 leftPadding: 0
98 text: qsTr("Grnd Res")
99 checked: !cameraCalc.valueSetIsDistance.value
100 onClicked: cameraCalc.valueSetIsDistance.value = 0
101 }
102
103 FactTextField {
104 fact: cameraCalc.imageDensity
105 enabled: fixedImageDensityRadio.checked
106 Layout.fillWidth: true
107 }
108 }
109 } // Column - Camera spec based ui
110
111 // No camera spec ui
112 GridLayout {
113 anchors.left: parent.left
114 anchors.right: parent.right
115 columnSpacing: _margin
116 rowSpacing: _margin
117 columns: 2
118 visible: cameraCalc.isManualCamera
119
120 QGCLabel { text: distanceToSurfaceLabel }
121 AltitudeFactTextField {
122 fact: cameraCalc.distanceToSurface
123 altitudeMode: cameraCalc.distanceMode
124 Layout.fillWidth: true
125 }
126
127 QGCLabel { text: frontalDistanceLabel }
128 FactTextField {
129 Layout.fillWidth: true
130 fact: cameraCalc.adjustedFootprintFrontal
131 }
132
133 QGCLabel { text: sideDistanceLabel }
134 FactTextField {
135 Layout.fillWidth: true
136 fact: cameraCalc.adjustedFootprintSide
137 }
138 } // GridLayout
139} // Column