X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=pv%2Fsession.cpp;h=c464942893c271a16c637a4df1c5aac982d9cd9c;hb=7db61e770abd2d1c7eb326a09e35cd4266664c1d;hp=42c581d420122fd126fc9e7fb7d51b11f3b34648;hpb=5e6967cb2bcacbfb9e5b627becb6752621949998;p=pulseview.git diff --git a/pv/session.cpp b/pv/session.cpp index 42c581d4..c4649428 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -954,7 +954,7 @@ void Session::feed_in_logic(shared_ptr logic) // Create a new data segment cur_logic_segment_ = shared_ptr( - new data::LogicSegment(logic, cur_samplerate_)); + new data::LogicSegment(*logic_data_, logic, cur_samplerate_)); logic_data_->push_segment(cur_logic_segment_); // @todo Putting this here means that only listeners querying @@ -997,11 +997,6 @@ void Session::feed_in_analog(shared_ptr analog) // in the sweep containing this segment. sweep_beginning = true; - // Create a segment, keep it in the maps of channels - segment = shared_ptr( - new data::AnalogSegment(cur_samplerate_)); - cur_analog_segments_[channel] = segment; - // Find the analog data associated with the channel shared_ptr base = signalbase_from_channel(channel); assert(base); @@ -1009,6 +1004,11 @@ void Session::feed_in_analog(shared_ptr analog) shared_ptr data(base->analog_data()); assert(data); + // Create a segment, keep it in the maps of channels + segment = shared_ptr( + new data::AnalogSegment(*data, cur_samplerate_)); + cur_analog_segments_[channel] = segment; + // Push the segment into the analog data. data->push_segment(segment); } @@ -1031,6 +1031,8 @@ void Session::feed_in_analog(shared_ptr analog) void Session::data_feed_in(shared_ptr device, shared_ptr packet) { + static bool frame_began=false; + (void)device; assert(device); @@ -1052,6 +1054,7 @@ void Session::data_feed_in(shared_ptr device, case SR_DF_FRAME_BEGIN: feed_in_frame_begin(); + frame_began = true; break; case SR_DF_LOGIC: @@ -1072,6 +1075,7 @@ void Session::data_feed_in(shared_ptr device, } break; + case SR_DF_FRAME_END: case SR_DF_END: { { @@ -1079,7 +1083,10 @@ void Session::data_feed_in(shared_ptr device, cur_logic_segment_.reset(); cur_analog_segments_.clear(); } - frame_ended(); + if (frame_began) { + frame_began = false; + frame_ended(); + } break; } default: