-vector< shared_ptr<Trace> > View::get_traces() const
-{
- const vector< shared_ptr<Signal> > sigs(
- session().get_signals());
-#ifdef ENABLE_DECODE
- const vector< shared_ptr<DecodeTrace> > decode_sigs(
- session().get_decode_signals());
- vector< shared_ptr<Trace> > traces(
- sigs.size() + decode_sigs.size());
-#else
- vector< shared_ptr<Trace> > traces(sigs.size());
-#endif
-
- auto i = traces.begin();
- i = copy(sigs.begin(), sigs.end(), i);
-#ifdef ENABLE_DECODE
- i = copy(decode_sigs.begin(), decode_sigs.end(), i);
-#endif
-
- stable_sort(traces.begin(), traces.end(), compare_trace_v_offsets);
- return traces;
-}
-
-list<weak_ptr<SelectableItem> > View::selected_items() const
-{
- list<weak_ptr<SelectableItem> > items;
-
- // List the selected signals
- const vector< shared_ptr<Trace> > traces(get_traces());
- for (shared_ptr<Trace> t : traces) {
- assert(t);
- if (t->selected())
- items.push_back(t);
- }
-
- // List the selected cursors
- if (_cursors.first()->selected())
- items.push_back(_cursors.first());
- if (_cursors.second()->selected())
- items.push_back(_cursors.second());
-
- return items;
-}
-