X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Ftoolbars%2Fsamplingbar.h;h=e59d2f9f0b195da8417c126de2ea6f4ec7f53539;hp=cf425775aeb83bbb01bca1413b8c4eb718bb2c22;hb=e95e8563a1de0d2045cb8f30083889896b6c94df;hpb=8575601295c4853ae73fa404eb157bd063af0c20 diff --git a/pv/toolbars/samplingbar.h b/pv/toolbars/samplingbar.h index cf425775..e59d2f9f 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,17 +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); - - struct sr_dev_inst* get_selected_device() const; - void set_selected_device(struct sr_dev_inst *const sdi); + void set_device_list( + const std::list< boost::shared_ptr > + &devices, + boost::shared_ptr selected); - uint64_t get_record_length() const; + boost::shared_ptr get_selected_device() const; void set_capture_state(pv::SigSession::capture_state state); @@ -69,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(); @@ -78,10 +87,14 @@ private slots: void on_sample_rate_changed(); void on_run_stop(); + void on_config_changed(); + private: SigSession &_session; QComboBox _device_selector; + std::map > + _device_selector_map; bool _updating_device_selector; pv::widgets::PopupToolButton _configure_button; @@ -94,6 +107,8 @@ private: bool _updating_sample_rate; bool _updating_sample_count; + bool _sample_count_supported; + QIcon _icon_red; QIcon _icon_green; QIcon _icon_grey;