1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Initial commit of pathcompiler stub

This commit is contained in:
James Cotton 2012-05-11 21:35:53 -05:00
parent f3e3a2f16b
commit 0f526fe67e
3 changed files with 179 additions and 46 deletions

View File

@ -1,46 +1,50 @@
TEMPLATE = lib
TARGET = OPMapGadget
include(../../openpilotgcsplugin.pri)
include(../../plugins/coreplugin/coreplugin.pri)
include(../../libs/opmapcontrol/opmapcontrol.pri)
include(../../plugins/uavobjects/uavobjects.pri)
include(../../plugins/uavobjectutil/uavobjectutil.pri)
include(../../plugins/uavtalk/uavtalk.pri)
include(../../libs/utils/utils.pri)
HEADERS += opmapplugin.h \
opmapgadgetoptionspage.h \
opmapgadgetfactory.h \
opmapgadgetconfiguration.h \
opmapgadget.h \
opmapgadgetwidget.h \
# opmap_waypointeditor_dialog.h \
# opmap_edit_waypoint_dialog.h \
opmap_zoom_slider_widget.h \
opmap_statusbar_widget.h \
opmap_overlay_widget.h
SOURCES += opmapplugin.cpp \
opmapgadgetwidget.cpp \
opmapgadgetoptionspage.cpp \
opmapgadgetfactory.cpp \
opmapgadgetconfiguration.cpp \
opmapgadget.cpp \
# opmap_waypointeditor_dialog.cpp \
# opmap_edit_waypoint_dialog.cpp \
opmap_zoom_slider_widget.cpp \
opmap_statusbar_widget.cpp \
opmap_overlay_widget.cpp
OTHER_FILES += OPMapGadget.pluginspec
FORMS += opmapgadgetoptionspage.ui \
opmap_widget.ui \
# opmap_waypointeditor_dialog.ui \
# opmap_edit_waypoint_dialog.ui \
opmap_zoom_slider_widget.ui \
opmap_statusbar_widget.ui \
opmap_overlay_widget.ui
RESOURCES += opmap.qrc
TEMPLATE = lib
TARGET = OPMapGadget
include(../../openpilotgcsplugin.pri)
include(../../plugins/coreplugin/coreplugin.pri)
include(../../libs/opmapcontrol/opmapcontrol.pri)
include(../../plugins/uavobjects/uavobjects.pri)
include(../../plugins/uavobjectutil/uavobjectutil.pri)
include(../../plugins/uavtalk/uavtalk.pri)
include(../../libs/utils/utils.pri)
HEADERS += opmapplugin.h \
opmapgadgetoptionspage.h \
opmapgadgetfactory.h \
opmapgadgetconfiguration.h \
opmapgadget.h \
opmapgadgetwidget.h \
# opmap_waypointeditor_dialog.h \
# opmap_edit_waypoint_dialog.h \
opmap_zoom_slider_widget.h \
opmap_statusbar_widget.h \
opmap_overlay_widget.h \
pathcompiler.h
SOURCES += opmapplugin.cpp \
opmapgadgetwidget.cpp \
opmapgadgetoptionspage.cpp \
opmapgadgetfactory.cpp \
opmapgadgetconfiguration.cpp \
opmapgadget.cpp \
# opmap_waypointeditor_dialog.cpp \
# opmap_edit_waypoint_dialog.cpp \
opmap_zoom_slider_widget.cpp \
opmap_statusbar_widget.cpp \
opmap_overlay_widget.cpp \
pathcompiler.cpp
OTHER_FILES += OPMapGadget.pluginspec
FORMS += opmapgadgetoptionspage.ui \
opmap_widget.ui \
# opmap_waypointeditor_dialog.ui \
# opmap_edit_waypoint_dialog.ui \
opmap_zoom_slider_widget.ui \
opmap_statusbar_widget.ui \
opmap_overlay_widget.ui
RESOURCES += opmap.qrc

View File

@ -0,0 +1,32 @@
/**
******************************************************************************
*
* @file pathcompiler.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup OPMapPlugin OpenPilot Map Plugin
* @{
* @brief The OpenPilot Map plugin
*****************************************************************************/
/*
* 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 "pathcompiler.h"
PathCompiler::PathCompiler(QObject *parent) :
QObject(parent)
{
}

View File

@ -0,0 +1,97 @@
/**
******************************************************************************
*
* @file pathcompiler.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup OPMapPlugin OpenPilot Map Plugin
* @{
* @brief The OpenPilot Map plugin
*****************************************************************************/
/*
* 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 PATHCOMPILER_H
#define PATHCOMPILER_H
#include <QObject>
#include <uavobject.h>
/**
* This class is a two way adapter between a visualization of a path and the
* UAVObject representation on the flight controller. It also can support multiple
* ways of converting a path from what the user clicked to the underlying representation
* to achieve the desired end flight trajectory
*/
class PathCompiler : public QObject
{
Q_OBJECT
public:
explicit PathCompiler(QObject *parent = 0);
//! This method opens a dialog (if filename is null) and saves the path
int savePath(QString filename = null);
//! This method opens a dialog (if filename is null) and loads the path
int loadPath(QString filename = null);
//! Waypoint representation that is exchanged between visualization
struct waypoint {
float latitude;
float longitude;
};
signals:
/**
* Indicates something changed the waypoints and the map should
* update the display
*/
void visualizationChanged(QList<struct PathCompiler::waypoint>);
public slots:
/**
* These are slots that the visualization can call to manipulate the path.
* It is an important design detail that the visualiation _not_ attempt to maintain
* the list of waypoints itself. This starts the slippery of moving the path logic
* into the view.
*/
/**
* add a waypoint
* @param waypoint the new waypoint to add
* @param position which position to insert it to, defaults to end
*/
void doAddWaypoint(struct PathCompiler::waypoint, int position = -1);
/**
* Delete a waypoint
* @param index which waypoint to delete
*/
void doDelWaypoint(int index);
public slots:
/**
* These are slots that the UAV can call to update the path.
*/
/**
* When the UAV waypoints change trigger the pathcompiler to
* get the latest version and then update the visualization
*/
void doUpdateFromUAV();
};
#endif // PATHCOMPILER_H