- ctx->num_enabled_probes = 0;
- for (l = o->sdi->probes; l; l = l->next) {
- probe = l->data;
- if (probe->enabled)
- ctx->num_enabled_probes++;
- }
- ctx->unitsize = (ctx->num_enabled_probes + 7) / 8;
-
- num_probes = g_slist_length(o->sdi->probes);
- comment[0] = '\0';
- samplerate = 0;
- if (sr_config_get(o->sdi->driver, SR_CONF_SAMPLERATE, &gvar,
- o->sdi) == SR_OK) {
- samplerate = g_variant_get_uint64(gvar);
- g_variant_unref(gvar);
- if (!(frequency_s = sr_samplerate_string(samplerate))) {
- sr_err("%s: sr_samplerate_string failed", __func__);
- g_free(ctx);
- return SR_ERR;
- }
- snprintf(comment, 127, gnuplot_header_comment,
- ctx->num_enabled_probes, num_probes, frequency_s);
- g_free(frequency_s);
- }
-
- /* Columns / channels */
- wbuf[0] = '\0';
- for (i = 0, l = o->sdi->probes; l; l = l->next, i++) {
- probe = l->data;
- if (!probe->enabled)
+ ctx->num_enabled_channels = 0;
+ for (l = o->sdi->channels; l; l = l->next) {
+ ch = l->data;
+ if (ch->type != SR_CHANNEL_LOGIC)