]> sigrok.org Git - pulseview.git/commitdiff
Fix #1591 by updating Logic and Analog if needed
authorSoeren Apel <redacted>
Fri, 13 Nov 2020 20:40:03 +0000 (21:40 +0100)
committerSoeren Apel <redacted>
Fri, 13 Nov 2020 20:56:22 +0000 (21:56 +0100)
pv/data/analog.cpp
pv/data/logic.cpp

index 0b5c37729ea0908c4e6a3a2b39a727088de014a9..9010097cee28bd9f314de88d378eaee8de6a56cf 100644 (file)
@@ -40,6 +40,9 @@ void Analog::push_segment(shared_ptr<AnalogSegment> &segment)
 {
        segments_.push_back(segment);
 
+       if ((samplerate_ == 1) && (segment->samplerate() > 1))
+               samplerate_ = segment->samplerate();
+
        connect(segment.get(), SIGNAL(completed()), this, SLOT(on_segment_completed()));
 }
 
index 038da649896a0f915883403fb420a37d9d36db0d..d2f89e856cd4ae58a9e682341670b88a8d003c3f 100644 (file)
@@ -46,6 +46,9 @@ unsigned int Logic::num_channels() const
 void Logic::push_segment(shared_ptr<LogicSegment> &segment)
 {
        segments_.push_back(segment);
+
+       if ((samplerate_ == 1) && (segment->samplerate() > 1))
+               samplerate_ = segment->samplerate();
 }
 
 const deque< shared_ptr<LogicSegment> >& Logic::logic_segments() const