X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdata%2Fdecode%2Frowdata.cpp;h=3d250f49472eb03194d1001c6dd693c2ef644ae2;hb=HEAD;hp=fc635b2452db765e7bd8896b6d6e6c474abc36da;hpb=1dcd9b18186741d3ce3164f7e8d6cb13abb578d3;p=pulseview.git diff --git a/pv/data/decode/rowdata.cpp b/pv/data/decode/rowdata.cpp index fc635b24..3d250f49 100644 --- a/pv/data/decode/rowdata.cpp +++ b/pv/data/decode/rowdata.cpp @@ -63,7 +63,7 @@ void RowData::get_annotation_subset( uint32_t max_ann_class_id = 0; for (AnnotationClass* c : row_->ann_classes()) { - if (!c->visible) + if (!c->visible()) all_ann_classes_enabled = false; else all_ann_classes_disabled = false; @@ -83,7 +83,7 @@ void RowData::get_annotation_subset( vector class_visible; class_visible.resize(max_ann_class_id + 1, 0); for (AnnotationClass* c : row_->ann_classes()) - if (c->visible) + if (c->visible()) class_visible[c->id] = 1; for (const auto& annotation : annotations_) @@ -95,13 +95,21 @@ void RowData::get_annotation_subset( } } +const deque& RowData::annotations() const +{ + return annotations_; +} + const Annotation* RowData::emplace_annotation(srd_proto_data *pdata) { const srd_proto_data_annotation *const pda = (const srd_proto_data_annotation*)pdata->data; - Annotation::Class ann_class_id = (Annotation::Class)(pda->ann_class); + uint32_t ann_class_id = pda->ann_class; - // Look up the longest annotation text to see if we have it in storage + // Look up the longest annotation text to see if we have it in storage. + // This implies that if the longest text is the same, the shorter texts + // are expected to be the same, too. PDs that violate this assumption + // should be considered broken. const char* const* ann_texts = (char**)pda->ann_text; const QString ann0 = QString::fromUtf8(ann_texts[0]); vector* storage_entry = &(ann_texts_[ann0]);