5import QGroundControl.Controls
10 anchors.rightMargin: ScreenTools.defaultFontPixelWidth
11 anchors.leftMargin: ScreenTools.defaultFontPixelWidth
14 property real _minSummaryW: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelWidth * 28 : ScreenTools.defaultFontPixelWidth * 36
15 property real _summaryBoxWidth: _minSummaryW
16 property real _summaryBoxSpace: ScreenTools.defaultFontPixelWidth * 2
18 function computeSummaryBoxSize() {
21 var idx = Math.floor(_summaryRoot.width / (_minSummaryW + ScreenTools.defaultFontPixelWidth))
23 _summaryBoxWidth = _summaryRoot.width
28 _summaryBoxSpace = ScreenTools.defaultFontPixelWidth * 2
29 sw = _summaryBoxSpace * (idx - 1)
31 rw = _summaryRoot.width - sw
32 _summaryBoxWidth = rw / idx
36 function capitalizeWords(sentence) {
37 return sentence.replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); });
42 colorGroupEnabled: enabled
45 Component.onCompleted: {
46 computeSummaryBoxSize()
50 computeSummaryBoxSize()
56 contentHeight: summaryColumn.height
57 contentWidth: _summaryRoot.width
58 flickableDirection: Flickable.VerticalFlick
62 width: _summaryRoot.width
63 spacing: ScreenTools.defaultFontPixelHeight
67 wrapMode: Text.WordWrap
68 color: setupComplete ? qgcPal.text : qgcPal.warningText
70 horizontalAlignment: Text.AlignHCenter
72 qsTr("Your vehicle configuration summary appears below. Select components on the left to review or fine-tune settings.") :
73 qsTr("WARNING: Configuration tasks remain before this vehicle is ready to fly. Open the red-marked components on the left to finish setup.")
75 property bool setupComplete: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle.autopilotPlugin.setupComplete : false
80 width: _summaryRoot.width
81 spacing: _summaryBoxSpace
84 model: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle.autopilotPlugin.vehicleComponents : undefined
86 // Outer summary item rectangle
88 width: _summaryBoxWidth
89 height: ScreenTools.defaultFontPixelHeight * 13
90 color: qgcPal.windowShade
91 visible: modelData.summaryQmlSource.toString() !== ""
93 border.color: qgcPal.text
94 Component.onCompleted: {
95 border.color = Qt.rgba(border.color.r, border.color.g, border.color.b, 0.1)
98 readonly property real titleHeight: ScreenTools.defaultFontPixelHeight * 2
105 text: capitalizeWords(modelData.name)
109 anchors.rightMargin: ScreenTools.defaultFontPixelWidth
110 anchors.right: parent.right
111 anchors.verticalCenter: parent.verticalCenter
112 width: ScreenTools.defaultFontPixelWidth * 1.75
115 color: modelData.setupComplete ? "#00d932" : "red"
116 visible: modelData.requiresSetup && modelData.setupSource !== ""
120 //console.log(modelData.setupSource)
121 if (modelData.setupSource !== "") {
122 setupView.showVehicleComponentPanel(modelData)
128 anchors.top: titleBar.bottom
132 anchors.margins: ScreenTools.defaultFontPixelWidth
133 source: modelData.summaryQmlSource
135 property var vehicleComponent: modelData