2
0
forked from Ivasoft/DSView

fix: The 'sample count' param can't restore from file

This commit is contained in:
dreamsourcelabTAI
2023-03-21 17:26:34 +08:00
parent a3b4525113
commit cec352ca8b
8 changed files with 35 additions and 17 deletions

View File

@@ -273,7 +273,7 @@ namespace pv
{
_session->broadcast_msg(DSV_MSG_DEVICE_OPTIONS_UPDATED);
update_sample_rate_selector();
update_sample_rate_list();
int mode = _device_agent->get_work_mode();
GVariant *gvar;
@@ -634,7 +634,8 @@ namespace pv
{
for (int i = 0; i < _sample_count.count(); i++)
{
if (pre_duration >= _sample_count.itemData(i).value<double>())
double sel_val = _sample_count.itemData(i).value<double>();
if (pre_duration >= sel_val)
{
_sample_count.setCurrentIndex(i);
break;
@@ -690,11 +691,13 @@ namespace pv
assert(!_updating_sample_count);
_updating_sample_count = true;
if (duration != _sample_count.itemData(_sample_count.currentIndex()).value<double>())
double cur_duration = _sample_count.itemData(_sample_count.currentIndex()).value<double>();
if (duration != cur_duration)
{
for (int i = 0; i < _sample_count.count(); i++)
{
if (duration >= _sample_count.itemData(i).value<double>())
double sel_val = _sample_count.itemData(i).value<double>();
if (duration >= sel_val)
{
_sample_count.setCurrentIndex(i);
break;
@@ -1132,7 +1135,7 @@ namespace pv
_device_selector.setCurrentIndex(select_index);
if (cur_dev_handle != _last_device_handle){
update_sample_rate_selector();
update_sample_rate_list();
_last_device_handle = cur_dev_handle;
}