]> sigrok.org Git - pulseview.git/commitdiff
DecoderStack: Emancipate from SignalData
authorJoel Holdsworth <redacted>
Sat, 29 Nov 2014 18:39:39 +0000 (18:39 +0000)
committerJoel Holdsworth <redacted>
Tue, 9 Dec 2014 18:24:59 +0000 (18:24 +0000)
pv/data/decoderstack.cpp
pv/data/decoderstack.hpp
pv/view/decodetrace.cpp

index e0b16573430d8ef466309363af9e7b29ba9a8d1a..bb2818bb79aab0d2c336a0045d5e0a0eb3c2a5a6 100644 (file)
@@ -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<mutex> decode_lock(output_mutex_);
index e8aeed10f2b09da3db62e8fbc82c317c383ed536..39e507e88c58a57cde8f605cfc01211b75ab1ea6 100644 (file)
@@ -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<decode::Decoder> decoder);
        void remove(int index);
 
+       double samplerate() const;
+
+       double start_time() const;
+
        int64_t samples_decoded() const;
 
        std::vector<decode::Row> 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.
index 6f14732d2bddc56a9b71ed6bf24af6cd15447d79..bdae3952ee33cf33b57f7377f9d526f8fa805b61 100644 (file)
@@ -527,7 +527,7 @@ pair<double, double> 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();