QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
MainStatusIndicatorOfflinePage.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
9ToolIndicatorPage {
10 id: control
11 showExpand: true
12
13 property var linkConfigs: QGroundControl.linkManager.linkConfigurations
14 property bool noLinks: true
15 property var editingConfig: null
16 property var autoConnectSettings: QGroundControl.settingsManager.autoConnectSettings
17
18 Component.onCompleted: {
19 for (var i = 0; i < linkConfigs.count; i++) {
20 var linkConfig = linkConfigs.get(i)
21 if (!linkConfig.dynamic && !linkConfig.isAutoConnect) {
22 noLinks = false
23 break
24 }
25 }
26 }
27
28 contentComponent: Component {
29 SettingsGroupLayout {
30 heading: qsTr("Select Link to Connect")
31
32 QGCLabel {
33 text: qsTr("No Links Configured")
34 visible: noLinks
35 }
36
37 Repeater {
38 model: linkConfigs
39
40 delegate: QGCButton {
41 Layout.fillWidth: true
42 text: object.name + (object.link ? " (" + qsTr("Connected") + ")" : "")
43 visible: !object.dynamic
44 enabled: !object.link
45 autoExclusive: true
46
47 onClicked: {
48 QGroundControl.linkManager.createConnectedLink(object)
49 mainWindow.closeIndicatorDrawer()
50 }
51 }
52 }
53 }
54 }
55
56 expandedComponent: Component {
57 ColumnLayout {
58 spacing: ScreenTools.defaultFontPixelHeight / 2
59
60 SettingsGroupLayout {
61 LabelledButton {
62 label: qsTr("Communication Links")
63 buttonText: qsTr("Configure")
64
65 onClicked: {
66 // Untranslated page key from SettingsPages.json — do not qsTr()
67 mainWindow.showSettingsTool("Comm Links")
68 mainWindow.closeIndicatorDrawer()
69 }
70 }
71 }
72
73 SettingsGroupLayout {
74 heading: qsTr("AutoConnect")
75 visible: autoConnectSettings.userVisible
76
77 Repeater {
78 id: autoConnectRepeater
79
80 model: [
81 autoConnectSettings.autoConnectPixhawk,
82 autoConnectSettings.autoConnectSiKRadio,
83 autoConnectSettings.autoConnectLibrePilot,
84 autoConnectSettings.autoConnectUDP,
85 ]
86
87 property var names: [ qsTr("Pixhawk"), qsTr("SiK Radio"), qsTr("LibrePilot"), qsTr("UDP") ]
88
89 FactCheckBoxSlider {
90 Layout.fillWidth: true
91 text: autoConnectRepeater.names[index]
92 fact: modelData
93 visible: modelData.visible
94 }
95 }
96 }
97 }
98 }
99}