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

Method hori_knob

DSView/pv/toolbars/samplingbar.cpp:706–745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

704 }
705
706 double SamplingBar::hori_knob(int dir)
707 {
708 double hori_res = -1;
709
710 if (_session->get_device()->get_work_mode() != DSO){
711 assert(false);
712 }
713
714 disconnect(&_sample_count, SIGNAL(currentIndexChanged(int)), this, SLOT(on_samplecount_sel(int)));
715
716 if (0 == dir)
717 {
718 hori_res = commit_hori_res();
719 }
720 else if ((dir > 0) && (_sample_count.currentIndex() > 0))
721 {
722 set_sample_count_index(_sample_count.currentIndex() - 1);
723 hori_res = commit_hori_res();
724
725 if (_session->have_view_data() == false){
726 _session->apply_samplerate();
727 _session->broadcast_msg(DSV_MSG_DEVICE_DURATION_UPDATED);
728 }
729 }
730 else if ((dir < 0) && (_sample_count.currentIndex() < _sample_count.count() - 1))
731 {
732 set_sample_count_index(_sample_count.currentIndex() + 1);
733 hori_res = commit_hori_res();
734
735 if (_session->have_view_data() == false){
736 _session->apply_samplerate();
737 _session->broadcast_msg(DSV_MSG_DEVICE_DURATION_UPDATED);
738 }
739 }
740
741 connect(&_sample_count, SIGNAL(currentIndexChanged(int)),
742 this, SLOT(on_samplecount_sel(int)));
743
744 return hori_res;
745 }
746
747 double SamplingBar::commit_hori_res()
748 {

Callers 2

update_hori_resMethod · 0.80
zoomMethod · 0.80

Calls 5

get_work_modeMethod · 0.80
get_deviceMethod · 0.80
have_view_dataMethod · 0.80
apply_samplerateMethod · 0.80
broadcast_msgMethod · 0.80

Tested by

no test coverage detected