X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=inline;f=pv%2Fdata%2Fdecodesignal.cpp;h=318a09535b5836beaa95ea4c848eab7b5bd90fc0;hb=ba5f21864c459a24f71ce3b0045805813c032134;hp=d85821c6ca58db1d20a74f0e71d1ec48129e989a;hpb=5ecf957f9f58abc2372b0214333d3491477c1b4d;p=pulseview.git diff --git a/pv/data/decodesignal.cpp b/pv/data/decodesignal.cpp index d85821c6..318a0953 100644 --- a/pv/data/decodesignal.cpp +++ b/pv/data/decodesignal.cpp @@ -151,7 +151,7 @@ void DecodeSignal::reset_decode() currently_processed_segment_ = 0; error_message_ = QString(); - rows_.clear(); + segmented_rows_.clear(); current_rows_= nullptr; class_rows_.clear(); @@ -224,7 +224,9 @@ void DecodeSignal::begin_decode() } } - prepare_annotation_segment(); + create_new_annotation_segment(); + + // TODO Allow logic_mux_data and logic_mux_segment to work with multiple segments // Free the logic data and its segment(s) if it needs to be updated if (logic_mux_data_invalid_) @@ -422,7 +424,7 @@ void DecodeSignal::get_annotation_subset( if (!current_rows_) return; - // TODO Instead of current_rows_, use rows_ and the ID of the segment + // TODO Instead of current_rows_, use segmented_rows_ and the ID of the segment const auto iter = current_rows_->find(row); if (iter != current_rows_->end()) @@ -762,6 +764,8 @@ void DecodeSignal::logic_mux_proc() } if (samples_to_process == 0) { + logic_mux_data_invalid_ = false; + // Wait for more input unique_lock logic_mux_lock(logic_mux_mutex_); logic_mux_cond_.wait(logic_mux_lock); @@ -949,11 +953,10 @@ void DecodeSignal::connect_input_notifiers() } } -void DecodeSignal::prepare_annotation_segment() +void DecodeSignal::create_new_annotation_segment() { - // TODO Won't work for multiple segments - rows_.emplace_back(map()); - current_rows_ = &(rows_.back()); + segmented_rows_.emplace_back(map()); + current_rows_ = &(segmented_rows_.back()); // Add annotation classes for (const shared_ptr &dec : stack_) { @@ -1026,8 +1029,10 @@ void DecodeSignal::annotation_callback(srd_proto_data *pdata, void *decode_signa void DecodeSignal::on_capture_state_changed(int state) { // If a new acquisition was started, we need to start decoding from scratch - if (state == Session::Running) + if (state == Session::Running) { + logic_mux_data_invalid_ = true; begin_decode(); + } } void DecodeSignal::on_data_cleared()