From: Soeren Apel Date: Tue, 29 Dec 2020 22:24:45 +0000 (+0100) Subject: Fix malformed declaration in MathSignal and add missing signal call X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=1c552f400ee967f7a489853578c4d8d4bd2edfbf;p=pulseview.git Fix malformed declaration in MathSignal and add missing signal call --- diff --git a/pv/data/decodesignal.cpp b/pv/data/decodesignal.cpp index e076e8c0..610bfc4f 100644 --- a/pv/data/decodesignal.cpp +++ b/pv/data/decodesignal.cpp @@ -472,7 +472,6 @@ vector DecodeSignal::get_rows(bool visible_only) const return rows; } - uint64_t DecodeSignal::get_annotation_count(const Row* row, uint32_t segment_id) const { if (segment_id >= segments_.size()) @@ -1450,6 +1449,7 @@ void DecodeSignal::connect_input_notifiers() if (!ch.assigned_signal) continue; const data::SignalBase *signal = ch.assigned_signal.get(); + connect(signal, SIGNAL(samples_cleared()), this, SLOT(on_data_cleared())); connect(signal, SIGNAL(samples_added(uint64_t, uint64_t, uint64_t)), @@ -1484,8 +1484,11 @@ void DecodeSignal::connect_input_segment_notifiers(uint32_t segment_id) continue; } - if (!segment) + if (!segment) { + qWarning() << "Signal" << name() << ":" << ch.assigned_signal->name() \ + << "has no logic segment, can't connect notifier" << segment_id; continue; + } connect(segment.get(), SIGNAL(completed()), this, SLOT(on_input_segment_completed())); } @@ -1498,11 +1501,10 @@ void DecodeSignal::disconnect_input_segment_notifiers(uint32_t segment_id) const shared_ptr logic_data = ch.assigned_signal->logic_data(); shared_ptr segment; - if (segment_id < logic_data->logic_segments().size()) { + if (segment_id < logic_data->logic_segments().size()) segment = logic_data->logic_segments().at(segment_id)->get_shared_ptr(); - } else { + else continue; - } if (!segment) continue; diff --git a/pv/data/mathsignal.hpp b/pv/data/mathsignal.hpp index e40dbfb3..98adbe80 100644 --- a/pv/data/mathsignal.hpp +++ b/pv/data/mathsignal.hpp @@ -105,13 +105,6 @@ private: bool all_input_signals_enabled(QString &disabled_signals) const; Q_SIGNALS: - void samples_cleared(); - - void samples_added(uint64_t segment_id, uint64_t start_sample, - uint64_t end_sample); - - void min_max_changed(float min, float max); - void expression_changed(QString expression); private Q_SLOTS: diff --git a/pv/data/signalbase.cpp b/pv/data/signalbase.cpp index 3ce22ba2..5f95ec33 100644 --- a/pv/data/signalbase.cpp +++ b/pv/data/signalbase.cpp @@ -723,6 +723,8 @@ void SignalBase::convert_single_segment_range(shared_ptr asegment delete[] lsamples; delete[] asamples; } + + samples_added(lsegment->segment_id(), start_sample, end_sample); } void SignalBase::convert_single_segment(shared_ptr asegment,