]> sigrok.org Git - libsigrok.git/commitdiff
Skip analog probes in logic-only output formats.
authorBert Vermeulen <redacted>
Sun, 29 Dec 2013 09:57:38 +0000 (10:57 +0100)
committerBert Vermeulen <redacted>
Sun, 29 Dec 2013 09:57:38 +0000 (10:57 +0100)
output/chronovu_la8.c
output/csv.c
output/gnuplot.c
output/ols.c
output/text/text.c
output/vcd.c

index 47b421d9054df938800c383c0f0617ebec256c12..e16f6174ec77e1bf7a40a3c8e40469391299413c 100644 (file)
@@ -108,6 +108,8 @@ static int init(struct sr_output *o)
        /* Get the unitsize. */
        for (l = o->sdi->probes; l; l = l->next) {
                probe = l->data;
+               if (probe->type != SR_PROBE_LOGIC)
+                       continue;
                if (!probe->enabled)
                        continue;
                ctx->num_enabled_probes++;
index 51cc8572145cf925d3d73c6aa00b14d92f758983..6de9ac3f155bfb7a7278631e5ce568a80efc751d 100644 (file)
@@ -76,8 +76,11 @@ static int init(struct sr_output *o)
        /* Get the number of probes, and the unitsize. */
        for (l = o->sdi->probes; l; l = l->next) {
                probe = l->data;
-               if (probe->enabled)
-                       ctx->num_enabled_probes++;
+               if (probe->type != SR_PROBE_LOGIC)
+                       continue;
+               if (!probe->enabled)
+                       continue;
+               ctx->num_enabled_probes++;
        }
 
        ctx->unitsize = (ctx->num_enabled_probes + 7) / 8;
@@ -107,8 +110,11 @@ static int init(struct sr_output *o)
                               ctx->num_enabled_probes, num_probes);
        for (l = o->sdi->probes; l; l = l->next) {
                probe = l->data;
-               if (probe->enabled)
-                       g_string_append_printf(ctx->header, "%s, ", probe->name);
+               if (probe->type != SR_PROBE_LOGIC)
+                       continue;
+               if (!probe->enabled)
+                       continue;
+               g_string_append_printf(ctx->header, "%s, ", probe->name);
        }
        g_string_append_printf(ctx->header, "\n");
 
index 29508cefdc62ae20c59e25217ccb2be33570d190..27a764c8ad209da04b816cc94772543b5f833fd2 100644 (file)
@@ -80,8 +80,11 @@ static int init(struct sr_output *o)
        ctx->num_enabled_probes = 0;
        for (l = o->sdi->probes; l; l = l->next) {
                probe = l->data;
-               if (probe->enabled)
-                       ctx->num_enabled_probes++;
+               if (probe->type != SR_PROBE_LOGIC)
+                       continue;
+               if (!probe->enabled)
+                       continue;
+               ctx->num_enabled_probes++;
        }
        ctx->unitsize = (ctx->num_enabled_probes + 7) / 8;
 
@@ -106,6 +109,8 @@ static int init(struct sr_output *o)
        wbuf[0] = '\0';
        for (i = 0, l = o->sdi->probes; l; l = l->next, i++) {
                probe = l->data;
+               if (probe->type != SR_PROBE_LOGIC)
+                       continue;
                if (!probe->enabled)
                        continue;
                c = (char *)&wbuf + strlen((const char *)&wbuf);
index 0e220534bf7a18187184a5dceef0ba2bf99a4fc1..9f9cc957bdb743566e01a96570b46bafb8f6b8d2 100644 (file)
@@ -71,8 +71,11 @@ static GString *gen_header(const struct sr_dev_inst *sdi, struct context *ctx)
        num_enabled_probes = 0;
        for (l = sdi->probes; l; l = l->next) {
                probe = l->data;
-               if (probe->enabled)
-                       num_enabled_probes++;
+               if (probe->type != SR_PROBE_LOGIC)
+                       continue;
+               if (!probe->enabled)
+                       continue;
+               num_enabled_probes++;
        }
 
        s = g_string_sized_new(512);
index 6856612127c1528f8df3f88380ed7230974584c8..47d0542b889e2bf4d2639c36764a04d725daca98 100644 (file)
@@ -92,6 +92,8 @@ SR_PRIV int init(struct sr_output *o, int default_spl, enum outputmode mode)
 
        for (l = o->sdi->probes; l; l = l->next) {
                probe = l->data;
+               if (probe->type != SR_PROBE_LOGIC)
+                       continue;
                if (!probe->enabled)
                        continue;
                ctx->probenames = g_slist_append(ctx->probenames, probe->name);
index d1526c1b6587e076732b343b07a9c81c692df156..44a12dec37a8c2e2265ea499d4410d61443d5ac3 100644 (file)
@@ -62,6 +62,8 @@ static int init(struct sr_output *o)
 
        for (l = o->sdi->probes; l; l = l->next) {
                probe = l->data;
+               if (probe->type != SR_PROBE_LOGIC)
+                       continue;
                if (!probe->enabled)
                        continue;
                ctx->probeindices = g_array_append_val(
@@ -124,6 +126,8 @@ static int init(struct sr_output *o)
        /* Wires / channels */
        for (i = 0, l = o->sdi->probes; l; l = l->next, i++) {
                probe = l->data;
+               if (probe->type != SR_PROBE_LOGIC)
+                       continue;
                if (!probe->enabled)
                        continue;
                g_string_append_printf(ctx->header, "$var wire 1 %c %s $end\n",