QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
RadioComponent.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Dialogs
4import QtQuick.Layouts
5
6import QGroundControl
7import QGroundControl.FactControls
8import QGroundControl.Controls
9import QGroundControl.VehicleSetup
10
11SetupPage {
12 id: radioPage
13 pageComponent: pageComponent
14
15 Component {
16 id: pageComponent
17
18 RemoteControlCalibration {
19 id: remoteControlCalibration
20
21 useDeadband: false
22
23 controller: RadioComponentController {
24 statusText: remoteControlCalibration.statusText
25 cancelButton: remoteControlCalibration.cancelButton
26 nextButton: remoteControlCalibration.nextButton
27 joystickMode: false
28
29 onThrottleReversedCalFailure: QGroundControl.showMessageDialog(radioPage, qsTr("Throttle channel reversed"), qsTr("Calibration failed. The throttle channel on your transmitter is reversed. You must correct this on your transmitter in order to complete calibration."))
30 }
31
32 Component.onCompleted: controller.start()
33
34 additionalSetupComponent: ColumnLayout {
35 spacing: ScreenTools.defaultFontPixelHeight / 2
36
37 ColumnLayout {
38 id: switchSettings
39 Layout.fillWidth: true
40
41 Repeater {
42 model: QGroundControl.multiVehicleManager.activeVehicle.px4Firmware ?
43 (QGroundControl.multiVehicleManager.activeVehicle.multiRotor ?
44 [ "RC_MAP_AUX1", "RC_MAP_AUX2", "RC_MAP_PARAM1", "RC_MAP_PARAM2", "RC_MAP_PARAM3", "RC_MAP_PAY_SW"] :
45 [ "RC_MAP_FLAPS", "RC_MAP_AUX1", "RC_MAP_AUX2", "RC_MAP_PARAM1", "RC_MAP_PARAM2", "RC_MAP_PARAM3", "RC_MAP_PAY_SW"]) :
46 0
47
48 LabelledFactComboBox {
49 label: fact.shortDescription
50 fact: controller.getParameterFact(-1, modelData)
51 indexModel: false
52 }
53 }
54 }
55
56 Rectangle {
57 Layout.fillWidth: true
58 implicitHeight: 1
59 color: qgcPal.text
60 }
61
62 RowLayout {
63 spacing: ScreenTools.defaultFontPixelWidth
64
65 QGCButton {
66 id: bindButton
67 text: qsTr("Spektrum Bind")
68 onClicked: spektrumBindDialogFactory.open()
69 }
70
71 QGCButton {
72 text: qsTr("CRSF Bind")
73 onClicked: QGroundControl.showMessageDialog(radioPage, qsTr("CRSF Bind"),
74 qsTr("Click Ok to place your CRSF receiver in the bind mode."),
75 Dialog.Ok | Dialog.Cancel,
76 function() { controller.crsfBindMode() })
77 }
78
79 QGCButton {
80 text: qsTr("Copy Trims")
81 onClicked: QGroundControl.showMessageDialog(radioPage, qsTr("Copy Trims"),
82 qsTr("Center your sticks and move throttle all the way down, then press Ok to copy trims. After pressing Ok, reset the trims on your radio back to zero."),
83 Dialog.Ok | Dialog.Cancel,
84 function() { controller.copyTrims() })
85 }
86 }
87
88 QGCPopupDialogFactory {
89 id: spektrumBindDialogFactory
90
91 dialogComponent: spektrumBindDialogComponent
92 }
93
94 Component {
95 id: spektrumBindDialogComponent
96
97 QGCPopupDialog {
98 title: qsTr("Spektrum Bind")
99 buttons: Dialog.Ok | Dialog.Cancel
100
101 onAccepted: { controller.spektrumBindMode(radioGroup.checkedButton.bindMode) }
102
103 ButtonGroup { id: radioGroup }
104
105 ColumnLayout {
106 spacing: ScreenTools.defaultFontPixelHeight / 2
107
108 QGCLabel {
109 wrapMode: Text.WordWrap
110 text: qsTr("Click Ok to place your Spektrum receiver in the bind mode.")
111 }
112
113 QGCLabel {
114 wrapMode: Text.WordWrap
115 text: qsTr("Select the specific receiver type below:")
116 }
117
118 QGCRadioButton {
119 text: qsTr("DSM2 Mode")
120 ButtonGroup.group: radioGroup
121 property int bindMode: RadioComponentController.DSM2
122 }
123
124 QGCRadioButton {
125 text: qsTr("DSMX (7 channels or less)")
126 ButtonGroup.group: radioGroup
127 property int bindMode: RadioComponentController.DSMX7
128 }
129
130 QGCRadioButton {
131 checked: true
132 text: qsTr("DSMX (8 channels or more)")
133 ButtonGroup.group: radioGroup
134 property int bindMode: RadioComponentController.DSMX8
135 }
136 }
137 }
138 }
139 }
140 }
141 }
142}