#include <stdint.h>
#include <list>
-#include <map>
-
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <QComboBox>
#include <QDoubleSpinBox>
#include <pv/widgets/popuptoolbutton.h>
#include <pv/widgets/sweeptimingwidget.h>
+namespace sigrok {
+ class Device;
+}
+
+Q_DECLARE_METATYPE(std::shared_ptr<sigrok::Device>)
+
class QAction;
namespace pv {
-class DevInst;
class SigSession;
namespace toolbars {
SamplingBar(SigSession &session, QWidget *parent);
void set_device_list(
- const std::list< boost::shared_ptr<pv::DevInst> > &devices);
+ const std::list< std::pair<std::shared_ptr<sigrok::Device>, std::string> > &devices,
+ std::shared_ptr<sigrok::Device> selected);
- boost::shared_ptr<pv::DevInst> get_selected_device() const;
- void set_selected_device(boost::shared_ptr<pv::DevInst> dev_inst);
+ std::shared_ptr<sigrok::Device> 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;
- std::map<const sr_dev_inst*, boost::weak_ptr<DevInst> >
- _device_selector_map;
- 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 _probes_button;
+ pv::widgets::PopupToolButton channels_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;
+ 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