QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
APMGimbalComponent.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3
4import QGroundControl
5import QGroundControl.Controls
6import QGroundControl.AutoPilotPlugins.APM
7
8SetupPage {
9 pageComponent: mainComponent
10
11 property real _verticalSpacing: ScreenTools.defaultFontPixelHeight / 2
12 property real _horizontalSpacing: ScreenTools.defaultFontPixelWidth * 2
13
14 APMGimbalParams { id: gimbalParams; instance: 1 }
15
16 Component {
17 id: mainComponent
18
19 Loader {
20 sourceComponent: gimbalParams.instanceCount > 0 ? baseComponent : notSupportedComponent
21 }
22 }
23
24 Component {
25 id: baseComponent
26
27 ColumnLayout {
28 spacing: _verticalSpacing
29
30 QGCTabBar {
31 id: tabBar
32 width: availableWidth
33 currentIndex: 0
34 visible: gimbalParams.instanceCount > 1
35
36 QGCTabButton {
37 text: qsTr("Gimbal 1")
38 }
39
40 QGCTabButton {
41 text: qsTr("Gimbal 2")
42 }
43 }
44
45 APMGimbalInstance {
46 instance: 1
47 verticalSpacing: _verticalSpacing
48 horizontalSpacing: _horizontalSpacing
49 visible: tabBar.currentIndex === 0
50 }
51
52 Loader {
53 id: gimbal2Loader
54 sourceComponent: gimbalParams.instanceCount > 1 ? gimbal2Component : null
55 visible: tabBar.currentIndex === 1
56 }
57 }
58 }
59
60 Component {
61 id: gimbal2Component
62
63 APMGimbalInstance {
64 instance: 2
65 verticalSpacing: _verticalSpacing
66 horizontalSpacing: _horizontalSpacing
67 }
68 }
69
70 Component {
71 id: notSupportedComponent
72
73 QGCLabel {
74 text: qsTr("Gimbal settings are not available for this firmware version.")
75 horizontalAlignment: Text.AlignHCenter
76 verticalAlignment: Text.AlignVCenter
77 font.pointSize: ScreenTools.largeFontPointSize
78 wrapMode: Text.WordWrap
79 width: availableWidth
80 height: availableHeight
81 }
82 }
83}