X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Ftoolbars%2Fsamplingbar.h;h=b2e7def25f7c4d1a2f112b4c3838f24bae7e7328;hp=41630bcab92703d7a7ff44a1ae02c47192c912db;hb=6ac6242b25cfbd4df14abe7580adc9d0f4cffe43;hpb=d99dc9f29066fba8948f1fca8b18a54b33064837 diff --git a/pv/toolbars/samplingbar.h b/pv/toolbars/samplingbar.h index 41630bca..b2e7def2 100644 --- a/pv/toolbars/samplingbar.h +++ b/pv/toolbars/samplingbar.h @@ -24,6 +24,8 @@ #include #include +#include +#include #include #include @@ -34,13 +36,16 @@ #include #include -struct st_dev_inst; class QAction; namespace pv { class SigSession; +namespace device { +class DevInst; +} + namespace toolbars { class SamplingBar : public QToolBar @@ -48,50 +53,64 @@ class SamplingBar : public QToolBar Q_OBJECT private: - static const uint64_t DefaultRecordLength; + static const uint64_t MinSampleCount; + static const uint64_t MaxSampleCount; + static const uint64_t DefaultSampleCount; public: SamplingBar(SigSession &session, QWidget *parent); - void set_device_list(const std::list &devices); + void set_device_list( + const std::list< std::shared_ptr > + &devices, + std::shared_ptr selected); - struct sr_dev_inst* get_selected_device() const; - void set_selected_device(struct sr_dev_inst *const sdi); + std::shared_ptr get_selected_device() const; void set_capture_state(pv::SigSession::capture_state state); -signals: +Q_SIGNALS: void run_stop(); private: void update_sample_rate_selector(); void update_sample_rate_selector_value(); void update_sample_count_selector(); + void update_device_config_widgets(); void commit_sample_rate(); void commit_sample_count(); -private slots: +private Q_SLOTS: void on_device_selected(); void on_sample_count_changed(); void on_sample_rate_changed(); void on_run_stop(); + void on_config_changed(); + +protected: + bool eventFilter(QObject *watched, QEvent *event); + private: SigSession &_session; QComboBox _device_selector; + std::map > + _device_selector_map; bool _updating_device_selector; pv::widgets::PopupToolButton _configure_button; QAction *_configure_button_action; - pv::widgets::PopupToolButton _probes_button; + pv::widgets::PopupToolButton _channels_button; pv::widgets::SweepTimingWidget _sample_count; pv::widgets::SweepTimingWidget _sample_rate; bool _updating_sample_rate; bool _updating_sample_count; + bool _sample_count_supported; + QIcon _icon_red; QIcon _icon_green; QIcon _icon_grey;