From 6f65cdf41e353426fa5b86c4add2151463e20ff5 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Tue, 19 Jul 2016 10:48:45 -0700 Subject: [PATCH] Add frequency step control to capture app. Redistribute other controls, remove empty row that had been reserved for options views. --- firmware/application/capture_app.cpp | 7 +++++++ firmware/application/capture_app.hpp | 24 ++++++++++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/firmware/application/capture_app.cpp b/firmware/application/capture_app.cpp index 9d1761a2d..1ccc9aa91 100644 --- a/firmware/application/capture_app.cpp +++ b/firmware/application/capture_app.cpp @@ -38,6 +38,7 @@ CaptureAppView::CaptureAppView(NavigationView& nav) { &rssi, &channel, &field_frequency, + &field_frequency_step, &field_rf_amp, &field_lna, &field_vga, @@ -59,6 +60,12 @@ CaptureAppView::CaptureAppView(NavigationView& nav) { }; }; + field_frequency_step.set_by_value(receiver_model.frequency_step()); + field_frequency_step.on_change = [this](size_t, OptionsField::value_t v) { + receiver_model.set_frequency_step(v); + this->field_frequency.set_step(v); + }; + radio::enable({ tuning_frequency(), sampling_rate, diff --git a/firmware/application/capture_app.hpp b/firmware/application/capture_app.hpp index e6a4b90e8..a7d048593 100644 --- a/firmware/application/capture_app.hpp +++ b/firmware/application/capture_app.hpp @@ -47,7 +47,7 @@ public: std::string title() const override { return "Capture"; }; private: - static constexpr ui::Dim header_height = 3 * 16; + static constexpr ui::Dim header_height = 2 * 16; static constexpr uint32_t sampling_rate = 4000000; static constexpr uint32_t baseband_bandwidth = 2500000; @@ -60,31 +60,35 @@ private: rf::Frequency tuning_frequency() const; RSSI rssi { - { 21 * 8, 0, 6 * 8, 4 }, + { 24 * 8, 0, 6 * 8, 4 }, }; Channel channel { - { 21 * 8, 5, 6 * 8, 4 }, + { 24 * 8, 5, 6 * 8, 4 }, }; FrequencyField field_frequency { - { 3 * 8, 0 * 16 }, + { 0 * 8, 0 * 16 }, + }; + + FrequencyStepView field_frequency_step { + { 10 * 8, 0 * 16 }, }; RFAmpField field_rf_amp { - { 13 * 8, 0 * 16 } + { 16 * 8, 0 * 16 } }; LNAGainField field_lna { - { 15 * 8, 0 * 16 } - }; - - VGAGainField field_vga { { 18 * 8, 0 * 16 } }; + VGAGainField field_vga { + { 21 * 8, 0 * 16 } + }; + RecordView record_view { - { 0 * 8, 2 * 16, 30 * 8, 1 * 16 }, + { 0 * 8, 1 * 16, 30 * 8, 1 * 16 }, "BBD_????", RecordView::FileType::RawS16, 16384, 3 };