From: Martin Ling Date: Tue, 14 Jan 2014 20:00:49 +0000 (+0000) Subject: No longer need to set sample limit on session start. X-Git-Tag: pulseview-0.2.0~128 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d99dc9f29066fba8948f1fca8b18a54b33064837;p=pulseview.git No longer need to set sample limit on session start. --- diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index b6d72fbc..4de010af 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -424,8 +424,8 @@ void MainWindow::run_stop() { 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; diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index 8d22296c..6f66be7c 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -161,8 +161,7 @@ SigSession::capture_state SigSession::get_capture_state() const return _capture_state; } -void SigSession::start_capture(uint64_t record_length, - function error_handler) +void SigSession::start_capture(function error_handler) { stop_capture(); @@ -188,8 +187,7 @@ void SigSession::start_capture(uint64_t record_length, // 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() @@ -557,7 +555,6 @@ void SigSession::load_input_thread_proc(const string name, } void SigSession::sample_thread_proc(struct sr_dev_inst *sdi, - uint64_t record_length, function error_handler) { assert(sdi); @@ -572,15 +569,6 @@ void SigSession::sample_thread_proc(struct sr_dev_inst *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; diff --git a/pv/sigsession.h b/pv/sigsession.h index cda49b5c..3848a3d4 100644 --- a/pv/sigsession.h +++ b/pv/sigsession.h @@ -86,8 +86,7 @@ public: capture_state get_capture_state() const; - void start_capture(uint64_t record_length, - boost::function error_handler); + void start_capture(boost::function error_handler); void stop_capture(); @@ -140,7 +139,6 @@ private: boost::function error_handler); void sample_thread_proc(struct sr_dev_inst *sdi, - uint64_t record_length, boost::function error_handler); void feed_in_header(const sr_dev_inst *sdi); diff --git a/pv/toolbars/samplingbar.cpp b/pv/toolbars/samplingbar.cpp index a2ddaae6..914083c3 100644 --- a/pv/toolbars/samplingbar.cpp +++ b/pv/toolbars/samplingbar.cpp @@ -126,11 +126,6 @@ void SamplingBar::set_selected_device(struct sr_dev_inst *const 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}; diff --git a/pv/toolbars/samplingbar.h b/pv/toolbars/samplingbar.h index cf425775..41630bca 100644 --- a/pv/toolbars/samplingbar.h +++ b/pv/toolbars/samplingbar.h @@ -58,8 +58,6 @@ public: 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: