Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
352fe512
Commit
352fe512
authored
Jan 25, 2011
by
Alejandro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check code UAS
parent
768fed96
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
32 additions
and
97 deletions
+32
-97
mapcontrol.cpp
lib/QMapControl/src/mapcontrol.cpp
+2
-0
UASWaypointManager.cc
src/uas/UASWaypointManager.cc
+2
-0
MainWindow.cc
src/ui/MainWindow.cc
+7
-0
MainWindow.h
src/ui/MainWindow.h
+2
-0
MapWidget.cc
src/ui/MapWidget.cc
+5
-5
MapWidget.h
src/ui/MapWidget.h
+1
-1
WaypointList.cc
src/ui/WaypointList.cc
+7
-86
WaypointList.h
src/ui/WaypointList.h
+1
-1
WaypointView.cc
src/ui/WaypointView.cc
+1
-0
QGCActionButton.cc
src/ui/designer/QGCActionButton.cc
+4
-4
No files found.
lib/QMapControl/src/mapcontrol.cpp
View file @
352fe512
...
...
@@ -328,11 +328,13 @@ namespace qmapcontrol
layermanager
->
zoomIn
();
update
();
}
void
MapControl
::
zoomOut
()
{
layermanager
->
zoomOut
();
update
();
}
void
MapControl
::
setZoom
(
int
zoomlevel
)
{
layermanager
->
setZoom
(
zoomlevel
);
...
...
src/uas/UASWaypointManager.cc
View file @
352fe512
...
...
@@ -315,7 +315,9 @@ int UASWaypointManager::removeWaypoint(quint16 seq)
{
waypoints
[
i
]
->
setId
(
i
);
}
emit
waypointListChanged
();
return
0
;
}
return
-
1
;
...
...
src/ui/MainWindow.cc
View file @
352fe512
...
...
@@ -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
...
...
src/ui/MainWindow.h
View file @
352fe512
...
...
@@ -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
();
...
...
src/ui/MapWidget.cc
View file @
352fe512
...
...
@@ -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
...
...
src/ui/MapWidget.h
View file @
352fe512
...
...
@@ -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
);
...
...
src/ui/WaypointList.cc
View file @
352fe512
...
...
@@ -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 */
...
...
src/ui/WaypointList.h
View file @
352fe512
...
...
@@ -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:
...
...
src/ui/WaypointView.cc
View file @
352fe512
...
...
@@ -107,6 +107,7 @@ void WaypointView::moveDown()
emit
moveDownWaypoint
(
wp
);
}
void
WaypointView
::
remove
()
{
emit
removeWaypoint
(
wp
);
...
...
src/ui/designer/QGCActionButton.cc
View file @
352fe512
...
...
@@ -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
)
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment