update_signals();
// Add all other signals
- unordered_set< shared_ptr<data::SignalBase> > view_signalbases = view->signalbases();
+ vector< shared_ptr<data::SignalBase> > view_signalbases = view->signalbases();
for (const shared_ptr<data::SignalBase>& signalbase : signalbases_) {
const int sb_exists = count_if(
qobject_cast<views::trace::View*>(viewbase.get());
if (trace_view) {
- unordered_set< shared_ptr<Signal> > prev_sigs(trace_view->signals());
+ vector< shared_ptr<Signal> > prev_sigs(trace_view->signals());
trace_view->clear_signals();
for (auto channel : sr_dev->channels()) {
return session_;
}
-unordered_set< shared_ptr<Signal> > View::signals() const
+vector< shared_ptr<Signal> > View::signals() const
{
return signals_;
}
void View::add_signal(const shared_ptr<Signal> signal)
{
ViewBase::add_signalbase(signal->base());
- signals_.insert(signal);
+ signals_.push_back(signal);
signal->set_segment_display_mode(segment_display_mode_);
signal->set_current_segment(current_segment_);
viewport_->update();
}
-set< shared_ptr<SignalData> > View::get_visible_data() const
+vector< shared_ptr<SignalData> > View::get_visible_data() const
{
// Make a set of all the visible data objects
- set< shared_ptr<SignalData> > visible_data;
+ vector< shared_ptr<SignalData> > visible_data;
for (const shared_ptr<Signal>& sig : signals_)
if (sig->enabled())
- visible_data.insert(sig->data());
+ visible_data.push_back(sig->data());
return visible_data;
}
pair<Timestamp, Timestamp> View::get_time_extents() const
{
boost::optional<Timestamp> left_time, right_time;
- const set< shared_ptr<SignalData> > visible_data = get_visible_data();
- for (const shared_ptr<SignalData>& d : visible_data) {
+
+ vector< shared_ptr<SignalData> > data;
+ if (signals_.size() == 0)
+ return make_pair(0, 0);
+
+ data.push_back(signals_.front()->data());
+
+ for (const shared_ptr<SignalData>& d : data) {
const vector< shared_ptr<Segment> > segments = d->segments();
for (const shared_ptr<Segment>& s : segments) {
double samplerate = s->samplerate();
/**
* Returns the signals contained in this view.
*/
- unordered_set< shared_ptr<Signal> > signals() const;
+ vector< shared_ptr<Signal> > signals() const;
shared_ptr<Signal> get_signal_by_signalbase(shared_ptr<data::SignalBase> base) const;
*/
void set_scale_offset(double scale, const pv::util::Timestamp& offset);
- set< shared_ptr<pv::data::SignalData> > get_visible_data() const;
+ vector< shared_ptr<pv::data::SignalData> > get_visible_data() const;
pair<pv::util::Timestamp, pv::util::Timestamp> get_time_extents() const;
QShortcut *grab_ruler_left_shortcut_, *grab_ruler_right_shortcut_;
QShortcut *cancel_grab_shortcut_;
- unordered_set< shared_ptr<Signal> > signals_;
+ vector< shared_ptr<Signal> > signals_;
#ifdef ENABLE_DECODE
vector< shared_ptr<DecodeTrace> > decode_traces_;
clear_signalbases();
}
-unordered_set< shared_ptr<data::SignalBase> > ViewBase::signalbases() const
+vector< shared_ptr<data::SignalBase> > ViewBase::signalbases() const
{
return signalbases_;
}
void ViewBase::add_signalbase(const shared_ptr<data::SignalBase> signalbase)
{
- signalbases_.insert(signalbase);
+ signalbases_.push_back(signalbase);
connect(signalbase.get(), SIGNAL(samples_cleared()),
this, SLOT(on_data_updated()));
void ViewBase::add_decode_signal(shared_ptr<data::DecodeSignal> signal)
{
- decode_signals_.insert(signal);
+ decode_signals_.push_back(signal);
}
void ViewBase::remove_decode_signal(shared_ptr<data::DecodeSignal> signal)
{
- decode_signals_.erase(signal);
+ decode_signals_.erase(std::remove_if(
+ decode_signals_.begin(), decode_signals_.end(),
+ [&](shared_ptr<data::DecodeSignal> s) { return s == signal; }),
+ decode_signals_.end());
}
#endif
#endif
using std::shared_ptr;
-using std::unordered_set;
+using std::vector;
namespace pv {
/**
* Returns the signal bases contained in this view.
*/
- unordered_set< shared_ptr<data::SignalBase> > signalbases() const;
+ vector< shared_ptr<data::SignalBase> > signalbases() const;
virtual void clear_signalbases();
util::TimeUnit time_unit_;
- unordered_set< shared_ptr<data::SignalBase> > signalbases_;
+ vector< shared_ptr<data::SignalBase> > signalbases_;
#ifdef ENABLE_DECODE
- unordered_set< shared_ptr<data::DecodeSignal> > decode_signals_;
+ vector< shared_ptr<data::DecodeSignal> > decode_signals_;
#endif
/// The ID of the currently displayed segment