diff --git a/ground/openpilotgcs/src/plugins/plugins.pro b/ground/openpilotgcs/src/plugins/plugins.pro index 75f777521..6bfff2e5c 100644 --- a/ground/openpilotgcs/src/plugins/plugins.pro +++ b/ground/openpilotgcs/src/plugins/plugins.pro @@ -134,6 +134,11 @@ plugin_qmlview.depends = plugin_coreplugin plugin_qmlview.depends += plugin_uavobjects SUBDIRS += plugin_qmlview +# Waypoint Editor gadget +plugin_waypointeditor.subdir = waypointeditor +plugin_waypointeditor.depends = plugin_coreplugin +plugin_waypointeditor.depends += plugin_uavobjects +SUBDIRS += plugin_waypointeditor #IP connection plugin plugin_ipconnection.subdir = ipconnection diff --git a/ground/openpilotgcs/src/plugins/waypointeditor/WaypointEditor.pluginspec b/ground/openpilotgcs/src/plugins/waypointeditor/WaypointEditor.pluginspec new file mode 100644 index 000000000..cd2e59be3 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/waypointeditor/WaypointEditor.pluginspec @@ -0,0 +1,11 @@ + + The OpenPilot Project + (C) 2012 OpenPilot Project + The GNU Public License (GPL) Version 3 + Allows editing a list of waypoints + http://www.openpilot.org + + + + + diff --git a/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditor.pro b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditor.pro new file mode 100644 index 000000000..a020e52b5 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditor.pro @@ -0,0 +1,22 @@ +TEMPLATE = lib +TARGET = WaypointEditor + +include(../../openpilotgcsplugin.pri) +include(../../plugins/coreplugin/coreplugin.pri) +include(../../plugins/uavobjects/uavobjects.pri) + +HEADERS += waypointeditorgadget.h +HEADERS += waypointeditorgadgetwidget.h +HEADERS += waypointeditorgadgetfactory.h +HEADERS += waypointeditorplugin.h + +SOURCES += waypointeditorgadget.cpp +SOURCES += waypointeditorgadgetwidget.cpp +SOURCES += waypointeditorgadgetfactory.cpp +SOURCES += waypointeditorplugin.cpp + +OTHER_FILES += waypointeditor.pluginspec + +FORMS += waypointeditor.ui + +RESOURCES += waypointeditor.qrc diff --git a/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditor.qrc b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditor.qrc new file mode 100644 index 000000000..c593d4e56 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditor.qrc @@ -0,0 +1,3 @@ + + + diff --git a/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditor.ui b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditor.ui new file mode 100644 index 000000000..2774b3148 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditor.ui @@ -0,0 +1,41 @@ + + + WaypointEditor + + + + 0 + 0 + 653 + 296 + + + + + 0 + 0 + + + + Form + + + + + + false + + + + + + + New Waypoint + + + + + + + + diff --git a/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorgadget.cpp b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorgadget.cpp new file mode 100644 index 000000000..b638636b8 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorgadget.cpp @@ -0,0 +1,48 @@ +/** + ****************************************************************************** + * @file waypointeditorgadget.cpp + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @addtogroup Waypoint Editor GCS Plugins + * @{ + * @addtogroup WaypointEditorGadgetPlugin Waypoint Editor Gadget Plugin + * @{ + * @brief A gadget to edit a list of waypoints + *****************************************************************************/ +/* + * 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 "waypointeditorgadget.h" +#include "waypointeditorgadgetwidget.h" + +#include "extensionsystem/pluginmanager.h" +#include "uavobjectmanager.h" +#include "uavobject.h" +#include + +WaypointEditorGadget::WaypointEditorGadget(QString classId, WaypointEditorGadgetWidget *widget, QWidget *parent) : + IUAVGadget(classId, parent), + m_widget(widget) +{ +} + +WaypointEditorGadget::~WaypointEditorGadget() +{ + delete m_widget; +} + +void WaypointEditorGadget::loadConfiguration(IUAVGadgetConfiguration* config) +{ + Q_UNUSED(config); +} diff --git a/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorgadget.h b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorgadget.h new file mode 100644 index 000000000..9f31759f7 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorgadget.h @@ -0,0 +1,59 @@ +/** + ****************************************************************************** + * @file waypointeditorgadget.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @addtogroup Waypoint Editor GCS Plugins + * @{ + * @addtogroup WaypointEditorGadgetPlugin Waypoint Editor Gadget Plugin + * @{ + * @brief A gadget to edit a list of waypoints + *****************************************************************************/ +/* + * 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 WaypointEditorGADGET_H_ +#define WaypointEditorGADGET_H_ + +#include + +namespace Core { +class IUAVGadget; +} +//class QWidget; +//class QString; +class WaypointEditorGadgetWidget; + +using namespace Core; + +class WaypointEditorGadget : public Core::IUAVGadget +{ + Q_OBJECT +public: + WaypointEditorGadget(QString classId, WaypointEditorGadgetWidget *widget, QWidget *parent = 0); + ~WaypointEditorGadget(); + + QList context() const { return m_context; } + QWidget *widget() { return m_widget; } + QString contextHelpId() const { return QString(); } + + void loadConfiguration(IUAVGadgetConfiguration* config); +private: + QWidget *m_widget; + QList m_context; +}; + + +#endif // WaypointEditorGADGET_H_ diff --git a/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorgadgetfactory.cpp b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorgadgetfactory.cpp new file mode 100644 index 000000000..e488e940d --- /dev/null +++ b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorgadgetfactory.cpp @@ -0,0 +1,47 @@ +/** + ****************************************************************************** + * @file waypointeditorgadgetfactor.cpp + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @addtogroup Waypoint Editor GCS Plugins + * @{ + * @addtogroup WaypointEditorGadgetPlugin Waypoint Editor Gadget Plugin + * @{ + * @brief A gadget to edit a list of waypoints + *****************************************************************************/ +/* + * 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 "waypointeditorgadgetfactory.h" +#include "waypointeditorgadgetwidget.h" +#include "waypointeditorgadget.h" +#include +#include + +WaypointEditorGadgetFactory::WaypointEditorGadgetFactory(QObject *parent) : + IUAVGadgetFactory(QString("WaypointEditorGadget"), + tr("Waypoint Editor"), + parent) +{ +} + +WaypointEditorGadgetFactory::~WaypointEditorGadgetFactory() +{ + +} + +IUAVGadget* WaypointEditorGadgetFactory::createGadget(QWidget *parent) { + WaypointEditorGadgetWidget* gadgetWidget = new WaypointEditorGadgetWidget(parent); + return new WaypointEditorGadget(QString("WaypointEditorGadget"), gadgetWidget, parent); +} diff --git a/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorgadgetfactory.h b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorgadgetfactory.h new file mode 100644 index 000000000..87070729c --- /dev/null +++ b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorgadgetfactory.h @@ -0,0 +1,49 @@ +/** + ****************************************************************************** + * @file waypointeditorgadgetfactory.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @addtogroup Waypoint Editor GCS Plugins + * @{ + * @addtogroup WaypointEditorGadgetPlugin Waypoint Editor Gadget Plugin + * @{ + * @brief A gadget to edit a list of waypoints + *****************************************************************************/ +/* + * 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 WaypointEditorGADGETFACTORY_H_ +#define WaypointEditorGADGETFACTORY_H_ + +#include + +namespace Core { +class IUAVGadget; +class IUAVGadgetFactory; +} + +using namespace Core; + +class WaypointEditorGadgetFactory : public IUAVGadgetFactory +{ + Q_OBJECT +public: + WaypointEditorGadgetFactory(QObject *parent = 0); + ~WaypointEditorGadgetFactory(); + + IUAVGadget *createGadget(QWidget *parent); +}; + +#endif // WaypointEditorGADGETFACTORY_H_ diff --git a/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorgadgetwidget.cpp new file mode 100644 index 000000000..b88119f25 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorgadgetwidget.cpp @@ -0,0 +1,69 @@ +/** + ****************************************************************************** + * @file waypointeditorgadgetwidget.cpp + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @addtogroup Waypoint Editor GCS Plugins + * @{ + * @addtogroup WaypointEditorGadgetPlugin Waypoint Editor Gadget Plugin + * @{ + * @brief A gadget to edit a list of waypoints + *****************************************************************************/ +/* + * 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 "waypointeditorgadgetwidget.h" +#include "ui_waypointeditor.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "uavobject.h" +#include "uavobjectmanager.h" +#include "manualcontrolcommand.h" +#include "extensionsystem/pluginmanager.h" +#include "extensionsystem/pluginmanager.h" + +WaypointEditorGadgetWidget::WaypointEditorGadgetWidget(QWidget *parent) : QLabel(parent) +{ + m_waypointeditor = new Ui_WaypointEditor(); + m_waypointeditor->setupUi(this); +} + +WaypointEditorGadgetWidget::~WaypointEditorGadgetWidget() +{ + // Do nothing +} + +void WaypointEditorGadgetWidget::waypointChanged(UAVObject *) +{ +} + +void WaypointEditorGadgetWidget::waypointActiveChanged(UAVObject *) +{ +} + +void WaypointEditorGadgetWidget::addInstance() +{ +} + +/** + * @} + * @} + */ diff --git a/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorgadgetwidget.h b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorgadgetwidget.h new file mode 100644 index 000000000..63bfd0d1c --- /dev/null +++ b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorgadgetwidget.h @@ -0,0 +1,55 @@ +/** + ****************************************************************************** + * @file waypointeditorgadgetwidget.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @addtogroup Waypoint Editor GCS Plugins + * @{ + * @addtogroup WaypointEditorGadgetPlugin Waypoint Editor Gadget Plugin + * @{ + * @brief A gadget to edit a list of waypoints + *****************************************************************************/ +/* + * 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 WaypointEditorGADGETWIDGET_H_ +#define WaypointEditorGADGETWIDGET_H_ + +#include +#include +#include + +class Ui_WaypointEditor; + +class WaypointEditorGadgetWidget : public QLabel +{ + Q_OBJECT + +public: + WaypointEditorGadgetWidget(QWidget *parent = 0); + ~WaypointEditorGadgetWidget(); + +signals: + +protected slots: + void waypointChanged(UAVObject *); + void waypointActiveChanged(UAVObject *); + void addInstance(); + +private: + Ui_WaypointEditor * m_waypointeditor; +}; + +#endif /* WaypointEditorGADGETWIDGET_H_ */ diff --git a/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorplugin.cpp b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorplugin.cpp new file mode 100644 index 000000000..068b3e7bf --- /dev/null +++ b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorplugin.cpp @@ -0,0 +1,68 @@ +/** + ****************************************************************************** + * @file waypointeditorplugin.cpp + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @addtogroup Waypoint Editor GCS Plugins + * @{ + * @addtogroup WaypointEditorGadgetPlugin Waypoint Editor Gadget Plugin + * @{ + * @brief A gadget to edit a list of waypoints + *****************************************************************************/ +/* + * 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 "waypointeditorplugin.h" +#include "waypointeditorgadgetfactory.h" +#include +#include +#include +#include + + +WaypointEditorPlugin::WaypointEditorPlugin() +{ + // Do nothing +} + +WaypointEditorPlugin::~WaypointEditorPlugin() +{ + // Do nothing +} + +bool WaypointEditorPlugin::initialize(const QStringList& args, QString *errMsg) +{ + Q_UNUSED(args); + Q_UNUSED(errMsg); + mf = new WaypointEditorGadgetFactory(this); + addAutoReleasedObject(mf); + + return true; +} + +void WaypointEditorPlugin::extensionsInitialized() +{ + // Do nothing +} + +void WaypointEditorPlugin::shutdown() +{ + // Do nothing +} +Q_EXPORT_PLUGIN(WaypointEditorPlugin) + +/** + * @} + * @} + */ diff --git a/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorplugin.h b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorplugin.h new file mode 100644 index 000000000..7529b491c --- /dev/null +++ b/ground/openpilotgcs/src/plugins/waypointeditor/waypointeditorplugin.h @@ -0,0 +1,46 @@ +/** + ****************************************************************************** + * @file waypointeditorplugin.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @addtogroup Waypoint Editor GCS Plugins + * @{ + * @addtogroup WaypointEditorGadgetPlugin Waypoint Editor Gadget Plugin + * @{ + * @brief A gadget to edit a list of waypoints + *****************************************************************************/ +/* + * 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 WaypointEditorPLUGIN_H_ +#define WaypointEditorPLUGIN_H_ + +#include + +class WaypointEditorGadgetFactory; + +class WaypointEditorPlugin : public ExtensionSystem::IPlugin +{ +public: + WaypointEditorPlugin(); + ~WaypointEditorPlugin(); + + void extensionsInitialized(); + bool initialize(const QStringList & arguments, QString * errorString); + void shutdown(); +private: + WaypointEditorGadgetFactory *mf; +}; +#endif /* WaypointEditorPLUGIN_H_ */