diff --git a/.gitignore b/.gitignore
index 0637d11..15d9c7e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,3 +20,5 @@ qgroundcontrol
qgroundcontrol.xcodeproj/**
doc/html
doc/doxy.log
+deploy/mac
+deploy/linux
diff --git a/deploy/linux_create_debian_packet.sh b/deploy/linux_create_debian_packet.sh
new file mode 100644
index 0000000..8bd436b
--- /dev/null
+++ b/deploy/linux_create_debian_packet.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+# Clean build directories
+rm -rf linux
+mkdir -p linux
+# Change to build directory and compile application
+cd ..
+make -j4
+# Copy and build the application bundle
+cd deploy
+cp -r qgroundcontrol linux/.
+cp -r ../audio linux/.
+# FIXME Create debian packet
+echo -e '\n QGroundControl Debian packet is now ready for publishing\n'
diff --git a/deploy/mac_create_dmg.sh b/deploy/mac_create_dmg.sh
new file mode 100644
index 0000000..1994ed0
--- /dev/null
+++ b/deploy/mac_create_dmg.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+# Clean build directories
+rm -rf mac
+mkdir -p mac
+# Change to build directory and compile application
+cd ..
+make -j4
+# Copy and build the application bundle
+cd deploy
+cp -r ../bin/mac/qgroundcontrol.app mac/.
+cp -r ../audio mac/qgroundcontrol.app/Contents/MacOs/.
+macdeployqt qgroundcontrol.app --bundle
+echo -e '\n QGroundControl .DMG file is now ready for publishing\n'
diff --git a/mac_audiotest.sh b/mac_audiotest.sh
new file mode 100644
index 0000000..12cd0fa
--- /dev/null
+++ b/mac_audiotest.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+cp -r audio bin/mac/qgroundcontrol.app/Contents/MacOs/.
diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc
index 6259ceb..65f7c53 100644
--- a/src/ui/MainWindow.cc
+++ b/src/ui/MainWindow.cc
@@ -216,18 +216,28 @@ void MainWindow::saveScreen()
}
}
+/**
+ * Reload the style sheet from disk. The function tries to load "qgroundcontrol.css" from the application
+ * directory (which by default does not exist). If it fails, it will load the bundled default CSS
+ * from memory.
+ * To customize the application, just create a qgroundcontrol.css file in the application directory
+ */
void MainWindow::reloadStylesheet()
{
// Load style sheet
- //QFile styleSheet(MG::DIR::getSupportFilesDirectory() + "/images/style-mission.css");
- QFile styleSheet(":/images/style-mission.css");
- if (styleSheet.open(QIODevice::ReadOnly | QIODevice::Text)) {
- QString style = QString(styleSheet.readAll());
- style.replace("ICONDIR", MG::DIR::getIconDirectory());
+ QFile* styleSheet = new QFile(QCoreApplication::applicationDirPath() + "/qgroundcontrol.css");
+ if (!styleSheet->exists())
+ {
+ styleSheet = new QFile(":/images/style-mission.css");
+ }
+ if (styleSheet->open(QIODevice::ReadOnly | QIODevice::Text)) {
+ QString style = QString(styleSheet->readAll());
+ style.replace("ICONDIR", QCoreApplication::applicationDirPath()+ "/images/");
qApp->setStyleSheet(style);
} else {
- qDebug() << "Style not set:" << styleSheet.fileName() << "opened: " << styleSheet.isOpen();
+ qDebug() << "Style not set:" << styleSheet->fileName() << "opened: " << styleSheet->isOpen();
}
+ delete styleSheet;
}
void MainWindow::showStatusMessage(const QString& status, int timeout)
@@ -235,14 +245,9 @@ void MainWindow::showStatusMessage(const QString& status, int timeout)
statusBar->showMessage(status, timeout);
}
-void MainWindow::setLastAction(QString status)
-{
- showStatusMessage(status, 5);
-}
-
-void MainWindow::setLinkStatus(QString status)
+void MainWindow::showStatusMessage(const QString& status)
{
- showStatusMessage(status, 15);
+ statusBar->showMessage(status, 5);
}
/**
@@ -270,6 +275,7 @@ void MainWindow::connectActions()
connect(ui.actionEngineerView, SIGNAL(triggered()), this, SLOT(loadEngineerView()));
connect(ui.actionOperatorView, SIGNAL(triggered()), this, SLOT(loadOperatorView()));
connect(ui.actionSettingsView, SIGNAL(triggered()), this, SLOT(loadSettingsView()));
+ connect(ui.actionShow_full_view, SIGNAL(triggered()), this, SLOT(loadAllView()));
connect(ui.actionStyleConfig, SIGNAL(triggered()), this, SLOT(reloadStylesheet()));
// Joystick configuration
@@ -501,28 +507,65 @@ void MainWindow::loadEngineerView()
void MainWindow::loadAllView()
{
+ clearView();
+ GAudioOutput::instance()->say("Loaded complete view");
+
+ QDockWidget* containerPFD = new QDockWidget(tr("Primary Flight Display"), this);
+ containerPFD->setWidget(headDown1);
+ addDockWidget(Qt::RightDockWidgetArea, containerPFD);
+
+ QDockWidget* containerPayload = new QDockWidget(tr("Payload Status"), this);
+ containerPayload->setWidget(headDown2);
+ addDockWidget(Qt::RightDockWidgetArea, containerPayload);
+ headDown1->start();
+ headDown2->start();
+
+ // UAS CONTROL
+ QDockWidget* containerControl = new QDockWidget(tr("Control"), this);
+ containerControl->setWidget(control);
+ addDockWidget(Qt::LeftDockWidgetArea, containerControl);
+
+ // UAS LIST
+ QDockWidget* containerUASList = new QDockWidget(tr("Unmanned Systems"), this);
+ containerUASList->setWidget(list);
+ addDockWidget(Qt::BottomDockWidgetArea, containerUASList);
+
+ // UAS STATUS
+ QDockWidget* containerStatus = new QDockWidget(tr("Status Details"), this);
+ containerStatus->setWidget(info);
+ addDockWidget(Qt::LeftDockWidgetArea, containerStatus);
+
+ // WAYPOINT LIST
+ QDockWidget* containerWaypoints = new QDockWidget(tr("Waypoint List"), this);
+ containerWaypoints->setWidget(waypoints);
+ addDockWidget(Qt::BottomDockWidgetArea, containerWaypoints);
+
+ // DEBUG CONSOLE
+ QDockWidget* containerComm = new QDockWidget(tr("Communication Console"), this);
+ containerComm->setWidget(debugConsole);
+ addDockWidget(Qt::BottomDockWidgetArea, containerComm);
+
+ // OBJECT DETECTION
+ QDockWidget* containerObjRec = new QDockWidget(tr("Object Recognition"), this);
+ containerObjRec->setWidget(detection);
+ addDockWidget(Qt::RightDockWidgetArea, containerObjRec);
+
+ // LINE CHART
+ linechart->setActive(true);
+ centerStack->setCurrentWidget(linechart);
+
+ // ONBOARD PARAMETERS
+ QDockWidget* containerParams = new QDockWidget(tr("Onboard Parameters"), this);
+ containerParams->setWidget(parameters);
+ addDockWidget(Qt::RightDockWidgetArea, containerParams);
+
+ this->show();
}
void MainWindow::loadWidgets()
{
- loadOperatorView();
- //loadEngineerView();
+ //loadOperatorView();
+ loadEngineerView();
//loadPilotView();
}
-
-/*
-void MainWindow::removeCommConfAct(QAction* action)
-{
- ui.menuNetwork->removeAction(action);
-}*/
-
-void MainWindow::runTests()
-{
- // TODO Remove after debugging: Add fake data
- static double testvalue = 0.0f;
- testvalue += 0.01f;
- linechart->appendData(126, "test data", testvalue, MG::TIME::getGroundTimeNow());
-}
-
-
diff --git a/src/ui/MainWindow.h b/src/ui/MainWindow.h
index 8418eee..9e0a43e 100644
--- a/src/ui/MainWindow.h
+++ b/src/ui/MainWindow.h
@@ -76,32 +76,6 @@ public:
MainWindow(QWidget *parent = 0);
~MainWindow();
- QSettings settings;
- UASControlWidget* control;
- LinechartWidget* linechart;
- UASInfoWidget* info;
- CameraView* camera;
- UASListWidget* list;
- WaypointList* waypoints;
- ObjectDetectionView* detection;
- HUD* hud;
- PFD* pfd;
- GaugePanel* gaugePanel;
-
- // Popup widgets
- JoystickWidget* joystickWidget;
-
- JoystickInput* joystick;
-
- /** User interface actions **/
- QAction* connectUASAct;
- QAction* disconnectUASAct;
- QAction* startUASAct;
- QAction* returnUASAct;
- QAction* stopUASAct;
- QAction* killUASAct;
- QAction* simulateUASAct;
-
public slots:
/**
* @brief Shows a status message on the bottom status bar
@@ -112,8 +86,15 @@ public slots:
* @param timeout how long the status should be displayed
*/
void showStatusMessage(const QString& status, int timeout);
- void setLastAction(QString status);
- void setLinkStatus(QString status);
+ /**
+ * @brief Shows a status message on the bottom status bar
+ *
+ * The status message will be overwritten if a new message is posted to this function.
+ * it will be automatically hidden after 5 seconds.
+ *
+ * @param status message text
+ */
+ void showStatusMessage(const QString& status);
void addLink();
void addLink(LinkInterface* link);
void configure();
@@ -133,10 +114,8 @@ public slots:
/** @brief Load view with all widgets */
void loadAllView();
+ /** @brief Reload the CSS style sheet */
void reloadStylesheet();
-
- void runTests();
-
protected:
QStatusBar* statusBar;
QStatusBar* createStatusBar();
@@ -151,16 +130,39 @@ protected:
MAVLinkSimulationLink* simulationLink;
LinkInterface* udpLink;
- QDockWidget* controlDock;
- QStackedWidget* centerStack;
-
+ QSettings settings;
+ UASControlWidget* control;
+ LinechartWidget* linechart;
+ UASInfoWidget* info;
+ CameraView* camera;
+ UASListWidget* list;
+ WaypointList* waypoints;
+ ObjectDetectionView* detection;
+ HUD* hud;
DebugConsole* debugConsole;
MapWidget* map;
ParameterInterface* parameters;
XMLCommProtocolWidget* protocol;
HDDisplay* headDown1;
HDDisplay* headDown2;
+ GaugePanel* gaugePanel;
+ // Popup widgets
+ JoystickWidget* joystickWidget;
+
+ JoystickInput* joystick;
+
+ /** User interface actions **/
+ QAction* connectUASAct;
+ QAction* disconnectUASAct;
+ QAction* startUASAct;
+ QAction* returnUASAct;
+ QAction* stopUASAct;
+ QAction* killUASAct;
+ QAction* simulateUASAct;
+
+ QDockWidget* controlDock;
+ QStackedWidget* centerStack;
LogCompressor* comp;
QString screenFileName;
diff --git a/src/ui/MainWindow.ui b/src/ui/MainWindow.ui
index 8176b97..d77e4f2 100644
--- a/src/ui/MainWindow.ui
+++ b/src/ui/MainWindow.ui
@@ -74,6 +74,7 @@
+
@@ -243,6 +244,15 @@
Simulate one vehicle to test and evaluate this application
+
+
+
+ :/images/status/network-transmit-receive.svg:/images/status/network-transmit-receive.svg
+
+
+ Show full view
+
+