X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Flogic.hpp;h=e0fb7dd14dd05dab2dc93451d999350f0d6dd60f;hp=d57df0cfe9e03020eed10a36e6fc6db34c11c6a5;hb=eeceee9955e7db4ac777d49d1b7a766069476b08;hpb=99503171d4f32570829df171521b4b9cbccb0503 diff --git a/pv/data/logic.hpp b/pv/data/logic.hpp index d57df0cf..e0fb7dd1 100644 --- a/pv/data/logic.hpp +++ b/pv/data/logic.hpp @@ -14,47 +14,65 @@ * 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_H -#define PULSEVIEW_PV_DATA_LOGIC_H +#ifndef PULSEVIEW_PV_DATA_LOGIC_HPP +#define PULSEVIEW_PV_DATA_LOGIC_HPP #include "signaldata.hpp" #include +#include + +using std::deque; +using std::shared_ptr; +using std::vector; + namespace pv { namespace data { -class LogicSnapshot; +class LogicSegment; class Logic : public SignalData { + Q_OBJECT + public: Logic(unsigned int num_channels); - int get_num_channels() const; + unsigned int num_channels() const; + + void push_segment(shared_ptr &segment); - void push_snapshot( - std::shared_ptr &snapshot); + const deque< shared_ptr >& logic_segments() const; - const std::deque< std::shared_ptr >& - logic_snapshots() const; + vector< shared_ptr > segments() const; - std::vector< std::shared_ptr > snapshots() const; + uint32_t get_segment_count() const; void clear(); - uint64_t get_max_sample_count() const; + double get_samplerate() const; + + uint64_t max_sample_count() const; + + void notify_samples_added(QObject* segment, uint64_t start_sample, + uint64_t end_sample); + +Q_SIGNALS: + void samples_cleared(); + + void samples_added(QObject* segment, uint64_t start_sample, + uint64_t end_sample); private: const unsigned int num_channels_; - std::deque< std::shared_ptr > snapshots_; + deque< shared_ptr > segments_; }; } // namespace data } // namespace pv -#endif // PULSEVIEW_PV_DATA_LOGIC_H +#endif // PULSEVIEW_PV_DATA_LOGIC_HPP