X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Ftoolbars%2Fsamplingbar.h;h=e2e24b788145bb3ca227b8931e6b13af934a7761;hp=41630bcab92703d7a7ff44a1ae02c47192c912db;hb=40065ab65c4f347ac5c3731fcea628ab26b49c1e;hpb=d99dc9f29066fba8948f1fca8b18a54b33064837 diff --git a/pv/toolbars/samplingbar.h b/pv/toolbars/samplingbar.h index 41630bca..e2e24b78 100644 --- a/pv/toolbars/samplingbar.h +++ b/pv/toolbars/samplingbar.h @@ -24,6 +24,9 @@ #include #include +#include + +#include #include #include @@ -34,13 +37,16 @@ #include #include -struct st_dev_inst; class QAction; namespace pv { class SigSession; +namespace device { +class DevInst; +} + namespace toolbars { class SamplingBar : public QToolBar @@ -48,15 +54,19 @@ 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< boost::shared_ptr > + &devices, + boost::shared_ptr selected); - struct sr_dev_inst* get_selected_device() const; - void set_selected_device(struct sr_dev_inst *const sdi); + boost::shared_ptr get_selected_device() const; void set_capture_state(pv::SigSession::capture_state state); @@ -67,6 +77,7 @@ 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(); @@ -76,10 +87,17 @@ private slots: 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; @@ -92,6 +110,8 @@ private: bool _updating_sample_rate; bool _updating_sample_count; + bool _sample_count_supported; + QIcon _icon_red; QIcon _icon_green; QIcon _icon_grey;