19 Q_MOC_INCLUDE(
"Vehicle.h")
20 Q_MOC_INCLUDE(
"QmlObjectListModel.h")
28 friend class OnboardLogDownloadTest;
35 Q_INVOKABLE
void download(
const QString &path = QString());
60 void _setActiveVehicle(
Vehicle *vehicle);
61 void _logEntry(uint32_t time_utc, uint32_t size, uint16_t
id, uint16_t num_logs, uint16_t last_log_num);
62 void _logData(uint32_t ofs, uint16_t
id, uint8_t count,
const uint8_t *data);
63 void _processDownload();
64 void _handleCompressionProgress(qreal progress);
65 void _handleCompressionFinished(
bool success);
69 bool _getRequestingList()
const {
return _requestingLogEntries; }
70 bool _getDownloadingLogs()
const {
return _downloadingLogs; }
72 bool _chunkComplete()
const;
73 bool _entriesComplete()
const;
74 bool _logComplete()
const;
75 bool _prepareLogDownload();
76 void _downloadToDirectory(
const QString &dir);
77 void _findMissingData();
78 void _findMissingEntries();
79 void _receivedAllData();
80 void _receivedAllEntries();
81 void _requestLogData(uint16_t
id, uint32_t offset, uint32_t count,
int retryCount = 0);
82 void _requestLogList(uint32_t start, uint32_t end);
83 void _requestLogEnd();
84 void _resetSelection(
bool canceled =
false);
85 void _setDownloading(
bool active);
86 void _setListing(
bool active);
87 void _updateDataRate();
91 QTimer *_timer =
nullptr;
94 bool _downloadingLogs =
false;
95 bool _requestingLogEntries =
false;
98 std::unique_ptr<OnboardLogDownloadData> _downloadData;
99 QString _downloadPath;
101 bool _compressLogs =
false;
102 bool _compressing =
false;
103 float _compressionProgress = 0.0F;
105 static constexpr uint32_t kTimeOutMs = 500;
106 static constexpr uint32_t kGUIRateMs = 500;
107 static constexpr uint32_t kRequestLogListTimeoutMs = 5000;