From: Soeren Apel Date: Fri, 13 Nov 2020 20:40:03 +0000 (+0100) Subject: Fix #1591 by updating Logic and Analog if needed X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=e505bec82f581f838bdcaae3c75bce96676cc9fd;p=pulseview.git Fix #1591 by updating Logic and Analog if needed --- diff --git a/pv/data/analog.cpp b/pv/data/analog.cpp index 0b5c3772..9010097c 100644 --- a/pv/data/analog.cpp +++ b/pv/data/analog.cpp @@ -40,6 +40,9 @@ void Analog::push_segment(shared_ptr &segment) { segments_.push_back(segment); + if ((samplerate_ == 1) && (segment->samplerate() > 1)) + samplerate_ = segment->samplerate(); + connect(segment.get(), SIGNAL(completed()), this, SLOT(on_segment_completed())); } diff --git a/pv/data/logic.cpp b/pv/data/logic.cpp index 038da649..d2f89e85 100644 --- a/pv/data/logic.cpp +++ b/pv/data/logic.cpp @@ -46,6 +46,9 @@ unsigned int Logic::num_channels() const void Logic::push_segment(shared_ptr &segment) { segments_.push_back(segment); + + if ((samplerate_ == 1) && (segment->samplerate() > 1)) + samplerate_ = segment->samplerate(); } const deque< shared_ptr >& Logic::logic_segments() const