]> sigrok.org Git - pulseview.git/blobdiff - pv/view/analogsignal.hpp
AnalogSignal: display type-related improvements
[pulseview.git] / pv / view / analogsignal.hpp
index a27f669681659f61c84cb7a7c737d00a5b17752a..32af0171399e0864143048f62654f1f7b8fb9567 100644 (file)
@@ -55,6 +55,12 @@ private:
        static const int MaxScaleIndex, MinScaleIndex;
        static const int InfoTextMarginRight, InfoTextMarginBottom;
 
+       enum DisplayType {
+               DisplayAnalog = 0,
+               DisplayConverted = 1,
+               DisplayBoth = 2
+       };
+
 public:
        AnalogSignal(pv::Session &session, shared_ptr<data::SignalBase> base);
 
@@ -122,6 +128,13 @@ private:
                int y, int left, const int64_t start, const int64_t end,
                const double pixels_offset, const double samples_per_pixel);
 
+       void paint_logic_mid(QPainter &p, const ViewItemPaintParams &pp);
+
+       void paint_logic_caps(QPainter &p, QLineF *const lines,
+               vector< pair<int64_t, bool> > &edges,
+               bool level, double samples_per_pixel, double pixels_offset,
+               float x_offset, float y_offset);
+
        /**
         * Computes the scale factor from the scale index and vdiv settings.
         */
@@ -129,6 +142,8 @@ private:
 
        void update_scale();
 
+       void update_conversion_type();
+
        void perform_autoranging(bool force_update = false);
 
 protected:
@@ -144,8 +159,12 @@ private Q_SLOTS:
 
        void on_autoranging_changed(int state);
 
+       void on_conversion_changed(int index);
+
+       void on_display_type_changed(int index);
+
 private:
-       QComboBox *resolution_cb_;
+       QComboBox *resolution_cb_, *conversion_cb_, *display_type_cb_;
 
        float scale_;
        int scale_index_;
@@ -155,6 +174,8 @@ private:
        int pos_vdivs_, neg_vdivs_;  // divs per positive/negative side
        float resolution_; // e.g. 10 for 10 V/div
 
+       data::SignalBase::ConversionType conversion_type_;
+       DisplayType display_type_;
        bool autoranging_;
 };