| 902 | } |
| 903 | |
| 904 | bool SamplingBar::action_instant_stop() |
| 905 | { |
| 906 | if (_session->is_doing_action()){ |
| 907 | dsv_info("Task is busy."); |
| 908 | return false; |
| 909 | } |
| 910 | |
| 911 | if (_session->is_working()){ |
| 912 | return _session->stop_capture(); |
| 913 | } |
| 914 | |
| 915 | if (_device_agent->have_instance() == false) |
| 916 | { |
| 917 | dsv_info("Error! Have no device, can't to collect data."); |
| 918 | return false; |
| 919 | } |
| 920 | |
| 921 | commit_settings(); |
| 922 | |
| 923 | if (_device_agent->get_work_mode() == DSO) |
| 924 | { |
| 925 | bool zero; |
| 926 | |
| 927 | bool ret = _device_agent->get_config_bool(SR_CONF_ZERO, zero); |
| 928 | if (ret && zero) |
| 929 | { |
| 930 | QString strMsg(L_S(STR_PAGE_MSG,S_ID(IDS_MSG_AUTO_CALIB_START), "Auto Calibration program will be started. Don't connect any probes. \nIt can take a while!")); |
| 931 | |
| 932 | if (MsgBox::Confirm(strMsg)) |
| 933 | { |
| 934 | zero_adj(); |
| 935 | } |
| 936 | else |
| 937 | { |
| 938 | _device_agent->set_config_bool(SR_CONF_ZERO, false); |
| 939 | update_view_status(); |
| 940 | } |
| 941 | return false; |
| 942 | } |
| 943 | } |
| 944 | |
| 945 | if (_device_agent->get_work_mode() == LOGIC && _session->is_realtime_refresh()){ |
| 946 | if (_view != NULL) |
| 947 | _view->auto_set_max_scale(); |
| 948 | } |
| 949 | |
| 950 | _is_run_as_instant = true; |
| 951 | bool ret = _session->start_capture(true); |
| 952 | |
| 953 | return ret; |
| 954 | } |
| 955 | |
| 956 | void SamplingBar::on_device_selected() |
| 957 | { |
nothing calls this directly
no test coverage detected