#include "signal.h"
-#include <boost/shared_ptr.hpp>
+#include <memory>
namespace pv {
class AnalogSignal : public Signal
{
private:
+ static const int NominalHeight;
static const QColor SignalColours[4];
static const float EnvelopeThreshold;
public:
AnalogSignal(pv::SigSession &session,
- boost::shared_ptr<pv::DevInst> dev_inst, sr_probe *const probe,
- boost::shared_ptr<pv::data::Analog> data);
+ std::shared_ptr<sigrok::Channel> channel,
+ std::shared_ptr<pv::data::Analog> data);
virtual ~AnalogSignal();
- boost::shared_ptr<pv::data::SignalData> data() const;
+ std::shared_ptr<pv::data::SignalData> data() const;
- boost::shared_ptr<pv::data::Analog> analog_data() const;
+ std::shared_ptr<pv::data::Analog> analog_data() const;
void set_scale(float scale);
+ /**
+ * Computes the vertical extents of the contents of this row item.
+ * @return A pair containing the minimum and maximum y-values.
+ */
+ std::pair<int, int> v_extents() const;
+
/**
* Paints the background layer of the signal with a QPainter
* @param p the QPainter to paint into.
private:
void paint_trace(QPainter &p,
- const boost::shared_ptr<pv::data::AnalogSnapshot> &snapshot,
+ const std::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,
+ const std::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;
+ std::shared_ptr<pv::data::Analog> _data;
float _scale;
};