]> 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 66a98055d66ac3cde5f34dac53fb7c7a1ad70952..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.
@@ -144,6 +162,9 @@ private Q_SLOTS:
 
 protected:
        shared_ptr<data::SignalBase> base_;
+       QPen axis_pen_;
+
+       SegmentDisplayMode segment_display_mode_;
 
 private:
        pv::widgets::Popup *popup_;