| 327 | } |
| 328 | |
| 329 | void DecoderOptionsDlg::update_decode_range() |
| 330 | { |
| 331 | const uint64_t last_samples = AppControl::Instance()->GetSession()->cur_samplelimits() - 1; |
| 332 | const int index1 = _start_comboBox->currentIndex(); |
| 333 | const int index2 = _end_comboBox->currentIndex(); |
| 334 | uint64_t decode_start, decode_end; |
| 335 | |
| 336 | auto view = _trace->get_view(); |
| 337 | |
| 338 | if (index1 == 0) { |
| 339 | decode_start = 0; |
| 340 | _cursor1 = 0; |
| 341 | |
| 342 | } else { |
| 343 | _cursor1 = _start_comboBox->itemData(index1).toULongLong(); |
| 344 | int cusrsor_index = view->get_cursor_index_by_key(_cursor1); |
| 345 | if (cusrsor_index != -1){ |
| 346 | decode_start = view->get_cursor_samples(cusrsor_index); |
| 347 | } |
| 348 | else{ |
| 349 | decode_start = 0; |
| 350 | _cursor1 = 0; |
| 351 | } |
| 352 | } |
| 353 | |
| 354 | if (index2 == 0) { |
| 355 | decode_end = last_samples; |
| 356 | _cursor2 = 0; |
| 357 | |
| 358 | } else { |
| 359 | _cursor2 = _end_comboBox->itemData(index2).toULongLong(); |
| 360 | int cusrsor_index = view->get_cursor_index_by_key(_cursor2); |
| 361 | if (cusrsor_index != -1){ |
| 362 | decode_end = view->get_cursor_samples(cusrsor_index); |
| 363 | } |
| 364 | else{ |
| 365 | decode_end = last_samples; |
| 366 | _cursor2 = 0; |
| 367 | } |
| 368 | } |
| 369 | |
| 370 | if (decode_start > last_samples) |
| 371 | decode_start = 0; |
| 372 | if (decode_end > last_samples) |
| 373 | decode_end = last_samples; |
| 374 | |
| 375 | if (decode_start > decode_end) { |
| 376 | uint64_t tmp = decode_start; |
| 377 | decode_start = decode_end; |
| 378 | decode_end = tmp; |
| 379 | } |
| 380 | |
| 381 | for(auto dec : _trace->decoder()->stack()) { |
| 382 | dec->set_decode_region(decode_start, decode_end); |
| 383 | } |
| 384 | } |
| 385 | |
| 386 |
nothing calls this directly
no test coverage detected