1
0
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:
ephy 2010-03-26 07:43:14 +00:00 committed by ephy
parent 4638a82b75
commit 31107be978
9 changed files with 200 additions and 40 deletions

View File

@ -1,8 +1,28 @@
/*
* mapgadget.cpp
/**
******************************************************************************
*
* Created on: Mar 11, 2010
* Author: peter
* @file mapgadget.cpp
* @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 "mapgadgetwidget.h"
@ -21,10 +41,10 @@ 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()));
int index = m_toolbar->findText(config->name());
m_toolbar->setCurrentIndex(index);
}

View File

@ -1,8 +1,28 @@
/*
* mapgadget.h
/**
******************************************************************************
*
* Created on: Mar 11, 2010
* Author: peter
* @file mapgadget.h
* @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_

View File

@ -1,8 +1,28 @@
/*
* mapgadgetfactory.cpp
/**
******************************************************************************
*
* Created on: Mar 11, 2010
* Author: peter
* @file mapgadgetfactory.cpp
* @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 "mapgadgetwidget.h"
@ -13,9 +33,7 @@
#include <coreplugin/iuavgadget.h>
MapGadgetFactory::MapGadgetFactory(QObject *parent) :
IUAVGadgetFactory(QString("MapGadget"),
tr("Map Gadget"),
parent)
IUAVGadgetFactory(QString("MapGadget"), tr("Map Gadget"), parent)
{
}
@ -23,8 +41,9 @@ MapGadgetFactory::~MapGadgetFactory()
{
}
Core::IUAVGadget* MapGadgetFactory::createGadget(QList<IUAVGadgetConfiguration*> *configurations, QWidget *parent) {
MapGadgetWidget* gadgetWidget = new MapGadgetWidget(parent);
Core::IUAVGadget* MapGadgetFactory::createGadget(QList<IUAVGadgetConfiguration*> *configurations, QWidget *parent)
{
MapGadgetWidget* gadgetWidget = new MapGadgetWidget(parent);
return new MapGadget(QString("MapGadget"), configurations, gadgetWidget);
}

View File

@ -1,8 +1,28 @@
/*
* mapgadgetfactory.h
/**
******************************************************************************
*
* Created on: Mar 6, 2010
* Author: peter
* @file mapgadgetfactory.h
* @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_

View File

@ -77,11 +77,12 @@ QWidget *MapGadgetOptionsPage::createPage(QWidget *parent)
m_longSpin->setMaximum(180);
longLayout->addWidget(label);
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(y);
vl->addWidget(z);
vl->addSpacerItem(spacer);
m_zoomSpin->setValue(m_config->zoom());
m_latSpin->setValue(m_config->latitude());

View File

@ -1,8 +1,28 @@
/*
* mapgadgetwidget.cpp
/**
******************************************************************************
*
* Created on: Mar 6, 2010
* Author: peter
* @file mapgadgetwidget.cpp
* @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 <QStringList>

View File

@ -1,8 +1,28 @@
/*
* mapgadgetwidget.h
/**
******************************************************************************
*
* Created on: Mar 6, 2010
* Author: peter
* @file mapgadgetwidget.h
* @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_

View File

@ -1,8 +1,28 @@
/*
* mapplugin.cpp
/**
******************************************************************************
*
* Created on: Mar 6, 2010
* Author: peter
* @file mapplugin.cpp
* @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 "mapgadgetfactory.h"

View File

@ -1,8 +1,28 @@
/*
* mapplugin.h
/**
******************************************************************************
*
* Created on: Mar 6, 2010
* Author: peter
* @file mapplugin.h
* @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_