{
switch(_session.get_capture_state()) {
case SigSession::Stopped:
- _session.start_capture(_sampling_bar->get_record_length(),
- boost::bind(&MainWindow::session_error, this,
+ _session.start_capture(
+ boost::bind(&MainWindow::session_error, this,
QString("Capture failed"), _1));
break;
return _capture_state;
}
-void SigSession::start_capture(uint64_t record_length,
- function<void (const QString)> error_handler)
+void SigSession::start_capture(function<void (const QString)> error_handler)
{
stop_capture();
// Begin the session
_sampling_thread = boost::thread(
- &SigSession::sample_thread_proc, this, _sdi,
- record_length, error_handler);
+ &SigSession::sample_thread_proc, this, _sdi, error_handler);
}
void SigSession::stop_capture()
}
void SigSession::sample_thread_proc(struct sr_dev_inst *sdi,
- uint64_t record_length,
function<void (const QString)> error_handler)
{
assert(sdi);
return;
}
- // Set the sample limit
- if (sr_config_set(sdi, NULL, SR_CONF_LIMIT_SAMPLES,
- g_variant_new_uint64(record_length)) != SR_OK) {
- error_handler(tr("Failed to configure "
- "time-based sample limit."));
- sr_session_destroy();
- return;
- }
-
if (sr_session_start() != SR_OK) {
error_handler(tr("Failed to start session."));
return;
capture_state get_capture_state() const;
- void start_capture(uint64_t record_length,
- boost::function<void (const QString)> error_handler);
+ void start_capture(boost::function<void (const QString)> error_handler);
void stop_capture();
boost::function<void (const QString)> error_handler);
void sample_thread_proc(struct sr_dev_inst *sdi,
- uint64_t record_length,
boost::function<void (const QString)> error_handler);
void feed_in_header(const sr_dev_inst *sdi);
}
}
-uint64_t SamplingBar::get_record_length() const
-{
- return _sample_count.value();
-}
-
void SamplingBar::set_capture_state(pv::SigSession::capture_state state)
{
const QIcon *icons[] = {&_icon_grey, &_icon_red, &_icon_green};
struct sr_dev_inst* get_selected_device() const;
void set_selected_device(struct sr_dev_inst *const sdi);
- uint64_t get_record_length() const;
-
void set_capture_state(pv::SigSession::capture_state state);
signals: