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
767fe5a5
Commit
767fe5a5
authored
Jan 20, 2011
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bugs
parent
3920c256
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
143 additions
and
127 deletions
+143
-127
MapWidget.cc
src/ui/MapWidget.cc
+15
-2
MapWidget.h
src/ui/MapWidget.h
+2
-0
WaypointList.cc
src/ui/WaypointList.cc
+126
-125
No files found.
src/ui/MapWidget.cc
View file @
767fe5a5
...
...
@@ -94,7 +94,7 @@ MapWidget::MapWidget(QWidget *parent) :
// SET INITIAL POSITION AND ZOOM
// Set default zoom level
mc
->
setZoom
(
1
6
);
mc
->
setZoom
(
1
7
);
// Zurich, ETH
mc
->
setView
(
QPointF
(
8.548056
,
47.376389
));
...
...
@@ -481,8 +481,12 @@ void MapWidget::updateWaypoint(int uas, Waypoint* wp)
{
// First set waypoint coordinate
waypoint
->
setCoordinate
(
coordinate
);
// Now update icon position
//mc->layer("Waypoints")->removeGeometry(wpIcons.at(wp->getId()));
wpIcons
.
at
(
wp
->
getId
())
->
setCoordinate
(
coordinate
);
//mc->layer("Waypoints")->addGeometry(wpIcons.at(wp->getId()));
// Then waypoint line coordinate
Point
*
linesegment
=
waypointPath
->
points
().
at
(
wp
->
getId
(
));
Point
*
linesegment
=
waypointPath
->
points
().
at
(
mav
->
getWaypointManager
()
->
getWaypointList
().
indexOf
(
wp
));
if
(
linesegment
)
{
...
...
@@ -524,6 +528,7 @@ void MapWidget::createWaypointGraphAtMap(int id, const QPointF coordinate)
mc
->
layer
(
"Waypoints"
)
->
addGeometry
(
tempCirclePoint
);
wpIcons
.
append
(
tempCirclePoint
);
Point
*
tempPoint
=
new
Point
(
coordinate
.
x
(),
coordinate
.
y
(),
str
);
wps
.
append
(
tempPoint
);
...
...
@@ -663,14 +668,22 @@ void MapWidget::updateWaypointList(int uas)
// Delete now unused wps
if
(
wps
.
count
()
>
wpList
.
count
())
{
mc
->
layer
(
"Waypoints"
)
->
removeGeometry
(
waypointPath
);
for
(
int
i
=
wpList
.
count
();
i
<
wps
.
count
();
++
i
)
{
QRect
updateRect
=
wps
.
at
(
i
)
->
boundingBox
().
toRect
();
wps
.
removeAt
(
i
);
mc
->
layer
(
"Waypoints"
)
->
removeGeometry
(
wpIcons
.
at
(
i
));
waypointPath
->
points
().
removeAt
(
i
);
//Point* linesegment = waypointPath->points().at(mav->getWaypointManager()->getWaypointList().indexOf(wp));
mc
->
updateRequest
(
updateRect
);
}
mc
->
layer
(
"Waypoints"
)
->
addGeometry
(
waypointPath
);
}
// Clear and rebuild linestring
}
}
...
...
src/ui/MapWidget.h
View file @
767fe5a5
...
...
@@ -45,6 +45,7 @@ This file is part of the QGROUNDCONTROL project
class
QMenu
;
class
Waypoint
;
class
Waypoint2DIcon
;
namespace
Ui
{
class
MapWidget
;
...
...
@@ -162,6 +163,7 @@ protected:
private:
Ui
::
MapWidget
*
m_ui
;
QList
<
qmapcontrol
::
Point
*>
wps
;
QList
<
Waypoint2DIcon
*>
wpIcons
;
qmapcontrol
::
LineString
*
waypointPath
;
//QHash <QString, qmapcontrol::Point*> wpIndex;
QPen
*
pointPen
;
...
...
src/ui/WaypointList.cc
View file @
767fe5a5
This diff is collapsed.
Click to expand it.
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