X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Ftoolbars%2Fsamplingbar.h;h=e59d2f9f0b195da8417c126de2ea6f4ec7f53539;hp=d24534bef185867883ec9657b5360011b1bafebb;hb=e95e8563a1de0d2045cb8f30083889896b6c94df;hpb=5ac961e325a9d2cbafdd8fae3a6704d7348cf19a diff --git a/pv/toolbars/samplingbar.h b/pv/toolbars/samplingbar.h index d24534be..e59d2f9f 100644 --- a/pv/toolbars/samplingbar.h +++ b/pv/toolbars/samplingbar.h @@ -24,16 +24,29 @@ #include #include +#include + +#include #include #include #include #include -struct st_dev_inst; +#include +#include +#include + class QAction; namespace pv { + +class SigSession; + +namespace device { +class DevInst; +} + namespace toolbars { class SamplingBar : public QToolBar @@ -41,48 +54,62 @@ class SamplingBar : public QToolBar Q_OBJECT private: - static const uint64_t RecordLengths[20]; - static const uint64_t DefaultRecordLength; + static const uint64_t MinSampleCount; + static const uint64_t MaxSampleCount; + static const uint64_t DefaultSampleCount; public: - SamplingBar(QWidget *parent); - - void set_device_list(const std::list &devices); + SamplingBar(SigSession &session, QWidget *parent); - 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_sampling(bool sampling); + void set_capture_state(pv::SigSession::capture_state state); signals: - void device_selected(); - 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: void on_device_selected(); + void on_sample_count_changed(); void on_sample_rate_changed(); - void on_configure(); void on_run_stop(); + void on_config_changed(); + private: + SigSession &_session; + QComboBox _device_selector; - QToolButton _configure_button; + std::map > + _device_selector_map; + bool _updating_device_selector; + + pv::widgets::PopupToolButton _configure_button; + QAction *_configure_button_action; + + pv::widgets::PopupToolButton _probes_button; - QComboBox _record_length_selector; + pv::widgets::SweepTimingWidget _sample_count; + pv::widgets::SweepTimingWidget _sample_rate; + bool _updating_sample_rate; + bool _updating_sample_count; - QComboBox _sample_rate_list; - QAction *_sample_rate_list_action; - QDoubleSpinBox _sample_rate_value; - QAction *_sample_rate_value_action; + bool _sample_count_supported; + QIcon _icon_red; QIcon _icon_green; QIcon _icon_grey; QToolButton _run_stop_button;