QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
SignalStrength.qml
Go to the documentation of this file.
1import QtQuick
2
3import QGroundControl
4import QGroundControl.Controls
5
6Item {
7 id: signalRoot
8 width: size
9 height: size
10
11 property real size: 50
12 property real percent: 0
13
14 QGCPalette { id: qgcPal }
15
16 function getIcon() {
17 if (percent < 20)
18 return "/qmlimages/Signal0.svg"
19 if (percent < 40)
20 return "/qmlimages/Signal20.svg"
21 if (percent < 60)
22 return "/qmlimages/Signal40.svg"
23 if (percent < 80)
24 return "/qmlimages/Signal60.svg"
25 if (percent < 95)
26 return "/qmlimages/Signal80.svg"
27 return "/qmlimages/Signal100.svg"
28 }
29
30 QGCColoredImage {
31 source: getIcon()
32 fillMode: Image.PreserveAspectFit
33 anchors.fill: parent
34 color: qgcPal.buttonText
35 sourceSize.height: size
36 }
37}