Add second pocsag proc for experimenting (#1428)

This commit is contained in:
Kyle Reed 2023-08-30 23:05:49 -07:00 committed by GitHub
parent 900086c1c9
commit 5d602ece5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 820 additions and 30 deletions

View file

@ -54,7 +54,8 @@ POCSAGSettingsView::POCSAGSettingsView(
POCSAGSettings& settings)
: settings_{settings} {
add_children(
{&check_log,
{&check_beta,
&check_log,
&check_log_raw,
&check_small_font,
&check_hide_bad,
@ -63,6 +64,7 @@ POCSAGSettingsView::POCSAGSettingsView(
&field_ignore,
&button_save});
check_beta.set_value(settings_.use_new_proc);
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);
@ -72,6 +74,7 @@ POCSAGSettingsView::POCSAGSettingsView(
field_ignore.set_value(settings_.address_to_ignore);
button_save.on_select = [this, &nav](Button&) {
settings_.use_new_proc = check_beta.value();
settings_.enable_logging = check_log.value();
settings_.enable_raw_log = check_log_raw.value();
settings_.enable_small_font = check_small_font.value();
@ -86,7 +89,10 @@ POCSAGSettingsView::POCSAGSettingsView(
POCSAGAppView::POCSAGAppView(NavigationView& nav)
: nav_{nav} {
baseband::run_image(portapack::spi_flash::image_tag_pocsag);
if (settings_.use_new_proc)
baseband::run_image(portapack::spi_flash::image_tag_pocsag2);
else
baseband::run_image(portapack::spi_flash::image_tag_pocsag);
add_children(
{&rssi,

View file

@ -60,6 +60,7 @@ struct POCSAGSettings {
bool hide_bad_data = false;
bool hide_addr_only = false;
uint32_t address_to_ignore = 0;
bool use_new_proc = false;
};
class POCSAGSettingsView : public View {
@ -67,45 +68,46 @@ class POCSAGSettingsView : public View {
POCSAGSettingsView(NavigationView& nav, POCSAGSettings& settings);
std::string title() const override { return "POCSAG Config"; };
void focus() override { button_save.focus(); }
private:
POCSAGSettings& settings_;
Checkbox check_beta{
{0 * 8 + 2, 18 * 16 - 4},
6,
"Beta",
true /*small*/};
Checkbox check_log{
{2 * 8, 2 * 16},
10,
"Enable Log",
false};
"Enable Log"};
Checkbox check_log_raw{
{2 * 8, 4 * 16},
12,
"Log Raw Data",
false};
"Log Raw Data"};
Checkbox check_small_font{
{2 * 8, 6 * 16},
4,
"Use Small Font",
false};
"Use Small Font"};
Checkbox check_hide_bad{
{2 * 8, 8 * 16},
22,
"Hide Bad Data",
false};
"Hide Bad Data"};
Checkbox check_hide_addr_only{
{2 * 8, 10 * 16},
22,
"Hide Addr Only",
false};
"Hide Addr Only"};
Checkbox check_ignore{
{2 * 8, 12 * 16},
22,
"Enable Ignored Address",
false};
"Enable Ignored Address"};
NumberField field_ignore{
{7 * 8, 13 * 16 + 8},
@ -115,7 +117,7 @@ class POCSAGSettingsView : public View {
'0'};
Button button_save{
{12 * 8, 16 * 16, 10 * 8, 2 * 16},
{11 * 8, 16 * 16, 10 * 8, 2 * 16},
"Save"};
};
@ -150,6 +152,7 @@ class POCSAGAppView : public View {
{"address_to_ignore"sv, &settings_.address_to_ignore},
{"hide_bad_data"sv, &settings_.hide_bad_data},
{"hide_addr_only"sv, &settings_.hide_addr_only},
{"use_new_proc"sv, &settings_.use_new_proc},
}};
void refresh_ui();