X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Flogic.hpp;h=07f8222c1946cc699828c6ac3cdc6c3d761eb67d;hp=e7f7a055da3db150f12f8365edf16af3b7aec59c;hb=HEAD;hpb=7db61e770abd2d1c7eb326a09e35cd4266664c1d diff --git a/pv/data/logic.hpp b/pv/data/logic.hpp index e7f7a055..07f8222c 100644 --- a/pv/data/logic.hpp +++ b/pv/data/logic.hpp @@ -21,17 +21,22 @@ #define PULSEVIEW_PV_DATA_LOGIC_HPP #include "signaldata.hpp" +#include "segment.hpp" #include #include +using std::deque; +using std::shared_ptr; +using std::vector; + namespace pv { namespace data { class LogicSegment; -class Logic : public QObject, public SignalData +class Logic : public SignalData { Q_OBJECT @@ -40,30 +45,39 @@ public: unsigned int num_channels() const; - void push_segment( - std::shared_ptr &segment); + void push_segment(shared_ptr &segment); + + const deque< shared_ptr >& logic_segments() const; + deque< shared_ptr >& logic_segments(); - const std::deque< std::shared_ptr >& - logic_segments() const; + vector< shared_ptr > segments() const; - std::vector< std::shared_ptr > segments() const; + uint32_t get_segment_count() const; void clear(); + void set_samplerate(double value); + + double get_samplerate() const; + uint64_t max_sample_count() const; - void notify_samples_added(QObject* segment, uint64_t start_sample, + void notify_samples_added(shared_ptr segment, uint64_t start_sample, uint64_t end_sample); Q_SIGNALS: void samples_cleared(); - void samples_added(QObject* segment, uint64_t start_sample, + void samples_added(SharedPtrToSegment segment, uint64_t start_sample, uint64_t end_sample); +private Q_SLOTS: + void on_segment_completed(); + private: + double samplerate_; const unsigned int num_channels_; - std::deque< std::shared_ptr > segments_; + deque< shared_ptr > segments_; }; } // namespace data