From bad14db17e377aeeeb16a9243e80b040f137c299 Mon Sep 17 00:00:00 2001 From: dogmaphobic Date: Sun, 17 Jan 2016 00:53:10 -0500 Subject: [PATCH] Stop paying attention to heartbeats while downloading logs. --- src/ViewWidgets/LogDownloadController.cc | 18 ++++++++++++------ src/ViewWidgets/LogDownloadController.h | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/ViewWidgets/LogDownloadController.cc b/src/ViewWidgets/LogDownloadController.cc index 1affbea7f..b570d7722 100644 --- a/src/ViewWidgets/LogDownloadController.cc +++ b/src/ViewWidgets/LogDownloadController.cc @@ -326,8 +326,7 @@ LogDownloadController::_receivedAllData() _requestLogData(_downloadData->ID, 0, _downloadData->entry->size()); } else { _resetSelection(); - _downloadingLogs = false; - emit downloadingLogsChanged(); + _setDownloading(false); } } @@ -456,8 +455,7 @@ LogDownloadController::download(void) } } //-- Start download process - _downloadingLogs = true; - emit downloadingLogsChanged(); + _setDownloading(true); _receivedAllData(); } } @@ -545,6 +543,15 @@ LogDownloadController::_prepareLogDownload() return result; } +//---------------------------------------------------------------------------------------- +void +LogDownloadController::_setDownloading(bool active) +{ + _downloadingLogs = active; + _vehicle->setConnectionLostEnabled(!active); + emit downloadingLogsChanged(); +} + //---------------------------------------------------------------------------------------- void LogDownloadController::eraseAll(void) @@ -577,8 +584,7 @@ LogDownloadController::cancel(void) _downloadData = 0; } _resetSelection(true); - _downloadingLogs = false; - emit downloadingLogsChanged(); + _setDownloading(false); } //----------------------------------------------------------------------------- diff --git a/src/ViewWidgets/LogDownloadController.h b/src/ViewWidgets/LogDownloadController.h index 21010acc1..99c909b52 100644 --- a/src/ViewWidgets/LogDownloadController.h +++ b/src/ViewWidgets/LogDownloadController.h @@ -176,6 +176,7 @@ private: void _requestLogList (uint32_t start = 0, uint32_t end = 0xFFFF); void _requestLogData (uint8_t id, uint32_t offset = 0, uint32_t count = 0xFFFFFFFF); bool _prepareLogDownload(); + void _setDownloading (bool active); QGCLogEntry* _getNextSelected(); -- 2.22.0