diff --git a/firmware/application/ui_receiver.cpp b/firmware/application/ui_receiver.cpp index 479d4468..18a5c613 100644 --- a/firmware/application/ui_receiver.cpp +++ b/firmware/application/ui_receiver.cpp @@ -232,7 +232,7 @@ FrequencyOptionsView::FrequencyOptionsView( { set_style(style); - options_step.on_change = [this](size_t n, OptionsField::value_t v) { + field_step.on_change = [this](size_t n, OptionsField::value_t v) { (void)n; this->on_step_changed(v); }; @@ -243,14 +243,14 @@ FrequencyOptionsView::FrequencyOptionsView( add_children({ { &text_step, - &options_step, + &field_step, &field_ppm, &text_ppm, } }); } void FrequencyOptionsView::set_step(rf::Frequency f) { - options_step.set_by_value(f); + field_step.set_by_value(f); } void FrequencyOptionsView::set_reference_ppm_correction(int32_t v) { diff --git a/firmware/application/ui_receiver.hpp b/firmware/application/ui_receiver.hpp index 12ab961c..1d4cb6d3 100644 --- a/firmware/application/ui_receiver.hpp +++ b/firmware/application/ui_receiver.hpp @@ -229,6 +229,32 @@ private: void update_text(); }; +class FrequencyStepView : public OptionsField { +public: + FrequencyStepView( + Point parent_pos + ) : OptionsField { + parent_pos, + 5, + { + { " 100", 100 }, + { " 1k ", 1000 }, + { " 3k ", 3000 }, /* Approximate SSB bandwidth */ + { " 5k ", 5000 }, + { " 6k3", 6250 }, + { " 9k ", 9000 }, /* channel spacing for LF, MF in some regions */ + { " 10k ", 10000 }, + { " 12k5", 12500 }, + { " 25k ", 25000 }, + { "100k ", 100000 }, + { " 1M ", 1000000 }, + { " 10M ", 10000000 }, + } + } + { + } +}; + class FrequencyOptionsView : public View { public: std::function on_change_step; @@ -245,23 +271,8 @@ private: "Step" }; - OptionsField options_step { + FrequencyStepView field_step { { 5 * 8, 0 * 16 }, - 5, - { - { " 100", 100 }, - { " 1k ", 1000 }, - { " 3k ", 3000 }, /* Approximate SSB bandwidth */ - { " 5k ", 5000 }, - { " 6k3", 6250 }, - { " 9k ", 9000 }, /* channel spacing for LF, MF in some regions */ - { " 10k ", 10000 }, - { " 12k5", 12500 }, - { " 25k ", 25000 }, - { "100k ", 100000 }, - { " 1M ", 1000000 }, - { " 10M ", 10000000 }, - } }; void on_step_changed(rf::Frequency v);