]> sigrok.org Git - libsigrok.git/commitdiff
output/analog: Support all known MQFLAGs.
authorUwe Hermann <redacted>
Fri, 30 Aug 2013 06:57:09 +0000 (08:57 +0200)
committerUwe Hermann <redacted>
Fri, 30 Aug 2013 14:11:33 +0000 (16:11 +0200)
output/analog.c

index 684f8826bf2c3c38e43d050801eb9c49f119cf79..85def20948abb808f6038246273c45cfca5d07bd 100644 (file)
@@ -177,12 +177,25 @@ static void fancyprint(int unit, int mqflags, float value, GString *out)
                si_printf(value, out, "");
                break;
        }
-       if ((mqflags & (SR_MQFLAG_AC | SR_MQFLAG_DC)) == (SR_MQFLAG_AC | SR_MQFLAG_DC))
-               g_string_append_printf(out, " AC+DC");
-       else if (mqflags & SR_MQFLAG_AC)
+
+       if (mqflags & SR_MQFLAG_AC)
                g_string_append_printf(out, " AC");
-       else if (mqflags & SR_MQFLAG_DC)
+       if (mqflags & SR_MQFLAG_DC)
                g_string_append_printf(out, " DC");
+       if (mqflags & SR_MQFLAG_RMS)
+               g_string_append_printf(out, " RMS");
+       if (mqflags & SR_MQFLAG_DIODE)
+               g_string_append_printf(out, " DIODE");
+       if (mqflags & SR_MQFLAG_HOLD)
+               g_string_append_printf(out, " HOLD");
+       if (mqflags & SR_MQFLAG_MAX)
+               g_string_append_printf(out, " MAX");
+       if (mqflags & SR_MQFLAG_MIN)
+               g_string_append_printf(out, " MIN");
+       if (mqflags & SR_MQFLAG_AUTORANGE)
+               g_string_append_printf(out, " AUTO");
+       if (mqflags & SR_MQFLAG_RELATIVE)
+               g_string_append_printf(out, " REL");
        g_string_append_c(out, '\n');
 }