From: Soeren Apel Date: Thu, 23 Nov 2017 17:30:26 +0000 (+0100) Subject: DecodeSignal: Rename some items X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=f2f4845f15f5b5aa60cceb47c349201f44e1d14b;hp=5ecf957f9f58abc2372b0214333d3491477c1b4d DecodeSignal: Rename some items --- diff --git a/pv/data/decodesignal.cpp b/pv/data/decodesignal.cpp index d85821c6..5d0ca90a 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()) @@ -949,11 +951,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_) { diff --git a/pv/data/decodesignal.hpp b/pv/data/decodesignal.hpp index 0a28fe3c..29e8441a 100644 --- a/pv/data/decodesignal.hpp +++ b/pv/data/decodesignal.hpp @@ -148,7 +148,7 @@ private: void connect_input_notifiers(); - void prepare_annotation_segment(); + void create_new_annotation_segment(); static void annotation_callback(srd_proto_data *pdata, void *decode_signal); Q_SIGNALS: @@ -183,10 +183,10 @@ private: map, decode::Row> class_rows_; /// Annotations for all segments - vector< map> rows_; + vector< map> segmented_rows_; /// Set of annotations for current segment - map *current_rows_; // TODO Multiple segment support + map *current_rows_; mutable mutex input_mutex_, output_mutex_, logic_mux_mutex_; mutable condition_variable decode_input_cond_, logic_mux_cond_;