- g_string_append_printf(ctx->header, "; Channels (%d/%d): ",
- ctx->num_enabled_probes, num_probes);
- for (i = 0; i < ctx->num_enabled_probes; i++)
- g_string_append_printf(ctx->header, "%s, ", ctx->probelist[i]);
+ g_string_append_printf(ctx->header, "; Channels (%d/%d):",
+ ctx->num_enabled_channels, num_channels);
+ for (i = 0, j = 0, l = o->sdi->channels; l; l = l->next, i++) {
+ ch = l->data;
+ if (ch->type != SR_CHANNEL_LOGIC)
+ continue;
+ if (!ch->enabled)
+ continue;
+ g_string_append_printf(ctx->header, " %s,", ch->name);
+ /* Remember the enabled channel's index while we're at it. */
+ ctx->channel_index[j++] = i;
+ }
+ if (o->sdi->channels)
+ /* Drop last separator. */
+ g_string_truncate(ctx->header, ctx->header->len - 1);