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