ApmToolBar.qml 3.19 KB
Newer Older
1 2 3 4 5 6
import QtQuick 1.1
import "./components"


Rectangle {
    id: toolbar
7 8 9 10 11 12

    property alias backgroundColor : toolbar.color
    property alias linkNameLabel: linkDevice.label
    property alias baudrateLabel: baudrate.label

    width: 1024 < parent.width ? 1024 : parent.width
13 14 15 16
    height: 72
    color: "black"
    border.color: "black"

17 18 19 20 21 22 23 24 25 26 27 28 29 30
    Connections {
            target: globalObj
            onMAVConnected: {
                console.log("Change Connection " + connected)
                if (connect){
                    console.log("connected")
                   // connectButton.image = "./resources/apmplanner/toolbar/disconnect.png"
                } else {
                    console.log("disconnected")
                   // connectButton.image = "./resources/apmplanner/toolbar/connect.png"
                }
            }
    }

31 32 33 34
    Row {
        anchors.left: parent.left
        spacing: 2

35 36 37 38 39 40
        Rectangle {
            width: 5
            height: parent.height
            color: "black"
        }

41 42 43 44 45
        Button {
            id: flightDataView
            label: "FLIGHT DATA"
            image: "./resources/apmplanner/toolbar/flightdata.png"
            onClicked: {
46
                globalObj.triggerFlightView()
47 48 49 50 51 52 53
            }
        }

        Button {
            id: flightPlanView
            label: "FLIGHT PLAN"
            image: "./resources/apmplanner/toolbar/flightplanner.png"
54
            onClicked: globalObj.triggerFlightPlanView()
55 56 57 58 59 60 61
        }

        Button {
            id: hardwareConfigView
            label: "HARDWARE"
            image: "./resources/apmplanner/toolbar/hardwareconfig.png"
            margins: 8
62
            onClicked: globalObj.triggerHardwareView()
63 64 65 66 67 68 69
        }

        Button {
            id: softwareConfigView
            label: "SOFTWARE"
            image: "./resources/apmplanner/toolbar/softwareconfig.png"
            margins: 8
70
            onClicked: globalObj.triggerSoftwareView()
71 72 73 74 75 76
        }

        Button {
            id: simualtionView
            label: "SIMULATION"
            image: "./resources/apmplanner/toolbar/simulation.png"
77
            onClicked: globalObj.triggerSimulationView()
78 79 80 81 82 83
        }

        Button {
            id: terminalView
            label: "TERMINAL"
            image: "./resources/apmplanner/toolbar/terminal.png"
84
            onClicked: globalObj.triggerTerminalView()
85 86 87 88
        }
    }

    Row {
89
        anchors.right: parent.right
90 91
        spacing: 2

92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
        TextButton {
            id: linkDevice
            label: "none"
            minWidth: 100

            onClicked: globalObj.showConnectionDialog()
        }

        TextButton {
            id: baudrate
            label: "none"
            minWidth: 100

            onClicked: globalObj.showConnectionDialog()
        }

        Rectangle {
            width: 5
            height: parent.height
            color: "black"
        }

114 115 116 117
        Button {
            id: connectButton
            label: "CONNECT"
            image: "./resources/apmplanner/toolbar/connect.png"
118 119 120 121 122 123 124 125
            onClicked: globalObj.connectMAV()
        }

        Rectangle {
            anchors.right: parent.right
            width: 5
            height: parent.height
            color: "black"
126 127 128
        }
    }
}