| 2303 | } |
| 2304 | |
| 2305 | bool SigSession::switch_work_mode(int mode) |
| 2306 | { |
| 2307 | assert(!_is_working); |
| 2308 | int cur_mode = _device_agent.get_work_mode(); |
| 2309 | |
| 2310 | if (cur_mode != mode) |
| 2311 | { |
| 2312 | set_collect_mode(COLLECT_SINGLE); |
| 2313 | |
| 2314 | _device_agent.set_config_int16(SR_CONF_DEVICE_MODE, mode); |
| 2315 | |
| 2316 | if (cur_mode == LOGIC){ |
| 2317 | clear_all_decode_task2(); |
| 2318 | clear_decode_result(); |
| 2319 | } |
| 2320 | |
| 2321 | _is_stream_mode = false; |
| 2322 | if (mode == LOGIC){ |
| 2323 | if (_device_agent.is_hardware()){ |
| 2324 | _is_stream_mode = _device_agent.is_stream_mode(); |
| 2325 | } |
| 2326 | else if (_device_agent.is_demo()){ |
| 2327 | _is_stream_mode = true; |
| 2328 | } |
| 2329 | } |
| 2330 | |
| 2331 | _capture_data->clear(); |
| 2332 | _view_data->clear(); |
| 2333 | _capture_data = _view_data; |
| 2334 | |
| 2335 | init_signals(); |
| 2336 | |
| 2337 | set_cur_snap_samplerate(_device_agent.get_sample_rate()); |
| 2338 | set_cur_samplelimits(_device_agent.get_sample_limit()); |
| 2339 | |
| 2340 | dsv_info("Switch work mode to:%d", mode); |
| 2341 | |
| 2342 | broadcast_msg(DSV_MSG_DEVICE_MODE_CHANGED); |
| 2343 | |
| 2344 | return true; |
| 2345 | } |
| 2346 | return false; |
| 2347 | } |
| 2348 | |
| 2349 | bool SigSession::is_first_store_confirm() |
| 2350 | { |
no test coverage detected