VehicleSummary.qml 2.82 KB
Newer Older
1 2 3
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
4

5
import QGroundControl.FactSystem 1.0
6
import QGroundControl.Palette 1.0
Don Gagne's avatar
Don Gagne committed
7
import QGroundControl.Controls 1.0
8 9

Rectangle {
Don Gagne's avatar
Don Gagne committed
10 11 12
    width: 600
    height: 400

13
    property var qgcPal: QGCPalette { id: palette; colorGroupEnabled: true }
14

15 16 17
    id: topLevel
    objectName: "topLevel"

18
    color: qgcPal.window
19

Don Gagne's avatar
Don Gagne committed
20
    Column {
21
        anchors.fill: parent
22

Don Gagne's avatar
Don Gagne committed
23 24 25 26
        QGCLabel {
            text: "VEHICLE SUMMARY"
            font.pointSize: 20
        }
27

Don Gagne's avatar
Don Gagne committed
28 29 30 31 32
        Item {
            // Just used as a spacer
            height: 20
            width: 10
        }
33

Don Gagne's avatar
Don Gagne committed
34 35 36
        Flow {
            width: parent.width
            spacing: 10
37

Don Gagne's avatar
Don Gagne committed
38 39
            Repeater {
                model: autopilot.components
40

Don Gagne's avatar
Don Gagne committed
41 42 43
                // Outer summary item rectangle
                Rectangle {
                    readonly property real titleHeight: 30
44

Don Gagne's avatar
Don Gagne committed
45 46 47
                    width:  250
                    height: 200
                    color:  qgcPal.windowShade
48

Don Gagne's avatar
Don Gagne committed
49 50
                    // Title bar
                    Rectangle {
51

Don Gagne's avatar
Don Gagne committed
52 53 54
                        width: parent.width
                        height: titleHeight
                        color: qgcPal.windowShadeDark
55

Don Gagne's avatar
Don Gagne committed
56 57 58
                        // Title text
                        Text {
                            anchors.fill:   parent
59

Don Gagne's avatar
Don Gagne committed
60 61 62
                            color:          qgcPal.buttonText
                            font.pixelSize: 12
                            text:           modelData.name.toUpperCase()
63

Don Gagne's avatar
Don Gagne committed
64 65
                            verticalAlignment:      TextEdit.AlignVCenter
                            horizontalAlignment:    TextEdit.AlignHCenter
66
                        }
Don Gagne's avatar
Don Gagne committed
67
                    }
68

Don Gagne's avatar
Don Gagne committed
69 70 71 72 73 74 75 76 77 78 79 80
                    // Setup indicator
                    Rectangle {
                        readonly property real indicatorRadius: 6
                        readonly property real indicatorRightInset: 5

                        x:      parent.width - (indicatorRadius * 2) - indicatorRightInset
                        y:      (parent.titleHeight - (indicatorRadius * 2)) / 2
                        width:  indicatorRadius * 2
                        height: indicatorRadius * 2
                        radius: indicatorRadius
                        color:  modelData.setupComplete ? "#00d932" : "red"
                    }
81

Don Gagne's avatar
Don Gagne committed
82 83 84 85 86 87
                    // Summary Qml
                    Rectangle {
                        y:      parent.titleHeight
                        width:  parent.width
                        height: parent.height - parent.titleHeight
                        color:  qgcPal.windowShade
88

Don Gagne's avatar
Don Gagne committed
89 90 91
                        Loader {
                            anchors.fill: parent
                            source: modelData.summaryQmlSource
92 93 94 95 96 97 98
                        }
                    }
                }
            }
        }
    }
}