Commit 1af73389 authored by lm's avatar lm

Cleanups

parent 29da5425
...@@ -569,7 +569,10 @@ void HUD::paintHUD() ...@@ -569,7 +569,10 @@ void HUD::paintHUD()
float yawTrans = yawInt * (double)maxYawTrans; float yawTrans = yawInt * (double)maxYawTrans;
yawInt *= 0.6f; yawInt *= 0.6f;
//qDebug() << "yaw translation" << yawTrans << "integral" << yawInt << "difference" << yawDiff << "yaw" << yaw << "asin(yawInt)" << asinYaw;
if ((yawTrans < 5.0) && (yawTrans > -5.0)) yawTrans = 0;
qDebug() << "yaw translation" << yawTrans << "integral" << yawInt << "difference" << yawDiff << "yaw" << yaw;
// Update scaling factor // Update scaling factor
// adjust scaling to fit both horizontally and vertically // adjust scaling to fit both horizontally and vertically
......
...@@ -48,6 +48,10 @@ This file is part of the QGROUNDCONTROL project ...@@ -48,6 +48,10 @@ This file is part of the QGROUNDCONTROL project
#include "JoystickWidget.h" #include "JoystickWidget.h"
#include "GAudioOutput.h" #include "GAudioOutput.h"
// FIXME Move
#include "PxQuadMAV.h"
#include "SlugsMAV.h"
#include "LogCompressor.h" #include "LogCompressor.h"
...@@ -344,6 +348,12 @@ void MainWindow::UASCreated(UASInterface* uas) ...@@ -344,6 +348,12 @@ void MainWindow::UASCreated(UASInterface* uas)
// Revalidate UI // Revalidate UI
// TODO Stylesheet reloading should in theory not be necessary // TODO Stylesheet reloading should in theory not be necessary
reloadStylesheet(); reloadStylesheet();
// Check which type this UAS is of
PxQuadMAV* mav = dynamic_cast<PxQuadMAV*>(uas);
if (mav) loadPixhawkView();
SlugsMAV* mav2 = dynamic_cast<SlugsMAV*>(uas);
if (mav2) loadSlugsView();
} }
/** /**
...@@ -377,6 +387,98 @@ void MainWindow::clearView() ...@@ -377,6 +387,98 @@ void MainWindow::clearView()
} }
} }
void MainWindow::loadSlugsView()
{
clearView();
// Engineer view, used in EMAV2009
// LINE CHART
linechart->setActive(true);
centerStack->setCurrentWidget(linechart);
// UAS CONTROL
QDockWidget* container1 = new QDockWidget(tr("Control"), this);
container1->setWidget(control);
addDockWidget(Qt::LeftDockWidgetArea, container1);
// UAS LIST
QDockWidget* container4 = new QDockWidget(tr("Unmanned Systems"), this);
container4->setWidget(list);
addDockWidget(Qt::BottomDockWidgetArea, container4);
// UAS STATUS
QDockWidget* container3 = new QDockWidget(tr("Status Details"), this);
container3->setWidget(info);
addDockWidget(Qt::LeftDockWidgetArea, container3);
// HORIZONTAL SITUATION INDICATOR
QDockWidget* container6 = new QDockWidget(tr("Horizontal Situation Indicator"), this);
container6->setWidget(hsi);
hsi->start();
addDockWidget(Qt::LeftDockWidgetArea, container6);
// WAYPOINT LIST
QDockWidget* container5 = new QDockWidget(tr("Waypoint List"), this);
container5->setWidget(waypoints);
addDockWidget(Qt::BottomDockWidgetArea, container5);
// DEBUG CONSOLE
QDockWidget* container7 = new QDockWidget(tr("Communication Console"), this);
container7->setWidget(debugConsole);
addDockWidget(Qt::BottomDockWidgetArea, container7);
// ONBOARD PARAMETERS
QDockWidget* containerParams = new QDockWidget(tr("Onboard Parameters"), this);
containerParams->setWidget(parameters);
addDockWidget(Qt::RightDockWidgetArea, containerParams);
this->show();
}
void MainWindow::loadPixhawkView()
{
clearView();
// Engineer view, used in EMAV2009
// LINE CHART
linechart->setActive(true);
centerStack->setCurrentWidget(linechart);
// UAS CONTROL
QDockWidget* container1 = new QDockWidget(tr("Control"), this);
container1->setWidget(control);
addDockWidget(Qt::LeftDockWidgetArea, container1);
// UAS LIST
QDockWidget* container4 = new QDockWidget(tr("Unmanned Systems"), this);
container4->setWidget(list);
addDockWidget(Qt::BottomDockWidgetArea, container4);
// UAS STATUS
QDockWidget* container3 = new QDockWidget(tr("Status Details"), this);
container3->setWidget(info);
addDockWidget(Qt::LeftDockWidgetArea, container3);
// WAYPOINT LIST
QDockWidget* container5 = new QDockWidget(tr("Waypoint List"), this);
container5->setWidget(waypoints);
addDockWidget(Qt::BottomDockWidgetArea, container5);
// DEBUG CONSOLE
QDockWidget* container7 = new QDockWidget(tr("Communication Console"), this);
container7->setWidget(debugConsole);
addDockWidget(Qt::BottomDockWidgetArea, container7);
// ONBOARD PARAMETERS
QDockWidget* containerParams = new QDockWidget(tr("Onboard Parameters"), this);
containerParams->setWidget(parameters);
addDockWidget(Qt::RightDockWidgetArea, containerParams);
this->show();
}
void MainWindow::loadPilotView() void MainWindow::loadPilotView()
{ {
clearView(); clearView();
...@@ -490,12 +592,6 @@ void MainWindow::loadEngineerView() ...@@ -490,12 +592,6 @@ void MainWindow::loadEngineerView()
container3->setWidget(info); container3->setWidget(info);
addDockWidget(Qt::LeftDockWidgetArea, container3); addDockWidget(Qt::LeftDockWidgetArea, container3);
// HORIZONTAL SITUATION INDICATOR
QDockWidget* container6 = new QDockWidget(tr("Horizontal Situation Indicator"), this);
container6->setWidget(hsi);
hsi->start();
addDockWidget(Qt::LeftDockWidgetArea, container6);
// WAYPOINT LIST // WAYPOINT LIST
QDockWidget* container5 = new QDockWidget(tr("Waypoint List"), this); QDockWidget* container5 = new QDockWidget(tr("Waypoint List"), this);
container5->setWidget(waypoints); container5->setWidget(waypoints);
......
...@@ -117,6 +117,10 @@ public slots: ...@@ -117,6 +117,10 @@ public slots:
/** @brief Load MAVLink XML generator view */ /** @brief Load MAVLink XML generator view */
void loadMAVLinkView(); void loadMAVLinkView();
// Fixme find a nicer solution that scales to more AP types
void loadSlugsView();
void loadPixhawkView();
/** @brief Reload the CSS style sheet */ /** @brief Reload the CSS style sheet */
void reloadStylesheet(); void reloadStylesheet();
protected: protected:
......
...@@ -270,6 +270,7 @@ void QGCParamWidget::requestParameterList() ...@@ -270,6 +270,7 @@ void QGCParamWidget::requestParameterList()
// Clear view and request param list // Clear view and request param list
clear(); clear();
parameters.clear(); parameters.clear();
received.clear();
mav->requestParameters(); mav->requestParameters();
} }
......
...@@ -83,6 +83,7 @@ protected: ...@@ -83,6 +83,7 @@ protected:
QMap<int, QMap<QString, QTreeWidgetItem*>* > paramGroups; ///< Parameter groups QMap<int, QMap<QString, QTreeWidgetItem*>* > paramGroups; ///< Parameter groups
QMap<int, QMap<QString, float>* > changedValues; ///< Changed values QMap<int, QMap<QString, float>* > changedValues; ///< Changed values
QMap<int, QMap<QString, float>* > parameters; ///< All parameters QMap<int, QMap<QString, float>* > parameters; ///< All parameters
QVector<bool> received; ///< Successfully received parameters
}; };
......
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