22 Q_MOC_INCLUDE(
"Vehicle.h")
23 Q_MOC_INCLUDE(
"QmlObjectListModel.h")
31 friend class LogDownloadTest;
38 Q_INVOKABLE
void download(
const QString &path = QString());
63 void _setActiveVehicle(
Vehicle *vehicle);
64 void _logEntry(uint32_t time_utc, uint32_t size, uint16_t
id, uint16_t num_logs, uint16_t last_log_num);
65 void _logData(uint32_t ofs, uint16_t
id, uint8_t count,
const uint8_t *data);
66 void _processDownload();
67 void _handleCompressionProgress(qreal progress);
68 void _handleCompressionFinished(
bool success);
72 bool _getRequestingList()
const {
return _requestingLogEntries; }
73 bool _getDownloadingLogs()
const {
return _downloadingLogs; }
75 bool _chunkComplete()
const;
76 bool _entriesComplete()
const;
77 bool _logComplete()
const;
78 bool _prepareLogDownload();
79 void _downloadToDirectory(
const QString &dir);
80 void _findMissingData();
81 void _findMissingEntries();
82 void _receivedAllData();
83 void _receivedAllEntries();
84 void _requestLogData(uint16_t
id, uint32_t offset, uint32_t count,
int retryCount = 0);
85 void _requestLogList(uint32_t start, uint32_t end);
86 void _requestLogEnd();
87 void _resetSelection(
bool canceled =
false);
88 void _setDownloading(
bool active);
89 void _setListing(
bool active);
90 void _updateDataRate();
94 QTimer *_timer =
nullptr;
97 bool _downloadingLogs =
false;
98 bool _requestingLogEntries =
false;
101 std::unique_ptr<LogDownloadData> _downloadData;
102 QString _downloadPath;
104 bool _compressLogs =
false;
105 bool _compressing =
false;
106 float _compressionProgress = 0.0F;
108 static constexpr uint32_t kTimeOutMs = 500;
109 static constexpr uint32_t kGUIRateMs = 500;
110 static constexpr uint32_t kRequestLogListTimeoutMs = 5000;