]> sigrok.org Git - pulseview.git/commitdiff
SigSession: Added signal_from_probe
authorJoel Holdsworth <redacted>
Sat, 18 Jan 2014 20:55:38 +0000 (20:55 +0000)
committerJoel Holdsworth <redacted>
Sat, 18 Jan 2014 21:34:38 +0000 (21:34 +0000)
pv/sigsession.cpp
pv/sigsession.h

index ecc125039303f36aae1b558722e3910e5b54c8e4..ad0b5d298637b9eeaa58c7157e3654d78a456c5f 100644 (file)
@@ -481,6 +481,18 @@ bool SigSession::is_trigger_enabled() const
        return false;
 }
 
+shared_ptr<view::Signal> SigSession::signal_from_probe(
+       const sr_probe *probe) const
+{
+       lock_guard<mutex> lock(_signals_mutex);
+       BOOST_FOREACH(shared_ptr<view::Signal> sig, _signals) {
+               assert(sig);
+               if (sig->probe() == probe)
+                       return sig;
+       }
+       return shared_ptr<view::Signal>();
+}
+
 void SigSession::read_sample_rate(const sr_dev_inst *const sdi)
 {
        GVariant *gvar;
index 159724fb5b9c040870a4e678271abf945b7b6204..319acf9ae110f33af3be1d85ee43d1b4b05c95f1 100644 (file)
@@ -112,6 +112,9 @@ private:
 
        bool is_trigger_enabled() const;
 
+       boost::shared_ptr<view::Signal> signal_from_probe(
+               const sr_probe *probe) const;
+
        void read_sample_rate(const sr_dev_inst *const sdi);
 
 private: