const uint64_t SamplingBar::DefaultRecordLength = 1000000;
-SamplingBar::SamplingBar(QWidget *parent) :
+SamplingBar::SamplingBar(SigSession &session, QWidget *parent) :
QToolBar("Sampling Bar", parent),
+ _session(session),
_device_selector(this),
+ _updating_device_selector(false),
_configure_button(this),
_probes_button(this),
_record_length_selector(this),
void SamplingBar::set_device_list(
const std::list<struct sr_dev_inst*> &devices)
{
+ _updating_device_selector = true;
+
_device_selector.clear();
BOOST_FOREACH (sr_dev_inst *sdi, devices) {
qVariantFromValue((void*)sdi));
}
+ _updating_device_selector = false;
+
update_sample_rate_selector();
}
{
using namespace pv::popups;
+ if (_updating_device_selector)
+ return;
+
update_sample_rate_selector();
sr_dev_inst *const sdi = get_selected_device();
+ _session.set_device(sdi);
_configure_button.set_popup(new DeviceOptions(sdi, this));
- _probes_button.set_popup(new Probes(sdi, this));
-
- device_selected();
+ _probes_button.set_popup(new Probes(_session, this));
}
void SamplingBar::on_sample_rate_changed()