]> sigrok.org Git - pulseview.git/commitdiff
Fix malformed declaration in MathSignal and add missing signal call
authorSoeren Apel <redacted>
Tue, 29 Dec 2020 22:24:45 +0000 (23:24 +0100)
committerSoeren Apel <redacted>
Tue, 29 Dec 2020 22:25:25 +0000 (23:25 +0100)
pv/data/decodesignal.cpp
pv/data/mathsignal.hpp
pv/data/signalbase.cpp

index e076e8c0532e94da8283a916f5a178854a040cfc..610bfc4fe6e89771c678f33453bcef1ad78c474e 100644 (file)
@@ -472,7 +472,6 @@ vector<const Row*> 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> logic_data = ch.assigned_signal->logic_data();
 
                        shared_ptr<const LogicSegment> 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;
index e40dbfb3cf61125643d945b2b760846f4069efee..98adbe8099b57058ba1c1a3e4fa243e49b8b7439 100644 (file)
@@ -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:
index 3ce22ba2a286eb715af9628b8dec77e84365e2cc..5f95ec337b16d5504000ce02736d29d31f4c924c 100644 (file)
@@ -723,6 +723,8 @@ void SignalBase::convert_single_segment_range(shared_ptr<AnalogSegment> asegment
                delete[] lsamples;
                delete[] asamples;
        }
+
+       samples_added(lsegment->segment_id(), start_sample, end_sample);
 }
 
 void SignalBase::convert_single_segment(shared_ptr<AnalogSegment> asegment,