analog: add pretty-printer for dBu and dBV
This commit is contained in:
parent
6b86923463
commit
796a79eb75
|
@ -137,6 +137,12 @@ static void fancyprint(int unit, int mqflags, float value, GString *out)
|
||||||
case SR_UNIT_SIEMENS:
|
case SR_UNIT_SIEMENS:
|
||||||
si_printf(value, out, "S");
|
si_printf(value, out, "S");
|
||||||
break;
|
break;
|
||||||
|
case SR_UNIT_DECIBEL_MW:
|
||||||
|
si_printf(value, out, "dBu");
|
||||||
|
break;
|
||||||
|
case SR_UNIT_DECIBEL_VOLT:
|
||||||
|
si_printf(value, out, "dBV");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if ((mqflags & (SR_MQFLAG_AC | SR_MQFLAG_DC)) == (SR_MQFLAG_AC | SR_MQFLAG_DC))
|
if ((mqflags & (SR_MQFLAG_AC | SR_MQFLAG_DC)) == (SR_MQFLAG_AC | SR_MQFLAG_DC))
|
||||||
g_string_append_printf(out, " AC+DC");
|
g_string_append_printf(out, " AC+DC");
|
||||||
|
@ -156,6 +162,7 @@ static GString *receive(struct sr_output *o, const struct sr_dev_inst *sdi,
|
||||||
float *fdata;
|
float *fdata;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
(void)sdi;
|
||||||
if (!o || !o->sdi)
|
if (!o || !o->sdi)
|
||||||
return NULL;
|
return NULL;
|
||||||
ctx = o->internal;
|
ctx = o->internal;
|
||||||
|
|
Loading…
Reference in New Issue