Added back scanning in BHT TX

Added file creation date display in File Manager
This commit is contained in:
furrtek 2018-01-09 21:12:19 +00:00
parent aebd1757da
commit 441a266dc4
17 changed files with 231 additions and 363 deletions

View file

@ -165,27 +165,35 @@ std::string to_string_datetime(const rtc::RTC& value, const TimeFormat format) {
std::string string { "" };
if (format == YMDHMS) {
string += to_string_dec_uint(value.year(), 4, '0') + "/" +
to_string_dec_uint(value.month(), 2, '0') + "/" +
to_string_dec_uint(value.day(), 2, '0') + " ";
string += to_string_dec_uint(value.year(), 4) + "/" +
to_string_dec_uint(value.month(), 2) + "/" +
to_string_dec_uint(value.day(), 2) + " ";
}
string += to_string_dec_uint(value.hour(), 2, '0') + ":" +
string += to_string_dec_uint(value.minute(), 2, '0');
string += to_string_dec_uint(value.hour(), 2) + ":" +
string += to_string_dec_uint(value.minute(), 2);
if ((format == YMDHMS) || (format == HMS))
string += ":" + to_string_dec_uint(value.second(), 2, '0');
string += ":" + to_string_dec_uint(value.second(), 2);
return string;
}
std::string to_string_timestamp(const rtc::RTC& value) {
return to_string_dec_uint(value.year(), 4, '0') +
to_string_dec_uint(value.month(), 2, '0') +
to_string_dec_uint(value.day(), 2, '0') +
to_string_dec_uint(value.hour(), 2, '0') +
to_string_dec_uint(value.minute(), 2, '0') +
to_string_dec_uint(value.second(), 2, '0');
return to_string_dec_uint(value.year(), 4) +
to_string_dec_uint(value.month(), 2) +
to_string_dec_uint(value.day(), 2) +
to_string_dec_uint(value.hour(), 2) +
to_string_dec_uint(value.minute(), 2) +
to_string_dec_uint(value.second(), 2);
}
std::string to_string_FAT_timestamp(const FATTimestamp& timestamp) {
return to_string_dec_uint((timestamp.FAT_date >> 9) + 1980) + "/" +
to_string_dec_uint((timestamp.FAT_date >> 5) & 0xF, 2) + "/" +
to_string_dec_uint((timestamp.FAT_date & 0x1F), 2) + " " +
to_string_dec_uint((timestamp.FAT_time >> 11), 2) + ":" +
to_string_dec_uint((timestamp.FAT_time >> 5) & 0x3F, 2);
}
std::string unit_auto_scale(double n, const uint32_t base_nano, uint32_t precision) {
@ -208,7 +216,7 @@ std::string unit_auto_scale(double n, const uint32_t base_nano, uint32_t precisi
string = to_string_dec_int(integer_part);
if (precision)
string += '.' + to_string_dec_uint(fractional_part, precision, '0');
string += '.' + to_string_dec_uint(fractional_part, precision);
if (prefix_index != 3)
string += unit_prefix[prefix_index];