Commit 352fe512 authored by Alejandro's avatar Alejandro

check code UAS

parent 768fed96
......@@ -328,11 +328,13 @@ namespace qmapcontrol
layermanager->zoomIn();
update();
}
void MapControl::zoomOut()
{
layermanager->zoomOut();
update();
}
void MapControl::setZoom(int zoomlevel)
{
layermanager->setZoom(zoomlevel);
......
......@@ -315,7 +315,9 @@ int UASWaypointManager::removeWaypoint(quint16 seq)
{
waypoints[i]->setId(i);
}
emit waypointListChanged();
return 0;
}
return -1;
......
......@@ -826,6 +826,7 @@ void MainWindow::updateLocationSettings (Qt::DockWidgetArea location)
}
}
/**
* Connect the signals and slots of the common window widgets
*/
......@@ -841,11 +842,17 @@ void MainWindow::connectCommonWidgets()
{
// clear path create on the map
connect(waypointsDockWidget->widget(), SIGNAL(clearPathclicked()), mapWidget, SLOT(clearWaypoints()));
//
connect(waypointsDockWidget->widget(), SIGNAL(changePointList()), mapWidget, SLOT(clearWaypoints()));
// add Waypoint widget in the WaypointList widget when mouse clicked
connect(mapWidget, SIGNAL(captureMapCoordinateClick(QPointF)), waypointsDockWidget->widget(), SLOT(addWaypointMouse(QPointF)));
// it notifies that a waypoint global goes to do create and a map graphic too
connect(waypointsDockWidget->widget(), SIGNAL(createWaypointAtMap(QPointF)), mapWidget, SLOT(createWaypointGraphAtMap(QPointF)));
}
//TODO temporaly debug
......
......@@ -106,8 +106,10 @@ public slots:
void configure();
/** @brief Set the currently controlled UAS */
void setActiveUAS(UASInterface* uas);
/** @brief Add a new UAS */
void UASCreated(UASInterface* uas);
void startVideoCapture();
void stopVideoCapture();
void saveScreen();
......
......@@ -177,11 +177,9 @@ MapWidget::MapWidget(QWidget *parent) :
// Connect the required signals-slots
connect(zoomin, SIGNAL(clicked(bool)),
mc, SLOT(zoomIn()));
connect(zoomin, SIGNAL(clicked(bool)), mc, SLOT(zoomIn()));
connect(zoomout, SIGNAL(clicked(bool)),
mc, SLOT(zoomOut()));
connect(zoomout, SIGNAL(clicked(bool)), mc, SLOT(zoomOut()));
QList<UASInterface*> systems = UASManager::instance()->getUASList();
foreach(UASInterface* system, systems)
......@@ -351,7 +349,6 @@ void MapWidget::createPathButtonClicked(bool checked)
* @param coordinate The coordinate in which it occured the mouse event
* @note This slot is connected to the mouseEventCoordinate of the QMapControl object
*/
void MapWidget::captureMapClick(const QMouseEvent* event, const QPointF coordinate)
{
//qDebug() << mc->mouseMode();
......@@ -373,6 +370,8 @@ void MapWidget::captureMapClick(const QMouseEvent* event, const QPointF coordina
{
tempCirclePoint = new Waypoint2DIcon(coordinate.x(), coordinate.y(), 20, str, qmapcontrol::Point::Middle);
}
//draw WP in map
mc->layer("Waypoints")->addGeometry(tempCirclePoint);
qmapcontrol::Point* tempPoint = new qmapcontrol::Point(coordinate.x(), coordinate.y(),str);
......@@ -500,6 +499,7 @@ MapWidget::~MapWidget()
{
delete m_ui;
}
/**
*
* @param uas the UAS/MAV to monitor/display with the HUD
......
......@@ -138,7 +138,7 @@ protected:
signals:
//void movePoint(QPointF newCoord);
void captureMapCoordinateClick(const QPointF coordinate); //ROCA
void captureMapCoordinateClick(const QPointF coordinate);
void createGlobalWP(bool value, QPointF centerCoordinate);
void sendGeometryEndDrag(const QPointF coordinate, const int index);
......
......@@ -176,27 +176,7 @@ void WaypointList::add()
{
if (uas)
{
// if(isGlobalWP)
// {
// const QVector<Waypoint *> &waypoints = uas->getWaypointManager().getWaypointList();
// if (waypoints.size() > 0)
// {
// Waypoint *last = waypoints.at(waypoints.size()-1);
// Waypoint *wp = new Waypoint(0, centerMapCoordinate.x(), centerMapCoordinate.y(), last->getZ(), last->getYaw(), last->getAutoContinue(), false, last->getOrbit(), last->getHoldTime());
// uas->getWaypointManager().addWaypoint(wp);
// }
// else
// {
// Waypoint *wp = new Waypoint(0, centerMapCoordinate.x(), centerMapCoordinate.y(), -0.8, 0.0, true, true, 0.15, 2000);
// uas->getWaypointManager().addWaypoint(wp);
// }
//
// emit createWaypointAtMap(centerMapCoordinate);
// }
// else
{
const QVector<Waypoint *> &waypoints = uas->getWaypointManager().getWaypointList();
const QVector<Waypoint *> &waypoints = uas->getWaypointManager().getWaypointList();
Waypoint *wp;
......@@ -219,7 +199,7 @@ void WaypointList::add()
{
emit createWaypointAtMap(QPointF(wp->getX(), wp->getY()));
}
}
}
}
......@@ -300,62 +280,7 @@ void WaypointList::waypointListChanged()
{
const QVector<Waypoint *> &waypoints = uas->getWaypointManager().getWaypointList();
// For Global Waypoints
//if(isGlobalWP)
//{
//isLocalWP = false;
//// first remove all views of non existing waypoints
//if (!wpGlobalViews.empty())
//{
//QMapIterator<Waypoint*,WaypointGlobalView*> viewIt(wpGlobalViews);
//viewIt.toFront();
//while(viewIt.hasNext())
//{
//viewIt.next();
//Waypoint *cur = viewIt.key();
//int i;
//for (i = 0; i < waypoints.size(); i++)
//{
//if (waypoints[i] == cur)
//{
//break;
//}
//}
//if (i == waypoints.size())
//{
//WaypointGlobalView* widget = wpGlobalViews.find(cur).value();
//widget->hide();
//listLayout->removeWidget(widget);
//wpGlobalViews.remove(cur);
//}
//}
//}
//// then add/update the views for each waypoint in the list
//for(int i = 0; i < waypoints.size(); i++)
//{
//Waypoint *wp = waypoints[i];
//if (!wpGlobalViews.contains(wp))
//{
//WaypointGlobalView* wpview = new WaypointGlobalView(wp, this);
//wpGlobalViews.insert(wp, wpview);
//connect(wpview, SIGNAL(removeWaypoint(Waypoint*)), this, SLOT(removeWaypoint(Waypoint*)));
//connect(wpview, SIGNAL(changePositionWP(Waypoint*)), this, SLOT(changeWPPositionBySpinBox(Waypoint*)));
//// connect(wpview, SIGNAL(moveDownWaypoint(Waypoint*)), this, SLOT(moveDown(Waypoint*)));
//// connect(wpview, SIGNAL(moveUpWaypoint(Waypoint*)), this, SLOT(moveUp(Waypoint*)));
//// connect(wpview, SIGNAL(changePositionWP(Waypoint*)), this, SLOT(waypointGlobalPositionChanged(Waypoint*)));
//// connect(wpview, SIGNAL(currentWaypointChanged(quint16)), this, SLOT(currentWaypointChanged(quint16)));
//// connect(wpview, SIGNAL(changeCurrentWaypoint(quint16)), this, SLOT(changeCurrentWaypoint(quint16)));
//}
//WaypointGlobalView *wpgv = wpGlobalViews.value(wp);
//wpgv->updateValues();
//listLayout->addWidget(wpgv);
//}
//}
//else
{
// for local Waypoints
// for local Waypoints
// first remove all views of non existing waypoints
if (!wpViews.empty())
{
......@@ -402,10 +327,10 @@ void WaypointList::waypointListChanged()
listLayout->addWidget(wpv);
}
}
loadFileGlobalWP = false;
//emit changePointList();
}
......@@ -431,6 +356,9 @@ void WaypointList::moveUp(Waypoint* wp)
uas->getWaypointManager().moveWaypoint(i, i-1);
}
}
//emitir seal de cambio orden en la lista,
//la debe capturar el mapwidget para volver a dibujar la ruta
}
void WaypointList::moveDown(Waypoint* wp)
......@@ -490,13 +418,6 @@ void WaypointList::on_clearWPListButton_clicked()
widget->remove();
}
}
else
{
// if(isGlobalWP)
// {
// emit clearPathclicked();
// }
}
}
/** @brief Add a waypoint by mouse click over the map */
......
......@@ -113,7 +113,7 @@ signals:
void createWaypointAtMap(const QPointF coordinate);
// void ChangeWaypointGlobalPosition(int index, QPointF coord);
void changePositionWPBySpinBox(int indexWP, float lat, float lon);
void changePointList();
protected:
......
......@@ -107,6 +107,7 @@ void WaypointView::moveDown()
emit moveDownWaypoint(wp);
}
void WaypointView::remove()
{
emit removeWaypoint(wp);
......
......@@ -35,10 +35,10 @@ const char* kActionLabels[MAV_ACTION_NB] =
"LOITER",
"SET ORIGIN",
"RELAY ON",
"RELAY OFF",
"GET IMAGE",
"START VIDEO",
"STOP VIDEO",
//"RELAY OFF",
//"GET IMAGE",
//"START VIDEO",
//"STOP VIDEO",
"RESET MAP"};
QGCActionButton::QGCActionButton(QWidget *parent) :
......
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