Commit 91888650 authored by tecnosapiens's avatar tecnosapiens

add WaypointGlobal class to create Waypoints with earth cordinate.

add widget WaypointView to widget WaypointList when create a waypoint with mouse over the map
parent 171d4c43
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?>
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="org.eclipse.cdt.core.default.config.989472769">
<storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="org.eclipse.cdt.core.default.config.989472769" moduleId="org.eclipse.cdt.core.settings" name="Configuration">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-E -P -v -dD" command="" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
<target name="Qt Release Build" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments/>
<buildTarget>release</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="Qt Debug Build" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments/>
<buildTarget>debug</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
</buildTargets>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.pathentry">
<pathentry base-path="C:/Qt/2010.04/qt/include" include="" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="ActiveQt" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="phonon" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="phonon_compat" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="Qt" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="Qt3Support" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtAssistant" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtCore" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtDBus" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtDeclarative" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtDesigner" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtGui" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtHelp" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtMultimedia" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtNetwork" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtOpenGL" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtOpenVG" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtScript" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtScriptTools" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtSql" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtSvg" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtTest" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtUiTools" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtWebKit" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtXml" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtXmlPatterns" kind="inc" path="" system="true"/>
</storageModule>
</cconfiguration>
</storageModule>
</cproject>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>qgroundcontrol</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.trolltech.qtcppproject.QtMakefileGenerator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.make.core.makeBuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>org.eclipse.cdt.core.errorOutputParser</key>
<value>org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.VCErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.MakeErrorParser;</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.build.arguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.build.command</key>
<value>mingw32-make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.build.target.auto</key>
<value>debug</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.build.target.clean</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.build.target.inc</key>
<value>debug</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.environment</key>
<value>QMAKESPEC=win32-g++|PATH=C:\\Qt\\2010.04\\qt\\bin;${env_var:PATH}|</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>false</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.make.core.makeNature</nature>
<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
<nature>com.trolltech.qtcppproject.QtNature</nature>
</natures>
</projectDescription>
......@@ -155,7 +155,8 @@ HEADERS += src/MG.h \
src/ui/linechart/IncrementalPlot.h \
src/ui/map/Waypoint2DIcon.h \
src/ui/map/MAV2DIcon.h \
src/ui/map/QGC2DIcon.h
src/ui/map/QGC2DIcon.h \
src/WaypointGlobal.h
SOURCES += src/main.cc \
src/Core.cc \
src/uas/UASManager.cc \
......@@ -218,7 +219,8 @@ SOURCES += src/main.cc \
src/ui/linechart/IncrementalPlot.cc \
src/ui/map/Waypoint2DIcon.cc \
src/ui/map/MAV2DIcon.cc \
src/ui/map/QGC2DIcon.cc
src/ui/map/QGC2DIcon.cc \
src/WaypointGlobal.cpp
RESOURCES = mavground.qrc
# Include RT-LAB Library
......
......@@ -59,7 +59,7 @@ public:
bool load(QTextStream &loadStream);
private:
protected:
quint16 id;
float x;
float y;
......
#include "WaypointGlobal.h"
#include <QPointF>
WaypointGlobal::WaypointGlobal(const QPointF coordinate):
Waypoint(id, x, y, z, yaw, autocontinue, current, orbit, holdTime)
{
coordinateWP = coordinate;
}
#ifndef WAYPOINTGLOBAL_H
#define WAYPOINTGLOBAL_H
#include "Waypoint.h"
#include <QPointF>
class WaypointGlobal: public Waypoint {
Q_OBJECT
public:
WaypointGlobal(const QPointF coordinate);
public slots:
// void set_latitud(double latitud);
// void set_longitud(double longitud);
// double get_latitud();
// double get_longitud();
private:
QPointF coordinateWP;
};
#endif // WAYPOINTGLOBAL_H
......@@ -92,14 +92,16 @@ MainWindow::MainWindow(QWidget *parent) :
// Create actions
connectActions();
// Load widgets and show application window
// Load widgets and show application windowa
loadWidgets();
// Adjust the size
adjustSize();
//waypoints->setMapHandle(map);
connect(waypoints, SIGNAL(clearPahtclicked()), map, SLOT(clearPath()));
// clear path create on the map
connect(waypoints, SIGNAL(clearPathclicked()), map, SLOT(clearPath()));
// add Waypoint widget in the WaypointList widget when mouse clicked
connect(map, SIGNAL(captureMapCoordinateClick(QPointF)), waypoints, SLOT(addWaypointMouse(QPointF)));
}
MainWindow::~MainWindow()
......
......@@ -342,6 +342,9 @@ void MapWidget::captureMapClick(const QMouseEvent* event, const QPointF coordina
// Refresh the screen
mc->updateRequestNew();
// emit signal mouse was clicked
emit captureMapCoordinateClick(coordinate);
}
}
......
......@@ -115,6 +115,8 @@ protected:
signals:
//void movePoint(QPointF newCoord);
void captureMapCoordinateClick(const QPointF coordinate); //ROCA
private:
Ui::MapWidget *m_ui;
......
......@@ -358,5 +358,39 @@ void WaypointList::changeEvent(QEvent *e)
void WaypointList::on_clearWPListButton_clicked()
{
emit clearPahtclicked();
emit clearPathclicked();
// if (uas)
// {
// const QVector<Waypoint *> &waypoints = uas->getWaypointManager().getWaypointList();
// for(int i = 0; i <=waypoints.size(); i++)
// {
// WaypointView* widget = wpViews.find(waypoints[i]).value();
// widget->remove();
// }
// }
}
/** @brief Add a waypoint by mouse click over the map */
void WaypointList::addWaypointMouse(QPointF coordinate)
{
if (uas)
{
const QVector<Waypoint *> &waypoints = uas->getWaypointManager().getWaypointList();
if (waypoints.size() > 0)
{
Waypoint *last = waypoints.at(waypoints.size()-1);
Waypoint *wp = new Waypoint(0, coordinate.x(), coordinate.y(), last->getZ(), last->getYaw(), last->getAutoContinue(), false, last->getOrbit(), last->getHoldTime());
uas->getWaypointManager().localAddWaypoint(wp);
}
else
{
Waypoint *wp = new Waypoint(0, coordinate.x(), coordinate.y(), -0.8, 0.0, true, true, 0.15, 2000);
uas->getWaypointManager().localAddWaypoint(wp);
}
}
}
......@@ -73,6 +73,8 @@ public slots:
void add();
/** @brief Add a waypoint at the current MAV position */
void addCurrentPositonWaypoint();
/** @brief Add a waypoint by mouse click over the map */
void addWaypointMouse(QPointF coordinate);
......@@ -93,7 +95,7 @@ public slots:
signals:
void clearPahtclicked();
void clearPathclicked();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment