1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-16 23:23:50 +01:00
LibrePilot/ground/src/plugins/map/mapgadget.cpp

31 lines
738 B
C++
Raw Normal View History

/*
* mapgadget.cpp
*
* Created on: Mar 11, 2010
* Author: peter
*/
#include "mapgadget.h"
#include "mapgadgetwidget.h"
#include "mapgadgetconfiguration.h"
MapGadget::MapGadget(QString classId, QList<IUAVGadgetConfiguration*> *configurations, MapGadgetWidget *widget) :
IUAVGadget(classId, configurations, widget),
m_widget(widget)
{
}
MapGadget::~MapGadget()
{
}
void MapGadget::loadConfiguration(IUAVGadgetConfiguration* config)
{
MapGadgetConfiguration *m = qobject_cast<MapGadgetConfiguration*>(config);
m_widget->setZoom(m->zoom());
m_widget->setPosition(QPointF(m->longitude(), m->latitude()));
int index = m_toolbar->findText(config->name());
m_toolbar->setCurrentIndex(index);
}