qRegisterMetaType<uint64_t>("uint64_t");
qRegisterMetaType<pv::util::Timestamp>("util::Timestamp");
- qRegisterMetaType<pv::data::Segment>("data::Segment");
+ qRegisterMetaType<SharedPtrToSegment>("SharedPtrToSegment");
// Prepare the global settings since logging needs them early on
pv::GlobalSettings settings;
#define PULSEVIEW_PV_DATA_LOGIC_HPP
#include "signaldata.hpp"
+#include "segment.hpp"
#include <deque>
Q_SIGNALS:
void samples_cleared();
- void samples_added(shared_ptr<Segment> segment, uint64_t start_sample,
+ void samples_added(SharedPtrToSegment segment, uint64_t start_sample,
uint64_t end_sample);
private:
append_payload_to_mipmap();
if (sample_count > 1)
- owner_.notify_samples_added(shared_ptr<Segment>(shared_from_this()),
+ owner_.notify_samples_added(SharedPtrToSegment(shared_from_this()),
prev_sample_count + 1, prev_sample_count + 1 + sample_count);
else
- owner_.notify_samples_added(shared_ptr<Segment>(shared_from_this()),
+ owner_.notify_samples_added(SharedPtrToSegment(shared_from_this()),
prev_sample_count + 1, prev_sample_count + 1);
}
} // namespace data
} // namespace pv
-Q_DECLARE_METATYPE(pv::data::Segment);
+typedef std::shared_ptr<pv::data::Segment> SharedPtrToSegment;
+
+Q_DECLARE_METATYPE(SharedPtrToSegment);
#endif // PULSEVIEW_PV_DATA_SEGMENT_HPP
if (data_) {
connect(data.get(), SIGNAL(samples_cleared()),
this, SLOT(on_samples_cleared()));
- connect(data.get(), SIGNAL(samples_added(shared_ptr<Segment>, uint64_t, uint64_t)),
- this, SLOT(on_samples_added(shared_ptr<Segment>, uint64_t, uint64_t)));
+ connect(data.get(), SIGNAL(samples_added(SharedPtrToSegment, uint64_t, uint64_t)),
+ this, SLOT(on_samples_added(SharedPtrToSegment, uint64_t, uint64_t)));
if (channel_type_ == AnalogChannel) {
shared_ptr<Analog> analog = analog_data();
samples_cleared();
}
-void SignalBase::on_samples_added(shared_ptr<Segment> segment, uint64_t start_sample,
+void SignalBase::on_samples_added(SharedPtrToSegment segment, uint64_t start_sample,
uint64_t end_sample)
{
if (conversion_type_ != NoConversion) {
#include <libsigrokcxx/libsigrokcxx.hpp>
+#include "segment.hpp"
+
using std::atomic;
using std::condition_variable;
using std::map;
private Q_SLOTS:
void on_samples_cleared();
- void on_samples_added(shared_ptr<Segment> segment, uint64_t start_sample,
+ void on_samples_added(SharedPtrToSegment segment, uint64_t start_sample,
uint64_t end_sample);
void on_min_max_changed(float min, float max);