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
d22409fd
Commit
d22409fd
authored
Dec 07, 2010
by
Mariano Lizarraga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in collecting global waypoints from the autopilot
parent
a2c07fa1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
MapWidget.cc
src/ui/MapWidget.cc
+14
-0
MapWidget.h
src/ui/MapWidget.h
+1
-1
No files found.
src/ui/MapWidget.cc
View file @
d22409fd
...
@@ -407,6 +407,7 @@ void MapWidget::captureMapClick(const QMouseEvent* event, const QPointF coordina
...
@@ -407,6 +407,7 @@ void MapWidget::captureMapClick(const QMouseEvent* event, const QPointF coordina
void
MapWidget
::
createWaypointGraphAtMap
(
const
QPointF
coordinate
)
void
MapWidget
::
createWaypointGraphAtMap
(
const
QPointF
coordinate
)
{
{
if
(
!
wpExists
(
coordinate
)){
// Create waypoint name
// Create waypoint name
QString
str
;
QString
str
;
...
@@ -425,6 +426,8 @@ void MapWidget::createWaypointGraphAtMap(const QPointF coordinate)
...
@@ -425,6 +426,8 @@ void MapWidget::createWaypointGraphAtMap(const QPointF coordinate)
{
{
tempCirclePoint
=
new
Waypoint2DIcon
(
coordinate
.
x
(),
coordinate
.
y
(),
20
,
str
,
qmapcontrol
::
Point
::
Middle
);
tempCirclePoint
=
new
Waypoint2DIcon
(
coordinate
.
x
(),
coordinate
.
y
(),
20
,
str
,
qmapcontrol
::
Point
::
Middle
);
}
}
mc
->
layer
(
"Waypoints"
)
->
addGeometry
(
tempCirclePoint
);
mc
->
layer
(
"Waypoints"
)
->
addGeometry
(
tempCirclePoint
);
Point
*
tempPoint
=
new
Point
(
coordinate
.
x
(),
coordinate
.
y
(),
str
);
Point
*
tempPoint
=
new
Point
(
coordinate
.
x
(),
coordinate
.
y
(),
str
);
...
@@ -436,11 +439,22 @@ void MapWidget::createWaypointGraphAtMap(const QPointF coordinate)
...
@@ -436,11 +439,22 @@ void MapWidget::createWaypointGraphAtMap(const QPointF coordinate)
// Refresh the screen
// Refresh the screen
mc
->
updateRequestNew
();
mc
->
updateRequestNew
();
}
//// // emit signal mouse was clicked
//// // emit signal mouse was clicked
// emit captureMapCoordinateClick(coordinate);
// emit captureMapCoordinateClick(coordinate);
}
}
int
MapWidget
::
wpExists
(
const
QPointF
coordinate
){
for
(
int
i
=
0
;
i
<
wps
.
size
();
i
++
){
if
(
wps
.
at
(
i
)
->
latitude
()
==
coordinate
.
y
()
&&
wps
.
at
(
i
)
->
longitude
()
==
coordinate
.
x
()){
return
1
;
}
}
return
0
;
}
void
MapWidget
::
captureGeometryClick
(
Geometry
*
geom
,
QPoint
point
)
void
MapWidget
::
captureGeometryClick
(
Geometry
*
geom
,
QPoint
point
)
{
{
...
...
src/ui/MapWidget.h
View file @
d22409fd
...
@@ -144,7 +144,7 @@ private:
...
@@ -144,7 +144,7 @@ private:
QHash
<
QString
,
qmapcontrol
::
Point
*>
wpIndex
;
QHash
<
QString
,
qmapcontrol
::
Point
*>
wpIndex
;
qmapcontrol
::
LineString
*
path
;
qmapcontrol
::
LineString
*
path
;
QPen
*
pointPen
;
QPen
*
pointPen
;
int
wpExists
(
const
QPointF
coordinate
);
bool
waypointIsDrag
;
bool
waypointIsDrag
;
...
...
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