X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fsigsession.cpp;h=a611e7ac7c14159eed9d8e4c569e2a8b79bb9880;hp=8ab7dab845708a1cc1c818e549096a1807b647b3;hb=9c48fa57f507c1eb153b0fb4d3a273c5e32757c8;hpb=ef7e3146c97eda68f38632cc60edf7a42e846610 diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index 8ab7dab8..a611e7ac 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -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));