Support for new log file extension. (#5355)

This commit is contained in:
Gus Grubba
2016-08-19 16:16:46 -04:00
committed by Lorenz Meier
parent 306a911dc9
commit 821d7062df
+4 -2
View File
@@ -456,7 +456,7 @@ LogListHelper::_init()
} }
if (entry.d_type == PX4LOG_DIRECTORY) if (entry.d_type == PX4LOG_DIRECTORY)
{ {
time_t tt; time_t tt = 0;
char log_path[128]; char log_path[128];
snprintf(log_path, sizeof(log_path), "%s/%s", kLogRoot, entry.d_name); snprintf(log_path, sizeof(log_path), "%s/%s", kLogRoot, entry.d_name);
if (_get_session_date(log_path, entry.d_name, tt)) { if (_get_session_date(log_path, entry.d_name, tt)) {
@@ -533,7 +533,8 @@ LogListHelper::_scan_logs(FILE* f, const char* dir, time_t& date)
bool bool
LogListHelper::_get_log_time_size(const char* path, const char* file, time_t& date, uint32_t& size) LogListHelper::_get_log_time_size(const char* path, const char* file, time_t& date, uint32_t& size)
{ {
if(file && file[0] && strstr(file, ".px4log")) { if(file && file[0]) {
if(strstr(file, ".px4log") || strstr(file, ".ulg")) {
// Convert "log000" to 00:00 (minute per flight in session) // Convert "log000" to 00:00 (minute per flight in session)
if (strncmp(file, "log", 3) == 0) { if (strncmp(file, "log", 3) == 0) {
unsigned u; unsigned u;
@@ -557,6 +558,7 @@ LogListHelper::_get_log_time_size(const char* path, const char* file, time_t& da
*/ */
} }
} }
}
return false; return false;
} }