6import QGroundControl.Controls
7import QGroundControl.FactControls
9// Camera calculator "Grid" section for mission item editors
13 property var cameraCalc
14 property bool vehicleFlightIsFrontal: true
15 property string distanceToSurfaceLabel
16 property string frontalDistanceLabel
17 property string sideDistanceLabel
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
24 readonly property int _gridTypeManual: 0
25 readonly property int _gridTypeCustomCamera: 1
26 readonly property int _gridTypeCamera: 2
28 QGCPalette { id: qgcPal; colorGroupEnabled: true }
31 anchors.left: parent.left
32 anchors.right: parent.right
34 visible: !cameraCalc.isManualCamera
37 anchors.left: parent.left
38 anchors.right: parent.right
40 Item { Layout.fillWidth: true }
42 Layout.preferredWidth: _root._fieldWidth
43 text: qsTr("Front Lap")
46 Layout.preferredWidth: _root._fieldWidth
47 text: qsTr("Side Lap")
52 anchors.left: parent.left
53 anchors.right: parent.right
55 QGCLabel { text: qsTr("Overlap"); Layout.fillWidth: true }
57 Layout.preferredWidth: _root._fieldWidth
58 fact: cameraCalc.frontalOverlap
61 Layout.preferredWidth: _root._fieldWidth
62 fact: cameraCalc.sideOverlap
67 wrapMode: Text.WordWrap
68 text: qsTr("Select one:")
69 Layout.preferredWidth: parent.width
74 anchors.left: parent.left
75 anchors.right: parent.right
76 columnSpacing: _margin
81 id: fixedDistanceRadio
83 text: distanceToSurfaceLabel
84 checked: !!cameraCalc.valueSetIsDistance.value
85 onClicked: cameraCalc.valueSetIsDistance.value = 1
88 AltitudeFactTextField {
89 fact: cameraCalc.distanceToSurface
90 altitudeMode: cameraCalc.distanceMode
91 enabled: fixedDistanceRadio.checked
92 Layout.fillWidth: true
96 id: fixedImageDensityRadio
98 text: qsTr("Grnd Res")
99 checked: !cameraCalc.valueSetIsDistance.value
100 onClicked: cameraCalc.valueSetIsDistance.value = 0
104 fact: cameraCalc.imageDensity
105 enabled: fixedImageDensityRadio.checked
106 Layout.fillWidth: true
109 } // Column - Camera spec based ui
113 anchors.left: parent.left
114 anchors.right: parent.right
115 columnSpacing: _margin
118 visible: cameraCalc.isManualCamera
120 QGCLabel { text: distanceToSurfaceLabel }
121 AltitudeFactTextField {
122 fact: cameraCalc.distanceToSurface
123 altitudeMode: cameraCalc.distanceMode
124 Layout.fillWidth: true
127 QGCLabel { text: frontalDistanceLabel }
129 Layout.fillWidth: true
130 fact: cameraCalc.adjustedFootprintFrontal
133 QGCLabel { text: sideDistanceLabel }
135 Layout.fillWidth: true
136 fact: cameraCalc.adjustedFootprintSide