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
9c4fd89f
Commit
9c4fd89f
authored
Aug 10, 2016
by
Don Gagne
Committed by
GitHub
Aug 10, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3914 from NaterGator/logdlrate
Use human appropriate values for bytes in log downloader
parents
a0d80bbb
4eb21337
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
LogDownloadController.cc
src/ViewWidgets/LogDownloadController.cc
+16
-4
No files found.
src/ViewWidgets/LogDownloadController.cc
View file @
9c4fd89f
...
...
@@ -15,6 +15,7 @@
#include "UAS.h"
#include "QGCApplication.h"
#include "QGCToolbox.h"
#include "QGCMapEngine.h"
#include "Vehicle.h"
#include "MainWindow.h"
...
...
@@ -31,7 +32,6 @@
QGC_LOGGING_CATEGORY
(
LogDownloadLog
,
"LogDownloadLog"
)
static
QLocale
kLocale
;
//-----------------------------------------------------------------------------
struct
LogDownloadData
{
LogDownloadData
(
QGCLogEntry
*
entry
);
...
...
@@ -42,6 +42,8 @@ struct LogDownloadData {
uint
ID
;
QGCLogEntry
*
entry
;
uint
written
;
size_t
rate_bytes
;
qreal
rate_avg
;
QElapsedTimer
elapsed
;
void
advanceChunk
()
...
...
@@ -76,6 +78,8 @@ LogDownloadData::LogDownloadData(QGCLogEntry* entry_)
:
ID
(
entry_
->
id
())
,
entry
(
entry_
)
,
written
(
0
)
,
rate_bytes
(
0
)
,
rate_avg
(
0
)
{
}
...
...
@@ -95,7 +99,7 @@ QGCLogEntry::QGCLogEntry(uint logId, const QDateTime& dateTime, uint logSize, bo
QString
QGCLogEntry
::
sizeStr
()
const
{
return
kLocale
.
t
oString
(
_logSize
);
return
QGCMapEngine
::
bigSizeT
oString
(
_logSize
);
}
//----------------------------------------------------------------------------------------
...
...
@@ -332,10 +336,18 @@ LogDownloadController::_logData(UASInterface* uas, uint32_t ofs, uint16_t id, ui
//-- Write chunk to file
if
(
_downloadData
->
file
.
write
((
const
char
*
)
data
,
count
))
{
_downloadData
->
written
+=
count
;
_downloadData
->
rate_bytes
+=
count
;
if
(
_downloadData
->
elapsed
.
elapsed
()
>=
kGUIRateMilliseconds
)
{
//-- Update download rate
qreal
rrate
=
_downloadData
->
rate_bytes
/
(
_downloadData
->
elapsed
.
elapsed
()
/
1000.0
);
_downloadData
->
rate_avg
=
_downloadData
->
rate_avg
*
0.95
+
rrate
*
0.05
;
_downloadData
->
rate_bytes
=
0
;
//-- Update status
QString
comma_value
=
kLocale
.
toString
(
_downloadData
->
written
);
_downloadData
->
entry
->
setStatus
(
comma_value
);
const
QString
status
=
QString
(
"%1 (%2/s)"
).
arg
(
QGCMapEngine
::
bigSizeToString
(
_downloadData
->
written
),
QGCMapEngine
::
bigSizeToString
(
_downloadData
->
rate_avg
));
_downloadData
->
entry
->
setStatus
(
status
);
_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