gnuplot: Remove unnecessary array of probe names.
This commit is contained in:
parent
1c5b099a13
commit
deb0908338
|
@ -37,7 +37,6 @@
|
||||||
struct context {
|
struct context {
|
||||||
unsigned int num_enabled_probes;
|
unsigned int num_enabled_probes;
|
||||||
unsigned int unitsize;
|
unsigned int unitsize;
|
||||||
char *probelist[SR_MAX_NUM_PROBES + 1];
|
|
||||||
char *header;
|
char *header;
|
||||||
uint8_t *old_sample;
|
uint8_t *old_sample;
|
||||||
};
|
};
|
||||||
|
@ -102,11 +101,9 @@ static int init(struct sr_output *o)
|
||||||
ctx->num_enabled_probes = 0;
|
ctx->num_enabled_probes = 0;
|
||||||
for (l = o->sdi->probes; l; l = l->next) {
|
for (l = o->sdi->probes; l; l = l->next) {
|
||||||
probe = l->data;
|
probe = l->data;
|
||||||
if (!probe->enabled)
|
if (probe->enabled)
|
||||||
continue;
|
ctx->num_enabled_probes++;
|
||||||
ctx->probelist[ctx->num_enabled_probes++] = probe->name;
|
|
||||||
}
|
}
|
||||||
ctx->probelist[ctx->num_enabled_probes] = 0;
|
|
||||||
ctx->unitsize = (ctx->num_enabled_probes + 7) / 8;
|
ctx->unitsize = (ctx->num_enabled_probes + 7) / 8;
|
||||||
|
|
||||||
num_probes = g_slist_length(o->sdi->probes);
|
num_probes = g_slist_length(o->sdi->probes);
|
||||||
|
@ -130,9 +127,12 @@ static int init(struct sr_output *o)
|
||||||
|
|
||||||
/* Columns / channels */
|
/* Columns / channels */
|
||||||
wbuf[0] = '\0';
|
wbuf[0] = '\0';
|
||||||
for (i = 0; i < ctx->num_enabled_probes; i++) {
|
for (i = 0, l = o->sdi->probes; l; l = l->next, i++) {
|
||||||
|
probe = l->data;
|
||||||
|
if (!probe->enabled)
|
||||||
|
continue;
|
||||||
c = (char *)&wbuf + strlen((const char *)&wbuf);
|
c = (char *)&wbuf + strlen((const char *)&wbuf);
|
||||||
sprintf(c, "# %d\t\t%s\n", i + 1, ctx->probelist[i]);
|
sprintf(c, "# %d\t\t%s\n", i + 1, probe->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(frequency_s = sr_period_string(samplerate))) {
|
if (!(frequency_s = sr_period_string(samplerate))) {
|
||||||
|
|
Loading…
Reference in New Issue