summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
85a7028)
Use case is as follows:
- Capture 20+ segments with ~500kS each
- Afterwards, enable conversion for a channel
Without this change, the converted logic will be repainted
20++ times because we are only told that new samples were
added but not which segment.
With this change, the logic trace is only painted when we
see that samples were added to the segment we're showing.
float* value;
} SegmentAnalogDataIterator;
float* value;
} SegmentAnalogDataIterator;
-class AnalogSegment : public QObject, public Segment
+class AnalogSegment : public Segment
uint8_t* value;
} SegmentLogicDataIterator;
uint8_t* value;
} SegmentLogicDataIterator;
-class LogicSegment : public QObject, public Segment
+class LogicSegment : public Segment
#include <thread>
#include <vector>
#include <thread>
#include <vector>
using std::recursive_mutex;
using std::vector;
using std::recursive_mutex;
using std::vector;
uint8_t* value;
} SegmentRawDataIterator;
uint8_t* value;
} SegmentRawDataIterator;
+class Segment : public QObject
private:
static const uint64_t MaxChunkSize;
private:
static const uint64_t MaxChunkSize;
vector< shared_ptr<DecodeTrace> > decode_traces_;
#endif
vector< shared_ptr<DecodeTrace> > decode_traces_;
#endif
- /// The ID of the currently displayed segment
- int current_segment_;
Trace::SegmentDisplayMode segment_display_mode_;
/// Signals whether the user can change the currently shown segment.
Trace::SegmentDisplayMode segment_display_mode_;
/// Signals whether the user can change the currently shown segment.
#include "pv/session.hpp"
#include "pv/util.hpp"
#include "pv/session.hpp"
#include "pv/util.hpp"
+#include "pv/data/segment.hpp"
ViewBase::ViewBase(Session &session, bool is_main_view, QWidget *parent) :
session_(session),
ViewBase::ViewBase(Session &session, bool is_main_view, QWidget *parent) :
session_(session),
- is_main_view_(is_main_view)
+ is_main_view_(is_main_view),
+ current_segment_(0)
disconnect(signalbase.get(), SIGNAL(samples_cleared()),
this, SLOT(on_data_updated()));
disconnect(signalbase.get(), SIGNAL(samples_added(QObject*, uint64_t, uint64_t)),
disconnect(signalbase.get(), SIGNAL(samples_cleared()),
this, SLOT(on_data_updated()));
disconnect(signalbase.get(), SIGNAL(samples_added(QObject*, uint64_t, uint64_t)),
- this, SLOT(on_data_updated()));
+ this, SLOT(on_samples_added(QObject*, uint64_t, uint64_t)));
connect(signalbase.get(), SIGNAL(samples_cleared()),
this, SLOT(on_data_updated()));
connect(signalbase.get(), SIGNAL(samples_added(QObject*, uint64_t, uint64_t)),
connect(signalbase.get(), SIGNAL(samples_cleared()),
this, SLOT(on_data_updated()));
connect(signalbase.get(), SIGNAL(samples_added(QObject*, uint64_t, uint64_t)),
- this, SLOT(on_data_updated()));
+ this, SLOT(on_samples_added(QObject*, uint64_t, uint64_t)));
+void ViewBase::on_samples_added(QObject* segment, uint64_t start_sample,
+ uint64_t end_sample)
+{
+ (void)start_sample;
+ (void)end_sample;
+
+ data::Segment* s = qobject_cast<data::Segment*>(segment);
+
+ if (s->segment_id() != current_segment_)
+ return;
+
+ if (!delayed_view_updater_.isActive())
+ delayed_view_updater_.start();
+}
+
void ViewBase::on_data_updated()
{
if (!delayed_view_updater_.isActive())
void ViewBase::on_data_updated()
{
if (!delayed_view_updater_.isActive())
virtual void perform_delayed_view_update();
private Q_SLOTS:
virtual void perform_delayed_view_update();
private Q_SLOTS:
+ void on_samples_added(QObject* segment, uint64_t start_sample,
+ uint64_t end_sample);
+
void on_data_updated();
protected:
void on_data_updated();
protected:
unordered_set< shared_ptr<data::SignalBase> > signalbases_;
unordered_set< shared_ptr<data::SignalBase> > signalbases_;
+ /// The ID of the currently displayed segment
+ uint32_t current_segment_;
+
QTimer delayed_view_updater_;
};
QTimer delayed_view_updater_;
};