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

Method set_region

DSView/pv/dialogs/regionoptions.cpp:84–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84void RegionOptions::set_region()
85{
86 const uint64_t last_samples = _session->cur_samplelimits() - 1;
87 const int index1 = _start_comboBox->currentIndex();
88 const int index2 = _end_comboBox->currentIndex();
89 uint64_t start, end;
90
91 _session->set_save_start(0);
92 _session->set_save_end(last_samples);
93
94 if (index1 == 0) {
95 start = 0;
96 } else {
97 start = _view->get_cursor_samples(index1-1);
98 }
99 if (index2 == 0) {
100 end = last_samples;
101 } else {
102 end = _view->get_cursor_samples(index2-1);
103 }
104
105 if (start > last_samples)
106 start = 0;
107 if (end > last_samples)
108 end = last_samples;
109
110 _session->set_save_start(min(start, end));
111 _session->set_save_end(max(start, end));
112
113 QDialog::accept();
114}
115
116} // namespace dialogs
117} // namespace pv

Callers

nothing calls this directly

Calls 4

cur_samplelimitsMethod · 0.80
set_save_startMethod · 0.80
set_save_endMethod · 0.80
get_cursor_samplesMethod · 0.80

Tested by

no test coverage detected