Skip to content

Commit

Permalink
Merge pull request #5836 from DonLakeFlyer/LogDownload
Browse files Browse the repository at this point in the history
Log Download: Bring fixes from master to Stable
  • Loading branch information
DonLakeFlyer authored Nov 10, 2017
2 parents 1ae6821 + 1fcbb0e commit 0c1d088
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/AnalyzeView/LogDownloadController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ LogDownloadController::_logEntry(UASInterface* uas, uint32_t time_utc, uint32_t
//-- Update this log record
if(num_logs > 0) {
//-- Skip if empty (APM first packet)
if(size) {
if(size || _vehicle->firmwareType() != MAV_AUTOPILOT_ARDUPILOTMEGA) {
id -= _apmOneBased;
if(id < _logEntriesModel.count()) {
QGCLogEntry* entry = _logEntriesModel[id];
Expand Down Expand Up @@ -407,6 +407,7 @@ LogDownloadController::_receivedAllData()
if(_prepareLogDownload()) {
//-- Request Log
_requestLogData(_downloadData->ID, 0, _downloadData->chunk_table.size()*MAVLINK_MSG_LOG_DATA_FIELD_DATA_LEN);
_timer.start(kTimeOutMilliseconds);
} else {
_resetSelection();
_setDownloading(false);
Expand Down Expand Up @@ -453,7 +454,7 @@ LogDownloadController::_findMissingData()

//----------------------------------------------------------------------------------------
void
LogDownloadController::_requestLogData(uint8_t id, uint32_t offset, uint32_t count)
LogDownloadController::_requestLogData(uint16_t id, uint32_t offset, uint32_t count)
{
if(_vehicle) {
//-- APM "Fix"
Expand Down Expand Up @@ -589,14 +590,14 @@ LogDownloadController::_prepareLogDownload()
bool result = false;
QString ftime;
if(entry->time().date().year() < 2010) {
ftime = "UnknownDate";
ftime = tr("UnknownDate");
} else {
ftime = entry->time().toString("yyyy-M-d-hh-mm-ss");
ftime = entry->time().toString(QStringLiteral("yyyy-M-d-hh-mm-ss"));
}
_downloadData = new LogDownloadData(entry);
_downloadData->filename = QString("log_") + QString::number(entry->id()) + "_" + ftime;
if (_vehicle->firmwareType() == MAV_AUTOPILOT_PX4) {
QString loggerParam("SYS_LOGGER");
QString loggerParam = QStringLiteral("SYS_LOGGER");
if (_vehicle->parameterManager()->parameterExists(FactSystem::defaultComponentId, loggerParam) &&
_vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, loggerParam)->rawValue().toInt() == 0) {
_downloadData->filename += ".px4log";
Expand Down
2 changes: 1 addition & 1 deletion src/AnalyzeView/LogDownloadController.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private slots:
void _resetSelection (bool canceled = false);
void _findMissingData ();
void _requestLogList (uint32_t start, uint32_t end);
void _requestLogData (uint8_t id, uint32_t offset = 0, uint32_t count = 0xFFFFFFFF);
void _requestLogData (uint16_t id, uint32_t offset = 0, uint32_t count = 0xFFFFFFFF);
bool _prepareLogDownload();
void _setDownloading (bool active);
void _setListing (bool active);
Expand Down

0 comments on commit 0c1d088

Please sign in to comment.