QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
ArmedIndicator.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Layouts
4
5import QGroundControl
6import QGroundControl.Controls
7
8//-------------------------------------------------------------------------
9//-- Armed Indicator
10QGCComboBox {
11 anchors.verticalCenter: parent.verticalCenter
12 alternateText: _armed ? qsTr("Armed") : qsTr("Disarmed")
13 model: [ qsTr("Arm"), qsTr("Disarm") ]
14 font.pointSize: ScreenTools.mediumFontPointSize
15 currentIndex: -1
16 sizeToContents: true
17
18 property bool showIndicator: true
19
20 property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
21 property bool _armed: _activeVehicle ? _activeVehicle.armed : false
22
23 onActivated: (index) => {
24 if (index == 0) {
25 mainWindow.armVehicleRequest()
26 } else {
27 mainWindow.disarmVehicleRequest()
28 }
29 currentIndex = -1
30 }
31}