| 1324 | } |
| 1325 | |
| 1326 | void DsoSignal::auto_set() |
| 1327 | { |
| 1328 | if (session->is_stopped_status()) { |
| 1329 | if (_autoV) |
| 1330 | autoV_end(); |
| 1331 | if (_autoH) |
| 1332 | autoH_end(); |
| 1333 | } |
| 1334 | else { |
| 1335 | if (_autoH && _autoV && get_zero_ratio() != 0.5) { |
| 1336 | set_zero_ratio(0.5); |
| 1337 | } |
| 1338 | if (_mValid && !session->get_data_auto_lock()) { |
| 1339 | if (_autoH) { |
| 1340 | bool roll = false; |
| 1341 | session->get_device()->get_config_bool(SR_CONF_ROLL, roll); |
| 1342 | |
| 1343 | const double hori_res = _view->get_hori_res(); |
| 1344 | if (_level_valid && ((!roll && _pcount < 3) || _period > 4*hori_res)) { |
| 1345 | _view->zoom(-1); |
| 1346 | } else if (_level_valid && _pcount > 6 && _period < 1.5*hori_res) { |
| 1347 | _view->zoom(1); |
| 1348 | } else if (_level_valid) { |
| 1349 | autoH_end(); |
| 1350 | } |
| 1351 | } |
| 1352 | if (_autoV) { |
| 1353 | const bool over_flag = _max == 0xff || _min == 0x0; |
| 1354 | const bool out_flag = _max >= 0xE0 || _min <= 0x20; |
| 1355 | const bool under_flag = _max <= 0xA0 && _min >= 0x60; |
| 1356 | if (over_flag) { |
| 1357 | if (!_autoV_over) |
| 1358 | _auto_cnt = 0; |
| 1359 | _autoV_over = true; |
| 1360 | go_vDialNext(false); |
| 1361 | } else if (out_flag) { |
| 1362 | go_vDialNext(false); |
| 1363 | } else if (!_autoV_over && under_flag) { |
| 1364 | go_vDialPre(false); |
| 1365 | } else if (!_autoH) { |
| 1366 | autoV_end(); |
| 1367 | } |
| 1368 | |
| 1369 | if (_autoV_over && under_flag) { |
| 1370 | if (_auto_cnt++ > 16) |
| 1371 | _autoV_over = false; |
| 1372 | } else { |
| 1373 | _auto_cnt = 0; |
| 1374 | } |
| 1375 | |
| 1376 | if (_level_valid) { |
| 1377 | _trig_value = (_min+_max)/2; |
| 1378 | set_trig_vpos(ratio2pos(get_trig_vrate())); |
| 1379 | } |
| 1380 | } |
| 1381 | if (_autoH || _autoV) |
| 1382 | session->data_auto_lock(AutoLock); |
| 1383 | } |
nothing calls this directly
no test coverage detected