X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=pv%2Fdata%2Fdecoderstack.h;h=308dce6edde0ad8b480bf65beba7cc6b6ca7cac9;hb=28b9cc08aa62c02fd64dfb09eff4b9bfdb01f518;hp=dc656f91f7f9b503ff13a850cc35e0328a68a3f5;hpb=a007f5ad25bad88cf62443d5471449ce8a6f5f29;p=pulseview.git diff --git a/pv/data/decoderstack.h b/pv/data/decoderstack.h index dc656f91..308dce6e 100644 --- a/pv/data/decoderstack.h +++ b/pv/data/decoderstack.h @@ -31,9 +31,14 @@ #include #include +#include +#include + struct srd_decoder; +struct srd_decoder_annotation_row; struct srd_probe; struct srd_proto_data; +struct srd_session; namespace DecoderStackTest { class TwoDecoderStack; @@ -41,18 +46,18 @@ class TwoDecoderStack; namespace pv { +class SigSession; + namespace view { class LogicSignal; - -namespace decode { -class Annotation; -} - } namespace data { +class LogicSnapshot; + namespace decode { +class Annotation; class Decoder; } @@ -68,7 +73,8 @@ private: static const int64_t DecodeChunkLength; public: - DecoderStack(const srd_decoder *const decoder); + DecoderStack(pv::SigSession &_session, + const srd_decoder *const decoder); virtual ~DecoderStack(); @@ -78,8 +84,15 @@ public: int64_t samples_decoded() const; - const std::vector< boost::shared_ptr > - annotations() const; + std::vector get_visible_rows() const; + + /** + * Extracts sorted annotations between two period into a vector. + */ + void get_annotation_subset( + std::vector &dest, + const decode::Row &row, uint64_t start_sample, + uint64_t end_sample) const; QString error_message(); @@ -90,15 +103,23 @@ public: void begin_decode(); private: + void decode_data( + const boost::shared_ptr &snapshot, + srd_session *const session); + void decode_proc(boost::shared_ptr data); static void annotation_callback(srd_proto_data *pdata, void *decoder); +private slots: + void on_new_frame(); + signals: void new_decode_data(); private: + pv::SigSession &_session; /** * This mutex prevents more than one decode operation occuring @@ -110,10 +131,13 @@ private: std::list< boost::shared_ptr > _stack; - mutable boost::mutex _mutex; + mutable boost::mutex _output_mutex; int64_t _samples_decoded; - std::vector< boost::shared_ptr > - _annotations; + + std::map _rows; + + std::map, decode::Row> _class_rows; + QString _error_message; boost::thread _decode_thread;