@ -1,55 +1,52 @@ |
|||||||
*.swp |
*.swp |
||||||
*.nfs |
*.nfs |
||||||
CMakeFiles |
CMakeFiles |
||||||
*Makefile* |
*Makefile* |
||||||
tags |
tags |
||||||
build*/ |
build*/ |
||||||
Info.plist |
Info.plist |
||||||
obj |
obj |
||||||
.DS_Store |
.DS_Store |
||||||
*.log |
*.log |
||||||
*~ |
*~ |
||||||
*~.skp |
*~.skp |
||||||
bin/*.exe |
bin/*.exe |
||||||
bin/*.txt |
bin/*.txt |
||||||
bin/mac |
bin/mac |
||||||
*pro.user* |
*pro.user* |
||||||
qrc_*.cpp |
qrc_*.cpp |
||||||
*.Debug |
*.Debug |
||||||
*.Release |
*.Release |
||||||
tmp |
tmp |
||||||
debug |
debug |
||||||
release |
release |
||||||
qgroundcontrol |
qgroundcontrol |
||||||
mavlinkgen-build-desktop |
mavlinkgen-build-desktop |
||||||
qgroundcontrol.xcodeproj/** |
qgroundcontrol.xcodeproj/** |
||||||
doc/html |
doc/html |
||||||
doc/doxy.log |
doc/doxy.log |
||||||
deploy/mac |
deploy/mac |
||||||
deploy/linux |
deploy/linux |
||||||
deploy/qgroundcontrol* |
deploy/qgroundcontrol* |
||||||
controller_log* |
controller_log* |
||||||
user_config.pri |
user_config.pri |
||||||
*.app |
*.app |
||||||
*.ncb |
*.ncb |
||||||
*.vcproj |
*.vcproj |
||||||
*.vcxproj* |
*.vcxproj* |
||||||
*.sdf |
*.sdf |
||||||
*.ipch |
*.ipch |
||||||
*.pdb |
*.pdb |
||||||
*.sln |
*.sln |
||||||
*.sln |
*.sln |
||||||
*.vcproj |
*.vcproj |
||||||
*.user |
*.user |
||||||
*.ncb |
*.ncb |
||||||
*.idb |
*.idb |
||||||
*.project |
*.project |
||||||
*.cproject |
*.cproject |
||||||
*.sln |
*.sln |
||||||
*.suo |
*.suo |
||||||
*.uhf.txt |
*.uhf.txt |
||||||
*.opensdf |
*.opensdf |
||||||
|
apmplanner2.xcodeproj/ |
||||||
thirdParty/qserialport-build-desktop/ |
|
||||||
thirdParty/qserialport/bin/ |
|
||||||
thirdParty/qserialport/lib/ |
|
||||||
|
@ -0,0 +1,75 @@ |
|||||||
|
import QtQuick 1.1 |
||||||
|
import "./components" |
||||||
|
|
||||||
|
|
||||||
|
Rectangle { |
||||||
|
id: toolbar |
||||||
|
width: parent.width |
||||||
|
height: 72 |
||||||
|
color: "black" |
||||||
|
border.color: "black" |
||||||
|
|
||||||
|
Row { |
||||||
|
anchors.left: parent.left |
||||||
|
spacing: 2 |
||||||
|
|
||||||
|
Button { |
||||||
|
id: flightDataView |
||||||
|
label: "FLIGHT DATA" |
||||||
|
image: "./resources/apmplanner/toolbar/flightdata.png" |
||||||
|
onClicked: { |
||||||
|
globalObj.selectFlightView() |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
Button { |
||||||
|
id: flightPlanView |
||||||
|
label: "FLIGHT PLAN" |
||||||
|
image: "./resources/apmplanner/toolbar/flightplanner.png" |
||||||
|
onClicked: globalObj.selectFlightPlanView() |
||||||
|
} |
||||||
|
|
||||||
|
Button { |
||||||
|
id: hardwareConfigView |
||||||
|
label: "HARDWARE" |
||||||
|
image: "./resources/apmplanner/toolbar/hardwareconfig.png" |
||||||
|
margins: 8 |
||||||
|
onClicked: globalObj.selectHardwareView() |
||||||
|
} |
||||||
|
|
||||||
|
Button { |
||||||
|
id: softwareConfigView |
||||||
|
label: "SOFTWARE" |
||||||
|
image: "./resources/apmplanner/toolbar/softwareconfig.png" |
||||||
|
margins: 8 |
||||||
|
onClicked: globalObj.selectSoftwareView() |
||||||
|
} |
||||||
|
|
||||||
|
Button { |
||||||
|
id: simualtionView |
||||||
|
label: "SIMULATION" |
||||||
|
image: "./resources/apmplanner/toolbar/simulation.png" |
||||||
|
onClicked: globalObj.selectSimulationView() |
||||||
|
} |
||||||
|
|
||||||
|
Button { |
||||||
|
id: terminalView |
||||||
|
label: "TERMINAL" |
||||||
|
image: "./resources/apmplanner/toolbar/terminal.png" |
||||||
|
onClicked: globalObj.selectTerminalView() |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
Row { |
||||||
|
anchors.left: parent.right |
||||||
|
spacing: 2 |
||||||
|
|
||||||
|
Button { |
||||||
|
id: connectButton |
||||||
|
label: "CONNECT" |
||||||
|
image: "./resources/apmplanner/toolbar/connect.png" |
||||||
|
onClicked: globalObj.connect() |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
@ -0,0 +1,70 @@ |
|||||||
|
import QtQuick 1.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: 2 |
||||||
|
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.") |
||||||
|
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 |
||||||
|
} |
||||||
|
|
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 2.8 KiB |
@ -0,0 +1,81 @@ |
|||||||
|
#include <QDebug> |
||||||
|
#include <QDeclarativeContext> |
||||||
|
#include <QGraphicsObject> |
||||||
|
|
||||||
|
#include "apmtoolbar.h" |
||||||
|
|
||||||
|
APMToolBar::APMToolBar(QWidget *parent) : |
||||||
|
QDeclarativeView(parent) |
||||||
|
{ |
||||||
|
// Configure our QML object
|
||||||
|
this->rootContext()->setContextProperty("globalObj", this); |
||||||
|
setSource(QUrl::fromLocalFile("qml/ApmToolBar.qml")); |
||||||
|
setResizeMode(QDeclarativeView::SizeRootObjectToView); |
||||||
|
} |
||||||
|
|
||||||
|
void APMToolBar::setFlightViewAction(QAction *action) |
||||||
|
{ |
||||||
|
connect(this, SIGNAL(selectFlightView()), action, SIGNAL(triggered())); |
||||||
|
} |
||||||
|
|
||||||
|
void APMToolBar::setFlightPlanViewAction(QAction *action) |
||||||
|
{ |
||||||
|
connect(this, SIGNAL(selectFlightPlanView()), action, SIGNAL(triggered())); |
||||||
|
} |
||||||
|
|
||||||
|
void APMToolBar::setHardwareViewAction(QAction *action) |
||||||
|
{ |
||||||
|
connect(this, SIGNAL(selectHardwareView()), action, SIGNAL(triggered())); |
||||||
|
} |
||||||
|
|
||||||
|
void APMToolBar::setSoftwareViewAction(QAction *action) |
||||||
|
{ |
||||||
|
connect(this, SIGNAL(selectSoftwareView()), action, SIGNAL(triggered())); |
||||||
|
} |
||||||
|
|
||||||
|
void APMToolBar::setSimulationViewAction(QAction *action) |
||||||
|
{ |
||||||
|
connect(this, SIGNAL(selectSimualtionView()), action, SIGNAL(triggered())); |
||||||
|
} |
||||||
|
|
||||||
|
void APMToolBar::setTerminalViewAction(QAction *action) |
||||||
|
{ |
||||||
|
connect(this, SIGNAL(selectTerminalView()), action, SIGNAL(triggered())); |
||||||
|
} |
||||||
|
|
||||||
|
void APMToolBar::selectFlightView() |
||||||
|
{ |
||||||
|
qDebug() << "APMToolBar: SelectFlightView"; |
||||||
|
// emit triggerFlightView();
|
||||||
|
} |
||||||
|
|
||||||
|
void APMToolBar::selectFlightPlanView() |
||||||
|
{ |
||||||
|
qDebug() << "APMToolBar: SelectFlightPlanView"; |
||||||
|
} |
||||||
|
|
||||||
|
void APMToolBar::selectHardwareView() |
||||||
|
{ |
||||||
|
qDebug() << "APMToolBar: selectHardwareView"; |
||||||
|
} |
||||||
|
|
||||||
|
void APMToolBar::selectSoftwareView() |
||||||
|
{ |
||||||
|
qDebug() << "APMToolBar: selectSoftwareView"; |
||||||
|
} |
||||||
|
|
||||||
|
void APMToolBar::selectSimulationView() |
||||||
|
{ |
||||||
|
qDebug() << "APMToolBar: selectSimulationView"; |
||||||
|
} |
||||||
|
|
||||||
|
void APMToolBar::selectTerminalView() |
||||||
|
{ |
||||||
|
qDebug() << "APMToolBar: selectTerminalView"; |
||||||
|
} |
||||||
|
|
||||||
|
void APMToolBar::connectMAV() |
||||||
|
{ |
||||||
|
qDebug() << "APMToolBar: connect"; |
||||||
|
} |
||||||
|
|
@ -0,0 +1,41 @@ |
|||||||
|
#ifndef APMTOOLBAR_H |
||||||
|
#define APMTOOLBAR_H |
||||||
|
|
||||||
|
#include <QAction> |
||||||
|
#include <QDeclarativeView> |
||||||
|
|
||||||
|
class APMToolBar : public QDeclarativeView |
||||||
|
{ |
||||||
|
Q_OBJECT |
||||||
|
public: |
||||||
|
explicit APMToolBar(QWidget *parent = 0); |
||||||
|
|
||||||
|
void setFlightViewAction(QAction *action); |
||||||
|
void setFlightPlanViewAction(QAction *action); |
||||||
|
void setHardwareViewAction(QAction *action); |
||||||
|
void setSoftwareViewAction(QAction *action); |
||||||
|
void setSimulationViewAction(QAction *action); |
||||||
|
void setTerminalViewAction(QAction *action); |
||||||
|
|
||||||
|
signals: |
||||||
|
void triggerFlightView(); |
||||||
|
void triggerFlightPlanView(); |
||||||
|
void triggerHardwareView(); |
||||||
|
void triggerSoftwareView(); |
||||||
|
void triggerSimulationView(); |
||||||
|
void triggerTerminalView(); |
||||||
|
|
||||||
|
public slots: |
||||||
|
//signals:
|
||||||
|
void selectFlightView(); |
||||||
|
void selectFlightPlanView(); |
||||||
|
void selectHardwareView(); |
||||||
|
void selectSoftwareView(); |
||||||
|
void selectSimulationView(); |
||||||
|
void selectTerminalView(); |
||||||
|
|
||||||
|
public slots: |
||||||
|
void connectMAV(); |
||||||
|
}; |
||||||
|
|
||||||
|
#endif // APMTOOLBAR_H
|