NEW: add track events for debugging network

Change-Id: I671f91b4af00277236ca71014f8d667109756d00
Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
Stone Li 2023-02-15 11:32:18 +08:00 committed by Lane.Wei
parent bd75af4a43
commit 6827b41eb3
13 changed files with 187 additions and 12 deletions

View file

@ -481,14 +481,12 @@ void PrinterFileSystem::DownloadNextFile()
download->index = FindFile(download->index, download->name);
if (download->index != size_t(-1)) {
int progress = data.size * 100 / data.total;
if (result > CONTINUE)
progress = -2;
auto & file = m_file_list[download->index];
if (result == ERROR_CANCEL)
file.flags &= ~FF_DOWNLOAD;
else if (file.progress != progress) {
file.progress = progress;
SendChangedEvent(EVT_DOWNLOAD, download->index, file.path, data.size);
SendChangedEvent(EVT_DOWNLOAD, download->index, file.path, result);
}
}
if (result != CONTINUE) DownloadNextFile();