]> sigrok.org Git - pulseview.git/blobdiff - pv/views/trace/decodetrace.hpp
Implement annotation export from the DecodeTrace context menu
[pulseview.git] / pv / views / trace / decodetrace.hpp
index 688a348f1092a0ea8d604459565008f9fb67d355..8f8765c17dc8857423901e353e9d574282f84960 100644 (file)
@@ -118,7 +118,9 @@ public:
 
        void populate_popup_form(QWidget *parent, QFormLayout *form);
 
-       QMenu* create_context_menu(QWidget *parent);
+       QMenu* create_header_context_menu(QWidget *parent);
+
+       virtual QMenu* create_view_context_menu(QWidget *parent, QPoint &click_pos);
 
        void delete_pressed();
 
@@ -131,15 +133,15 @@ private:
                int h, const ViewItemPaintParams &pp, int y,
                QColor row_color, int row_title_width) const;
 
-       void draw_annotation_block(int start, int end,
+       void draw_annotation_block(qreal start, qreal end,
                pv::data::decode::Annotation::Class ann_class, bool use_ann_format,
                QPainter &p, int h, int y, QColor row_color) const;
 
        void draw_instant(const pv::data::decode::Annotation &a, QPainter &p,
-               int h, double x, int y) const;
+               int h, qreal x, int y) const;
 
        void draw_range(const pv::data::decode::Annotation &a, QPainter &p,
-               int h, double start, double end, int y, const ViewItemPaintParams &pp,
+               int h, qreal start, qreal end, int y, const ViewItemPaintParams &pp,
                int row_title_width) const;
 
        void draw_error(QPainter &p, const QString &message,
@@ -176,7 +178,7 @@ private:
                const data::DecodeChannel *ch);
 
 public:
-       void hover_point_changed(const QPoint &hp);
+       virtual void hover_point_changed(const QPoint &hp);
 
 private Q_SLOTS:
        void on_new_annotations();
@@ -198,6 +200,9 @@ private Q_SLOTS:
 
        void on_show_hide_decoder(int index);
 
+       void on_export_row();
+       void on_export_row_from_here();
+
 private:
        pv::Session &session_;
        shared_ptr<data::DecodeSignal> decode_signal_;
@@ -208,6 +213,9 @@ private:
        map<QComboBox*, uint16_t> init_state_map_;  // init state selector -> decode channel ID
        list< shared_ptr<pv::binding::Decoder> > bindings_;
 
+       data::decode::Row *selected_row_;
+       uint64_t selected_samplepos_;
+
        vector<pv::widgets::DecoderGroupBox*> decoder_forms_;
 
        map<data::decode::Row, int> row_title_widths_;