Display percent of data dropped during capture to SD card.

This commit is contained in:
Jared Boone 2016-04-27 12:07:31 -07:00
parent 6ee886b90e
commit be9f3362da
2 changed files with 12 additions and 0 deletions

View File

@ -29,6 +29,8 @@ using namespace portapack;
#include "utility.hpp"
#include "string_format.hpp"
namespace ui {
CaptureAppView::CaptureAppView(NavigationView& nav) {
@ -40,6 +42,7 @@ CaptureAppView::CaptureAppView(NavigationView& nav) {
&field_lna,
&field_vga,
&text_record_filename,
&text_record_dropped,
&waterfall,
} });
@ -114,6 +117,7 @@ void CaptureAppView::on_record() {
} else {
const auto filename = next_filename_matching_pattern("BBD_????.C16");
text_record_filename.set(filename);
text_record_dropped.set("");
if( filename.empty() ) {
return;
}
@ -125,6 +129,9 @@ void CaptureAppView::on_record() {
void CaptureAppView::on_tick_second() {
if( capture_thread ) {
const auto dropped_percent = std::min(99U, capture_thread->state().dropped_percent());
const auto s = to_string_dec_uint(dropped_percent, 2, ' ') + "\%";
text_record_dropped.set(s);
}
}

View File

@ -79,6 +79,11 @@ private:
"",
};
Text text_record_dropped {
{ 16 * 8, 2 * 16, 3 * 8, 16 },
"",
};
RSSI rssi {
{ 21 * 8, 0, 6 * 8, 4 },
};