mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
GCS/map: Some cleanup of map gadget.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@390 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
4638a82b75
commit
31107be978
@ -1,8 +1,28 @@
|
|||||||
/*
|
/**
|
||||||
* mapgadget.cpp
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* Created on: Mar 11, 2010
|
* @file mapgadget.cpp
|
||||||
* Author: peter
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
|
* @brief
|
||||||
|
* @see The GNU Public License (GPL) Version 3
|
||||||
|
* @defgroup map
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
*****************************************************************************/
|
||||||
|
/*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#include "mapgadget.h"
|
#include "mapgadget.h"
|
||||||
#include "mapgadgetwidget.h"
|
#include "mapgadgetwidget.h"
|
||||||
@ -21,10 +41,10 @@ MapGadget::~MapGadget()
|
|||||||
|
|
||||||
void MapGadget::loadConfiguration(IUAVGadgetConfiguration* config)
|
void MapGadget::loadConfiguration(IUAVGadgetConfiguration* config)
|
||||||
{
|
{
|
||||||
|
setActiveConfiguration(config);
|
||||||
|
|
||||||
MapGadgetConfiguration *m = qobject_cast<MapGadgetConfiguration*>(config);
|
MapGadgetConfiguration *m = qobject_cast<MapGadgetConfiguration*>(config);
|
||||||
m_widget->setZoom(m->zoom());
|
m_widget->setZoom(m->zoom());
|
||||||
m_widget->setPosition(QPointF(m->longitude(), m->latitude()));
|
m_widget->setPosition(QPointF(m->longitude(), m->latitude()));
|
||||||
int index = m_toolbar->findText(config->name());
|
|
||||||
m_toolbar->setCurrentIndex(index);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,28 @@
|
|||||||
/*
|
/**
|
||||||
* mapgadget.h
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* Created on: Mar 11, 2010
|
* @file mapgadget.h
|
||||||
* Author: peter
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
|
* @brief
|
||||||
|
* @see The GNU Public License (GPL) Version 3
|
||||||
|
* @defgroup map
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
*****************************************************************************/
|
||||||
|
/*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MAPGADGET_H_
|
#ifndef MAPGADGET_H_
|
||||||
|
@ -1,8 +1,28 @@
|
|||||||
/*
|
/**
|
||||||
* mapgadgetfactory.cpp
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* Created on: Mar 11, 2010
|
* @file mapgadgetfactory.cpp
|
||||||
* Author: peter
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
|
* @brief
|
||||||
|
* @see The GNU Public License (GPL) Version 3
|
||||||
|
* @defgroup map
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
*****************************************************************************/
|
||||||
|
/*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#include "mapgadgetfactory.h"
|
#include "mapgadgetfactory.h"
|
||||||
#include "mapgadgetwidget.h"
|
#include "mapgadgetwidget.h"
|
||||||
@ -13,9 +33,7 @@
|
|||||||
#include <coreplugin/iuavgadget.h>
|
#include <coreplugin/iuavgadget.h>
|
||||||
|
|
||||||
MapGadgetFactory::MapGadgetFactory(QObject *parent) :
|
MapGadgetFactory::MapGadgetFactory(QObject *parent) :
|
||||||
IUAVGadgetFactory(QString("MapGadget"),
|
IUAVGadgetFactory(QString("MapGadget"), tr("Map Gadget"), parent)
|
||||||
tr("Map Gadget"),
|
|
||||||
parent)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,7 +41,8 @@ MapGadgetFactory::~MapGadgetFactory()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::IUAVGadget* MapGadgetFactory::createGadget(QList<IUAVGadgetConfiguration*> *configurations, QWidget *parent) {
|
Core::IUAVGadget* MapGadgetFactory::createGadget(QList<IUAVGadgetConfiguration*> *configurations, QWidget *parent)
|
||||||
|
{
|
||||||
MapGadgetWidget* gadgetWidget = new MapGadgetWidget(parent);
|
MapGadgetWidget* gadgetWidget = new MapGadgetWidget(parent);
|
||||||
return new MapGadget(QString("MapGadget"), configurations, gadgetWidget);
|
return new MapGadget(QString("MapGadget"), configurations, gadgetWidget);
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,28 @@
|
|||||||
/*
|
/**
|
||||||
* mapgadgetfactory.h
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* Created on: Mar 6, 2010
|
* @file mapgadgetfactory.h
|
||||||
* Author: peter
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
|
* @brief
|
||||||
|
* @see The GNU Public License (GPL) Version 3
|
||||||
|
* @defgroup map
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
*****************************************************************************/
|
||||||
|
/*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MAPGADGETFACTORY_H_
|
#ifndef MAPGADGETFACTORY_H_
|
||||||
|
@ -77,11 +77,12 @@ QWidget *MapGadgetOptionsPage::createPage(QWidget *parent)
|
|||||||
m_longSpin->setMaximum(180);
|
m_longSpin->setMaximum(180);
|
||||||
longLayout->addWidget(label);
|
longLayout->addWidget(label);
|
||||||
longLayout->addWidget(m_longSpin);
|
longLayout->addWidget(m_longSpin);
|
||||||
QSpacerItem *item = new QSpacerItem(100, 100, QSizePolicy::Expanding, QSizePolicy::Expanding);
|
QSpacerItem *spacer = new QSpacerItem(100, 100, QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
|
||||||
vl->addWidget(x);
|
vl->addWidget(x);
|
||||||
vl->addWidget(y);
|
vl->addWidget(y);
|
||||||
vl->addWidget(z);
|
vl->addWidget(z);
|
||||||
|
vl->addSpacerItem(spacer);
|
||||||
|
|
||||||
m_zoomSpin->setValue(m_config->zoom());
|
m_zoomSpin->setValue(m_config->zoom());
|
||||||
m_latSpin->setValue(m_config->latitude());
|
m_latSpin->setValue(m_config->latitude());
|
||||||
|
@ -1,8 +1,28 @@
|
|||||||
/*
|
/**
|
||||||
* mapgadgetwidget.cpp
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* Created on: Mar 6, 2010
|
* @file mapgadgetwidget.cpp
|
||||||
* Author: peter
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
|
* @brief
|
||||||
|
* @see The GNU Public License (GPL) Version 3
|
||||||
|
* @defgroup map
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
*****************************************************************************/
|
||||||
|
/*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#include "mapgadgetwidget.h"
|
#include "mapgadgetwidget.h"
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
@ -1,8 +1,28 @@
|
|||||||
/*
|
/**
|
||||||
* mapgadgetwidget.h
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* Created on: Mar 6, 2010
|
* @file mapgadgetwidget.h
|
||||||
* Author: peter
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
|
* @brief
|
||||||
|
* @see The GNU Public License (GPL) Version 3
|
||||||
|
* @defgroup map
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
*****************************************************************************/
|
||||||
|
/*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MAPGADGETWIDGET_H_
|
#ifndef MAPGADGETWIDGET_H_
|
||||||
|
@ -1,8 +1,28 @@
|
|||||||
/*
|
/**
|
||||||
* mapplugin.cpp
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* Created on: Mar 6, 2010
|
* @file mapplugin.cpp
|
||||||
* Author: peter
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
|
* @brief
|
||||||
|
* @see The GNU Public License (GPL) Version 3
|
||||||
|
* @defgroup map
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
*****************************************************************************/
|
||||||
|
/*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#include "mapplugin.h"
|
#include "mapplugin.h"
|
||||||
#include "mapgadgetfactory.h"
|
#include "mapgadgetfactory.h"
|
||||||
|
@ -1,8 +1,28 @@
|
|||||||
/*
|
/**
|
||||||
* mapplugin.h
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* Created on: Mar 6, 2010
|
* @file mapplugin.h
|
||||||
* Author: peter
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
|
* @brief
|
||||||
|
* @see The GNU Public License (GPL) Version 3
|
||||||
|
* @defgroup map
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
*****************************************************************************/
|
||||||
|
/*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MAPPLUGIN_H_
|
#ifndef MAPPLUGIN_H_
|
||||||
|
Loading…
Reference in New Issue
Block a user