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 mainWindow.showSettingsTool(qsTr("Comm Links"))
67 mainWindow.closeIndicatorDrawer()
68 }
69 }
70 }
71
72 SettingsGroupLayout {
73 heading: qsTr("AutoConnect")
74 visible: autoConnectSettings.visible
75
76 Repeater {
77 id: autoConnectRepeater
78
79 model: [
80 autoConnectSettings.autoConnectPixhawk,
81 autoConnectSettings.autoConnectSiKRadio,
82 autoConnectSettings.autoConnectLibrePilot,
83 autoConnectSettings.autoConnectUDP,
84 autoConnectSettings.autoConnectZeroConf,
85 autoConnectSettings.autoConnectRTKGPS,
86 ]
87
88 property var names: [ qsTr("Pixhawk"), qsTr("SiK Radio"), qsTr("LibrePilot"), qsTr("UDP"), qsTr("Zero-Conf"), qsTr("RTK") ]
89
90 FactCheckBoxSlider {
91 Layout.fillWidth: true
92 text: autoConnectRepeater.names[index]
93 fact: modelData
94 visible: modelData.visible
95 }
96 }
97 }
98 }
99 }
100}