Merge pull request #60 from eried/scanner-update

Scanner features (#55) - Added freq description to scanner display.
This commit is contained in:
Erwin Ried 2020-06-07 16:18:13 +02:00 committed by GitHub
commit 0afc88ea7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -81,6 +81,7 @@ void ScannerView::handle_retune(uint32_t i) {
text_cycle.set( to_string_dec_uint(i) + "/" +
to_string_dec_uint(frequency_list.size()) + " : " +
to_string_dec_uint(frequency_list[i]) );
desc_cycle.set( description_list[i] );
}
void ScannerView::focus() {
@ -109,6 +110,7 @@ ScannerView::ScannerView(
&field_wait,
//&record_view,
&text_cycle,
&desc_cycle,
//&waterfall,
});
@ -119,19 +121,27 @@ ScannerView::ScannerView(
if (entry.type == RANGE) {
for (uint32_t i=entry.frequency_a; i < entry.frequency_b; i+= 1000000) {
frequency_list.push_back(i);
description_list.push_back("RNG " + to_string_dec_uint(entry.frequency_a) + ">" + to_string_dec_uint(entry.frequency_b));
}
} else {
frequency_list.push_back(entry.frequency_a);
description_list.push_back(entry.description);
}
}
} else {
// DEBUG
frequency_list.push_back(466025000);
description_list.push_back("POCSAG-France");
frequency_list.push_back(466050000);
description_list.push_back("POCSAG-France");
frequency_list.push_back(466075000);
description_list.push_back("POCSAG-France");
frequency_list.push_back(466175000);
description_list.push_back("POCSAG-France");
frequency_list.push_back(466206250);
description_list.push_back("POCSAG-France");
frequency_list.push_back(466231250);
description_list.push_back("POCSAG-France");
}
field_bw.set_selected_index(2);

View File

@ -66,6 +66,7 @@ private:
void handle_retune(uint32_t i);
std::vector<rf::Frequency> frequency_list { };
std::vector<string> description_list { };
int32_t trigger { 0 };
int32_t squelch { 0 };
uint32_t timer { 0 };
@ -136,6 +137,10 @@ private:
{ 0, 5 * 16, 240, 16 },
"--/--"
};
Text desc_cycle {
{0, 6 * 16, 240, 16 },
" "
};
std::unique_ptr<ScannerThread> scan_thread { };