Commit 9ab80260 authored by lm's avatar lm

Fixed icon and audio paths, added "all" view which contains almost all widgets

parent 966cad30
...@@ -20,3 +20,5 @@ qgroundcontrol ...@@ -20,3 +20,5 @@ qgroundcontrol
qgroundcontrol.xcodeproj/** qgroundcontrol.xcodeproj/**
doc/html doc/html
doc/doxy.log doc/doxy.log
deploy/mac
deploy/linux
#!/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'
#!/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'
#!/bin/sh
cp -r audio bin/mac/qgroundcontrol.app/Contents/MacOs/.
...@@ -216,18 +216,28 @@ void MainWindow::saveScreen() ...@@ -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() void MainWindow::reloadStylesheet()
{ {
// Load style sheet // Load style sheet
//QFile styleSheet(MG::DIR::getSupportFilesDirectory() + "/images/style-mission.css"); QFile* styleSheet = new QFile(QCoreApplication::applicationDirPath() + "/qgroundcontrol.css");
QFile styleSheet(":/images/style-mission.css"); if (!styleSheet->exists())
if (styleSheet.open(QIODevice::ReadOnly | QIODevice::Text)) { {
QString style = QString(styleSheet.readAll()); styleSheet = new QFile(":/images/style-mission.css");
style.replace("ICONDIR", MG::DIR::getIconDirectory()); }
if (styleSheet->open(QIODevice::ReadOnly | QIODevice::Text)) {
QString style = QString(styleSheet->readAll());
style.replace("ICONDIR", QCoreApplication::applicationDirPath()+ "/images/");
qApp->setStyleSheet(style); qApp->setStyleSheet(style);
} else { } 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) void MainWindow::showStatusMessage(const QString& status, int timeout)
...@@ -235,14 +245,9 @@ void MainWindow::showStatusMessage(const QString& status, int timeout) ...@@ -235,14 +245,9 @@ void MainWindow::showStatusMessage(const QString& status, int timeout)
statusBar->showMessage(status, timeout); statusBar->showMessage(status, timeout);
} }
void MainWindow::setLastAction(QString status) void MainWindow::showStatusMessage(const QString& status)
{
showStatusMessage(status, 5);
}
void MainWindow::setLinkStatus(QString status)
{ {
showStatusMessage(status, 15); statusBar->showMessage(status, 5);
} }
/** /**
...@@ -270,6 +275,7 @@ void MainWindow::connectActions() ...@@ -270,6 +275,7 @@ void MainWindow::connectActions()
connect(ui.actionEngineerView, SIGNAL(triggered()), this, SLOT(loadEngineerView())); connect(ui.actionEngineerView, SIGNAL(triggered()), this, SLOT(loadEngineerView()));
connect(ui.actionOperatorView, SIGNAL(triggered()), this, SLOT(loadOperatorView())); connect(ui.actionOperatorView, SIGNAL(triggered()), this, SLOT(loadOperatorView()));
connect(ui.actionSettingsView, SIGNAL(triggered()), this, SLOT(loadSettingsView())); 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())); connect(ui.actionStyleConfig, SIGNAL(triggered()), this, SLOT(reloadStylesheet()));
// Joystick configuration // Joystick configuration
...@@ -501,28 +507,65 @@ void MainWindow::loadEngineerView() ...@@ -501,28 +507,65 @@ void MainWindow::loadEngineerView()
void MainWindow::loadAllView() 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() void MainWindow::loadWidgets()
{ {
loadOperatorView(); //loadOperatorView();
//loadEngineerView(); loadEngineerView();
//loadPilotView(); //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());
}
...@@ -76,32 +76,6 @@ public: ...@@ -76,32 +76,6 @@ public:
MainWindow(QWidget *parent = 0); MainWindow(QWidget *parent = 0);
~MainWindow(); ~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: public slots:
/** /**
* @brief Shows a status message on the bottom status bar * @brief Shows a status message on the bottom status bar
...@@ -112,8 +86,15 @@ public slots: ...@@ -112,8 +86,15 @@ public slots:
* @param timeout how long the status should be displayed * @param timeout how long the status should be displayed
*/ */
void showStatusMessage(const QString& status, int timeout); 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();
void addLink(LinkInterface* link); void addLink(LinkInterface* link);
void configure(); void configure();
...@@ -133,10 +114,8 @@ public slots: ...@@ -133,10 +114,8 @@ public slots:
/** @brief Load view with all widgets */ /** @brief Load view with all widgets */
void loadAllView(); void loadAllView();
/** @brief Reload the CSS style sheet */
void reloadStylesheet(); void reloadStylesheet();
void runTests();
protected: protected:
QStatusBar* statusBar; QStatusBar* statusBar;
QStatusBar* createStatusBar(); QStatusBar* createStatusBar();
...@@ -151,16 +130,39 @@ protected: ...@@ -151,16 +130,39 @@ protected:
MAVLinkSimulationLink* simulationLink; MAVLinkSimulationLink* simulationLink;
LinkInterface* udpLink; LinkInterface* udpLink;
QDockWidget* controlDock; QSettings settings;
QStackedWidget* centerStack; UASControlWidget* control;
LinechartWidget* linechart;
UASInfoWidget* info;
CameraView* camera;
UASListWidget* list;
WaypointList* waypoints;
ObjectDetectionView* detection;
HUD* hud;
DebugConsole* debugConsole; DebugConsole* debugConsole;
MapWidget* map; MapWidget* map;
ParameterInterface* parameters; ParameterInterface* parameters;
XMLCommProtocolWidget* protocol; XMLCommProtocolWidget* protocol;
HDDisplay* headDown1; HDDisplay* headDown1;
HDDisplay* headDown2; 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; LogCompressor* comp;
QString screenFileName; QString screenFileName;
......
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
<addaction name="actionOperatorView"/> <addaction name="actionOperatorView"/>
<addaction name="actionSettingsView"/> <addaction name="actionSettingsView"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionShow_full_view"/>
<addaction name="actionStyleConfig"/> <addaction name="actionStyleConfig"/>
</widget> </widget>
<addaction name="menuMGround"/> <addaction name="menuMGround"/>
...@@ -243,6 +244,15 @@ ...@@ -243,6 +244,15 @@
<string>Simulate one vehicle to test and evaluate this application</string> <string>Simulate one vehicle to test and evaluate this application</string>
</property> </property>
</action> </action>
<action name="actionShow_full_view">
<property name="icon">
<iconset resource="../../mavground.qrc">
<normaloff>:/images/status/network-transmit-receive.svg</normaloff>:/images/status/network-transmit-receive.svg</iconset>
</property>
<property name="text">
<string>Show full view</string>
</property>
</action>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<resources> <resources>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment