start or stop capture
| 833 | |
| 834 | // start or stop capture |
| 835 | bool SamplingBar::action_run_stop() |
| 836 | { |
| 837 | if (_session->is_doing_action()){ |
| 838 | dsv_info("Task is busy."); |
| 839 | return false; |
| 840 | } |
| 841 | |
| 842 | if (_session->is_working()){ |
| 843 | return _session->stop_capture(); |
| 844 | } |
| 845 | |
| 846 | if (_device_agent->have_instance() == false) |
| 847 | { |
| 848 | dsv_info("Have no device, can't to collect data."); |
| 849 | return false; |
| 850 | } |
| 851 | |
| 852 | commit_settings(); |
| 853 | |
| 854 | if (_device_agent->get_work_mode() == DSO) |
| 855 | { |
| 856 | bool zero; |
| 857 | |
| 858 | bool ret = _device_agent->get_config_bool(SR_CONF_ZERO, zero); |
| 859 | if (ret && zero) |
| 860 | { |
| 861 | QString str1(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_AUTO_CALIB), "Auto Calibration")); |
| 862 | QString str2(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_ADJUST_SAVE), "Please adjust zero skew and save the result")); |
| 863 | bool bRet = MsgBox::Confirm(str1, str2); |
| 864 | |
| 865 | if (bRet) |
| 866 | { |
| 867 | zero_adj(); |
| 868 | } |
| 869 | else |
| 870 | { |
| 871 | _device_agent->set_config_bool(SR_CONF_ZERO, false); |
| 872 | update_view_status(); |
| 873 | } |
| 874 | return false; |
| 875 | } |
| 876 | } |
| 877 | |
| 878 | if (_device_agent->get_work_mode() == LOGIC && _view != NULL){ |
| 879 | if (_session->is_realtime_refresh()) |
| 880 | _view->auto_set_max_scale(); |
| 881 | } |
| 882 | |
| 883 | _is_run_as_instant = false; |
| 884 | bool ret = _session->start_capture(false); |
| 885 | |
| 886 | return ret; |
| 887 | } |
| 888 | |
| 889 | void SamplingBar::on_instant_stop() |
| 890 | { |
nothing calls this directly
no test coverage detected