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 _summaryBoxWidth: _minSummaryW
17 property real _summaryBoxSpace: ScreenTools.defaultFontPixelWidth * 2
18 property real _margins: ScreenTools.defaultFontPixelHeight / 2
20 function computeSummaryBoxSize() {
23 var idx = Math.floor(_summaryRoot.width / (_minSummaryW + ScreenTools.defaultFontPixelWidth))
25 _summaryBoxWidth = _summaryRoot.width
30 _summaryBoxSpace = ScreenTools.defaultFontPixelWidth * 2
31 sw = _summaryBoxSpace * (idx - 1)
33 rw = _summaryRoot.width - sw
34 _summaryBoxWidth = rw / idx
38 function capitalizeWords(sentence) {
39 return sentence.replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); });
44 colorGroupEnabled: enabled
47 Component.onCompleted: {
48 computeSummaryBoxSize()
52 computeSummaryBoxSize()
58 contentHeight: summaryColumn.height
59 contentWidth: _summaryRoot.width
60 flickableDirection: Flickable.VerticalFlick
64 width: _summaryRoot.width
65 spacing: ScreenTools.defaultFontPixelHeight
69 wrapMode: Text.WordWrap
70 color: setupComplete ? qgcPal.text : qgcPal.warningText
72 horizontalAlignment: Text.AlignHCenter
74 qsTr("Your vehicle configuration summary appears below. Select components on the left to review or fine-tune settings.") :
75 qsTr("WARNING: Configuration tasks remain before this vehicle is ready to fly. Open the red-marked components on the left to finish setup.")
77 property bool setupComplete: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle.autopilotPlugin.setupComplete : false
82 width: _summaryRoot.width
83 spacing: _summaryBoxSpace
86 model: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle.autopilotPlugin.vehicleComponents : undefined
88 // Outer summary item rectangle
90 width: mainLayout.width + (_margins * 2)
91 height: mainLayout.height + (_margins * 2)
92 color: qgcPal.windowShade
93 visible: modelData.summaryQmlSource.toString() !== ""
95 border.color: qgcPal.text
97 Component.onCompleted: {
98 border.color = Qt.rgba(border.color.r, border.color.g, border.color.b, 0.1)
101 readonly property real titleHeight: ScreenTools.defaultFontPixelHeight * 2
105 anchors.margins: _margins
106 anchors.left: parent.left
107 anchors.top: parent.top
108 spacing: ScreenTools.defaultFontPixelHeight / 2
112 Layout.fillWidth: true
113 Layout.preferredHeight: titleHeight
114 text: capitalizeWords(modelData.name)
118 anchors.rightMargin: ScreenTools.defaultFontPixelWidth
119 anchors.right: parent.right
120 anchors.verticalCenter: parent.verticalCenter
121 width: ScreenTools.defaultFontPixelWidth * 1.75
124 color: modelData.setupComplete ? "#00d932" : "red"
125 visible: modelData.requiresSetup && modelData.setupSource !== ""
129 if (modelData.setupSource !== "") {
130 setupView.showVehicleComponentPanel(modelData)
138 Layout.fillWidth: true
139 Layout.preferredWidth: item ? item.implicitWidth : 0
140 Layout.preferredHeight: item ? item.implicitHeight : 0
141 source: modelData.summaryQmlSource
143 property var vehicleComponent: modelData