]> sigrok.org Git - pulseview.git/commitdiff
LogicSegment: Remove constructor requiring sigrok::Logic
authorSoeren Apel <redacted>
Thu, 16 Mar 2017 21:24:17 +0000 (22:24 +0100)
committerSoeren Apel <redacted>
Wed, 22 Mar 2017 21:47:20 +0000 (22:47 +0100)
pv/data/logicsegment.cpp
pv/data/logicsegment.hpp
pv/session.cpp

index fcf572297e689f87762eabc81df96207df3000dc..25aa2d0aa445bd2671129e60d51585f746dda6a2 100644 (file)
@@ -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<sigrok::Logic> data,
-       uint64_t samplerate) :
-       Segment(samplerate, data->unit_size()),
-       owner_(owner),
-       last_append_sample_(0)
-{
-       lock_guard<recursive_mutex> 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),
index c7971726fe667a192a295c578f8ce07dcb64f5a8..bc9c77d0f4c7b6923287967f3b189648c0c65459 100644 (file)
@@ -77,7 +77,6 @@ public:
        typedef pair<int64_t, bool> EdgePair;
 
 public:
-       LogicSegment(pv::data::Logic& owner, shared_ptr<sigrok::Logic> data, uint64_t samplerate);
        LogicSegment(pv::data::Logic& owner, unsigned int unit_size, uint64_t samplerate);
 
        virtual ~LogicSegment();
index f5f1e4974b6ea155dcdb923924a05c0fef4077c3..fb7d6379c2a6af1b613e410b3f68e5e1239e1e52 100644 (file)
@@ -962,7 +962,7 @@ void Session::feed_in_logic(shared_ptr<Logic> logic)
 
                // Create a new data segment
                cur_logic_segment_ = make_shared<data::LogicSegment>(
-                       *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> 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();
 }