mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
GCS/empty,map,scope: Cleanup of uav gadget interface.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@394 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
058b261b82
commit
d642b4a012
@ -27,8 +27,8 @@
|
||||
#include "emptygadget.h"
|
||||
#include "emptygadgetwidget.h"
|
||||
|
||||
EmptyGadget::EmptyGadget(QString classId, QList<IUAVGadgetConfiguration*> *configurations, EmptyGadgetWidget *widget) :
|
||||
IUAVGadget(classId, configurations, widget),
|
||||
EmptyGadget::EmptyGadget(QString classId, EmptyGadgetWidget *widget, QWidget *parent) :
|
||||
IUAVGadget(classId, parent),
|
||||
m_widget(widget)
|
||||
{
|
||||
}
|
||||
|
@ -30,9 +30,11 @@
|
||||
|
||||
#include <coreplugin/iuavgadget.h>
|
||||
|
||||
namespace Core {
|
||||
class IUAVGadget;
|
||||
class QWidget;
|
||||
class QString;
|
||||
}
|
||||
//class QWidget;
|
||||
//class QString;
|
||||
class EmptyGadgetWidget;
|
||||
|
||||
using namespace Core;
|
||||
@ -41,7 +43,7 @@ class EmptyGadget : public Core::IUAVGadget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
EmptyGadget(QString classId, QList<IUAVGadgetConfiguration*> *configurations, EmptyGadgetWidget *widget = 0);
|
||||
EmptyGadget(QString classId, EmptyGadgetWidget *widget, QWidget *parent = 0);
|
||||
~EmptyGadget();
|
||||
|
||||
QList<int> context() const { return m_context; }
|
||||
|
@ -41,7 +41,7 @@ EmptyGadgetFactory::~EmptyGadgetFactory()
|
||||
|
||||
}
|
||||
|
||||
Core::IUAVGadget* EmptyGadgetFactory::createGadget(QList<IUAVGadgetConfiguration*> *configurations, QWidget *parent) {
|
||||
EmptyGadgetWidget* gadgetWidget = new EmptyGadgetWidget(parent);
|
||||
return new EmptyGadget(QString("EmptyGadget"), configurations, gadgetWidget);
|
||||
IUAVGadget* EmptyGadgetFactory::createGadget(QWidget *parent) {
|
||||
EmptyGadgetWidget* gadgetWidget = new EmptyGadgetWidget(parent);
|
||||
return new EmptyGadget(QString("EmptyGadget"), gadgetWidget, parent);
|
||||
}
|
||||
|
@ -30,18 +30,21 @@
|
||||
|
||||
#include <coreplugin/iuavgadgetfactory.h>
|
||||
|
||||
using namespace Core;
|
||||
namespace Core {
|
||||
class IUAVGadget;
|
||||
class IUAVGadgetFactory;
|
||||
}
|
||||
|
||||
class EmptyGadgetFactory : public Core::IUAVGadgetFactory
|
||||
using namespace Core;
|
||||
|
||||
class EmptyGadgetFactory : public IUAVGadgetFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
EmptyGadgetFactory(QObject *parent = 0);
|
||||
~EmptyGadgetFactory();
|
||||
|
||||
Core::IUAVGadget *createGadget(QList<IUAVGadgetConfiguration*> *configurations, QWidget *parent);
|
||||
IUAVGadget *createGadget(QWidget *parent);
|
||||
};
|
||||
|
||||
#endif // EMPTYGADGETFACTORY_H_
|
||||
|
@ -28,8 +28,8 @@
|
||||
#include "mapgadgetwidget.h"
|
||||
#include "mapgadgetconfiguration.h"
|
||||
|
||||
MapGadget::MapGadget(QString classId, QList<IUAVGadgetConfiguration*> *configurations, MapGadgetWidget *widget) :
|
||||
IUAVGadget(classId, configurations, widget),
|
||||
MapGadget::MapGadget(QString classId, MapGadgetWidget *widget, QWidget *parent) :
|
||||
IUAVGadget(classId, parent),
|
||||
m_widget(widget)
|
||||
{
|
||||
}
|
||||
@ -41,8 +41,6 @@ MapGadget::~MapGadget()
|
||||
|
||||
void MapGadget::loadConfiguration(IUAVGadgetConfiguration* config)
|
||||
{
|
||||
setActiveConfiguration(config);
|
||||
|
||||
MapGadgetConfiguration *m = qobject_cast<MapGadgetConfiguration*>(config);
|
||||
m_widget->setZoom(m->zoom());
|
||||
m_widget->setPosition(QPointF(m->longitude(), m->latitude()));
|
||||
|
@ -43,17 +43,14 @@ class MapGadget : public Core::IUAVGadget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MapGadget(QString classId, QList<IUAVGadgetConfiguration*> *configurations, MapGadgetWidget *widget = 0);
|
||||
MapGadget(QString classId, MapGadgetWidget *widget, QWidget *parent = 0);
|
||||
~MapGadget();
|
||||
|
||||
QList<int> context() const { return m_context; }
|
||||
QWidget *widget() { return m_widget; }
|
||||
QString contextHelpId() const { return QString(); }
|
||||
void loadConfiguration(IUAVGadgetConfiguration* config);
|
||||
|
||||
private:
|
||||
MapGadgetWidget *m_widget;
|
||||
QList<int> m_context;
|
||||
MapGadgetWidget *m_widget;
|
||||
};
|
||||
|
||||
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "mapgadget.h"
|
||||
#include "mapgadgetconfiguration.h"
|
||||
#include "mapgadgetoptionspage.h"
|
||||
#include <coreplugin/uavgadgetoptionspagedecorator.h>
|
||||
#include <coreplugin/iuavgadget.h>
|
||||
|
||||
MapGadgetFactory::MapGadgetFactory(QObject *parent) :
|
||||
@ -41,10 +40,10 @@ MapGadgetFactory::~MapGadgetFactory()
|
||||
{
|
||||
}
|
||||
|
||||
Core::IUAVGadget* MapGadgetFactory::createGadget(QList<IUAVGadgetConfiguration*> *configurations, QWidget *parent)
|
||||
Core::IUAVGadget* MapGadgetFactory::createGadget(QWidget *parent)
|
||||
{
|
||||
MapGadgetWidget* gadgetWidget = new MapGadgetWidget(parent);
|
||||
return new MapGadget(QString("MapGadget"), configurations, gadgetWidget);
|
||||
MapGadgetWidget* gadgetWidget = new MapGadgetWidget(parent);
|
||||
return new MapGadget(QString("MapGadget"), gadgetWidget, parent);
|
||||
}
|
||||
|
||||
IUAVGadgetConfiguration *MapGadgetFactory::createConfiguration(bool locked,
|
||||
@ -56,7 +55,6 @@ IUAVGadgetConfiguration *MapGadgetFactory::createConfiguration(bool locked,
|
||||
|
||||
IOptionsPage *MapGadgetFactory::createOptionsPage(IUAVGadgetConfiguration *config)
|
||||
{
|
||||
MapGadgetOptionsPage *page = new MapGadgetOptionsPage(config);
|
||||
return new UAVGadgetOptionsPageDecorator(page, config);
|
||||
return new MapGadgetOptionsPage(config);
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
MapGadgetFactory(QObject *parent = 0);
|
||||
~MapGadgetFactory();
|
||||
|
||||
Core::IUAVGadget *createGadget(QList<IUAVGadgetConfiguration*> *configurations, QWidget *parent);
|
||||
Core::IUAVGadget *createGadget(QWidget *parent);
|
||||
IUAVGadgetConfiguration *createConfiguration(bool locked,
|
||||
const QString configName,
|
||||
const QByteArray &state);
|
||||
|
@ -7,8 +7,8 @@
|
||||
#include "scopegadget.h"
|
||||
#include "scopegadgetwidget.h"
|
||||
|
||||
ScopeGadget::ScopeGadget(QString classId, QList<IUAVGadgetConfiguration*> *configurations, ScopeGadgetWidget *widget) :
|
||||
IUAVGadget(classId, configurations, widget),
|
||||
ScopeGadget::ScopeGadget(QString classId, ScopeGadgetWidget *widget, QWidget *parent) :
|
||||
IUAVGadget(classId, parent),
|
||||
m_widget(widget)
|
||||
{
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ class ScopeGadget : public Core::IUAVGadget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ScopeGadget(QString classId, QList<IUAVGadgetConfiguration*> *configurations, ScopeGadgetWidget *widget = 0);
|
||||
ScopeGadget(QString classId, ScopeGadgetWidget *widget, QWidget *parent = 0);
|
||||
~ScopeGadget();
|
||||
|
||||
QList<int> context() const { return m_context; }
|
||||
|
@ -21,7 +21,7 @@ ScopeGadgetFactory::~ScopeGadgetFactory()
|
||||
|
||||
}
|
||||
|
||||
Core::IUAVGadget* ScopeGadgetFactory::createGadget(QList<IUAVGadgetConfiguration*> *configurations, QWidget *parent) {
|
||||
ScopeGadgetWidget* gadgetWidget = new ScopeGadgetWidget(parent);
|
||||
return new ScopeGadget(QString("ScopeGadget"), configurations, gadgetWidget);
|
||||
Core::IUAVGadget* ScopeGadgetFactory::createGadget(QWidget *parent) {
|
||||
ScopeGadgetWidget* gadgetWidget = new ScopeGadgetWidget(parent);
|
||||
return new ScopeGadget(QString("ScopeGadget"), gadgetWidget, parent);
|
||||
}
|
||||
|
@ -10,18 +10,21 @@
|
||||
|
||||
#include <coreplugin/iuavgadgetfactory.h>
|
||||
|
||||
using namespace Core;
|
||||
namespace Core {
|
||||
class IUAVGadget;
|
||||
class IUAVGadgetFactory;
|
||||
}
|
||||
|
||||
class ScopeGadgetFactory : public Core::IUAVGadgetFactory
|
||||
using namespace Core;
|
||||
|
||||
class ScopeGadgetFactory : public IUAVGadgetFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ScopeGadgetFactory(QObject *parent = 0);
|
||||
~ScopeGadgetFactory();
|
||||
|
||||
Core::IUAVGadget *createGadget(QList<IUAVGadgetConfiguration*> *configurations, QWidget *parent);
|
||||
IUAVGadget *createGadget(QWidget *parent);
|
||||
};
|
||||
|
||||
#endif // SCOPEGADGETFACTORY_H_
|
||||
|
Loading…
Reference in New Issue
Block a user