X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdata%2Flogic.cpp;h=d13cd766cc69f9eabfed4930ab6c4550ce9a7808;hb=54c9f681a95aec6e746b9e5e567a2220ee8322b7;hp=4d2254428dee22f44a9ca1bd1efd5a8d25103458;hpb=be73bdfa788fcc62bda3187cb1ba04fed2b9d721;p=pulseview.git diff --git a/pv/data/logic.cpp b/pv/data/logic.cpp index 4d225442..d13cd766 100644 --- a/pv/data/logic.cpp +++ b/pv/data/logic.cpp @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "logic.h" #include "logicsnapshot.h" @@ -27,8 +29,8 @@ using namespace std; namespace pv { namespace data { -Logic::Logic(unsigned int num_probes, uint64_t samplerate) : - SignalData(samplerate), +Logic::Logic(unsigned int num_probes) : + SignalData(), _num_probes(num_probes) { assert(_num_probes > 0); @@ -50,5 +52,20 @@ deque< shared_ptr >& Logic::get_snapshots() return _snapshots; } +void Logic::clear() +{ + _snapshots.clear(); +} + +uint64_t Logic::get_max_sample_count() const +{ + uint64_t l = 0; + BOOST_FOREACH(boost::shared_ptr s, _snapshots) { + assert(s); + l = max(l, s->get_sample_count()); + } + return l; +} + } // namespace data } // namespace pv