Recon revamp (#1144)

* fixing recon/scanner restarting while on pause and setting a manual start or end
* gui revamping, duplicated options suppressed from config menu
* recon_match_mode set at start
This commit is contained in:
gullradriel 2023-06-11 18:49:28 +02:00 committed by GitHub
parent 843880d22e
commit f65e743c4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 103 additions and 138 deletions

View file

@ -101,44 +101,31 @@ void ReconSetupViewMain::save(std::string& input_file, std::string& output_file)
input_file = _input_file;
output_file = _output_file;
};
void ReconSetupViewMore::save(uint32_t& recon_lock_duration, uint32_t& recon_lock_nb_match, uint32_t& recon_match_mode) {
void ReconSetupViewMore::save() {
persistent_memory::set_recon_load_freqs(checkbox_load_freqs.value());
persistent_memory::set_recon_load_ranges(checkbox_load_ranges.value());
persistent_memory::set_recon_load_hamradios(checkbox_load_hamradios.value());
persistent_memory::set_recon_update_ranges_when_recon(checkbox_update_ranges_when_recon.value());
recon_lock_duration = field_recon_lock_duration.value();
recon_lock_nb_match = field_recon_lock_nb_match.value();
recon_match_mode = field_recon_match_mode.selected_index_value();
};
void ReconSetupViewMain::focus() {
button_load_freqs.focus();
}
ReconSetupViewMore::ReconSetupViewMore(NavigationView& nav, Rect parent_rect, uint32_t recon_lock_duration, uint32_t recon_lock_nb_match, uint32_t recon_match_mode)
: View(parent_rect), _recon_lock_duration{recon_lock_duration}, _recon_lock_nb_match{recon_lock_nb_match}, _recon_match_mode{recon_match_mode} {
ReconSetupViewMore::ReconSetupViewMore(NavigationView& nav, Rect parent_rect)
: View(parent_rect) {
(void)nav;
hidden(true);
add_children({
&checkbox_load_freqs,
&checkbox_load_ranges,
&checkbox_load_hamradios,
&checkbox_update_ranges_when_recon,
&text_recon_lock_duration,
&field_recon_lock_duration,
&text_recon_lock_nb,
&field_recon_lock_nb_match,
&field_recon_match_mode,
});
add_children({&checkbox_load_freqs,
&checkbox_load_ranges,
&checkbox_load_hamradios,
&checkbox_update_ranges_when_recon});
checkbox_load_freqs.set_value(persistent_memory::recon_load_freqs());
checkbox_load_ranges.set_value(persistent_memory::recon_load_ranges());
checkbox_load_hamradios.set_value(persistent_memory::recon_load_hamradios());
checkbox_update_ranges_when_recon.set_value(persistent_memory::recon_update_ranges_when_recon());
field_recon_lock_duration.set_value(_recon_lock_duration);
field_recon_lock_nb_match.set_value(_recon_lock_nb_match);
field_recon_match_mode.set_by_value(_recon_match_mode);
};
void ReconSetupViewMore::focus() {
@ -149,14 +136,8 @@ void ReconSetupView::focus() {
viewMain.focus();
}
ReconSetupView::ReconSetupView(
NavigationView& nav,
std::string _input_file,
std::string _output_file,
uint32_t _recon_lock_duration,
uint32_t _recon_lock_nb_match,
uint32_t _recon_match_mode)
: nav_{nav}, input_file{_input_file}, output_file{_output_file}, recon_lock_duration{_recon_lock_duration}, recon_lock_nb_match{_recon_lock_nb_match}, recon_match_mode{_recon_match_mode} {
ReconSetupView::ReconSetupView(NavigationView& nav, std::string _input_file, std::string _output_file)
: nav_{nav}, input_file{_input_file}, output_file{_output_file} {
add_children({&tab_view,
&viewMain,
&viewMore,
@ -164,13 +145,10 @@ ReconSetupView::ReconSetupView(
button_save.on_select = [this, &nav](Button&) {
viewMain.save(input_file, output_file);
viewMore.save(recon_lock_duration, recon_lock_nb_match, recon_match_mode);
viewMore.save();
std::vector<std::string> messages;
messages.push_back(input_file);
messages.push_back(output_file);
messages.push_back(to_string_dec_uint(recon_lock_duration));
messages.push_back(to_string_dec_uint(recon_lock_nb_match));
messages.push_back(to_string_dec_uint(recon_match_mode));
on_changed(messages);
nav.pop();
};