From: Joel Holdsworth Date: Sat, 18 Jan 2014 20:55:38 +0000 (+0000) Subject: SigSession: Added signal_from_probe X-Git-Tag: pulseview-0.2.0~135 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=3ddcc08324d17537c4878a30a1797b36ed3cc15c;p=pulseview.git SigSession: Added signal_from_probe --- diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index ecc12503..ad0b5d29 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -481,6 +481,18 @@ bool SigSession::is_trigger_enabled() const return false; } +shared_ptr SigSession::signal_from_probe( + const sr_probe *probe) const +{ + lock_guard lock(_signals_mutex); + BOOST_FOREACH(shared_ptr sig, _signals) { + assert(sig); + if (sig->probe() == probe) + return sig; + } + return shared_ptr(); +} + void SigSession::read_sample_rate(const sr_dev_inst *const sdi) { GVariant *gvar; diff --git a/pv/sigsession.h b/pv/sigsession.h index 159724fb..319acf9a 100644 --- a/pv/sigsession.h +++ b/pv/sigsession.h @@ -112,6 +112,9 @@ private: bool is_trigger_enabled() const; + boost::shared_ptr signal_from_probe( + const sr_probe *probe) const; + void read_sample_rate(const sr_dev_inst *const sdi); private: