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
79948c12
Commit
79948c12
authored
Apr 22, 2011
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on 2D map
parent
094d0521
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
UDPLink.cc
src/comm/UDPLink.cc
+11
-4
QGCMapWidget.cc
src/ui/QGCMapWidget.cc
+13
-1
No files found.
src/comm/UDPLink.cc
View file @
79948c12
...
...
@@ -143,7 +143,6 @@ void UDPLink::removeHost(const QString& hostname)
}
}
void
UDPLink
::
writeBytes
(
const
char
*
data
,
qint64
size
)
{
// Broadcast to all connected systems
...
...
@@ -151,18 +150,26 @@ void UDPLink::writeBytes(const char* data, qint64 size)
{
QHostAddress
currentHost
=
hosts
.
at
(
h
);
quint16
currentPort
=
ports
.
at
(
h
);
//#define UDPLINK_DEBUG
#ifdef UDPLINK_DEBUG
QString
bytes
;
QString
ascii
;
//qDebug() << "WRITING DATA TO" << currentHost.toString() << currentPort;
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
unsigned
char
v
=
data
[
i
];
bytes
.
append
(
QString
().
sprintf
(
"%02x "
,
v
));
ascii
.
append
(
data
[
i
]);
if
(
data
[
i
]
>
31
&&
data
[
i
]
<
127
)
{
ascii
.
append
(
data
[
i
]);
}
else
{
ascii
.
append
(
219
);
}
}
qDebug
()
<<
"Sent"
<<
size
<<
"bytes to"
<<
currentHost
.
toString
()
<<
":"
<<
currentPort
<<
"data:"
;
qDebug
()
<<
bytes
;
qDebug
()
<<
"ASCII:"
<<
ascii
;
#endif
socket
->
writeDatagram
(
data
,
size
,
currentHost
,
currentPort
);
}
}
...
...
src/ui/QGCMapWidget.cc
View file @
79948c12
#include "QGCMapWidget.h"
#include "UASInterface.h"
#include "UASManager.h"
QGCMapWidget
::
QGCMapWidget
(
QWidget
*
parent
)
:
mapcontrol
::
OPMapWidget
(
parent
)
{
//UAV = new mapcontrol::UAVItem();
connect
(
UASManager
::
instance
(),
SIGNAL
(
UASCreated
(
UASInterface
*
)),
this
,
SLOT
(
addUAS
(
UASInterface
*
)));
foreach
(
UASInterface
*
uas
,
UASManager
::
instance
()
->
getUASList
())
{
addUAS
(
uas
);
}
UAV
->
setVisible
(
true
);
UAV
->
setPos
(
40
,
8
);
UAV
->
show
();
}
/**
...
...
@@ -31,7 +41,9 @@ void QGCMapWidget::updateGlobalPosition(UASInterface* uas, double lat, double lo
Q_UNUSED
(
usec
);
Q_UNUSED
(
alt
);
// FIXME Use altitude
UAV
->
setPos
(
lat
,
lon
);
UAV
->
show
();
qDebug
()
<<
"Updating 2D map position"
;
// QPointF coordinate;
// coordinate.setX(lon);
...
...
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