X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Ftoolbars%2Fsamplingbar.h;h=2397e2aa5c20b6821b4e2159f20bd9598a5346fd;hb=8dbbc7f0b9ea59d0f0d62225772f8a56eee125f5;hp=41630bcab92703d7a7ff44a1ae02c47192c912db;hpb=d99dc9f29066fba8948f1fca8b18a54b33064837;p=pulseview.git diff --git a/pv/toolbars/samplingbar.h b/pv/toolbars/samplingbar.h index 41630bc..2397e2a 100644 --- a/pv/toolbars/samplingbar.h +++ b/pv/toolbars/samplingbar.h @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -34,7 +35,12 @@ #include #include -struct st_dev_inst; +namespace sigrok { + class Device; +} + +Q_DECLARE_METATYPE(std::shared_ptr) + class QAction; namespace pv { @@ -48,54 +54,65 @@ 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::pair, std::string> > &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; + SigSession &session_; + + QComboBox device_selector_; + bool updating_device_selector_; - QComboBox _device_selector; - bool _updating_device_selector; + pv::widgets::PopupToolButton configure_button_; + QAction *configure_button_action_; - pv::widgets::PopupToolButton _configure_button; - QAction *_configure_button_action; + pv::widgets::PopupToolButton channels_button_; - pv::widgets::PopupToolButton _probes_button; + pv::widgets::SweepTimingWidget sample_count_; + pv::widgets::SweepTimingWidget sample_rate_; + bool updating_sample_rate_; + bool updating_sample_count_; - 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; - QToolButton _run_stop_button; + QIcon icon_red_; + QIcon icon_green_; + QIcon icon_grey_; + QToolButton run_stop_button_; }; } // namespace toolbars