#include <libsigrok/libsigrok.hpp>
using std::max;
+using std::make_pair;
using std::min;
using std::shared_ptr;
using std::deque;
namespace pv {
namespace view {
+const int AnalogSignal::NominalHeight = 80;
+
const QColor AnalogSignal::SignalColours[4] = {
QColor(0xC4, 0xA0, 0x00), // Yellow
QColor(0x87, 0x20, 0x7A), // Magenta
_scale = scale;
}
+std::pair<int, int> AnalogSignal::v_extents() const
+{
+ return make_pair(-NominalHeight / 2, NominalHeight / 2);
+}
+
void AnalogSignal::paint_back(QPainter &p, int left, int right)
{
if (_channel->enabled())
- paint_axis(p, get_y(), left, right);
+ paint_axis(p, get_visual_y(), left, right);
}
void AnalogSignal::paint_mid(QPainter &p, int left, int right)
{
assert(_data);
assert(right >= left);
+ assert(_owner);
+
+ const int y = get_visual_y();
- const int y = get_y();
+ const View *const view = _owner->view();
+ assert(view);
- const double scale = _view->scale();
+ const double scale = view->scale();
assert(scale > 0);
- const double offset = _view->offset();
+ const double offset = view->offset();
if (!_channel->enabled())
return;