]> sigrok.org Git - pulseview.git/blobdiff - pv/view/analogsignal.h
Added analog envelope painting
[pulseview.git] / pv / view / analogsignal.h
index 86471537abce44236291664b98a1e74084cc187d..ce1dff105041a77934355f302e5a80168f1cdbff 100644 (file)
@@ -29,15 +29,23 @@ namespace pv {
 
 namespace data {
 class Analog;
+class AnalogSnapshot;
 }
 
 namespace view {
 
 class AnalogSignal : public Signal
 {
+private:
+       static const QColor SignalColours[4];
+
+       static const float EnvelopeThreshold;
+
 public:
        AnalogSignal(QString name,
-               boost::shared_ptr<pv::data::Analog> data);
+               boost::shared_ptr<pv::data::Analog> data, int probe_index);
+
+       void set_scale(float scale);
 
        /**
         * Paints the signal with a QPainter
@@ -52,8 +60,20 @@ public:
        void paint(QPainter &p, int y, int left, int right, double scale,
                double offset);
 
+private:
+       void paint_trace(QPainter &p,
+               const boost::shared_ptr<pv::data::AnalogSnapshot> &snapshot,
+               int y, int left, const int64_t start, const int64_t end,
+               const double pixels_offset, const double samples_per_pixel);
+
+       void paint_envelope(QPainter &p,
+               const boost::shared_ptr<pv::data::AnalogSnapshot> &snapshot,
+               int y, int left, const int64_t start, const int64_t end,
+               const double pixels_offset, const double samples_per_pixel);
+
 private:
        boost::shared_ptr<pv::data::Analog> _data;
+       float _scale;
 };
 
 } // namespace view