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
99d25403
Commit
99d25403
authored
Jul 11, 2011
by
LM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2D map now fully operational
parent
727d7397
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
24 deletions
+36
-24
mapgraphicitem.cpp
src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.cpp
+4
-14
mapgraphicitem.h
src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.h
+5
-0
opmapwidget.cpp
src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp
+2
-4
waypointlineitem.cpp
src/libs/opmapcontrol/src/mapwidget/waypointlineitem.cpp
+18
-4
waypointlineitem.h
src/libs/opmapcontrol/src/mapwidget/waypointlineitem.h
+4
-0
HDDisplay.cc
src/ui/HDDisplay.cc
+2
-0
HUD.cc
src/ui/HUD.cc
+1
-2
No files found.
src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.cpp
View file @
99d25403
...
...
@@ -92,13 +92,8 @@ namespace mapcontrol
GPSItem
*
wwww
=
qgraphicsitem_cast
<
GPSItem
*>
(
i
);
if
(
wwww
)
wwww
->
RefreshPos
();
QGraphicsItemGroup
*
wwwww
=
qgraphicsitem_cast
<
QGraphicsItemGroup
*>
(
i
);
if
(
wwwww
)
foreach
(
QGraphicsItem
*
i
,
wwwww
->
childItems
())
{
WaypointLineItem
*
line
=
qgraphicsitem_cast
<
WaypointLineItem
*>
(
i
);
if
(
line
)
line
->
RefreshPos
();
}
emit
mapChanged
();
}
}
void
MapGraphicItem
::
ChildPosRefresh
()
...
...
@@ -117,13 +112,8 @@ namespace mapcontrol
GPSItem
*
wwww
=
qgraphicsitem_cast
<
GPSItem
*>
(
i
);
if
(
wwww
)
wwww
->
RefreshPos
();
QGraphicsItemGroup
*
wwwww
=
qgraphicsitem_cast
<
QGraphicsItemGroup
*>
(
i
);
if
(
wwwww
)
foreach
(
QGraphicsItem
*
i
,
wwwww
->
childItems
())
{
WaypointLineItem
*
line
=
qgraphicsitem_cast
<
WaypointLineItem
*>
(
i
);
if
(
line
)
line
->
RefreshPos
();
}
emit
mapChanged
();
}
}
void
MapGraphicItem
::
ConstructLastImage
(
int
const
&
zoomdiff
)
...
...
src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.h
View file @
99d25403
...
...
@@ -229,6 +229,11 @@ namespace mapcontrol
* @param zoom
*/
void
zoomChanged
(
double
zoomtotal
,
double
zoomreal
,
double
zoomdigi
);
/**
* @brief Fired when map changes in any visible way
*/
void
mapChanged
();
};
}
#endif // MAPGRAPHICITEM_H
src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp
View file @
99d25403
...
...
@@ -94,8 +94,7 @@ namespace mapcontrol
UAVItem
*
newUAV
=
new
UAVItem
(
map
,
this
);
newUAV
->
setParentItem
(
map
);
UAVS
.
insert
(
id
,
newUAV
);
QGraphicsItemGroup
*
waypointLine
=
new
QGraphicsItemGroup
();
waypointLine
->
setParentItem
(
map
);
QGraphicsItemGroup
*
waypointLine
=
new
QGraphicsItemGroup
(
map
);
waypointLines
.
insert
(
id
,
waypointLine
);
return
newUAV
;
}
...
...
@@ -103,8 +102,7 @@ namespace mapcontrol
void
OPMapWidget
::
AddUAV
(
int
id
,
UAVItem
*
uav
)
{
uav
->
setParentItem
(
map
);
QGraphicsItemGroup
*
waypointLine
=
new
QGraphicsItemGroup
();
waypointLine
->
setParentItem
(
map
);
QGraphicsItemGroup
*
waypointLine
=
new
QGraphicsItemGroup
(
map
);
waypointLines
.
insert
(
id
,
waypointLine
);
UAVS
.
insert
(
id
,
uav
);
}
...
...
src/libs/opmapcontrol/src/mapwidget/waypointlineitem.cpp
View file @
99d25403
...
...
@@ -17,6 +17,9 @@ WaypointLineItem::WaypointLineItem(WayPointItem* wp1, WayPointItem* wp2, QColor
pen
.
setWidth
(
2
);
setPen
(
pen
);
point1
=
wp1
->
Coord
();
point2
=
wp2
->
Coord
();
// Pixel coordinates of the local points
core
::
Point
localPoint1
=
map
->
FromLatLngToLocal
(
wp1
->
Coord
());
core
::
Point
localPoint2
=
map
->
FromLatLngToLocal
(
wp2
->
Coord
());
...
...
@@ -33,6 +36,7 @@ WaypointLineItem::WaypointLineItem(WayPointItem* wp1, WayPointItem* wp2, QColor
connect
(
wp2
,
SIGNAL
(
destroyed
()),
this
,
SLOT
(
deleteLater
()));
// Map Zoom and move
connect
(
map
,
SIGNAL
(
mapChanged
()),
this
,
SLOT
(
updateWPValues
()));
}
void
WaypointLineItem
::
RefreshPos
()
...
...
@@ -45,10 +49,13 @@ void WaypointLineItem::RefreshPos()
else
{
// Set new pixel coordinates based on new global coordinates
core
::
Point
localPoint1
=
map
->
FromLatLngToLocal
(
wp1
->
Coord
());
core
::
Point
localPoint2
=
map
->
FromLatLngToLocal
(
wp2
->
Coord
());
setLine
(
localPoint1
.
X
(),
localPoint1
.
Y
(),
localPoint2
.
X
(),
localPoint2
.
Y
());
//QTimer::singleShot(0, this, SLOT(updateWPValues()));
core
::
Point
localPoint1
=
map
->
FromLatLngToLocal
(
point1
);
core
::
Point
localPoint2
=
map
->
FromLatLngToLocal
(
point2
);
if
(
!
localPoint1
.
IsEmpty
()
&&
!
localPoint2
.
IsEmpty
())
{
setLine
(
localPoint1
.
X
(),
localPoint1
.
Y
(),
localPoint2
.
X
(),
localPoint2
.
Y
());
}
}
}
...
...
@@ -63,6 +70,8 @@ void WaypointLineItem::updateWPValues(WayPointItem* waypoint)
else
{
// Set new pixel coordinates based on new global coordinates
point1
=
wp1
->
Coord
();
point2
=
wp2
->
Coord
();
core
::
Point
localPoint1
=
map
->
FromLatLngToLocal
(
wp1
->
Coord
());
core
::
Point
localPoint2
=
map
->
FromLatLngToLocal
(
wp2
->
Coord
());
...
...
@@ -70,6 +79,11 @@ void WaypointLineItem::updateWPValues(WayPointItem* waypoint)
}
}
void
WaypointLineItem
::
updateWPValues
()
{
updateWPValues
(
NULL
);
}
int
WaypointLineItem
::
type
()
const
{
return
Type
;
...
...
src/libs/opmapcontrol/src/mapwidget/waypointlineitem.h
View file @
99d25403
...
...
@@ -23,6 +23,10 @@ public slots:
void
updateWPValues
(
WayPointItem
*
waypoint
);
/**
* @brief Update waypoint values
*/
void
updateWPValues
();
/**
* @brief Update waypoint values
*
*/
void
RefreshPos
();
...
...
src/ui/HDDisplay.cc
View file @
99d25403
...
...
@@ -112,6 +112,8 @@ HDDisplay::HDDisplay(QStringList* plotList, QString title, QWidget *parent) :
this
->
setMinimumHeight
(
125
);
this
->
setMinimumWidth
(
100
);
scalingFactor
=
this
->
width
()
/
vwidth
;
// Refresh timer
refreshTimer
->
setInterval
(
180
);
//
connect
(
refreshTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
triggerUpdate
()));
...
...
src/ui/HUD.cc
View file @
99d25403
...
...
@@ -147,6 +147,7 @@ HUD::HUD(int width, int height, QWidget* parent)
setMinimumSize
(
80
,
60
);
// Set preferred size
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Expanding
);
scalingFactor
=
this
->
width
()
/
vwidth
;
// Fill with black background
QImage
fill
=
QImage
(
width
,
height
,
QImage
::
Format_Indexed8
);
...
...
@@ -196,8 +197,6 @@ HUD::HUD(int width, int height, QWidget* parent)
createActions
();
if
(
UASManager
::
instance
()
->
getActiveUAS
()
!=
NULL
)
setActiveUAS
(
UASManager
::
instance
()
->
getActiveUAS
());
setVisible
(
false
);
}
HUD
::~
HUD
()
...
...
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