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
8e97b8f5
Commit
8e97b8f5
authored
Feb 05, 2016
by
Nate Weibley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve final conditions and speed up fragment acquisition
parent
68b77d7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
LogDownloadController.cc
src/ViewWidgets/LogDownloadController.cc
+7
-2
No files found.
src/ViewWidgets/LogDownloadController.cc
View file @
8e97b8f5
...
...
@@ -275,8 +275,9 @@ LogDownloadController::_logData(UASInterface* uas, uint32_t ofs, uint16_t id, ui
qWarning
()
<<
"Received log data for wrong log"
;
return
;
}
bool
result
=
false
;
bool
result
=
false
;
uint32_t
timeout_time
=
kTimeOutMilliseconds
;
if
(
ofs
<=
_downloadData
->
entry
->
size
())
{
// Check for a gap
qint64
pos
=
_downloadData
->
file
.
pos
();
...
...
@@ -287,6 +288,8 @@ LogDownloadController::_logData(UASInterface* uas, uint32_t ofs, uint16_t id, ui
const
int32_t
gap
=
_downloadData
->
gaps
.
take
(
ofs
)
-
count
;
if
(
gap
>
0
)
{
_downloadData
->
gaps
[
ofs
+
count
]
=
qMax
(
static_cast
<
uint32_t
>
(
gap
),
_downloadData
->
gaps
.
value
(
ofs
+
count
,
0
));
}
else
{
timeout_time
=
20
;
}
}
else
if
(
pos
<
ofs
)
{
// Mind the gap
...
...
@@ -314,7 +317,7 @@ LogDownloadController::_logData(UASInterface* uas, uint32_t ofs, uint16_t id, ui
//-- reset retries
_retries
=
0
;
//-- Reset timer
_timer
.
start
(
kTimeOutMilliseconds
);
_timer
.
start
(
timeout_time
);
//-- Do we have it all?
if
(
_logComplete
())
{
_downloadData
->
entry
->
setStatus
(
QString
(
"Downloaded"
));
...
...
@@ -539,6 +542,8 @@ LogDownloadController::_prepareLogDownload()
if
(
!
_downloadData
->
file
.
resize
(
entry
->
size
()))
{
qWarning
()
<<
"Failed to allocate space for log file:"
<<
_downloadData
->
filename
;
}
else
{
// Force ourselves to request the last few bytes if we have any gaps so we end cleanly
_downloadData
->
gaps
.
insert
(
entry
->
size
()
-
MAVLINK_MSG_LOG_DATA_FIELD_DATA_LEN
,
MAVLINK_MSG_LOG_DATA_FIELD_DATA_LEN
);
_downloadData
->
elapsed
.
start
();
result
=
true
;
}
...
...
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