]> sigrok.org Git - pulseview.git/commitdiff
Added LogicSignal::get_data
authorJoel Holdsworth <redacted>
Sun, 16 Feb 2014 10:55:27 +0000 (10:55 +0000)
committerJoel Holdsworth <redacted>
Sat, 1 Mar 2014 18:19:01 +0000 (18:19 +0000)
pv/data/decode/decoder.cpp
pv/data/decode/decoder.h

index 8cde226da847327395bcb306e2cc28c4b0d6b0b0..89d19b3ad7c3ec80dd3c6d2c4f7c73d0f2d5038d 100644 (file)
@@ -26,6 +26,7 @@
 #include <pv/view/logicsignal.h>
 
 using boost::shared_ptr;
+using std::set;
 using std::map;
 using std::string;
 
@@ -97,6 +98,21 @@ bool Decoder::have_required_probes() const
        return true;
 }
 
+set< shared_ptr<pv::data::Logic> > Decoder::get_data()
+{
+       set< shared_ptr<pv::data::Logic> > data;
+       for(map<const srd_probe*, shared_ptr<view::LogicSignal> >::
+               const_iterator i = _probes.begin();
+               i != _probes.end(); i++)
+       {
+               shared_ptr<view::LogicSignal> signal((*i).second);
+               assert(signal);
+               data.insert(signal->logic_data());
+       }
+
+       return data;
+}
+
 srd_decoder_inst* Decoder::create_decoder_inst(srd_session *session, int unit_size) const
 {
        GHashTable *const opt_hash = g_hash_table_new_full(g_str_hash,
index d8ed469203cf804ac1c2eabc215b80a1d024c993..0c3662cb5f75604aa0bf7cbd89ad94c4a3a67344 100644 (file)
@@ -22,6 +22,7 @@
 #define PULSEVIEW_PV_DATA_DECODE_DECODER_H
 
 #include <map>
+#include <set>
 
 #include <boost/shared_ptr.hpp>
 
@@ -39,6 +40,9 @@ class LogicSignal;
 }
 
 namespace data {
+
+class Logic;
+
 namespace decode {
 
 class Decoder
@@ -67,6 +71,8 @@ public:
        srd_decoder_inst* create_decoder_inst(
                srd_session *session, int unit_size) const;
 
+       std::set< boost::shared_ptr<pv::data::Logic> > get_data();      
+
 private:
        const srd_decoder *const _decoder;