QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
APMESCComponentSummary.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Layouts
4
5import QGroundControl
6import QGroundControl.FactControls
7import QGroundControl.Controls
8
9Item {
10 implicitWidth: mainLayout.implicitWidth
11 implicitHeight: mainLayout.implicitHeight
12 width: parent.width
13
14 FactPanelController { id: controller; }
15
16 property bool _isQuadPlane: !controller.parameterExists(-1, "MOT_PWM_TYPE") && controller.parameterExists(-1, "Q_M_PWM_TYPE")
17 property string _escPrefix: _isQuadPlane ? "Q_M_" : "MOT_"
18
19 property bool _motPwmTypeAvailable: controller.parameterExists(-1, _escPrefix + "PWM_TYPE")
20 property Fact _motPwmType: controller.getParameterFact(-1, _escPrefix + "PWM_TYPE", false /* reportMissing */)
21
22 property bool _isDshot: _motPwmTypeAvailable && _motPwmType && _motPwmType.rawValue >= 4
23 property bool _servoDshotEscAvailable: controller.parameterExists(-1, "SERVO_DSHOT_ESC")
24 property Fact _servoDshotEsc: controller.getParameterFact(-1, "SERVO_DSHOT_ESC", false /* reportMissing */)
25 property bool _servoDshotRateAvailable: controller.parameterExists(-1, "SERVO_DSHOT_RATE")
26 property Fact _servoDshotRate: controller.getParameterFact(-1, "SERVO_DSHOT_RATE", false /* reportMissing */)
27
28 ColumnLayout {
29 id: mainLayout
30 spacing: 0
31
32 VehicleSummaryRow {
33 labelText: qsTr("Output type")
34 valueText: _motPwmTypeAvailable ? _motPwmType.enumStringValue : ""
35 visible: _motPwmTypeAvailable
36 }
37
38 VehicleSummaryRow {
39 labelText: qsTr("DShot ESC type")
40 valueText: _servoDshotEscAvailable ? _servoDshotEsc.enumStringValue : ""
41 visible: _isDshot && _servoDshotEscAvailable
42 }
43
44 VehicleSummaryRow {
45 labelText: qsTr("DShot output rate")
46 valueText: _servoDshotRateAvailable ? _servoDshotRate.enumStringValue : ""
47 visible: _isDshot && _servoDshotRateAvailable
48 }
49 }
50}