QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
ParameterDiffDialog.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Layouts
3import QtQuick.Controls
4import QtQuick.Dialogs
5
6import QGroundControl
7import QGroundControl.Controls
8import QGroundControl.FactControls
9
10QGCPopupDialog {
11 title: qsTr("Load Parameters")
12 buttons: Dialog.Cancel | (paramController.diffList.count ? Dialog.Ok : 0)
13
14 property var paramController
15
16 onAccepted: paramController.sendDiff()
17
18 Component.onDestruction: paramController.clearDiff();
19
20 ColumnLayout {
21 spacing: ScreenTools.defaultDialogControlSpacing
22
23 QGCLabel {
24 Layout.preferredWidth: mainGrid.visible ? mainGrid.width : ScreenTools.defaultFontPixelWidth * 40
25 wrapMode: Text.WordWrap
26 text: paramController.diffList.count ?
27 qsTr("The following parameters from the loaded file differ from what is currently set on the Vehicle. Click 'Ok' to update them on the Vehicle.") :
28 qsTr("There are no differences between the file loaded and the current settings on the Vehicle.")
29 }
30
31 GridLayout {
32 id: mainGrid
33 rows: paramController.diffList.count + 1
34 columns: paramController.diffMultipleComponents ? 5 : 4
35 flow: GridLayout.TopToBottom
36 visible: paramController.diffList.count
37
38 QGCCheckBox {
39 checked: true
40 onClicked: {
41 for (var i=0; i<paramController.diffList.count; i++) {
42 paramController.diffList.get(i).load = checked
43 }
44 }
45 }
46 Repeater {
47 model: paramController.diffList
48 QGCCheckBox {
49 checked: object.load
50 onClicked: object.load = checked
51 }
52 }
53
54 Repeater {
55 model: paramController.diffMultipleComponents ? 1 : 0
56 QGCLabel { text: qsTr("Comp ID") }
57 }
58 Repeater {
59 model: paramController.diffMultipleComponents ? paramController.diffList : 0
60 QGCLabel { text: object.componentId }
61 }
62
63 QGCLabel { text: qsTr("Name") }
64 Repeater {
65 model: paramController.diffList
66 QGCLabel { text: object.name }
67 }
68
69 QGCLabel { text: qsTr("File") }
70 Repeater {
71 model: paramController.diffList
72 QGCLabel { text: object.fileValue + " " + object.units }
73 }
74
75 QGCLabel { text: qsTr("Vehicle") }
76 Repeater {
77 model: paramController.diffList
78 QGCLabel { text: object.noVehicleValue ? qsTr("N/A") : object.vehicleValue + " " + object.units }
79 }
80 }
81 }
82}