| 250 | } |
| 251 | |
| 252 | void SamplingBar::on_configure() |
| 253 | { |
| 254 | int ret; |
| 255 | |
| 256 | if (_device_agent->have_instance() == false) |
| 257 | { |
| 258 | dsv_info("Have no device, can't to set device config."); |
| 259 | return; |
| 260 | } |
| 261 | |
| 262 | _session->broadcast_msg(DSV_MSG_BEGIN_DEVICE_OPTIONS); |
| 263 | |
| 264 | pv::dialogs::DeviceOptions dlg(this); |
| 265 | connect(_session->device_event_object(), SIGNAL(device_updated()), &dlg, SLOT(reject())); |
| 266 | |
| 267 | ret = dlg.exec(); |
| 268 | |
| 269 | if (ret == QDialog::Accepted) |
| 270 | { |
| 271 | if (_session->have_view_data() == false) |
| 272 | this->commit_settings(); |
| 273 | |
| 274 | _session->broadcast_msg(DSV_MSG_DEVICE_OPTIONS_UPDATED); |
| 275 | |
| 276 | update_sample_rate_list(); |
| 277 | |
| 278 | int mode = _device_agent->get_work_mode(); |
| 279 | bool zero = false; |
| 280 | bool test; |
| 281 | bool ret; |
| 282 | |
| 283 | if (mode == DSO){ |
| 284 | _device_agent->get_config_bool(SR_CONF_ZERO, zero); |
| 285 | |
| 286 | if (zero){ |
| 287 | zero_adj(); |
| 288 | return; |
| 289 | } |
| 290 | } |
| 291 | |
| 292 | ret = _device_agent->get_config_bool(SR_CONF_TEST, test); |
| 293 | if (ret) |
| 294 | { |
| 295 | if (test) |
| 296 | { |
| 297 | update_sample_rate_selector_value(); |
| 298 | _sample_count.setDisabled(true); |
| 299 | _sample_rate.setDisabled(true); |
| 300 | } |
| 301 | else |
| 302 | { |
| 303 | _sample_count.setDisabled(false); |
| 304 | if (mode != DSO) |
| 305 | _sample_rate.setDisabled(false); |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | this->reload(); |
nothing calls this directly
no test coverage detected