mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
GCS/map Missing files.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@381 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
9c042a35f4
commit
e865b880c2
50
ground/src/plugins/map/mapgadgetconfiguration.cpp
Normal file
50
ground/src/plugins/map/mapgadgetconfiguration.cpp
Normal file
@ -0,0 +1,50 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file mapgadgetconfiguration.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 "mapgadgetconfiguration.h"
|
||||
#include <QtCore/QDataStream>
|
||||
|
||||
MapGadgetConfiguration::MapGadgetConfiguration(bool locked, QString classId, QString name, const QByteArray &state, QObject *parent) :
|
||||
IUAVGadgetConfiguration(locked, classId, name, parent),
|
||||
m_defaultZoom(10)
|
||||
{
|
||||
if (state.count() > 0) {
|
||||
QDataStream stream(state);
|
||||
int zoom;
|
||||
stream >> zoom;
|
||||
m_defaultZoom = zoom;
|
||||
}
|
||||
}
|
||||
|
||||
QByteArray MapGadgetConfiguration::saveState() const
|
||||
{
|
||||
QByteArray bytes;
|
||||
QDataStream stream(&bytes, QIODevice::WriteOnly);
|
||||
stream << m_defaultZoom;
|
||||
return bytes;
|
||||
}
|
||||
|
54
ground/src/plugins/map/mapgadgetconfiguration.h
Normal file
54
ground/src/plugins/map/mapgadgetconfiguration.h
Normal file
@ -0,0 +1,54 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file mapgadgetconfiguration.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 MAPGADGETCONFIGURATION_H
|
||||
#define MAPGADGETCONFIGURATION_H
|
||||
|
||||
#include <coreplugin/iuavgadgetconfiguration.h>
|
||||
|
||||
using namespace Core;
|
||||
|
||||
class MapGadgetConfiguration : public IUAVGadgetConfiguration
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MapGadgetConfiguration(bool locked, QString classId, QString name, const QByteArray &state = 0, QObject *parent = 0);
|
||||
int zoom() { return m_defaultZoom; }
|
||||
QByteArray saveState() const;
|
||||
IUAVGadgetConfiguration *clone() { return 0; }
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
private:
|
||||
int m_defaultZoom;
|
||||
double m_defaultLatitude;
|
||||
double m_defaultLongitude;
|
||||
|
||||
};
|
||||
|
||||
#endif // MAPGADGETCONFIGURATION_H
|
55
ground/src/plugins/map/mapgadgetoptionspage.cpp
Normal file
55
ground/src/plugins/map/mapgadgetoptionspage.cpp
Normal file
@ -0,0 +1,55 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file mapgadgetoptionspage.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 "mapgadgetoptionspage.h"
|
||||
#include "mapgadgetconfiguration.h"
|
||||
#include <QtGui/QLabel>
|
||||
|
||||
MapGadgetOptionsPage::MapGadgetOptionsPage(IUAVGadgetConfiguration *config, QObject *parent) :
|
||||
UAVGadgetOptionsPage(config, parent)
|
||||
{
|
||||
m_config = qobject_cast<MapGadgetConfiguration*>(config);
|
||||
}
|
||||
|
||||
QWidget *MapGadgetOptionsPage::widget()
|
||||
{
|
||||
QWidget *label = new QLabel("Settings will be here.");
|
||||
// QLabel *label = new QLabel(QString(m_config->zoom()));
|
||||
label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||
return label;
|
||||
}
|
||||
|
||||
void MapGadgetOptionsPage::apply()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MapGadgetOptionsPage::finish()
|
||||
{
|
||||
|
||||
}
|
||||
|
55
ground/src/plugins/map/mapgadgetoptionspage.h
Normal file
55
ground/src/plugins/map/mapgadgetoptionspage.h
Normal file
@ -0,0 +1,55 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file mapgadgetoptionspage.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 MAPGADGETOPTIONSPAGE_H
|
||||
#define MAPGADGETOPTIONSPAGE_H
|
||||
|
||||
#include "coreplugin/uavgadgetoptionspage.h"
|
||||
|
||||
class MapGadgetConfiguration;
|
||||
|
||||
using namespace Core;
|
||||
|
||||
class MapGadgetOptionsPage : public UAVGadgetOptionsPage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MapGadgetOptionsPage(IUAVGadgetConfiguration *config, QObject *parent = 0);
|
||||
QWidget *widget();
|
||||
void apply();
|
||||
void finish();
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
private:
|
||||
MapGadgetConfiguration *m_config;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // MAPGADGETOPTIONSPAGE_H
|
Loading…
x
Reference in New Issue
Block a user