From: Joel Holdsworth Date: Sun, 16 Feb 2014 10:55:27 +0000 (+0000) Subject: Added LogicSignal::get_data X-Git-Tag: pulseview-0.2.0~43 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ddee4cf8c09fa27c329084b8706a984995648056;p=pulseview.git Added LogicSignal::get_data --- diff --git a/pv/data/decode/decoder.cpp b/pv/data/decode/decoder.cpp index 8cde226d..89d19b3a 100644 --- a/pv/data/decode/decoder.cpp +++ b/pv/data/decode/decoder.cpp @@ -26,6 +26,7 @@ #include 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 > Decoder::get_data() +{ + set< shared_ptr > data; + for(map >:: + const_iterator i = _probes.begin(); + i != _probes.end(); i++) + { + shared_ptr 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, diff --git a/pv/data/decode/decoder.h b/pv/data/decode/decoder.h index d8ed4692..0c3662cb 100644 --- a/pv/data/decode/decoder.h +++ b/pv/data/decode/decoder.h @@ -22,6 +22,7 @@ #define PULSEVIEW_PV_DATA_DECODE_DECODER_H #include +#include #include @@ -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 > get_data(); + private: const srd_decoder *const _decoder;