X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fview.cpp;h=28408eee39db4723497d906ae8a21b02e901427d;hp=e0c49c20ad4b2f60b4e9ea1b16c69420318321ba;hb=2496bf451ebd50b9ab67a1af9b979761c0fbad49;hpb=ff008de665c7990d5f3408f918ff090d8e6c60b2 diff --git a/pv/view/view.cpp b/pv/view/view.cpp index e0c49c20..28408eee 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -50,14 +50,14 @@ #include "pv/session.hpp" #include "pv/data/logic.hpp" -#include "pv/data/logicsnapshot.hpp" +#include "pv/data/logicsegment.hpp" #include "pv/util.hpp" using boost::shared_lock; using boost::shared_mutex; using pv::data::SignalData; -using pv::data::Snapshot; +using pv::data::Segment; using pv::util::format_time; using std::back_inserter; @@ -195,6 +195,14 @@ const Viewport* View::viewport() const return viewport_; } +vector< shared_ptr > View::time_items() const +{ + vector< shared_ptr > items; + items.push_back(cursors_.first()); + items.push_back(cursors_.second()); + return items; +} + double View::scale() const { return scale_; @@ -263,9 +271,9 @@ void View::zoom_one_to_one() double samplerate = 0.0; for (const shared_ptr d : visible_data) { assert(d); - const vector< shared_ptr > snapshots = - d->snapshots(); - for (const shared_ptr &s : snapshots) + const vector< shared_ptr > segments = + d->segments(); + for (const shared_ptr &s : segments) samplerate = max(samplerate, s->samplerate()); } @@ -314,9 +322,9 @@ pair View::get_time_extents() const const set< shared_ptr > visible_data = get_visible_data(); for (const shared_ptr d : visible_data) { - const vector< shared_ptr > snapshots = - d->snapshots(); - for (const shared_ptr &s : snapshots) { + const vector< shared_ptr > segments = + d->segments(); + for (const shared_ptr &s : segments) { double samplerate = s->samplerate(); samplerate = (samplerate <= 0.0) ? 1.0 : samplerate;