From 3b8ca57eef490ff1c0fae066ac96a6b87b07e4e8 Mon Sep 17 00:00:00 2001 From: PT_Dreamer Date: Fri, 1 Jun 2012 22:13:29 +0100 Subject: [PATCH] GCS/MapLib - added pathplanmanager class --- .../opmapcontrol/src/mapwidget/opmapwidget.h | 1 + .../openpilotgcs/src/plugins/opmap/opmap.pro | 95 ++++++++++--------- .../opmap/opmap_edit_waypoint_dialog.h | 2 + .../src/plugins/opmap/opmapgadgetwidget.h | 1 - .../src/plugins/opmap/pathplanmanager.cpp | 60 ++++++++++++ .../src/plugins/opmap/pathplanmanager.h | 65 +++++++++++++ .../src/plugins/opmap/pathplanmanager.ui | 21 ++++ 7 files changed, 198 insertions(+), 47 deletions(-) create mode 100644 ground/openpilotgcs/src/plugins/opmap/pathplanmanager.cpp create mode 100644 ground/openpilotgcs/src/plugins/opmap/pathplanmanager.h create mode 100644 ground/openpilotgcs/src/plugins/opmap/pathplanmanager.ui diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/opmapwidget.h b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/opmapwidget.h index 2d0604f3d..6438131be 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/opmapwidget.h +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/opmapwidget.h @@ -43,6 +43,7 @@ #include "mapripper.h" #include "waypointline.h" #include "waypointcircle.h" +#include "waypointitem.h" namespace mapcontrol { class UAVItem; diff --git a/ground/openpilotgcs/src/plugins/opmap/opmap.pro b/ground/openpilotgcs/src/plugins/opmap/opmap.pro index caab7a52f..61b200a97 100644 --- a/ground/openpilotgcs/src/plugins/opmap/opmap.pro +++ b/ground/openpilotgcs/src/plugins/opmap/opmap.pro @@ -1,46 +1,49 @@ -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 \ + pathplanmanager.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 \ + pathplanmanager.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 \ + pathplanmanager.ui + +RESOURCES += opmap.qrc diff --git a/ground/openpilotgcs/src/plugins/opmap/opmap_edit_waypoint_dialog.h b/ground/openpilotgcs/src/plugins/opmap/opmap_edit_waypoint_dialog.h index 45612253d..b6fde4828 100644 --- a/ground/openpilotgcs/src/plugins/opmap/opmap_edit_waypoint_dialog.h +++ b/ground/openpilotgcs/src/plugins/opmap/opmap_edit_waypoint_dialog.h @@ -63,6 +63,8 @@ private: QString original_description; double original_distance; double original_bearing; + + mapcontrol::WayPointItem::wptype original_type; mapcontrol::WayPointItem *waypoint_item; diff --git a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.h b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.h index 669393743..e787f1cf7 100644 --- a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.h +++ b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.h @@ -146,7 +146,6 @@ private slots: * * Some are currently disabled for the v1.0 plugin version. */ - void comboBoxFindPlace_returnPressed(); void on_toolButtonZoomM_clicked(); void on_toolButtonZoomP_clicked(); void on_toolButtonMapHome_clicked(); diff --git a/ground/openpilotgcs/src/plugins/opmap/pathplanmanager.cpp b/ground/openpilotgcs/src/plugins/opmap/pathplanmanager.cpp new file mode 100644 index 000000000..cc60dcc5b --- /dev/null +++ b/ground/openpilotgcs/src/plugins/opmap/pathplanmanager.cpp @@ -0,0 +1,60 @@ +/** + ****************************************************************************** + * + * @file pathplanmanager.cpp + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * @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 "pathplanmanager.h" +#include "ui_pathplanmanager.h" + +pathPlanManager::pathPlanManager(QWidget *parent,OPMapWidget *map): + QWidget(parent),myMap(map), + ui(new Ui::pathPlanManager) +{ + ui->setupUi(this); + connect(myMap,SIGNAL(WPDeleted(int)),this,SLOT(on_WPDeleted(int))); + connect(myMap,SIGNAL(WPInserted(int,WayPointItem*)),this,SLOT(on_WPInserted(int,WayPointItem*))); + connect(myMap,SIGNAL(WPNumberChanged(int,int,WayPointItem*)),this,SLOT(on_WPNumberChanged(int,int,WayPointItem*))); + connect(myMap,SIGNAL(WPValuesChanged(WayPointItem*)),this,SLOT(on_WPValuesChanged(WayPointItem*))); + +} + +pathPlanManager::~pathPlanManager() +{ + delete ui; +} +void pathPlanManager::on_WPDeleted(int wp_number) +{ +} + +void pathPlanManager::on_WPInserted(int wp_number, WayPointItem * wp) +{ +} + +void pathPlanManager::on_WPNumberChanged(int oldNumber, int newNumber, WayPointItem * wp) +{ +} + +void pathPlanManager::on_WPValuesChanged(WayPointItem * wp) +{ +} diff --git a/ground/openpilotgcs/src/plugins/opmap/pathplanmanager.h b/ground/openpilotgcs/src/plugins/opmap/pathplanmanager.h new file mode 100644 index 000000000..aa318f743 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/opmap/pathplanmanager.h @@ -0,0 +1,65 @@ +/** + ****************************************************************************** + * + * @file pathplanmanager.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * @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 PATHPLANMANAGER_H +#define PATHPLANMANAGER_H + +#include +#include "opmapcontrol/opmapcontrol.h" + +namespace Ui { +class pathPlanManager; +} +using namespace mapcontrol; +class pathPlanManager : public QWidget +{ + Q_OBJECT + struct customData + { + float velocity; + int mode; + float mode_params[4]; + int condition; + float condition_params[4]; + int command; + int jumpdestination; + int errordestination; + }; +public: + explicit pathPlanManager(QWidget *parent,OPMapWidget * map); + ~pathPlanManager(); +private slots: + void on_WPDeleted(int); + void on_WPInserted(int,WayPointItem*); + void on_WPNumberChanged(int,int,WayPointItem*); + void on_WPValuesChanged(WayPointItem*); +private: + Ui::pathPlanManager *ui; + OPMapWidget * myMap; +}; + +#endif // PATHPLANMANAGER_H diff --git a/ground/openpilotgcs/src/plugins/opmap/pathplanmanager.ui b/ground/openpilotgcs/src/plugins/opmap/pathplanmanager.ui new file mode 100644 index 000000000..c8fbf92cb --- /dev/null +++ b/ground/openpilotgcs/src/plugins/opmap/pathplanmanager.ui @@ -0,0 +1,21 @@ + + + + + pathPlanManager + + + + 0 + 0 + 400 + 300 + + + + Form + + + + +