X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fviews%2Fviewbase.cpp;h=8311f122faa54e253b62bc11aca652d196b7c1ec;hp=30fd7cec7a59fddcf80ae729614cbe4f67161a9d;hb=4a07615736968fc8d635c8d187b8a5d6b8a0e2eb;hpb=4e86ec7042631d4b54876cba89c01a73abaf7213 diff --git a/pv/views/viewbase.cpp b/pv/views/viewbase.cpp index 30fd7cec..8311f122 100644 --- a/pv/views/viewbase.cpp +++ b/pv/views/viewbase.cpp @@ -26,6 +26,7 @@ #include "pv/session.hpp" #include "pv/util.hpp" +#include "pv/data/segment.hpp" using std::shared_ptr; @@ -36,7 +37,9 @@ const int ViewBase::MaxViewAutoUpdateRate = 25; // No more than 25 Hz ViewBase::ViewBase(Session &session, bool is_main_view, QWidget *parent) : session_(session), - is_main_view_(is_main_view) + is_main_view_(is_main_view), + ruler_shift_(0), + current_segment_(0) { (void)parent; @@ -78,7 +81,7 @@ void ViewBase::clear_signalbases() disconnect(signalbase.get(), SIGNAL(samples_cleared()), this, SLOT(on_data_updated())); disconnect(signalbase.get(), SIGNAL(samples_added(QObject*, uint64_t, uint64_t)), - this, SLOT(on_data_updated())); + this, SLOT(on_samples_added(QObject*, uint64_t, uint64_t))); } signalbases_.clear(); @@ -91,7 +94,7 @@ void ViewBase::add_signalbase(const shared_ptr signalbase) connect(signalbase.get(), SIGNAL(samples_cleared()), this, SLOT(on_data_updated())); connect(signalbase.get(), SIGNAL(samples_added(QObject*, uint64_t, uint64_t)), - this, SLOT(on_data_updated())); + this, SLOT(on_samples_added(QObject*, uint64_t, uint64_t))); } #ifdef ENABLE_DECODE @@ -134,6 +137,11 @@ void ViewBase::on_new_segment(int new_segment_id) (void)new_segment_id; } +void ViewBase::on_segment_completed(int new_segment_id) +{ + (void)new_segment_id; +} + void ViewBase::capture_state_updated(int state) { (void)state; @@ -143,6 +151,21 @@ void ViewBase::perform_delayed_view_update() { } +void ViewBase::on_samples_added(QObject* segment, uint64_t start_sample, + uint64_t end_sample) +{ + (void)start_sample; + (void)end_sample; + + data::Segment* s = qobject_cast(segment); + + if (s->segment_id() != current_segment_) + return; + + if (!delayed_view_updater_.isActive()) + delayed_view_updater_.start(); +} + void ViewBase::on_data_updated() { if (!delayed_view_updater_.isActive())