Added channel centering cursor in waterfall view

Added more samplerate choices in capture
Updated binary
This commit is contained in:
furrtek 2018-04-18 22:44:41 +01:00
parent d0ce9610b5
commit 5636764226
7 changed files with 114 additions and 13 deletions

View file

@ -41,12 +41,16 @@ public:
void set_spectrum_sampling_rate(const int new_sampling_rate);
void set_channel_filter(const int pass_frequency, const int stop_frequency);
void show_cursor(const bool v);
void set_cursor_position(const int32_t value);
void paint(Painter& painter) override;
private:
static constexpr int filter_band_height = 4;
bool _show_cursor { false };
int32_t cursor_position { 0 };
int spectrum_sampling_rate { 0 };
const int spectrum_bins = std::tuple_size<decltype(ChannelSpectrum::db)>::value;
int channel_filter_pass_frequency { 0 };
@ -74,7 +78,10 @@ private:
class WaterfallWidget : public View {
public:
WaterfallWidget();
std::function<void(int32_t offset)> on_select { };
WaterfallWidget(const bool cursor = false);
~WaterfallWidget();
WaterfallWidget(const WaterfallWidget&) = delete;
WaterfallWidget(WaterfallWidget&&) = delete;
@ -83,15 +90,27 @@ public:
void on_show() override;
void on_hide() override;
void on_focus() override;
void on_blur() override;
bool on_encoder(const EncoderEvent delta) override;
bool on_key(const KeyEvent key) override;
void set_parent_rect(const Rect new_parent_rect) override;
void paint(Painter& painter) override;
private:
void on_tick_second();
WaterfallView waterfall_view { };
FrequencyScale frequency_scale { };
ChannelSpectrumFIFO* fifo { nullptr };
bool _blink { false };
int sampling_rate { 0 };
int32_t cursor_position { 0 };
SignalToken signal_token_tick_second { };
MessageHandlerRegistration message_handler_spectrum_config {
Message::ID::ChannelSpectrumConfig,