using std::deque;
using std::max;
+using std::make_pair;
using std::min;
using std::pair;
using std::shared_ptr;
namespace pv {
namespace view {
+const int LogicSignal::SignalHeight = 30;
+const int LogicSignal::SignalMargin = 10;
+
const float LogicSignal::Oversampling = 2.0f;
const QColor LogicSignal::EdgeColour(0x80, 0x80, 0x80);
return _data;
}
+std::pair<int, int> LogicSignal::v_extents() const
+{
+ return make_pair(-SignalHeight - SignalMargin, SignalMargin);
+}
+
void LogicSignal::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 LogicSignal::paint_mid(QPainter &p, int left, int right)
assert(_channel);
assert(_data);
assert(right >= left);
+ assert(_owner);
+
+ const int y = get_visual_y();
- assert(_view);
- const int y = _v_offset - _view->v_offset();
+ 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;
- const float high_offset = y - View::SignalHeight + 0.5f;
+ const float high_offset = y - SignalHeight + 0.5f;
const float low_offset = y + 0.5f;
const deque< shared_ptr<pv::data::LogicSnapshot> > &snapshots =