]> sigrok.org Git - pulseview.git/blobdiff - pv/data/decode/row.hpp
Continue work on SRD_OUTPUT_LOGIC
[pulseview.git] / pv / data / decode / row.hpp
index 25e6fcc492863f90ac97b2ae23a9a73d3b51a39c..80aa114c1edb8dde8514c67f7ee67139a55c0d91 100644 (file)
 #ifndef PULSEVIEW_PV_DATA_DECODE_ROW_HPP
 #define PULSEVIEW_PV_DATA_DECODE_ROW_HPP
 
+#include <map>
 #include <vector>
 
-#include "annotation.hpp"
+#include <QObject>
+#include <QColor>
 
 struct srd_decoder;
 struct srd_decoder_annotation_row;
 
+using std::map;
+using std::vector;
+
 namespace pv {
 namespace data {
 namespace decode {
 
+#define DECODE_COLOR_SATURATION (180) /* 0-255 */
+#define DECODE_COLOR_VALUE (170) /* 0-255 */
+
+class AnnotationClass;
 class Decoder;
 
-class Row
+class Row: public QObject
 {
+       Q_OBJECT
+
 public:
        Row();
 
-       Row(int index, const Decoder* decoder,
-               const srd_decoder_annotation_row* row = nullptr);
+       Row(uint32_t index, Decoder* decoder,
+               const srd_decoder_annotation_row* srd_row = nullptr);
 
        const Decoder* decoder() const;
-       const srd_decoder_annotation_row* srd_row() const;
+       const srd_decoder_annotation_row* get_srd_row() const;
 
        const QString title() const;
-       const QString class_name() const;
-       int index() const;
+       const QString description() const;
+       vector<AnnotationClass*> ann_classes() const;
+       uint32_t index() const;
+
+       bool visible() const;
+       void set_visible(bool visible);
+
+       void set_base_color(QColor base_color);
+       const QColor color() const;
+       const QColor get_class_color(uint32_t ann_class_id) const;
+       const QColor get_bright_class_color(uint32_t ann_class_id) const;
+       const QColor get_dark_class_color(uint32_t ann_class_id) const;
+
+       bool has_hidden_classes() const;
+       bool class_is_visible(uint32_t ann_class_id) const;
 
        bool operator<(const Row& other) const;
        bool operator==(const Row& other) const;
 
+Q_SIGNALS:
+       void visibility_changed();
+
 private:
-       int index_;
-       const Decoder* decoder_;
-       const srd_decoder_annotation_row* row_;
+       uint32_t index_;
+       Decoder* decoder_;
+       const srd_decoder_annotation_row* srd_row_;
+       bool visible_;
+
+       QColor color_;
+       map<uint32_t, QColor> ann_class_color_;
+       map<uint32_t, QColor> ann_bright_class_color_;
+       map<uint32_t, QColor> ann_dark_class_color_;
 };
 
 }  // namespace decode