Browse Source

Remove APM toolbar qml

QGC4.4
Don Gagne 11 years ago
parent
commit
14998d64de
  1. 2
      QGCSetup.pri
  2. 3
      qgroundcontrol.pro
  3. 210
      qml/ApmToolBar.qml
  4. 70
      qml/components/Button.qml
  5. 30
      qml/components/DigitalDisplay.qml
  6. 24
      qml/components/StatusDisplay.qml
  7. 70
      qml/components/TextButton.qml
  8. BIN
      qml/resources/qgroundcontrol/toolbar/connect.png
  9. BIN
      qml/resources/qgroundcontrol/toolbar/disconnect.png
  10. BIN
      qml/resources/qgroundcontrol/toolbar/donate.png
  11. BIN
      qml/resources/qgroundcontrol/toolbar/flightdata.png
  12. BIN
      qml/resources/qgroundcontrol/toolbar/flightplanner.png
  13. BIN
      qml/resources/qgroundcontrol/toolbar/hardwareconfig.png
  14. BIN
      qml/resources/qgroundcontrol/toolbar/helpwizard.png
  15. BIN
      qml/resources/qgroundcontrol/toolbar/simulation.png
  16. BIN
      qml/resources/qgroundcontrol/toolbar/softwareconfig.png
  17. BIN
      qml/resources/qgroundcontrol/toolbar/terminal.png

2
QGCSetup.pri

@ -39,12 +39,10 @@ WindowsBuild { @@ -39,12 +39,10 @@ WindowsBuild {
DESTDIR_COPY_RESOURCE_LIST = $$replace(DESTDIR,"/","\\")
BASEDIR_COPY_RESOURCE_LIST = $$replace(BASEDIR,"/","\\")
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY_DIR \"$$BASEDIR_COPY_RESOURCE_LIST\\files\" \"$$DESTDIR_COPY_RESOURCE_LIST\\files\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY_DIR \"$$BASEDIR_COPY_RESOURCE_LIST\\qml\" \"$$DESTDIR_COPY_RESOURCE_LIST\\qml\"
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY_DIR \"$$BASEDIR_COPY_RESOURCE_LIST\\data\" \"$$DESTDIR_COPY_RESOURCE_LIST\\data\"
} else {
# Make sure to keep both side of this if using the same set of directories
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR $$BASEDIR/files $$DESTDIR_COPY_RESOURCE_LIST
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR $$BASEDIR/qml $$DESTDIR_COPY_RESOURCE_LIST
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR $$BASEDIR/data $$DESTDIR_COPY_RESOURCE_LIST
}

3
qgroundcontrol.pro

@ -113,8 +113,7 @@ QT += network \ @@ -113,8 +113,7 @@ QT += network \
serialport \
sql \
printsupport \
webkitwidgets \
quick
webkitwidgets
# testlib is needed even in release flavor for QSignalSpy support
QT += testlib

210
qml/ApmToolBar.qml

@ -1,210 +0,0 @@ @@ -1,210 +0,0 @@
import QtQuick 2.1
import "./components"
Rectangle {
id: toolbar
property alias backgroundColor : toolbar.color
property alias linkNameLabel: linkDevice.label
property alias baudrateLabel: baudrate.label
property bool connected: false
property bool armed: false
property string armedstr: "DISARMED"
width: toolbar.width
height: 72
color: "black"
border.color: "black"
onArmedChanged: {
if (armed) {
statusDisplay.statusText = "ARMED"
statusDisplay.statusTextColor = "red"
statusDisplay.statusBackgroundColor = "#FF880000"
}
else {
statusDisplay.statusText = "DISARMED"
statusDisplay.statusTextColor = "yellow"
statusDisplay.statusBackgroundColor = "black"
}
}
onConnectedChanged: {
if (connected){
console.log("APM Tool BAR QML: connected")
connectButton.image = "./resources/qgroundcontrol/toolbar/disconnect.png"
connectButton.label = "DISCONNECT"
} else {
console.log("APM Tool BAR QML: disconnected")
connectButton.image = "./resources/qgroundcontrol/toolbar/connect.png"
connectButton.label = "CONNECT"
}
}
// [BB] The code below should work, not sure why. replaced with code above
// Connections {
// target: globalObj
// onMAVConnected: {
// console.log("QML Change Connection " + connected)
// if (connected){
// console.log("connected")
// connectButton.image = "./resources/qgroundcontrol/toolbar/disconnect.png"
// } else {
// console.log("disconnected")
// connectButton.image = "./resources/qgroundcontrol/toolbar/connect.png"
// }
// }
// }
Row {
anchors.left: parent.left
spacing: 10
Rectangle { // Spacer
width: 5
height: parent.height
color: "black"
}
Button {
id: flightDataView
label: "FLIGHT DATA"
image: "./resources/qgroundcontrol/toolbar/flightdata.png"
onClicked: {
globalObj.triggerFlightView()
}
}
Button {
id: flightPlanView
label: "FLIGHT PLAN"
image: "./resources/qgroundcontrol/toolbar/flightplanner.png"
onClicked: globalObj.triggerFlightPlanView()
}
Button {
id: hardwareConfigView
label: "HARDWARE"
image: "./resources/qgroundcontrol/toolbar/hardwareconfig.png"
margins: 8
onClicked: globalObj.triggerHardwareView()
}
Button {
id: softwareConfigView
label: "SOFTWARE"
image: "./resources/qgroundcontrol/toolbar/softwareconfig.png"
margins: 8
onClicked: globalObj.triggerSoftwareView()
}
Button {
id: simulationView
label: "SIMULATION"
image: "./resources/qgroundcontrol/toolbar/simulation.png"
onClicked: globalObj.triggerSimulationView()
}
Button {
id: terminalView
label: "TERMINAL"
image: "./resources/qgroundcontrol/toolbar/terminal.png"
onClicked: globalObj.triggerTerminalView()
}
Rectangle { // Spacer
width: 5
height: parent.height
color: "black"
}
StatusDisplay {
id: statusDisplay
width: 110
statusText: "DISARMED"
statusTextColor: "yellow"
statusBackgroundColor: "black"
}
Rectangle { // Spacer
width: 5
height: parent.height
color: "black"
}
// [BB] Commented out ToolBar Status info work.
// WIP: To be fixed later
// DigitalDisplay { // Information Pane
// title:"Mode"
// textValue: "Stabilize"
// color: "black"
// }
// DigitalDisplay { // Information Pane
// title: "Speed"
// textValue: "11.0m/s"
// color: "black"
// }
// DigitalDisplay { // Information Pane
// title: "Alt"
// textValue: "20.0m"
// color: "black"
// }
// DigitalDisplay { // Information Pane
// title: "Volts"
// textValue: "14.8V"
// color: "black"
// }
// DigitalDisplay { // Information Pane
// title: "Current"
// textValue: "12.0A"
// color: "black"
// }
// DigitalDisplay { // Information Pane
// title: "Level"
// textValue: "77%"
// color: "black"
// }
}
Row {
anchors.right: parent.right
spacing: 2
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"
}
Button {
id: connectButton
label: "CONNECT"
image: "./resources/qgroundcontrol/toolbar/connect.png"
onClicked: globalObj.connectMAV()
}
Rectangle { // Spacer
width: 5
height: parent.height
color: "black"
}
}
}

70
qml/components/Button.qml

@ -1,70 +0,0 @@ @@ -1,70 +0,0 @@
import QtQuick 2.1
Rectangle {
signal clicked
property string label: "button label"
property alias image: buttonImage.source
property int margins: 2
id: button
width: 72
height: 72
radius: 3
smooth: true
border.width: 2
Text {
id: buttonLabel
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
anchors.margins: 5
text: label
color: "white"
font.pointSize: 10
}
Image {
id: buttonImage
anchors.horizontalCenter: button.horizontalCenter
anchors.top: buttonLabel.bottom
anchors.margins: margins
source: image
fillMode: Image.PreserveAspectFit
width: image.width
height: image.height
}
signal buttonClick()
onButtonClick: {
console.log(buttonLabel.text + " clicked calling signal")
clicked()
}
// Highlighting and ativation section
property color buttonColor: "black"
property color onHoverbuttonColor: "lightblue"
property color onHoverColor: "darkblue"
property color borderColor: "black"
MouseArea {
id: buttonMouseArea
anchors.fill: parent
onClicked: buttonClick()
hoverEnabled: true
onEntered: {
parent.border.color = onHoverColor
parent.color = onHoverbuttonColor
}
onExited: {
parent.border.color = borderColor
parent.color = buttonColor
}
onPressed: parent.color = Qt.darker(onHoverbuttonColor, 1.5)
onReleased: parent.color = buttonColor
}
color: buttonColor
border.color: borderColor
}

30
qml/components/DigitalDisplay.qml

@ -1,30 +0,0 @@ @@ -1,30 +0,0 @@
import QtQuick 2.1
Rectangle {
property alias title: displayTitle.text
property string textValue: "none"
width: 110
height: parent.height/3
anchors.verticalCenter: parent.verticalCenter
border.color: "white"
Text {
id:displayTitle
anchors.left: parent.left
anchors.leftMargin: 3
anchors.verticalCenter: parent.verticalCenter
text: "blank"
color: "white"
}
Text {
id:displayValue
anchors.right: parent.right
anchors.rightMargin: 3
anchors.verticalCenter: parent.verticalCenter
text: textValue
color: "white"
}
}

24
qml/components/StatusDisplay.qml

@ -1,24 +0,0 @@ @@ -1,24 +0,0 @@
import QtQuick 2.1
Rectangle {
id: statusDisplay
property alias statusText: armedText.text
property alias statusTextColor: armedText.color
property alias statusBackgroundColor: statusDisplay.color
width: 100
height: parent.height/3
anchors.verticalCenter: parent.verticalCenter
radius: 3
border.color: "white"
border.width: 1
Text {
id: armedText
anchors.centerIn: parent
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 20
}
}

70
qml/components/TextButton.qml

@ -1,70 +0,0 @@ @@ -1,70 +0,0 @@
import QtQuick 2.1
Rectangle {
signal clicked
property string label: "Text Button label"
property int minWidth: 75
property int minHeight: 0
property int margin: 5
width: textBox.width
height: 72
anchors.verticalCenter: parent.verticalCenter
color: "black"
signal buttonClick()
onButtonClick: {
console.log(label + " clicked calling signal")
clicked()
}
// Highlighting and ativation section
property color buttonColor: "black"
property color onHoverbuttonColor: "lightblue"
property color onHoverColor: "darkblue"
property color borderColor: "white"
Rectangle {
width: textButtonLabel.paintedwidth
anchors.centerIn: parent
Rectangle{
id: textBox
anchors.centerIn: parent
width: minWidth > textButtonLabel.paintedWidth + margin ? minWidth : textButtonLabel.paintedWidth + margin
height: minHeight > textButtonLabel.paintedHeight + margin ? minHeight : textButtonLabel.paintedHeight + margin
Text {
id: textButtonLabel
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
anchors.margins: 2
text: label
color: "white"
font.pointSize: 11
}
MouseArea {
id: textButtonMouseArea
anchors.fill: parent
onClicked: buttonClick()
hoverEnabled: true
onEntered: {
parent.border.color = onHoverColor
parent.color = onHoverbuttonColor
}
onExited: {
parent.border.color = borderColor
parent.color = buttonColor
}
onPressed: parent.color = Qt.darker(onHoverbuttonColor, 1.5)
onReleased: parent.color = buttonColor
}
color: buttonColor
border.color: borderColor
border.width: 1
}
}
}

BIN
qml/resources/qgroundcontrol/toolbar/connect.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

BIN
qml/resources/qgroundcontrol/toolbar/disconnect.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

BIN
qml/resources/qgroundcontrol/toolbar/donate.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

BIN
qml/resources/qgroundcontrol/toolbar/flightdata.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

BIN
qml/resources/qgroundcontrol/toolbar/flightplanner.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

BIN
qml/resources/qgroundcontrol/toolbar/hardwareconfig.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

BIN
qml/resources/qgroundcontrol/toolbar/helpwizard.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

BIN
qml/resources/qgroundcontrol/toolbar/simulation.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

BIN
qml/resources/qgroundcontrol/toolbar/softwareconfig.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

BIN
qml/resources/qgroundcontrol/toolbar/terminal.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Loading…
Cancel
Save