From: Joel Holdsworth Date: Sat, 29 Nov 2014 18:39:39 +0000 (+0000) Subject: DecoderStack: Emancipate from SignalData X-Git-Tag: pulseview-0.3.0~397 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f054289f67046e0c2d23d0f34eba94a681cc7ccd;p=pulseview.git DecoderStack: Emancipate from SignalData --- diff --git a/pv/data/decoderstack.cpp b/pv/data/decoderstack.cpp index e0b16573..bb2818bb 100644 --- a/pv/data/decoderstack.cpp +++ b/pv/data/decoderstack.cpp @@ -62,6 +62,8 @@ mutex DecoderStack::global_decode_mutex_; DecoderStack::DecoderStack(pv::Session &session, const srd_decoder *const dec) : session_(session), + start_time_(0), + samplerate_(0), sample_count_(0), frame_complete_(false), samples_decoded_(0) @@ -112,6 +114,16 @@ void DecoderStack::remove(int index) stack_.erase(iter); } +double DecoderStack::samplerate() const +{ + return samplerate_; +} + +double DecoderStack::start_time() const +{ + return start_time_; +} + int64_t DecoderStack::samples_decoded() const { lock_guard decode_lock(output_mutex_); diff --git a/pv/data/decoderstack.hpp b/pv/data/decoderstack.hpp index e8aeed10..39e507e8 100644 --- a/pv/data/decoderstack.hpp +++ b/pv/data/decoderstack.hpp @@ -67,7 +67,7 @@ class Decoder; class Logic; -class DecoderStack : public QObject, public SignalData +class DecoderStack : public QObject { Q_OBJECT @@ -87,6 +87,10 @@ public: void push(std::shared_ptr decoder); void remove(int index); + double samplerate() const; + + double start_time() const; + int64_t samples_decoded() const; std::vector get_visible_rows() const; @@ -131,6 +135,9 @@ Q_SIGNALS: private: pv::Session &session_; + double start_time_; + double samplerate_; + /** * This mutex prevents more than one decode operation occuring * concurrently. diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp index 6f14732d..bdae3952 100644 --- a/pv/view/decodetrace.cpp +++ b/pv/view/decodetrace.cpp @@ -527,7 +527,7 @@ pair DecodeTrace::get_pixels_offset_samples_per_pixel() const assert(scale > 0); const double pixels_offset = - (view->offset() - decoder_stack_->get_start_time()) / scale; + (view->offset() - decoder_stack_->start_time()) / scale; double samplerate = decoder_stack_->samplerate();