| 369 | } |
| 370 | |
| 371 | void View::get_traces(int type, std::vector<Trace*> &traces) |
| 372 | { |
| 373 | assert(_session); |
| 374 | |
| 375 | auto &sigs = _session->get_signals(); |
| 376 | |
| 377 | const auto &decode_sigs = _session->get_decode_signals(); |
| 378 | |
| 379 | const auto &spectrums = _session->get_spectrum_traces(); |
| 380 | |
| 381 | for(auto t : sigs) { |
| 382 | if (type == ALL_VIEW || _trace_view_map[t->get_type()] == type) |
| 383 | traces.push_back(t); |
| 384 | } |
| 385 | |
| 386 | for(auto t : decode_sigs) { |
| 387 | if (type == ALL_VIEW || _trace_view_map[t->get_type()] == type) |
| 388 | traces.push_back(t); |
| 389 | } |
| 390 | |
| 391 | for(auto t : spectrums) { |
| 392 | if (type == ALL_VIEW || _trace_view_map[t->get_type()] == type) |
| 393 | traces.push_back(t); |
| 394 | } |
| 395 | |
| 396 | auto lissajous = _session->get_lissajous_trace(); |
| 397 | if (lissajous && lissajous->enabled() && |
| 398 | (type == ALL_VIEW || _trace_view_map[lissajous->get_type()] == type)){ |
| 399 | traces.push_back(lissajous); |
| 400 | } |
| 401 | |
| 402 | auto math = _session->get_math_trace(); |
| 403 | if (math && math->enabled() && |
| 404 | (type == ALL_VIEW || _trace_view_map[math->get_type()] == type)){ |
| 405 | traces.push_back(math); |
| 406 | } |
| 407 | |
| 408 | sort(traces.begin(), traces.end(), compare_trace_v_offsets); |
| 409 | } |
| 410 | |
| 411 | bool View::compare_trace_v_offsets(const Trace *a, const Trace *b) |
| 412 | { |
no test coverage detected