Option to hide address only messages (#1413)

This commit is contained in:
Kyle Reed 2023-08-26 19:32:02 -07:00 committed by GitHub
parent 933920edfd
commit 014db9e233
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 14 deletions

View File

@ -57,7 +57,8 @@ POCSAGSettingsView::POCSAGSettingsView(
{&check_log,
&check_log_raw,
&check_small_font,
&check_show_bad,
&check_hide_bad,
&check_hide_addr_only,
&check_ignore,
&field_ignore,
&button_save});
@ -65,7 +66,8 @@ POCSAGSettingsView::POCSAGSettingsView(
check_log.set_value(settings_.enable_logging);
check_log_raw.set_value(settings_.enable_raw_log);
check_small_font.set_value(settings_.enable_small_font);
check_show_bad.set_value(settings_.hide_bad_data);
check_hide_bad.set_value(settings_.hide_bad_data);
check_hide_addr_only.set_value(settings_.hide_addr_only);
check_ignore.set_value(settings_.enable_ignore);
field_ignore.set_value(settings_.address_to_ignore);
@ -73,7 +75,8 @@ POCSAGSettingsView::POCSAGSettingsView(
settings_.enable_logging = check_log.value();
settings_.enable_raw_log = check_log_raw.value();
settings_.enable_small_font = check_small_font.value();
settings_.hide_bad_data = check_show_bad.value();
settings_.hide_bad_data = check_hide_bad.value();
settings_.hide_addr_only = check_hide_addr_only.value();
settings_.enable_ignore = check_ignore.value();
settings_.address_to_ignore = field_ignore.value();
@ -171,14 +174,16 @@ void POCSAGAppView::handle_decoded(Timestamp timestamp, const std::string& prefi
if (pocsag_state.out_type == ADDRESS) {
last_address = pocsag_state.address;
if (!hide_addr_only()) {
console.write(console_info);
if (logging()) {
logger.log_decoded(
timestamp,
to_string_dec_uint(pocsag_state.address) +
" F" + to_string_dec_uint(pocsag_state.function) +
" Address only");
" F" + to_string_dec_uint(pocsag_state.function));
}
}
} else if (pocsag_state.out_type == MESSAGE) {
@ -197,7 +202,7 @@ void POCSAGAppView::handle_decoded(Timestamp timestamp, const std::string& prefi
timestamp,
to_string_dec_uint(pocsag_state.address) +
" F" + to_string_dec_uint(pocsag_state.function) +
" > " + pocsag_state.output);
" " + pocsag_state.output);
}
}
}

View File

@ -58,6 +58,7 @@ struct POCSAGSettings {
bool enable_raw_log = false;
bool enable_ignore = false;
bool hide_bad_data = false;
bool hide_addr_only = false;
uint32_t address_to_ignore = 0;
};
@ -88,20 +89,26 @@ class POCSAGSettingsView : public View {
"Use Small Font",
false};
Checkbox check_show_bad{
Checkbox check_hide_bad{
{2 * 8, 8 * 16},
22,
"Hide Bad Data",
false};
Checkbox check_ignore{
Checkbox check_hide_addr_only{
{2 * 8, 10 * 16},
22,
"Hide Addr Only",
false};
Checkbox check_ignore{
{2 * 8, 12 * 16},
22,
"Enable Ignored Address",
false};
NumberField field_ignore{
{7 * 8, 11 * 16 + 8},
{7 * 8, 13 * 16 + 8},
7,
{0, 9999999},
1,
@ -126,6 +133,7 @@ class POCSAGAppView : public View {
bool logging_raw() const { return settings_.enable_raw_log; };
bool ignore() const { return settings_.enable_ignore; };
bool hide_bad_data() const { return settings_.hide_bad_data; };
bool hide_addr_only() const { return settings_.hide_addr_only; };
NavigationView& nav_;
RxRadioState radio_state_{
@ -144,6 +152,7 @@ class POCSAGAppView : public View {
{"enable_ignore"sv, &settings_.enable_ignore},
{"address_to_ignore"sv, &settings_.address_to_ignore},
{"hide_bad_data"sv, &settings_.hide_bad_data},
{"hide_addr_only"sv, &settings_.hide_addr_only},
}};
void refresh_ui();