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 property Loader preVehicleChecklistLoader: null
18 property bool showChecklist: false
19
20 readonly property bool _checklistPassed: !preVehicleChecklistLoader || !preVehicleChecklistLoader.item || preVehicleChecklistLoader.item.allChecksPassed
21
22 Component.onCompleted: {
23 for (var i = 0; i < linkConfigs.count; i++) {
24 var linkConfig = linkConfigs.get(i)
25 if (!linkConfig.dynamic && !linkConfig.isAutoConnect) {
26 noLinks = false
27 break
28 }
29 }
30 }
31
32 contentComponent: Component {
33 QGCGroupBox {
34 Component.onCompleted: currentIndex = (showChecklist && !_checklistPassed) ? 0 : 1
35
36 QGCGroupBoxTab {
37 title: qsTr("Pre-Flight Checklist")
38 buttonObjectName: "mainStatusChecklistTab"
39 tabVisible: showChecklist
40 badge: StatusPill {
41 objectName: "mainStatusChecklistTabBadge"
42 text: _checklistPassed ? qsTr("Passed") : qsTr("In Progress")
43 color: _checklistPassed ? QGroundControl.globalPalette.successIndicator : QGroundControl.globalPalette.warningIndicator
44 }
45
46 MainStatusChecklistHost {
47 loader: control.preVehicleChecklistLoader
48 }
49 }
50
51 QGCGroupBoxTab {
52 title: qsTr("Select Link to Connect")
53
54 QGCLabel {
55 text: qsTr("No Links Configured")
56 visible: noLinks
57 }
58
59 Repeater {
60 model: linkConfigs
61
62 delegate: QGCButton {
63 Layout.fillWidth: true
64 text: object.name + (object.link ? " (" + qsTr("Connected") + ")" : "")
65 visible: !object.dynamic
66 enabled: !object.link
67 autoExclusive: true
68
69 onClicked: {
70 QGroundControl.linkManager.createConnectedLink(object)
71 mainWindow.closeIndicatorDrawer()
72 }
73 }
74 }
75 }
76 }
77 }
78
79 expandedComponent: Component {
80 ColumnLayout {
81 spacing: ScreenTools.defaultFontPixelHeight / 2
82
83 QGCGroupBox {
84 LabelledButton {
85 label: qsTr("Communication Links")
86 buttonText: qsTr("Configure")
87
88 onClicked: {
89 // Untranslated page key from SettingsPages.json — do not qsTr()
90 mainWindow.showSettingsTool("Comm Links")
91 mainWindow.closeIndicatorDrawer()
92 }
93 }
94 }
95
96 QGCGroupBox {
97 heading: qsTr("AutoConnect")
98 visible: autoConnectSettings.userVisible
99
100 Repeater {
101 id: autoConnectRepeater
102
103 model: [
104 autoConnectSettings.autoConnectPixhawk,
105 autoConnectSettings.autoConnectSiKRadio,
106 autoConnectSettings.autoConnectLibrePilot,
107 autoConnectSettings.autoConnectUDP,
108 ]
109
110 property var names: [ qsTr("Pixhawk"), qsTr("SiK Radio"), qsTr("LibrePilot"), qsTr("UDP") ]
111
112 FactCheckBoxSlider {
113 Layout.fillWidth: true
114 text: autoConnectRepeater.names[index]
115 fact: modelData
116 visible: modelData.visible
117 }
118 }
119 }
120 }
121 }
122}