]> sigrok.org Git - pulseview.git/commitdiff
No longer need to set sample limit on session start.
authorMartin Ling <redacted>
Tue, 14 Jan 2014 20:00:49 +0000 (20:00 +0000)
committerJoel Holdsworth <redacted>
Sat, 18 Jan 2014 22:56:12 +0000 (22:56 +0000)
pv/mainwindow.cpp
pv/sigsession.cpp
pv/sigsession.h
pv/toolbars/samplingbar.cpp
pv/toolbars/samplingbar.h

index b6d72fbcb57fa6ad4baad61cbdcfe55ce5f37987..4de010af7a97282a37eeba8c18d177e7317ad838 100644 (file)
@@ -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;
 
index 8d22296c40e89e57da2ad24ec12aec88112c7be9..6f66be7c586be3958b6b08290829264e401997c3 100644 (file)
@@ -161,8 +161,7 @@ SigSession::capture_state SigSession::get_capture_state() const
        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();
 
@@ -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<void (const QString)> 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;
index cda49b5ca5c3ada9a3b4853c61909a6aa66d35a6..3848a3d4d6267a35093471cd7495a32c75595821 100644 (file)
@@ -86,8 +86,7 @@ public:
 
        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();
 
@@ -140,7 +139,6 @@ private:
                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);
index a2ddaae6bb46a4bde8284b92438ee87716b2052d..914083c3c0a50ea1968caffa21cd8ee23e9ad248 100644 (file)
@@ -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};
index cf425775aeb83bbb01bca1413b8c4eb718bb2c22..41630bcab92703d7a7ff44a1ae02c47192c912db 100644 (file)
@@ -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: