6import QGroundControl.Controls
11 anchors.rightMargin: ScreenTools.defaultFontPixelWidth
12 anchors.leftMargin: ScreenTools.defaultFontPixelWidth
15 property real _minSummaryW: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelWidth * 28 : ScreenTools.defaultFontPixelWidth * 36
16 property real _summaryBoxSpace: ScreenTools.defaultFontPixelWidth * 2
17 property real _margins: ScreenTools.defaultFontPixelHeight / 2
19 function capitalizeWords(sentence) {
20 return sentence.replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); });
25 colorGroupEnabled: enabled
31 contentHeight: summaryColumn.height
32 contentWidth: _summaryRoot.width
33 flickableDirection: Flickable.VerticalFlick
37 width: _summaryRoot.width
38 spacing: ScreenTools.defaultFontPixelHeight
42 wrapMode: Text.WordWrap
43 color: setupComplete ? qgcPal.text : qgcPal.warningText
45 horizontalAlignment: Text.AlignHCenter
47 qsTr("Your vehicle configuration summary appears below. Select components on the left to review or fine-tune settings.") :
48 qsTr("WARNING: Configuration tasks remain before this vehicle is ready to fly. Open the red-marked components on the left to finish setup.")
50 property bool setupComplete: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle.autopilotPlugin.setupComplete : false
55 width: _summaryRoot.width
56 columns: Math.max(1, Math.floor((_summaryRoot.width + _summaryBoxSpace) / (_minSummaryW + _summaryBoxSpace)))
57 columnSpacing: _summaryBoxSpace
58 rowSpacing: ScreenTools.defaultFontPixelHeight
61 model: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle.autopilotPlugin.vehicleComponents : undefined
63 // Outer summary item rectangle
65 Layout.fillWidth: true
66 Layout.fillHeight: true
67 implicitWidth: _minSummaryW
68 implicitHeight: mainLayout.implicitHeight + (_margins * 2)
69 radius: ScreenTools.defaultFontPixelHeight / 4
70 color: qgcPal.windowShade
71 visible: modelData.summaryQmlSource.toString() !== ""
73 border.color: Qt.rgba(qgcPal.text.r, qgcPal.text.g, qgcPal.text.b, 0.1)
75 readonly property real titleHeight: ScreenTools.defaultFontPixelHeight * 2
79 anchors.margins: _margins
80 anchors.left: parent.left
81 anchors.right: parent.right
82 anchors.top: parent.top
83 spacing: ScreenTools.defaultFontPixelHeight / 2
87 Layout.fillWidth: true
88 Layout.preferredHeight: titleHeight
89 text: capitalizeWords(modelData.name)
90 rightPadding: setupIndicator.visible ? setupIndicator.width + ScreenTools.defaultFontPixelWidth * 2 : leftPadding
95 anchors.rightMargin: ScreenTools.defaultFontPixelWidth
96 anchors.right: parent.right
97 anchors.verticalCenter: parent.verticalCenter
98 width: ScreenTools.defaultFontPixelWidth * 1.5
101 color: modelData.setupComplete ? qgcPal.colorGreen : qgcPal.colorRed
102 visible: modelData.requiresSetup && modelData.setupSource !== ""
106 if (modelData.setupSource !== "") {
107 setupView.showVehicleComponentPanel(modelData)
115 Layout.fillWidth: true
116 Layout.preferredWidth: item ? item.implicitWidth : 0
117 Layout.preferredHeight: item ? item.implicitHeight : 0
118 source: modelData.summaryQmlSource
120 property var vehicleComponent: modelData