X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdata%2Flogic.hpp;h=b5e532c45e9a0523d13991f39fb8c653d498eca3;hb=9431e2d3d256f3602c3637847a8ec3ad3fdcd590;hp=a597027f85f7f3d4cc310bf4ad2d5e2bb334e829;hpb=e45b13b536666034c9b6fe52a9321d749dae3c02;p=pulseview.git diff --git a/pv/data/logic.hpp b/pv/data/logic.hpp index a597027f..b5e532c4 100644 --- a/pv/data/logic.hpp +++ b/pv/data/logic.hpp @@ -14,17 +14,23 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_DATA_LOGIC_HPP #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 { @@ -32,26 +38,43 @@ class LogicSegment; class Logic : public SignalData { + Q_OBJECT + public: Logic(unsigned int num_channels); unsigned int num_channels() const; - void push_segment( - std::shared_ptr &segment); + void push_segment(shared_ptr &segment); - const std::deque< std::shared_ptr >& - logic_segments() const; + const deque< shared_ptr >& logic_segments() const; + deque< shared_ptr >& logic_segments(); - std::vector< std::shared_ptr > segments() const; + vector< 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(shared_ptr segment, uint64_t start_sample, + uint64_t end_sample); + +Q_SIGNALS: + void samples_cleared(); + + void samples_added(SharedPtrToSegment segment, uint64_t start_sample, + uint64_t end_sample); + private: + double samplerate_; const unsigned int num_channels_; - std::deque< std::shared_ptr > segments_; + deque< shared_ptr > segments_; }; } // namespace data