mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-05 14:17:20 +08:00
Support for new log file extension. (#5355)
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user