fix: The scale can't set as max to show all waveform after the mode swith to LOGIC

This commit is contained in:
dreamsourcelabTAI 2023-04-21 11:19:04 +08:00
parent 50b176ed95
commit 80fdaaa90a
3 changed files with 34 additions and 12 deletions

View File

@ -468,11 +468,11 @@ namespace pv
clear_decode_result();
_capture_data->clear();
_view_data->clear();
_capture_data = _view_data;
_view_data->clear();
_is_stream_mode = false;
_capture_times = 0;
_capture_data = _view_data;
set_cur_snap_samplerate(_device_agent.get_sample_rate());
set_cur_samplelimits(_device_agent.get_sample_limit());
@ -2085,7 +2085,24 @@ namespace pv
if (cur_mode == LOGIC){
clear_all_decode_task2();
}
}
_is_stream_mode = false;
if (mode == LOGIC){
if (_device_agent.is_hardware()){
_is_stream_mode = _device_agent.is_stream_mode();
}
else if (_device_agent.is_demo()){
_is_stream_mode = true;
}
}
if (_view_data != _capture_data){
_capture_data->clear();
_capture_data = _view_data;
}
set_cur_snap_samplerate(_device_agent.get_sample_rate());
set_cur_samplelimits(_device_agent.get_sample_limit());
init_signals();
dsv_info("Switch work mode to:%d", mode);
@ -2189,4 +2206,15 @@ namespace pv
return NULL;
}
bool SigSession::is_realtime_refresh()
{
if (is_loop_mode())
return true;
if (_is_stream_mode && is_single_mode())
return true;
if (_is_stream_mode && is_repeat_mode() && is_single_buffer())
return true;
return false;
}
} // namespace pv

View File

@ -343,13 +343,7 @@ public:
return _opt_mode == OPT_LOOP;
}
inline bool is_realtime_refresh(){
if (is_loop_mode() || (_is_stream_mode && is_single_mode() ))
return true;
if (_is_stream_mode && is_repeat_mode() && is_single_buffer())
return true;
return false;
}
bool is_realtime_refresh();
inline bool is_repeating(){
return _opt_mode == OPT_REPEAT && !_is_instant;

View File

@ -904,8 +904,8 @@ namespace pv
}
}
if (_device_agent->get_work_mode() == LOGIC && _session->is_realtime_refresh()){
if (_view != NULL)
if (_device_agent->get_work_mode() == LOGIC && _view != NULL){
if (_session->is_realtime_refresh())
_view->auto_set_max_scale();
}