]> sigrok.org Git - pulseview.git/commitdiff
SignalBase: Also emit data related signals
authorSoeren Apel <redacted>
Fri, 26 May 2017 08:46:14 +0000 (10:46 +0200)
committerSoeren Apel <redacted>
Fri, 26 May 2017 17:36:04 +0000 (19:36 +0200)
If we have a SignalBase instance we don't want to hook into
every single segment just to be notified when data changes.

pv/data/signalbase.cpp
pv/data/signalbase.hpp

index 6bcacd734a94f7e15e91d46fc285c6a2424f68d3..45dc082cce7f65c5dbc55548b94692d43dfc0729 100644 (file)
@@ -318,6 +318,8 @@ void SignalBase::conversion_thread_proc(QObject* segment, uint64_t start_sample,
                                lsamples.push_back(convert_a2l_threshold(threshold, asamples[j]));
                        lsegment->append_payload(lsamples.data(), lsamples.size());
                        delete[] asamples;
+
+                       samples_added(lsegment, start_sample, end_sample);
                }
 
                if (conversion_type_ == A2LConversionBySchmittTrigger) {
@@ -343,6 +345,8 @@ void SignalBase::conversion_thread_proc(QObject* segment, uint64_t start_sample,
                                lsamples.push_back(convert_a2l_schmitt_trigger(lo_thr, hi_thr, asamples[j], state));
                        lsegment->append_payload(lsamples.data(), lsamples.size());
                        delete[] asamples;
+
+                       samples_added(lsegment, start_sample, end_sample);
                }
        }
 }
@@ -351,6 +355,8 @@ void SignalBase::on_samples_cleared()
 {
        if (converted_data_)
                converted_data_->clear();
+
+       samples_cleared();
 }
 
 void SignalBase::on_samples_added(QObject* segment, uint64_t start_sample,
@@ -370,6 +376,8 @@ void SignalBase::on_samples_added(QObject* segment, uint64_t start_sample,
                        &SignalBase::conversion_thread_proc, this,
                        segment, start_sample, end_sample);
        }
+
+       samples_added(segment, start_sample, end_sample);
 }
 
 void SignalBase::on_capture_state_changed(int state)
index 381716480371f6c5494a618e53aca196c7160787..e6726c5aec160d124b538e07ea04696ab721f629 100644 (file)
@@ -176,6 +176,11 @@ Q_SIGNALS:
 
        void conversion_type_changed(const ConversionType t);
 
+       void samples_cleared();
+
+       void samples_added(QObject* segment, uint64_t start_sample,
+               uint64_t end_sample);
+
 private Q_SLOTS:
        void on_samples_cleared();