From: Soeren Apel Date: Thu, 16 Mar 2017 21:24:17 +0000 (+0100) Subject: LogicSegment: Remove constructor requiring sigrok::Logic X-Git-Tag: pulseview-0.4.0~137 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=04e1acc23e835018c3c13d8f29115cb285035151;p=pulseview.git LogicSegment: Remove constructor requiring sigrok::Logic --- diff --git a/pv/data/logicsegment.cpp b/pv/data/logicsegment.cpp index fcf57229..25aa2d0a 100644 --- a/pv/data/logicsegment.cpp +++ b/pv/data/logicsegment.cpp @@ -47,17 +47,6 @@ const int LogicSegment::MipMapScaleFactor = 1 << MipMapScalePower; const float LogicSegment::LogMipMapScaleFactor = logf(MipMapScaleFactor); const uint64_t LogicSegment::MipMapDataUnit = 64*1024; // bytes -LogicSegment::LogicSegment(pv::data::Logic& owner, shared_ptr data, - uint64_t samplerate) : - Segment(samplerate, data->unit_size()), - owner_(owner), - last_append_sample_(0) -{ - lock_guard lock(mutex_); - memset(mip_map_, 0, sizeof(mip_map_)); - append_payload(data); -} - LogicSegment::LogicSegment(pv::data::Logic& owner, unsigned int unit_size, uint64_t samplerate) : Segment(samplerate, unit_size), diff --git a/pv/data/logicsegment.hpp b/pv/data/logicsegment.hpp index c7971726..bc9c77d0 100644 --- a/pv/data/logicsegment.hpp +++ b/pv/data/logicsegment.hpp @@ -77,7 +77,6 @@ public: typedef pair EdgePair; public: - LogicSegment(pv::data::Logic& owner, shared_ptr data, uint64_t samplerate); LogicSegment(pv::data::Logic& owner, unsigned int unit_size, uint64_t samplerate); virtual ~LogicSegment(); diff --git a/pv/session.cpp b/pv/session.cpp index f5f1e497..fb7d6379 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -962,7 +962,7 @@ void Session::feed_in_logic(shared_ptr logic) // Create a new data segment cur_logic_segment_ = make_shared( - *logic_data_, logic, cur_samplerate_); + *logic_data_, logic->unit_size(), cur_samplerate_); logic_data_->push_segment(cur_logic_segment_); // @todo Putting this here means that only listeners querying @@ -970,11 +970,10 @@ void Session::feed_in_logic(shared_ptr logic) // frame_began is DecoderStack, but in future we need to signal // this after both analog and logic sweeps have begun. frame_began(); - } else { - // Append to the existing data segment - cur_logic_segment_->append_payload(logic); } + cur_logic_segment_->append_payload(logic); + data_received(); }