QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
OnboardLogEntry.cc
Go to the documentation of this file.
1
#include "
OnboardLogEntry.h
"
2
#include "
MAVLinkLib.h
"
3
#include "
QGCFormat.h
"
4
#include "
QGCLoggingCategory.h
"
5
6
#include <QtCore/QtMath>
7
8
QGC_LOGGING_CATEGORY
(OnboardLogEntryLog,
"AnalyzeView.QGCOnboardLogEntry"
)
9
10
const uint32_t
OnboardLogDownloadData
::kChunkSize =
OnboardLogDownloadData
::kTableBins * MAVLINK_MSG_LOG_DATA_FIELD_DATA_LEN;
11
12
OnboardLogDownloadData
::
OnboardLogDownloadData
(
QGCOnboardLogEntry
* const logEntry)
13
: ID(logEntry->
id
())
14
, entry(logEntry)
15
{
16
qCDebug(OnboardLogEntryLog) << Q_FUNC_INFO <<
"id"
<< ID;
17
}
18
19
OnboardLogDownloadData::~OnboardLogDownloadData
()
20
{
21
qCDebug(OnboardLogEntryLog) << Q_FUNC_INFO <<
"id"
<<
ID
;
22
}
23
24
void
OnboardLogDownloadData::advanceChunk
()
25
{
26
++
current_chunk
;
27
chunk_table
= QBitArray(
chunkBins
(),
false
);
28
}
29
30
uint32_t
OnboardLogDownloadData::chunkBins
()
const
31
{
32
const
qreal num =
static_cast<
qreal
>
((
entry
->
size
() - (
current_chunk
*
kChunkSize
))) /
static_cast<
qreal
>
(MAVLINK_MSG_LOG_DATA_FIELD_DATA_LEN);
33
return
qMin(
static_cast<
uint32_t
>
(qCeil(num)),
kTableBins
);
34
}
35
36
uint32_t
OnboardLogDownloadData::numChunks
()
const
37
{
38
const
qreal num =
static_cast<
qreal
>
(
entry
->
size
()) /
static_cast<
qreal
>
(
kChunkSize
);
39
return
qCeil(num);
40
}
41
42
bool
OnboardLogDownloadData::chunkEquals
(
const
bool
val)
const
43
{
44
return
(
chunk_table
== QBitArray(
chunk_table
.size(), val));
45
}
46
47
/*===========================================================================*/
48
49
QGCOnboardLogEntry::QGCOnboardLogEntry
(uint logId,
const
QDateTime &dateTime, uint logSize,
bool
received, QObject *parent)
50
: QObject(parent)
51
, _logID(logId)
52
, _logSize(logSize)
53
, _logTimeUTC(dateTime)
54
, _received(received)
55
{
56
qCDebug(OnboardLogEntryLog) << Q_FUNC_INFO <<
"id"
<< _logID;
57
}
58
59
QGCOnboardLogEntry::~QGCOnboardLogEntry
()
60
{
61
qCDebug(OnboardLogEntryLog) << Q_FUNC_INFO <<
"id"
<< _logID;
62
}
63
64
QString
QGCOnboardLogEntry::sizeStr
()
const
65
{
66
return
QGC::bigSizeToString
(_logSize);
67
}
MAVLinkLib.h
OnboardLogEntry.h
QGCFormat.h
QGCLoggingCategory.h
QGC_LOGGING_CATEGORY
#define QGC_LOGGING_CATEGORY(name, categoryStr)
Definition
QGCLoggingCategory.h:7
QGCOnboardLogEntry
Definition
OnboardLogEntry.h:49
QGCOnboardLogEntry::QGCOnboardLogEntry
QGCOnboardLogEntry(uint logId, const QDateTime &dateTime=QDateTime(), uint logSize=0, bool received=false, QObject *parent=nullptr)
Definition
OnboardLogEntry.cc:49
QGCOnboardLogEntry::size
uint size() const
Definition
OnboardLogEntry.h:66
QGCOnboardLogEntry::~QGCOnboardLogEntry
~QGCOnboardLogEntry()
Definition
OnboardLogEntry.cc:59
QGCOnboardLogEntry::sizeStr
QString sizeStr() const
Definition
OnboardLogEntry.cc:64
QGC::bigSizeToString
QString bigSizeToString(quint64 size)
Byte size with unit: B, KB, MB, GB, TB. 1 fractional digit above 1 KB.
Definition
QGCFormat.cc:20
OnboardLogDownloadData
Definition
OnboardLogEntry.h:14
OnboardLogDownloadData::advanceChunk
void advanceChunk()
Definition
OnboardLogEntry.cc:24
OnboardLogDownloadData::kChunkSize
static const uint32_t kChunkSize
Definition
OnboardLogEntry.h:43
OnboardLogDownloadData::kTableBins
static constexpr uint32_t kTableBins
Definition
OnboardLogEntry.h:42
OnboardLogDownloadData::entry
QGCOnboardLogEntry *const entry
Definition
OnboardLogEntry.h:30
OnboardLogDownloadData::numChunks
uint32_t numChunks() const
The number of kChunkSize chunks in the file.
Definition
OnboardLogEntry.cc:36
OnboardLogDownloadData::ID
uint ID
Definition
OnboardLogEntry.h:29
OnboardLogDownloadData::chunkEquals
bool chunkEquals(const bool val) const
True if all bins in the chunk have been set to val.
Definition
OnboardLogEntry.cc:42
OnboardLogDownloadData::chunk_table
QBitArray chunk_table
Definition
OnboardLogEntry.h:32
OnboardLogDownloadData::~OnboardLogDownloadData
~OnboardLogDownloadData()
Definition
OnboardLogEntry.cc:19
OnboardLogDownloadData::current_chunk
uint32_t current_chunk
Definition
OnboardLogEntry.h:33
OnboardLogDownloadData::chunkBins
uint32_t chunkBins() const
The number of MAVLINK_MSG_LOG_DATA_FIELD_DATA_LEN bins in the current chunk.
Definition
OnboardLogEntry.cc:30
src
AnalyzeView
OnboardLogs
OnboardLogEntry.cc
Generated by
1.9.8