fix: Load form the dso file, it works as repeat mode

This commit is contained in:
dreamsourcelabTAI 2023-04-13 19:46:16 +08:00
parent b3a01b5a9d
commit df986ae99c
3 changed files with 15 additions and 9 deletions

View File

@ -209,7 +209,9 @@ namespace pv
{ {
assert(!_is_saving); assert(!_is_saving);
assert(!_is_working); assert(!_is_working);
assert(_callback); assert(_callback);
set_operation_mode(OPT_SINGLE);
_callback->trigger_message(DSV_MSG_CURRENT_DEVICE_CHANGE_PREV); _callback->trigger_message(DSV_MSG_CURRENT_DEVICE_CHANGE_PREV);
@ -241,10 +243,12 @@ namespace pv
_capture_data->_cur_snap_samplerate = _device_agent.get_sample_rate(); _capture_data->_cur_snap_samplerate = _device_agent.get_sample_rate();
_capture_data->_cur_samplelimits = _device_agent.get_sample_limit(); _capture_data->_cur_samplelimits = _device_agent.get_sample_limit();
/*
if (_device_agent.get_work_mode() == DSO) if (_device_agent.get_work_mode() == DSO)
_opt_mode = OPT_REPEAT; _opt_mode = OPT_REPEAT;
else else
_opt_mode = OPT_SINGLE; _opt_mode = OPT_SINGLE;
*/
// The current device changed. // The current device changed.
_callback->trigger_message(DSV_MSG_CURRENT_DEVICE_CHANGED); _callback->trigger_message(DSV_MSG_CURRENT_DEVICE_CHANGED);
@ -488,7 +492,10 @@ namespace pv
if (_device_agent.get_config_value_int16(SR_CONF_OPERATION_MODE, mode_val)){ if (_device_agent.get_config_value_int16(SR_CONF_OPERATION_MODE, mode_val)){
_is_stream_mode = mode_val == LO_OP_STREAM; _is_stream_mode = mode_val == LO_OP_STREAM;
} }
} }
else if (instant && mode == LOGIC && _device_agent.is_demo()){
_is_stream_mode = true;
}
update_view(); update_view();
@ -1554,7 +1561,7 @@ namespace pv
int SigSession::get_repeat_hold() int SigSession::get_repeat_hold()
{ {
if (!_is_instant && _is_working && is_repeat_mode()) if (_is_working && is_repeat_mode())
return _repeat_hold_prg; return _repeat_hold_prg;
else else
return 0; return 0;

View File

@ -801,8 +801,6 @@ namespace pv
{ {
bool test = false; bool test = false;
dsv_info("Commit device settings.");
if (_device_agent->have_instance()) if (_device_agent->have_instance())
{ {
GVariant *gvar = _device_agent->get_config(NULL, NULL, SR_CONF_TEST); GVariant *gvar = _device_agent->get_config(NULL, NULL, SR_CONF_TEST);

View File

@ -170,9 +170,10 @@ void Viewport::doPaint()
break; break;
} }
if (_view.session().get_device()->get_work_mode() == LOGIC || int mode = _view.session().get_device()->get_work_mode();
_view.session().is_instant())
{ if (mode == LOGIC || _view.session().is_instant())
{
if (_view.session().is_init_status()) if (_view.session().is_init_status())
{ {
paintCursors(p); paintCursors(p);
@ -1349,7 +1350,7 @@ void Viewport::set_receive_len(quint64 length)
} }
// Received new data, and refresh the view. // Received new data, and refresh the view.
update(); repaint();
} }
void Viewport::clear_measure() void Viewport::clear_measure()