From: Soeren Apel Date: Sat, 9 Sep 2017 07:01:07 +0000 (+0200) Subject: DecodeTrace: Reset cached trace properties when decoder stack resets X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=eee3eab96253315b2a3dc04ffa7051a8ec963c32;p=pulseview.git DecodeTrace: Reset cached trace properties when decoder stack resets --- diff --git a/pv/data/decodesignal.cpp b/pv/data/decodesignal.cpp index 03ecc2ef..8bdad109 100644 --- a/pv/data/decodesignal.cpp +++ b/pv/data/decodesignal.cpp @@ -155,6 +155,8 @@ void DecodeSignal::reset_decode() logic_mux_data_.reset(); logic_mux_data_invalid_ = true; + + decode_reset(); } void DecodeSignal::begin_decode() diff --git a/pv/data/decodesignal.hpp b/pv/data/decodesignal.hpp index 3187c850..dd2ad79d 100644 --- a/pv/data/decodesignal.hpp +++ b/pv/data/decodesignal.hpp @@ -153,6 +153,7 @@ private: Q_SIGNALS: void new_annotations(); + void decode_reset(); void decode_finished(); void channels_updated(); diff --git a/pv/views/trace/decodetrace.cpp b/pv/views/trace/decodetrace.cpp index 7bbc5a19..509e77f6 100644 --- a/pv/views/trace/decodetrace.cpp +++ b/pv/views/trace/decodetrace.cpp @@ -146,6 +146,8 @@ DecodeTrace::DecodeTrace(pv::Session &session, connect(decode_signal_.get(), SIGNAL(new_annotations()), this, SLOT(on_new_annotations())); + connect(decode_signal_.get(), SIGNAL(decode_reset()), + this, SLOT(on_decode_reset())); connect(decode_signal_.get(), SIGNAL(decode_finished()), this, SLOT(on_decode_finished())); connect(decode_signal_.get(), SIGNAL(channels_updated()), @@ -889,6 +891,15 @@ void DecodeTrace::on_delayed_trace_update() owner_->row_item_appearance_changed(false, true); } +void DecodeTrace::on_decode_reset() +{ + visible_rows_.clear(); + max_visible_rows_ = 0; + + if (owner_) + owner_->row_item_appearance_changed(false, true); +} + void DecodeTrace::on_decode_finished() { if (owner_) diff --git a/pv/views/trace/decodetrace.hpp b/pv/views/trace/decodetrace.hpp index fe3503b6..43473873 100644 --- a/pv/views/trace/decodetrace.hpp +++ b/pv/views/trace/decodetrace.hpp @@ -184,6 +184,7 @@ public: private Q_SLOTS: void on_new_annotations(); void on_delayed_trace_update(); + void on_decode_reset(); void on_decode_finished(); void on_delete();