fix: Failed to restore the dutyfactor from data file

This commit is contained in:
dreamsourcelabTAI 2023-09-26 19:04:13 +08:00
parent 62a29ac5f4
commit 8373824144
2 changed files with 6 additions and 2 deletions

View File

@ -853,6 +853,8 @@ void DsoSignal::paint_mid(QPainter &p, int left, int right, QColor fore, QColor
(status.ch1_plevel ? status.ch1_cyc_plen - status.ch1_cyc_llen :
status.ch1_cyc_tlen - status.ch1_cyc_plen + status.ch1_cyc_llen);
_high_time = ((count == 0) ? 0 : samples / count) * tfactor;
// dsv_info("samples:%f,count:%d,tfactor:%f",
// samples, count, tfactor);
samples = (index == 0) ? status.ch0_cyc_tlen + status.ch0_cyc_llen : status.ch1_cyc_flen + status.ch1_cyc_llen;
_burst_time = samples * tfactor;

View File

@ -1061,6 +1061,7 @@ static int config_set(int id, GVariant *data, struct sr_dev_inst *sdi,
struct session_vdev *vdev;
const char *stropt;
unsigned int i;
int pv;
assert(sdi);
assert(sdi->priv);
@ -1198,10 +1199,11 @@ static int config_set(int id, GVariant *data, struct sr_dev_inst *sdi,
vdev->mstatus.ch1_cyc_plen = g_variant_get_uint32(data);
break;
case SR_CONF_STATUS_LLEN:
pv = g_variant_get_uint32(data);
if (ch->index == 0)
vdev->mstatus.ch0_cyc_llen = g_variant_get_uint32(data);
vdev->mstatus.ch0_cyc_llen = pv;
else
vdev->mstatus.ch0_cyc_llen = g_variant_get_uint32(data);
vdev->mstatus.ch1_cyc_llen = pv;
break;
case SR_CONF_STATUS_LEVEL:
if (ch->index == 0)