MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / update_edge

Method update_edge

DSView/pv/dock/measuredock.cpp:681–735  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

679}
680
681void MeasureDock::update_edge()
682{
683 auto &cursor_list = _view.get_cursorList();
684 auto mode_rows = get_mode_rows();
685
686 for (auto &inf : mode_rows->_edge_row_list)
687 {
688 if (inf.start_bt == NULL)
689 break;
690
691 if (inf.cursor1 != -1) {
692 if (inf.cursor1 > (int)cursor_list.size()) {
693 inf.start_bt->setText("");
694 set_cursor_btn_color(inf.start_bt);
695 inf.cursor1 = -1;
696 }
697 }
698 if (inf.cursor2 != -1) {
699 if (inf.cursor2 > (int)cursor_list.size()) {
700 inf.end_bt->setText("");
701 set_cursor_btn_color(inf.end_bt);
702 inf.cursor2 = -1;
703 }
704 }
705
706 bool mValid = false;
707 if (inf.cursor1 != -1 && inf.cursor2 != -1) {
708 uint64_t rising_edges;
709 uint64_t falling_edges;
710
711 for(auto s : _session->get_signals()) {
712 if (s->signal_type() == SR_CHANNEL_LOGIC
713 && s->enabled()
714 && s->get_index() == inf.box->currentText().toInt())
715 {
716 view::LogicSignal *logicSig = (view::LogicSignal*)s;
717
718 if (logicSig->edges(_view.get_cursor_samples(inf.cursor2-1),
719 _view.get_cursor_samples(inf.cursor1-1), rising_edges, falling_edges))
720 {
721 QString delta_text = QString::number(rising_edges) + "/" +
722 QString::number(falling_edges) + "/" +
723 QString::number(rising_edges + falling_edges);
724 inf.r_label->setText(delta_text);
725 mValid = true;
726 break;
727 }
728 }
729 }
730 }
731
732 if (!mValid)
733 inf.r_label->setText("-/-/-");
734 }
735}
736
737void MeasureDock::update_cursor_info()
738{

Callers

nothing calls this directly

Calls 6

sizeMethod · 0.80
signal_typeMethod · 0.80
edgesMethod · 0.80
get_cursor_samplesMethod · 0.80
enabledMethod · 0.45
get_indexMethod · 0.45

Tested by

no test coverage detected