X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Foutput%2Fanalog.c;h=d10f2e94c2985f49372f271353c854ea1e784bb3;hb=9380ec2f05e67518b1b23057749df3684a0cf05e;hp=3b9a581202213414d5413932c4fee8a6a940255f;hpb=8a174d23427735617d69c7502ed8dcade786bbf9;p=libsigrok.git diff --git a/src/output/analog.c b/src/output/analog.c index 3b9a5812..d10f2e94 100644 --- a/src/output/analog.c +++ b/src/output/analog.c @@ -21,7 +21,7 @@ #include #include #include -#include "libsigrok.h" +#include #include "libsigrok-internal.h" #define LOG_PREFIX "output/analog" @@ -173,7 +173,7 @@ static void fancyprint(int unit, int mqflags, float value, GString *out) g_string_append(out, " %oA"); break; case SR_UNIT_CONCENTRATION: - g_string_append_printf(out, "%f ppm", value * 1000000); + g_string_append_printf(out, "%f ppm", value * (1000 * 1000)); break; case SR_UNIT_REVOLUTIONS_PER_MINUTE: si_printf(value, out, "RPM"); @@ -200,6 +200,39 @@ static void fancyprint(int unit, int mqflags, float value, GString *out) si_printf(value, out, ""); g_string_append_unichar(out, 0x00b0); break; + case SR_UNIT_GRAM: + si_printf(value, out, "g"); + break; + case SR_UNIT_CARAT: + si_printf(value, out, "ct"); + break; + case SR_UNIT_OUNCE: + si_printf(value, out, "oz"); + break; + case SR_UNIT_TROY_OUNCE: + si_printf(value, out, "oz t"); + break; + case SR_UNIT_POUND: + si_printf(value, out, "lb"); + break; + case SR_UNIT_PENNYWEIGHT: + si_printf(value, out, "dwt"); + break; + case SR_UNIT_GRAIN: + si_printf(value, out, "gr"); + break; + case SR_UNIT_TAEL: + si_printf(value, out, "tael"); + break; + case SR_UNIT_MOMME: + si_printf(value, out, "momme"); + break; + case SR_UNIT_TOLA: + si_printf(value, out, "tola"); + break; + case SR_UNIT_PIECE: + si_printf(value, out, "pcs"); + break; default: si_printf(value, out, ""); break; @@ -227,6 +260,8 @@ static void fancyprint(int unit, int mqflags, float value, GString *out) g_string_append_printf(out, " AVG"); if (mqflags & SR_MQFLAG_REFERENCE) g_string_append_printf(out, " REF"); + if (mqflags & SR_MQFLAG_UNSTABLE) + g_string_append_printf(out, " UNSTABLE"); g_string_append_c(out, '\n'); } @@ -345,6 +380,7 @@ SR_PRIV struct sr_output_module output_analog = { .name = "Analog", .desc = "Analog data and types", .exts = NULL, + .flags = 0, .options = get_options, .init = init, .receive = receive,