X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fdecodetrace.hpp;h=96332d97b46c8a3842ed1f8fa580ae9a59528ebf;hp=ada01db70548d34f641fb60ed0190a9b908427f9;hb=bf0edd2b0cbb5f4bd5d69b0f00bcea7d037e2287;hpb=3cc9ad7b867853315473df611612c562d562ed8a diff --git a/pv/view/decodetrace.hpp b/pv/view/decodetrace.hpp index ada01db..96332d9 100644 --- a/pv/view/decodetrace.hpp +++ b/pv/view/decodetrace.hpp @@ -18,18 +18,20 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef PULSEVIEW_PV_VIEW_DECODETRACE_H -#define PULSEVIEW_PV_VIEW_DECODETRACE_H +#ifndef PULSEVIEW_PV_VIEW_DECODETRACE_HPP +#define PULSEVIEW_PV_VIEW_DECODETRACE_HPP #include "trace.hpp" #include #include #include +#include #include #include +#include #include struct srd_channel; @@ -76,13 +78,14 @@ private: static const int ArrowSize; static const double EndCapWidth; + static const int RowTitleMargin; static const int DrawPadding; static const QColor Colours[16]; static const QColor OutlineColours[16]; public: - DecodeTrace(pv::Session &session, + DecodeTrace(pv::Session &session, std::shared_ptr signalbase, std::shared_ptr decoder_stack, int index); @@ -100,21 +103,21 @@ public: * Paints the background layer of the trace with a QPainter * @param p the QPainter to paint into. * @param pp the painting parameters object to paint with.. - **/ + */ void paint_back(QPainter &p, const ViewItemPaintParams &pp); /** * Paints the mid-layer of the trace with a QPainter * @param p the QPainter to paint into. * @param pp the painting parameters object to paint with. - **/ + */ void paint_mid(QPainter &p, const ViewItemPaintParams &pp); /** * Paints the foreground layer of the trace with a QPainter * @param p the QPainter to paint into. * @param pp the painting parameters object to paint with. - **/ + */ void paint_fore(QPainter &p, const ViewItemPaintParams &pp); void populate_popup_form(QWidget *parent, QFormLayout *form); @@ -124,16 +127,23 @@ public: void delete_pressed(); private: + void draw_annotations(std::vector annotations, + QPainter &p, int h, const ViewItemPaintParams &pp, int y, + size_t base_colour, int row_title_width); + void draw_annotation(const pv::data::decode::Annotation &a, QPainter &p, - int text_height, const ViewItemPaintParams &pp, int y, - size_t base_colour) const; + int h, const ViewItemPaintParams &pp, int y, + size_t base_colour, int row_title_width) const; + + void draw_annotation_block(std::vector annotations, + QPainter &p, int h, int y, size_t base_colour) const; void draw_instant(const pv::data::decode::Annotation &a, QPainter &p, - QColor fill, QColor outline, int h, double x, int y) const; + int h, double x, int y) const; void draw_range(const pv::data::decode::Annotation &a, QPainter &p, - QColor fill, QColor outline, int h, double start, - double end, int y) const; + int h, double start, double end, int y, const ViewItemPaintParams &pp, + int row_title_width) const; void draw_error(QPainter &p, const QString &message, const ViewItemPaintParams &pp); @@ -187,6 +197,7 @@ private Q_SLOTS: private: pv::Session &session_; + std::shared_ptr signalbase_; std::shared_ptr decoder_stack_; uint64_t decode_start_, decode_end_; @@ -198,7 +209,10 @@ private: std::vector decoder_forms_; std::vector visible_rows_; - int row_height_; + std::map row_title_widths_; + int row_height_, max_visible_rows_; + + int min_useful_label_width_; QSignalMapper delete_mapper_, show_hide_mapper_; }; @@ -206,4 +220,4 @@ private: } // namespace view } // namespace pv -#endif // PULSEVIEW_PV_VIEW_DECODETRACE_H +#endif // PULSEVIEW_PV_VIEW_DECODETRACE_HPP