X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fsamplingbar.h;h=7034962c2a1a5593630815f632db53cd27ca155b;hp=170379e0ce37c4b957f7ad75f239a96cd9abc282;hb=dba73e734310f538bd19d709c95c5cbe7f453c0e;hpb=51e77110d4316fd0106f8306f5e1f0523c5bf7d7 diff --git a/pv/samplingbar.h b/pv/samplingbar.h index 170379e0..7034962c 100644 --- a/pv/samplingbar.h +++ b/pv/samplingbar.h @@ -18,16 +18,19 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef SAMPLINGBAR_H -#define SAMPLINGBAR_H +#ifndef PULSEVIEW_PV_SAMPLINGBAR_H +#define PULSEVIEW_PV_SAMPLINGBAR_H #include +#include + #include #include #include #include +struct st_dev_inst; class QAction; namespace pv { @@ -37,27 +40,37 @@ class SamplingBar : public QToolBar Q_OBJECT private: - static const uint64_t RecordLengths[11]; + static const uint64_t RecordLengths[20]; + static const uint64_t DefaultRecordLength; public: SamplingBar(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); + uint64_t get_record_length() const; - uint64_t get_sample_rate() const; + + void set_sampling(bool sampling); signals: void run_stop(); private: - void update_device_selector(); void update_sample_rate_selector(); + void update_sample_rate_selector_value(); + void commit_sample_rate(); private slots: void on_device_selected(); + void on_sample_rate_changed(); + void configure(); private: QComboBox _device_selector; + QToolButton _configure_button; QComboBox _record_length_selector; @@ -66,9 +79,11 @@ private: QDoubleSpinBox _sample_rate_value; QAction *_sample_rate_value_action; + QIcon _icon_green; + QIcon _icon_grey; QToolButton _run_stop_button; }; } // namespace pv -#endif // SAMPLINGBAR_H +#endif // PULSEVIEW_PV_SAMPLINGBAR_H