From 18ab0fef9b73a6a89d2d318ddef5410568025a68 Mon Sep 17 00:00:00 2001 From: dogmaphobic Date: Sun, 24 Jul 2016 18:12:06 -0400 Subject: [PATCH] Log Download Fixes --- src/ViewWidgets/LogDownloadController.cc | 24 ++++++++++++++++-------- src/ViewWidgets/LogDownloadController.h | 3 ++- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/ViewWidgets/LogDownloadController.cc b/src/ViewWidgets/LogDownloadController.cc index dd2adb475..21018a221 100644 --- a/src/ViewWidgets/LogDownloadController.cc +++ b/src/ViewWidgets/LogDownloadController.cc @@ -26,7 +26,7 @@ #define kTimeOutMilliseconds 500 #define kGUIRateMilliseconds 17 -#define kTableBins 128 +#define kTableBins 512 #define kChunkSize (kTableBins * MAVLINK_MSG_LOG_DATA_FIELD_DATA_LEN) QGC_LOGGING_CATEGORY(LogDownloadLog, "LogDownloadLog") @@ -234,8 +234,7 @@ void LogDownloadController::_receivedAllEntries() { _timer.stop(); - _requestingLogEntries = false; - emit requestingListChanged(); + _setListing(false); } //---------------------------------------------------------------------------------------- @@ -458,7 +457,8 @@ void LogDownloadController::refresh(void) { _logEntriesModel.clear(); - _requestLogList(); + //-- Get first 50 entries + _requestLogList(0, 49); } //---------------------------------------------------------------------------------------- @@ -467,8 +467,7 @@ LogDownloadController::_requestLogList(uint32_t start, uint32_t end) { if(_vehicle && _uas) { qCDebug(LogDownloadLog) << "Request log entry list (" << start << "through" << end << ")"; - _requestingLogEntries = true; - emit requestingListChanged(); + _setListing(true); mavlink_message_t msg; mavlink_msg_log_request_list_pack( qgcApp()->toolbox()->mavlinkProtocol()->getSystemId(), @@ -479,8 +478,8 @@ LogDownloadController::_requestLogList(uint32_t start, uint32_t end) start, end); _vehicle->sendMessageOnLink(_vehicle->priorityLink(), msg); - //-- Wait 2 seconds before bitching about not getting anything - _timer.start(2000); + //-- Wait 5 seconds before bitching about not getting anything + _timer.start(5000); } } @@ -610,6 +609,15 @@ LogDownloadController::_setDownloading(bool active) emit downloadingLogsChanged(); } +//---------------------------------------------------------------------------------------- +void +LogDownloadController::_setListing(bool active) +{ + _requestingLogEntries = active; + _vehicle->setConnectionLostEnabled(!active); + emit requestingListChanged(); +} + //---------------------------------------------------------------------------------------- void LogDownloadController::eraseAll(void) diff --git a/src/ViewWidgets/LogDownloadController.h b/src/ViewWidgets/LogDownloadController.h index 9a0abc853..5956a9923 100644 --- a/src/ViewWidgets/LogDownloadController.h +++ b/src/ViewWidgets/LogDownloadController.h @@ -152,10 +152,11 @@ private: void _receivedAllData (); void _resetSelection (bool canceled = false); void _findMissingData (); - void _requestLogList (uint32_t start = 0, uint32_t end = 0xFFFF); + void _requestLogList (uint32_t start, uint32_t end); void _requestLogData (uint8_t id, uint32_t offset = 0, uint32_t count = 0xFFFFFFFF); bool _prepareLogDownload(); void _setDownloading (bool active); + void _setListing (bool active); QGCLogEntry* _getNextSelected(); -- 2.22.0