MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / nav_table_view

Method nav_table_view

DSView/pv/dock/protocoldock.cpp:619–659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

617}
618
619void ProtocolDock::nav_table_view()
620{
621 uint64_t row_index = 0;
622 pv::data::DecoderModel *decoder_model = _session->get_decoder_model();
623
624 auto decoder_stack = decoder_model->getDecoderStack();
625 if (decoder_stack) {
626 uint64_t offset = _view.offset() * (decoder_stack->samplerate() * _view.scale());
627 std::map<const pv::data::decode::Row, bool> rows = decoder_stack->get_rows_lshow();
628 int column = _model_proxy.filterKeyColumn();
629 for (std::map<const pv::data::decode::Row, bool>::const_iterator i = rows.begin();
630 i != rows.end(); i++) {
631 if ((*i).second && column-- == 0) {
632 row_index = decoder_stack->get_annotation_index((*i).first, offset);
633 break;
634 }
635 }
636 QModelIndex index = _model_proxy.mapToSource(_model_proxy.index(row_index, _model_proxy.filterKeyColumn()));
637
638 if(index.isValid()){
639
640 pv::data::decode::Annotation ann;
641
642 if (decoder_stack->list_annotation(&ann, index.column(), index.row()))
643 {
644 _table_view->scrollTo(index);
645 _table_view->setCurrentIndex(index);
646
647 const auto &decode_sigs = _session->get_decode_signals();
648
649 for(auto d : decode_sigs) {
650 d->decoder()->set_mark_index(-1);
651 }
652
653 decoder_stack->set_mark_index((ann.start_sample()+ann.end_sample())/2);
654 _view.set_all_update(true);
655 _view.update();
656 }
657 }
658 }
659}
660
661void ProtocolDock::search_pre()
662{

Callers

nothing calls this directly

Calls 15

get_decoder_modelMethod · 0.80
getDecoderStackMethod · 0.80
offsetMethod · 0.80
scaleMethod · 0.80
get_rows_lshowMethod · 0.80
indexMethod · 0.80
list_annotationMethod · 0.80
rowMethod · 0.80
set_mark_indexMethod · 0.80
start_sampleMethod · 0.80
end_sampleMethod · 0.80
set_all_updateMethod · 0.80

Tested by

no test coverage detected