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