QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
ActuatorFact.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
9Loader {
10 property var fact
11 id: loader
12
13 Component {
14 id: factComboBox
15 FactComboBox {
16 fact: loader.fact
17 indexModel: false
18 sizeToContents: true
19 }
20 }
21 Component {
22 id: factCheckbox
23 FactCheckBox {
24 fact: loader.fact
25 }
26 }
27
28 Component {
29 id: factTextField
30 FactTextField {
31 fact: loader.fact
32 width: ScreenTools.defaultFontPixelWidth * 8
33 showUnits: false
34 }
35 }
36 Component {
37 id: factReadOnly
38 QGCLabel {
39 text: loader.fact.valueString
40 }
41 }
42 Component {
43 id: notAvailable
44 QGCLabel {
45 text: qsTr("(Param not available)")
46 }
47 }
48 sourceComponent: fact ?
49 (fact.enumStrings.length > 0 ? factComboBox :
50 (fact.readOnly ? factReadOnly : (fact.typeIsBool ? factCheckbox : factTextField))
51 ) : notAvailable
52}