]> sigrok.org Git - pulseview.git/commitdiff
pv::data::decode::Annotation: Add row() and set_row().
authorUwe Hermann <redacted>
Fri, 31 Jan 2014 20:03:03 +0000 (21:03 +0100)
committerUwe Hermann <redacted>
Sat, 1 Feb 2014 01:28:12 +0000 (02:28 +0100)
Keep track of the "annotation row" this annotation is supposed to be
displayed on.

pv/data/decode/annotation.cpp
pv/data/decode/annotation.h

index b0517ae69ef9c6a13eefc4bad41efeea08b7d9a0..573fefaffa8c0829bc1440e362203d15dc5065b5 100644 (file)
@@ -40,6 +40,7 @@ Annotation::Annotation(const srd_proto_data *const pdata) :
        assert(pda);
 
        _format = pda->ann_format;
        assert(pda);
 
        _format = pda->ann_format;
+       _row = 0;
 
        const char *const *annotations = (char**)pda->ann_text;
        while(*annotations) {
 
        const char *const *annotations = (char**)pda->ann_text;
        while(*annotations) {
@@ -63,11 +64,21 @@ int Annotation::format() const
        return _format;
 }
 
        return _format;
 }
 
+int Annotation::row() const
+{
+       return _row;
+}
+
 const std::vector<QString>& Annotation::annotations() const
 {
        return _annotations;
 }
 
 const std::vector<QString>& Annotation::annotations() const
 {
        return _annotations;
 }
 
+void Annotation::set_row(int row)
+{
+       _row = row;
+}
+
 } // namespace decode
 } // namespace data
 } // namespace pv
 } // namespace decode
 } // namespace data
 } // namespace pv
index 0d7fd5d5e59441e8ed9a81d7993fe7fa97340d47..9cacafaeaac0c1ea9a92478f1a01b9e2233c78e2 100644 (file)
@@ -39,12 +39,16 @@ public:
        uint64_t start_sample() const;
        uint64_t end_sample() const;
        int format() const;
        uint64_t start_sample() const;
        uint64_t end_sample() const;
        int format() const;
+       int row() const;
        const std::vector<QString>& annotations() const;
 
        const std::vector<QString>& annotations() const;
 
+       void set_row(int row);
+
 private:
        uint64_t _start_sample;
        uint64_t _end_sample;
        int _format;
 private:
        uint64_t _start_sample;
        uint64_t _end_sample;
        int _format;
+       int _row;
        std::vector<QString> _annotations; 
 };
 
        std::vector<QString> _annotations; 
 };