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
fe00cbb2
Commit
fe00cbb2
authored
Mar 19, 2011
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reverted buggy changes
parent
06ecc8c2
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
99 additions
and
182 deletions
+99
-182
Waypoint.h
src/Waypoint.h
+1
-1
MapWidget.cc
src/ui/MapWidget.cc
+66
-159
MapWidget.h
src/ui/MapWidget.h
+22
-15
WaypointList.cc
src/ui/WaypointList.cc
+9
-6
WaypointList.h
src/ui/WaypointList.h
+1
-1
No files found.
src/Waypoint.h
View file @
fe00cbb2
...
...
@@ -44,7 +44,7 @@ class Waypoint : public QObject
public:
Waypoint
(
quint16
id
=
0
,
double
x
=
0
.
0
,
double
y
=
0
.
0
,
double
z
=
0
.
0
,
double
param1
=
0
.
0
,
double
param2
=
0
.
0
,
double
param3
=
0
.
0
,
double
param4
=
0
.
0
,
bool
autocontinue
=
true
,
bool
current
=
false
,
MAV_FRAME
frame
=
MAV_FRAME_GLOBAL
_RELATIVE_ALT
,
MAV_CMD
action
=
MAV_CMD_NAV_WAYPOINT
);
bool
autocontinue
=
true
,
bool
current
=
false
,
MAV_FRAME
frame
=
MAV_FRAME_GLOBAL
,
MAV_CMD
action
=
MAV_CMD_NAV_WAYPOINT
);
~
Waypoint
();
quint16
getId
()
const
{
return
id
;
}
...
...
src/ui/MapWidget.cc
View file @
fe00cbb2
This diff is collapsed.
Click to expand it.
src/ui/MapWidget.h
View file @
fe00cbb2
...
...
@@ -40,7 +40,8 @@ This file is part of the QGROUNDCONTROL project
#include "QPointF"
#include <qmath.h>
#include <QSettings>
class
QMenu
;
class
Waypoint
;
...
...
@@ -75,8 +76,8 @@ public slots:
void
updateAttitude
(
UASInterface
*
uas
,
double
roll
,
double
pitch
,
double
yaw
,
quint64
usec
);
void
updateGlobalPosition
(
UASInterface
*
uas
,
double
lat
,
double
lon
,
double
alt
,
quint64
usec
);
void
updatePosition
(
float
time
,
double
lat
,
double
lon
);
//
void updateCameraPosition(double distance, double bearing, QString dir);
//
QPointF getPointxBearing_Range(double lat1, double lon1, double bearing, double distance);
void
updateCameraPosition
(
double
distance
,
double
bearing
,
QString
dir
);
QPointF
getPointxBearing_Range
(
double
lat1
,
double
lon1
,
double
bearing
,
double
distance
);
/** @brief Clear the waypoints overlay layer */
void
clearWaypoints
(
int
uas
=
0
);
...
...
@@ -92,7 +93,7 @@ public slots:
void
updateWaypoint
(
int
uas
,
Waypoint
*
wp
);
void
updateWaypoint
(
int
uas
,
Waypoint
*
wp
,
bool
updateView
);
//
void drawBorderCamAtMap(bool status);
void
drawBorderCamAtMap
(
bool
status
);
/** @brief Bring up dialog to go to a specific location */
void
goTo
();
...
...
@@ -117,7 +118,6 @@ protected:
QPushButton
*
followgps
;
QPushButton
*
createPath
;
QPushButton
*
clearTracking
;
QPushButton
*
setHome
;
QLabel
*
gpsposition
;
QMenu
*
mapMenu
;
QPushButton
*
mapButton
;
...
...
@@ -128,7 +128,9 @@ protected:
qmapcontrol
::
Layer
*
overlay
;
///< Street overlay (foreground)
qmapcontrol
::
Layer
*
tracks
;
///< Layer for UAV tracks
qmapcontrol
::
GeometryLayer
*
geomLayer
;
///< Layer for waypoints
qmapcontrol
::
GeometryLayer
*
homePosition
;
///< Layer for station control
//only for experiment
qmapcontrol
::
GeometryLayer
*
camLayer
;
///< Layer for camera indicator
int
zoomLevel
;
int
detailZoom
;
///< Steps zoomed in further than qMapControl allows
...
...
@@ -140,6 +142,8 @@ protected:
QMap
<
int
,
qmapcontrol
::
Point
*>
uasIcons
;
QMap
<
int
,
qmapcontrol
::
LineString
*>
uasTrails
;
QMap
<
int
,
QPen
*>
mavPens
;
//QMap<int, QList<qmapcontrol::Point*> > mavWps;
//QMap<int, qmapcontrol::LineString*> waypointPaths;
UASInterface
*
mav
;
quint64
lastUpdate
;
bool
initialized
;
...
...
@@ -153,23 +157,20 @@ protected:
void
captureGeometryDrag
(
Geometry
*
geom
,
QPointF
coordinate
);
void
captureGeometryEndDrag
(
Geometry
*
geom
,
QPointF
coordinate
);
void
captureGeometryDragHome
(
Geometry
*
geom
,
QPointF
coordinate
);
void
createPathButtonClicked
(
bool
checked
);
/** @brief Create the graphic representation of the waypoint */
void
createWaypointGraphAtMap
(
int
id
,
const
QPointF
coordinate
);
void
mapproviderSelected
(
QAction
*
action
);
void
createHomePosition
(
const
QMouseEvent
*
event
,
const
QPointF
coordinate
);
void
createHomePosition
(
const
QPointF
coordinate
);
void
createHomePositionClick
(
bool
click
);
void
loadSettingsMap
(
int8_t
index
);
signals:
//void movePoint(QPointF newCoord);
//void captureMapCoordinateClick(const QPointF coordinate); //ROCA
//void createGlobalWP(bool value, QPointF centerCoordinate);
void
waypointCreated
(
Waypoint
*
wp
);
void
sendGeometryEndDrag
(
const
QPointF
coordinate
,
const
int
index
);
private:
Ui
::
MapWidget
*
m_ui
;
QList
<
qmapcontrol
::
Point
*>
wps
;
...
...
@@ -179,8 +180,14 @@ private:
QPen
*
pointPen
;
int
wpExists
(
const
QPointF
coordinate
);
bool
waypointIsDrag
;
QPointF
homeCoordinate
;
int8_t
index
;
qmapcontrol
::
LineString
*
camLine
;
QList
<
qmapcontrol
::
Point
*>
camPoints
;
QPointF
lastCamBorderPos
;
bool
drawCamBorder
;
int
radioCamera
;
};
#endif // MAPWIDGET_H
src/ui/WaypointList.cc
View file @
fe00cbb2
...
...
@@ -190,13 +190,12 @@ void WaypointList::add()
// Create global frame waypoint per default
wp
=
new
Waypoint
(
0
,
uas
->
getLatitude
(),
uas
->
getLongitude
(),
uas
->
getAltitude
(),
0.0
,
0.0
,
0.0
,
0.0
,
true
,
true
,
MAV_FRAME_GLOBAL
,
MAV_CMD_NAV_WAYPOINT
);
uas
->
getWaypointManager
()
->
addWaypoint
(
wp
);
}
}
}
void
WaypointList
::
addCurrentPositonWaypoint
()
{
void
WaypointList
::
addCurrentPositonWaypoint
()
{
/* TODO: implement with new waypoint structure
if (uas)
{
...
...
@@ -463,9 +462,6 @@ 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
)
...
...
@@ -525,6 +521,13 @@ void WaypointList::on_clearWPListButton_clicked()
widget
->
remove
();
}
}
else
{
// if(isGlobalWP)
// {
// emit clearPathclicked();
// }
}
}
///** @brief The MapWidget informs that a waypoint global was changed on the map */
...
...
src/ui/WaypointList.h
View file @
fe00cbb2
...
...
@@ -108,7 +108,7 @@ public slots:
signals:
void
clearPathclicked
();
void
createWaypointAtMap
(
const
QPointF
coordinate
);
void
changePointList
();
protected:
virtual
void
changeEvent
(
QEvent
*
e
);
...
...
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