X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fanalogsignal.cpp;h=250fb94e9bc6623c6720a581721662798cdb571c;hp=eaa25bccc947dac826d5bddf2eff50ec2fcdd325;hb=a5d93c27b5bd6b95000e29c6cddac56ab254b289;hpb=dc747705ac06c9e9ab582b6b8b7cfc31003128e0 diff --git a/pv/view/analogsignal.cpp b/pv/view/analogsignal.cpp index eaa25bcc..250fb94e 100644 --- a/pv/view/analogsignal.cpp +++ b/pv/view/analogsignal.cpp @@ -31,6 +31,7 @@ #include using std::max; +using std::make_pair; using std::min; using std::shared_ptr; using std::deque; @@ -40,6 +41,8 @@ using sigrok::Channel; namespace pv { namespace view { +const int AnalogSignal::NominalHeight = 80; + const QColor AnalogSignal::SignalColours[4] = { QColor(0xC4, 0xA0, 0x00), // Yellow QColor(0x87, 0x20, 0x7A), // Magenta @@ -79,6 +82,11 @@ void AnalogSignal::set_scale(float scale) _scale = scale; } +std::pair AnalogSignal::v_extents() const +{ + return make_pair(-NominalHeight / 2, NominalHeight / 2); +} + void AnalogSignal::paint_back(QPainter &p, int left, int right) { if (_channel->enabled())