#include <extdef.h>
-#include <math.h>
+#include <cassert>
+#include <cmath>
#include "analogsignal.h"
#include "pv/data/analog.h"
#include "pv/data/analogsnapshot.h"
#include "pv/view/view.h"
-using boost::shared_ptr;
using std::max;
using std::min;
+using std::shared_ptr;
using std::deque;
namespace pv {
const float AnalogSignal::EnvelopeThreshold = 256.0f;
-AnalogSignal::AnalogSignal(shared_ptr<pv::DevInst> dev_inst,
- const sr_probe *const probe, shared_ptr<data::Analog> data) :
- Signal(dev_inst, probe),
+AnalogSignal::AnalogSignal(shared_ptr<pv::device::DevInst> dev_inst,
+ const sr_channel *const channel, shared_ptr<data::Analog> data) :
+ Signal(dev_inst, channel),
_data(data),
_scale(1.0f)
{
- _colour = SignalColours[probe->index % countof(SignalColours)];
+ _colour = SignalColours[channel->index % countof(SignalColours)];
}
AnalogSignal::~AnalogSignal()
void AnalogSignal::paint_back(QPainter &p, int left, int right)
{
- if (_probe->enabled)
+ if (_channel->enabled)
paint_axis(p, get_y(), left, right);
}
const double offset = _view->offset();
- if (!_probe->enabled)
+ if (!_channel->enabled)
return;
const deque< shared_ptr<pv::data::AnalogSnapshot> > &snapshots =