X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdata%2Fanalog.hpp;h=630dc9db435bf36617aca313d220de8126a4ebdf;hb=36e62b1700d580adde53c8f4489037f0071fa6a0;hp=c0c6bd6f07d82ca2b20ddb7db2e15b83c2110b62;hpb=1df18f6b6d20abd3f1ede94325b6781bf5038ea9;p=pulseview.git diff --git a/pv/data/analog.hpp b/pv/data/analog.hpp index c0c6bd6f..630dc9db 100644 --- a/pv/data/analog.hpp +++ b/pv/data/analog.hpp @@ -14,43 +14,76 @@ * 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_ANALOG_H -#define PULSEVIEW_PV_DATA_ANALOG_H +#ifndef PULSEVIEW_PV_DATA_ANALOG_HPP +#define PULSEVIEW_PV_DATA_ANALOG_HPP #include "signaldata.hpp" #include #include +#include +#include "pv/data/segment.hpp" + +using std::deque; +using std::shared_ptr; +using std::vector; + namespace pv { namespace data { -class AnalogSnapshot; +class AnalogSegment; class Analog : public SignalData { + Q_OBJECT + public: Analog(); - void push_snapshot( - std::shared_ptr &snapshot); + void push_segment(shared_ptr &segment); + + const deque< shared_ptr >& analog_segments() const; - const std::deque< std::shared_ptr >& - analog_snapshots() const; + vector< shared_ptr > segments() const; + + uint32_t get_segment_count() const; void clear(); - uint64_t get_max_sample_count() const; + 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); + + void notify_min_max_changed(float min, float max); + +Q_SIGNALS: + void samples_cleared(); + + void samples_added(SharedPtrToSegment segment, uint64_t start_sample, + uint64_t end_sample); + + void min_max_changed(float min, float max); + + void segment_completed(); + +private Q_SLOTS: + void on_segment_completed(); private: - std::deque< std::shared_ptr > snapshots_; + double samplerate_; + deque< shared_ptr > segments_; }; } // namespace data } // namespace pv -#endif // PULSEVIEW_PV_DATA_ANALOG_H +#endif // PULSEVIEW_PV_DATA_ANALOG_HPP