| 745 | } |
| 746 | |
| 747 | double SamplingBar::commit_hori_res() |
| 748 | { |
| 749 | const double hori_res = _sample_count.itemData( |
| 750 | _sample_count.currentIndex()) |
| 751 | .value<double>(); |
| 752 | |
| 753 | const uint64_t sample_limit = _device_agent->get_sample_limit(); |
| 754 | uint64_t max_sample_rate; |
| 755 | |
| 756 | if (_device_agent->get_config_uint64(SR_CONF_MAX_DSO_SAMPLERATE, max_sample_rate) == false) |
| 757 | { |
| 758 | dsv_err("ERROR: config_get SR_CONF_MAX_DSO_SAMPLERATE failed."); |
| 759 | return -1; |
| 760 | } |
| 761 | |
| 762 | const uint64_t sample_rate = min((uint64_t)(sample_limit * SR_SEC(1) / |
| 763 | (hori_res * DS_CONF_DSO_HDIVS)), |
| 764 | (uint64_t)(max_sample_rate / |
| 765 | (_session->get_ch_num(SR_CHANNEL_DSO) ? _session->get_ch_num(SR_CHANNEL_DSO) : 1))); |
| 766 | set_sample_rate(sample_rate); |
| 767 | |
| 768 | _device_agent->set_config_uint64( SR_CONF_TIMEBASE, hori_res); |
| 769 | |
| 770 | return hori_res; |
| 771 | } |
| 772 | |
| 773 | void SamplingBar::commit_settings() |
| 774 | { |
nothing calls this directly
no test coverage detected