]> sigrok.org Git - pulseview.git/commitdiff
Check that at least one probe is enabled before acquisition begins
authorJoel Holdsworth <redacted>
Mon, 11 Mar 2013 23:30:34 +0000 (23:30 +0000)
committerJoel Holdsworth <redacted>
Mon, 11 Mar 2013 23:30:34 +0000 (23:30 +0000)
pv/sigsession.cpp

index 8ab7dab845708a1cc1c818e549096a1807b647b3..a611e7ac7c14159eed9d8e4c569e2a8b79bb9880 100644 (file)
@@ -77,6 +77,21 @@ void SigSession::start_capture(struct sr_dev_inst *sdi,
 {
        stop_capture();
 
+       // Check that at least one probe is enabled
+       const GSList *l;
+       for (l = sdi->probes; l; l = l->next) {
+               sr_probe *const probe = (sr_probe*)l->data;
+               assert(probe);
+               if (probe->enabled)
+                       break;
+       }
+
+       if (!l) {
+               error_handler(tr("No probes enabled."));
+               return;
+       }
+
+       // Begin the session
        _sampling_thread.reset(new boost::thread(
                &SigSession::sample_thread_proc, this, sdi,
                record_length, error_handler));