]> sigrok.org Git - pulseview.git/blobdiff - pv/views/trace/trace.hpp
Implement segment display mode handling and update notifications
[pulseview.git] / pv / views / trace / trace.hpp
index 407592de63bc7bb2221aadc77388424789533dfe..75705226780e8c7a7aea029806fbf5ffdf78b4d4 100644 (file)
@@ -63,6 +63,19 @@ class Trace : public TraceTreeItem
 {
        Q_OBJECT
 
+public:
+       /**
+        * Allowed values for the multi-segment display mode.
+        *
+        * Note: Consider @ref View::set_segment_display_mode when updating the list.
+        */
+       enum SegmentDisplayMode {
+               ShowLastSegmentOnly = 1,
+               ShowSingleSegmentOnly,
+               ShowAllSegments,
+               ShowAccumulatedIntensity
+       };
+
 private:
        static const QPen AxisPen;
        static const int LabelHitPadding;
@@ -89,6 +102,11 @@ public:
         */
        virtual void set_colour(QColor colour);
 
+       /**
+        * Configures the segment display mode to use.
+        */
+       virtual void set_segment_display_mode(SegmentDisplayMode mode);
+
        /**
         * Paints the signal label.
         * @param p the QPainter to paint into.
@@ -146,6 +164,8 @@ protected:
        shared_ptr<data::SignalBase> base_;
        QPen axis_pen_;
 
+       SegmentDisplayMode segment_display_mode_;
+
 private:
        pv::widgets::Popup *popup_;
        QFormLayout *popup_form_;