Commit 171d4c43 authored by tecnosapiens's avatar tecnosapiens

changes added in widget WaypointList.ui: clear path button was added

parent 4e1acc5e
...@@ -29,6 +29,7 @@ namespace qmapcontrol ...@@ -29,6 +29,7 @@ namespace qmapcontrol
Layer::Layer(QString layername, MapAdapter* mapadapter, enum LayerType layertype, bool takeevents) Layer::Layer(QString layername, MapAdapter* mapadapter, enum LayerType layertype, bool takeevents)
:visible(true), mylayername(layername), mylayertype(layertype), mapAdapter(mapadapter), takeevents(takeevents), myoffscreenViewport(QRect(0,0,0,0)) :visible(true), mylayername(layername), mylayertype(layertype), mapAdapter(mapadapter), takeevents(takeevents), myoffscreenViewport(QRect(0,0,0,0))
{ {
draggingGeometry = false;
//qDebug() << "creating new Layer: " << layername << ", type: " << contents; //qDebug() << "creating new Layer: " << layername << ", type: " << contents;
//qDebug() << this->layertype; //qDebug() << this->layertype;
} }
......
...@@ -366,15 +366,26 @@ namespace qmapcontrol ...@@ -366,15 +366,26 @@ namespace qmapcontrol
void LayerManager::mouseEvent(const QMouseEvent* evnt) void LayerManager::mouseEvent(const QMouseEvent* evnt)
{ {
QListIterator<Layer*> it(mylayers); // TODO: to review errors generated in the Windows operating system when the QListIterator is used
while (it.hasNext()) for(int i=0; i<mylayers.size(); i++)
{ {
Layer* l = it.next(); Layer* l = mylayers[i];
if (l->isVisible()) if (l->isVisible())
{ {
l->mouseEvent(evnt, mapmiddle_px); l->mouseEvent(evnt, mapmiddle_px);
} }
} }
// QListIterator<Layer*> it(mylayers);
// while (it.hasNext())
// {
// qDebug() << it.next();
// Layer* l = it.next();
// if (l->isVisible())
// {
// l->mouseEvent(evnt, mapmiddle_px);
// }
// }
} }
void LayerManager::updateRequest(QRectF rect) void LayerManager::updateRequest(QRectF rect)
......
...@@ -126,7 +126,8 @@ win32 { ...@@ -126,7 +126,8 @@ win32 {
# Special settings for debug # Special settings for debug
#CONFIG += CONSOLE #CONFIG += CONSOLE
INCLUDEPATH += $$BASEDIR\lib\sdl\include #\ INCLUDEPATH += $$BASEDIR\lib\sdl\include \
$$BASEDIR\lib\opal\include #\ #\
#"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include" #"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"
LIBS += -L$$BASEDIR\lib\sdl\win32 \ LIBS += -L$$BASEDIR\lib\sdl\win32 \
......
...@@ -97,6 +97,9 @@ MainWindow::MainWindow(QWidget *parent) : ...@@ -97,6 +97,9 @@ MainWindow::MainWindow(QWidget *parent) :
// Adjust the size // Adjust the size
adjustSize(); adjustSize();
//waypoints->setMapHandle(map);
connect(waypoints, SIGNAL(clearPahtclicked()), map, SLOT(clearPath()));
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
...@@ -147,6 +150,10 @@ void MainWindow::connectWidgets() ...@@ -147,6 +150,10 @@ void MainWindow::connectWidgets()
connect(UASManager::instance(), SIGNAL(activeUASSet(int)), linechart, SLOT(selectSystem(int))); connect(UASManager::instance(), SIGNAL(activeUASSet(int)), linechart, SLOT(selectSystem(int)));
connect(linechart, SIGNAL(logfileWritten(QString)), this, SLOT(loadDataView(QString))); connect(linechart, SIGNAL(logfileWritten(QString)), this, SLOT(loadDataView(QString)));
connect(mavlink, SIGNAL(receiveLossChanged(int, float)), info, SLOT(updateSendLoss(int, float))); connect(mavlink, SIGNAL(receiveLossChanged(int, float)), info, SLOT(updateSendLoss(int, float)));
} }
void MainWindow::arrangeCenterStack() void MainWindow::arrangeCenterStack()
...@@ -308,6 +315,8 @@ void MainWindow::connectActions() ...@@ -308,6 +315,8 @@ void MainWindow::connectActions()
// Joystick configuration // Joystick configuration
connect(ui.actionJoystickSettings, SIGNAL(triggered()), this, SLOT(configure())); connect(ui.actionJoystickSettings, SIGNAL(triggered()), this, SLOT(configure()));
} }
void MainWindow::showHelp() void MainWindow::showHelp()
......
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
<height>800</height> <height>800</height>
</size> </size>
</property> </property>
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>MGMainWindow</string> <string>MGMainWindow</string>
</property> </property>
...@@ -35,7 +38,7 @@ ...@@ -35,7 +38,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1000</width> <width>1000</width>
<height>22</height> <height>21</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuMGround"> <widget class="QMenu" name="menuMGround">
......
...@@ -305,13 +305,13 @@ void MapWidget::createPathButtonClicked(bool checked) ...@@ -305,13 +305,13 @@ void MapWidget::createPathButtonClicked(bool checked)
this->setCursor(Qt::PointingHandCursor); this->setCursor(Qt::PointingHandCursor);
mc->setMouseMode(qmapcontrol::MapControl::None); mc->setMouseMode(qmapcontrol::MapControl::None);
// Clear the previous WP track // // Clear the previous WP track
// TODO: Move this to an actual clear track button and add a warning dialog // // TODO: Move this to an actual clear track button and add a warning dialog
mc->layer("Waypoints")->clearGeometries(); // mc->layer("Waypoints")->clearGeometries();
wps.clear(); // wps.clear();
path->setPoints(wps); // path->setPoints(wps);
mc->layer("Waypoints")->addGeometry(path); // mc->layer("Waypoints")->addGeometry(path);
wpIndex.clear(); // wpIndex.clear();
} else { } else {
...@@ -536,3 +536,14 @@ void MapWidget::changeEvent(QEvent *e) ...@@ -536,3 +536,14 @@ void MapWidget::changeEvent(QEvent *e)
break; break;
} }
} }
void MapWidget::clearPath()
{
// Clear the previous WP track
mc->layer("Waypoints")->clearGeometries();
wps.clear();
path->setPoints(wps);
mc->layer("Waypoints")->addGeometry(path);
wpIndex.clear();
mc->updateRequestNew();
}
...@@ -63,6 +63,9 @@ public slots: ...@@ -63,6 +63,9 @@ public slots:
void updateGlobalPosition(UASInterface* uas, double lat, double lon, double alt, quint64 usec); void updateGlobalPosition(UASInterface* uas, double lat, double lon, double alt, quint64 usec);
void updatePosition(float time, double lat, double lon); void updatePosition(float time, double lat, double lon);
//ROCA
void clearPath();
protected: protected:
void changeEvent(QEvent* e); void changeEvent(QEvent* e);
void wheelEvent(QWheelEvent *event); void wheelEvent(QWheelEvent *event);
...@@ -108,8 +111,10 @@ protected: ...@@ -108,8 +111,10 @@ protected:
void captureGeometryDrag(Geometry* geom, QPointF coordinate); void captureGeometryDrag(Geometry* geom, QPointF coordinate);
void captureGeometryEndDrag(Geometry* geom, QPointF coordinate); void captureGeometryEndDrag(Geometry* geom, QPointF coordinate);
signals: signals:
void movePoint(QPointF newCoord); //void movePoint(QPointF newCoord);
private: private:
Ui::MapWidget *m_ui; Ui::MapWidget *m_ui;
......
...@@ -77,6 +77,8 @@ WaypointList::WaypointList(QWidget *parent, UASInterface* uas) : ...@@ -77,6 +77,8 @@ WaypointList::WaypointList(QWidget *parent, UASInterface* uas) :
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setUAS(UASInterface*))); connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setUAS(UASInterface*)));
// SET UAS AFTER ALL SIGNALS/SLOTS ARE CONNECTED // SET UAS AFTER ALL SIGNALS/SLOTS ARE CONNECTED
setUAS(uas); setUAS(uas);
...@@ -352,3 +354,9 @@ void WaypointList::changeEvent(QEvent *e) ...@@ -352,3 +354,9 @@ void WaypointList::changeEvent(QEvent *e)
} }
} }
void WaypointList::on_clearWPListButton_clicked()
{
emit clearPahtclicked();
}
...@@ -42,6 +42,7 @@ This file is part of the QGROUNDCONTROL project ...@@ -42,6 +42,7 @@ This file is part of the QGROUNDCONTROL project
#include "UASInterface.h" #include "UASInterface.h"
#include "WaypointView.h" #include "WaypointView.h"
namespace Ui { namespace Ui {
class WaypointList; class WaypointList;
} }
...@@ -73,6 +74,8 @@ public slots: ...@@ -73,6 +74,8 @@ public slots:
/** @brief Add a waypoint at the current MAV position */ /** @brief Add a waypoint at the current MAV position */
void addCurrentPositonWaypoint(); void addCurrentPositonWaypoint();
//Update events //Update events
/** @brief sets statusLabel string */ /** @brief sets statusLabel string */
void updateStatusLabel(const QString &string); void updateStatusLabel(const QString &string);
...@@ -88,6 +91,12 @@ public slots: ...@@ -88,6 +91,12 @@ public slots:
void moveDown(Waypoint* wp); void moveDown(Waypoint* wp);
void removeWaypoint(Waypoint* wp); void removeWaypoint(Waypoint* wp);
signals:
void clearPahtclicked();
protected: protected:
virtual void changeEvent(QEvent *e); virtual void changeEvent(QEvent *e);
...@@ -102,6 +111,13 @@ protected: ...@@ -102,6 +111,13 @@ protected:
private: private:
Ui::WaypointList *m_ui; Ui::WaypointList *m_ui;
private slots:
void on_clearWPListButton_clicked();
}; };
#endif // WAYPOINTLIST_H #endif // WAYPOINTLIST_H
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<property name="spacing"> <property name="spacing">
<number>4</number> <number>4</number>
</property> </property>
<item row="0" column="0" colspan="9"> <item row="0" column="0" colspan="10">
<widget class="QScrollArea" name="scrollArea"> <widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>466</width> <width>466</width>
<height>149</height> <height>163</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</widget> </widget>
</widget> </widget>
</item> </item>
<item row="2" column="7"> <item row="2" column="8">
<widget class="QPushButton" name="readButton"> <widget class="QPushButton" name="readButton">
<property name="text"> <property name="text">
<string>Read</string> <string>Read</string>
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="8"> <item row="2" column="9">
<widget class="QPushButton" name="transmitButton"> <widget class="QPushButton" name="transmitButton">
<property name="text"> <property name="text">
<string>Write</string> <string>Write</string>
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0" colspan="9"> <item row="3" column="0" colspan="10">
<widget class="QLabel" name="statusLabel"> <widget class="QLabel" name="statusLabel">
<property name="text"> <property name="text">
<string>TextLabel</string> <string>TextLabel</string>
...@@ -135,6 +135,17 @@ ...@@ -135,6 +135,17 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="7">
<widget class="QPushButton" name="clearWPListButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../mavground.qrc">
<normaloff>:/images/actions/process-stop.svg</normaloff>:/images/actions/process-stop.svg</iconset>
</property>
</widget>
</item>
</layout> </layout>
<action name="actionAddWaypoint"> <action name="actionAddWaypoint">
<property name="icon"> <property name="icon">
......
This diff is collapsed.
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