rigol-ds: Calculate effective samplerate.
This commit is contained in:
parent
5415e60247
commit
4914dd4b9a
|
@ -41,6 +41,7 @@ static const int32_t hwcaps[] = {
|
||||||
SR_CONF_HORIZ_TRIGGERPOS,
|
SR_CONF_HORIZ_TRIGGERPOS,
|
||||||
SR_CONF_NUM_TIMEBASE,
|
SR_CONF_NUM_TIMEBASE,
|
||||||
SR_CONF_LIMIT_FRAMES,
|
SR_CONF_LIMIT_FRAMES,
|
||||||
|
SR_CONF_SAMPLERATE,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int32_t analog_hwcaps[] = {
|
static const int32_t analog_hwcaps[] = {
|
||||||
|
@ -517,6 +518,15 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
||||||
else
|
else
|
||||||
*data = g_variant_new_string("Segmented");
|
*data = g_variant_new_string("Segmented");
|
||||||
break;
|
break;
|
||||||
|
case SR_CONF_SAMPLERATE:
|
||||||
|
if (devc->data_source == DATA_SOURCE_LIVE) {
|
||||||
|
uint64_t samplerate = analog_frame_size(sdi) /
|
||||||
|
(devc->timebase * devc->model->num_horizontal_divs);
|
||||||
|
*data = g_variant_new_uint64(samplerate);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return SR_ERR_NA;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return SR_ERR_NA;
|
return SR_ERR_NA;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue