Commit 73436f42 authored by pixhawk's avatar pixhawk

Enabled selection of individual widgets in menu, persistence pending

parent 27737cde
......@@ -133,11 +133,13 @@ macx {
exists(/opt/local/include/libfreenect) {
message("Building support for libfreenect")
message("ENABLED support for libfreenect")
DEPENDENCIES_PRESENT += libfreenect
# Include libfreenect libraries
LIBS += -lfreenect
DEFINES += QGC_LIBFREENECT_ENABLED
} else {
message("DISABLED libfreenect support")
}
# osg/osgEarth dynamic casts might fail without this compiler option.
......
......@@ -14,6 +14,9 @@ namespace QGC
/** @brief Get the current ground time in microseconds */
quint64 groundTimeUsecs();
const QString APPNAME = "QGROUNDCONTROL";
const QString COMPANYNAME = "OPENMAV";
}
#endif // QGC_H
......@@ -165,6 +165,19 @@ HUD::~HUD()
}
void HUD::showEvent(QShowEvent* event)
{
Q_UNUSED(event);
if (isVisible())
{
refreshTimer->start();
}
else
{
refreshTimer->stop();
}
}
void HUD::start()
{
refreshTimer->start();
......
......@@ -123,6 +123,8 @@ protected:
float refLineWidthToPen(float line);
/** @brief Rotate a polygon around a point clockwise */
void rotatePolygonClockWiseRad(QPolygonF& p, float angle, QPointF origin);
/** @brief Override base class show */
virtual void showEvent(QShowEvent* event);
QImage* image; ///< Double buffer image
QImage glImage; ///< The background / camera image
......
This diff is collapsed.
......@@ -160,8 +160,8 @@ protected:
void arrangeCenterStack();
void configureWindowName();
void createCenterWidgetMenu();
void createDockWidgetMenu();
QMenu* createCenterWidgetMenu();
QMenu* createDockWidgetMenu();
// TODO Should be moved elsewhere, as the protocol does not belong to the UI
MAVLinkProtocol* mavlink;
......@@ -203,6 +203,7 @@ protected:
QPointer<QDockWidget> headUpDockWidget;
QPointer<QDockWidget> hsiDockWidget;
QPointer<QDockWidget> rcViewDockWidget;
QPointer<QDockWidget> hudDockWidget;
QPointer<QDockWidget> slugsDataWidget;
QPointer<QDockWidget> slugsPIDControlWidget;
QPointer<QDockWidget> slugsHilSimWidget;
......
......@@ -7,6 +7,7 @@
#include "ui_XMLCommProtocolWidget.h"
#include "MAVLinkXMLParser.h"
#include "MAVLinkSyntaxHighlighter.h"
#include "QGC.h"
#include <QDebug>
#include <iostream>
......@@ -31,7 +32,7 @@ XMLCommProtocolWidget::XMLCommProtocolWidget(QWidget *parent) :
void XMLCommProtocolWidget::selectXMLFile()
{
//QString fileName = QFileDialog::getOpenFileName(this, tr("Load Protocol Definition File"), ".", "*.xml");
QSettings settings;
QSettings settings(QGC::COMPANYNAME, QGC::APPNAME);
const QString mavlinkXML = "MAVLINK_XML_FILE";
QString dirPath = settings.value(mavlinkXML, QCoreApplication::applicationDirPath() + "../").toString();
QFileDialog dialog;
......@@ -92,7 +93,7 @@ void XMLCommProtocolWidget::setXML(const QString& xml)
void XMLCommProtocolWidget::selectOutputDirectory()
{
QSettings settings;
QSettings settings(QGC::COMPANYNAME, QGC::APPNAME);
const QString mavlinkOutputDir = "MAVLINK_OUTPUT_DIR";
QString dirPath = settings.value(mavlinkOutputDir, QCoreApplication::applicationDirPath() + "../").toString();
QFileDialog dialog;
......@@ -110,7 +111,7 @@ void XMLCommProtocolWidget::selectOutputDirectory()
{
m_ui->outputDirNameLabel->setText(fileNames.first());
// Store directory for next time
settings.setValue(mavlinkOutputDir, fileNames.first());
settings.setValue(mavlinkOutputDir, QFileInfo(fileNames.first()).absoluteFilePath());
//QFile file(fileName);
}
}
......
......@@ -159,7 +159,9 @@ void LinechartWidget::createLayout()
QToolButton* timeButton = new QToolButton(this);
timeButton->setText(tr("Ground Time"));
timeButton->setCheckable(true);
timeButton->setChecked(false);
bool gTimeDefault = true;
if (activePlot) activePlot->enforceGroundTime(gTimeDefault);
timeButton->setChecked(gTimeDefault);
layout->addWidget(timeButton, 1, 4);
layout->setColumnStretch(4, 0);
connect(timeButton, SIGNAL(clicked(bool)), activePlot, SLOT(enforceGroundTime(bool)));
......@@ -442,6 +444,12 @@ void LinechartWidget::removeCurve(QString curve)
// Remove name
}
void LinechartWidget::showEvent(QShowEvent* event)
{
Q_UNUSED(event);
setActive(isVisible());
}
void LinechartWidget::setActive(bool active)
{
if (activePlot)
......
......@@ -77,6 +77,8 @@ public slots:
void setPlotWindowPosition(int scrollBarValue);
void setPlotWindowPosition(quint64 position);
void setPlotInterval(quint64 interval);
/** @brief Override base class show */
virtual void showEvent(QShowEvent* event);
void setActive(bool active);
/** @brief Set the number of values to average over */
void setAverageWindow(int windowSize);
......
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