From 3f53457656c72dc870f603677843613b708b4ea1 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Fri, 31 Jan 2014 21:03:03 +0100 Subject: [PATCH 1/1] pv::data::decode::Annotation: Add row() and set_row(). Keep track of the "annotation row" this annotation is supposed to be displayed on. --- pv/data/decode/annotation.cpp | 11 +++++++++++ pv/data/decode/annotation.h | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/pv/data/decode/annotation.cpp b/pv/data/decode/annotation.cpp index b0517ae6..573fefaf 100644 --- a/pv/data/decode/annotation.cpp +++ b/pv/data/decode/annotation.cpp @@ -40,6 +40,7 @@ Annotation::Annotation(const srd_proto_data *const pdata) : assert(pda); _format = pda->ann_format; + _row = 0; const char *const *annotations = (char**)pda->ann_text; while(*annotations) { @@ -63,11 +64,21 @@ int Annotation::format() const return _format; } +int Annotation::row() const +{ + return _row; +} + const std::vector& Annotation::annotations() const { return _annotations; } +void Annotation::set_row(int row) +{ + _row = row; +} + } // namespace decode } // namespace data } // namespace pv diff --git a/pv/data/decode/annotation.h b/pv/data/decode/annotation.h index 0d7fd5d5..9cacafae 100644 --- a/pv/data/decode/annotation.h +++ b/pv/data/decode/annotation.h @@ -39,12 +39,16 @@ public: uint64_t start_sample() const; uint64_t end_sample() const; int format() const; + int row() const; const std::vector& annotations() const; + void set_row(int row); + private: uint64_t _start_sample; uint64_t _end_sample; int _format; + int _row; std::vector _annotations; }; -- 2.30.2