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
d8512cc2
Commit
d8512cc2
authored
Jun 21, 2019
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
f5cd508a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
15 deletions
+8
-15
Vehicle.cc
src/Vehicle/Vehicle.cc
+8
-15
No files found.
src/Vehicle/Vehicle.cc
View file @
d8512cc2
...
...
@@ -3753,12 +3753,7 @@ void Vehicle::_handleADSBVehicle(const mavlink_message_t& message)
mavlink_msg_adsb_vehicle_decode
(
&
message
,
&
adsbVehicle
);
if
(
adsbVehicle
.
flags
|
ADSB_FLAGS_VALID_COORDS
)
{
if
(
_adsbICAOMap
.
contains
(
adsbVehicle
.
ICAO_address
))
{
if
(
adsbVehicle
.
tslc
>
maxTimeSinceLastSeen
)
{
ADSBVehicle
*
vehicle
=
_adsbICAOMap
[
adsbVehicle
.
ICAO_address
];
_adsbVehicles
.
removeOne
(
vehicle
);
_adsbICAOMap
.
remove
(
adsbVehicle
.
ICAO_address
);
vehicle
->
deleteLater
();
}
else
{
if
(
adsbVehicle
.
tslc
<=
maxTimeSinceLastSeen
)
{
_adsbICAOMap
[
adsbVehicle
.
ICAO_address
]
->
update
(
adsbVehicle
);
}
}
else
if
(
adsbVehicle
.
tslc
<=
maxTimeSinceLastSeen
)
{
...
...
@@ -3876,15 +3871,13 @@ void Vehicle::_trafficUpdate(bool alert, QString traffic_id, QString vehicle_id,
}
void
Vehicle
::
_adsbTimerTimeout
()
{
// TODO: take into account _adsbICAOMap as well? Needs to be tested, especially the timeout
for
(
auto
it
=
_trafficVehicleMap
.
begin
();
it
!=
_trafficVehicleMap
.
end
();)
{
if
(
it
.
value
()
->
expired
())
{
_adsbVehicles
.
removeOne
(
it
.
value
());
delete
it
.
value
();
it
=
_trafficVehicleMap
.
erase
(
it
);
}
else
{
++
it
;
// Remove all expired ADSB vehicle whether from AirMap or ADSB Mavlink
for
(
int
i
=
_adsbVehicles
.
count
()
-
1
;
i
>=
0
;
i
--
)
{
ADSBVehicle
*
adsbVehicle
=
_adsbVehicles
.
value
<
ADSBVehicle
*>
(
i
);
if
(
adsbVehicle
->
expired
())
{
qDebug
()
<<
"ADSB expired"
;
_adsbVehicles
.
removeAt
(
i
);
adsbVehicle
->
deleteLater
();
}
}
}
...
...
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