From be365fa86325d59f606a5cb86011e0bf3dc446de Mon Sep 17 00:00:00 2001 From: Guido Trentalancia Date: Wed, 21 Nov 2018 17:43:01 +0100 Subject: [PATCH] Support printing Volts per division (V/div) units (used for the vertical scale). Signed-off-by: Guido Trentalancia --- show.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- show.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/show.c b/show.c index 672483f..26b6320 100644 --- a/show.c +++ b/show.c @@ -646,7 +646,8 @@ void show_dev_detail(void) printf("\n"); } else if (srci->datatype == SR_T_RATIONAL_PERIOD - || srci->datatype == SR_T_RATIONAL_VOLT) { + || srci->datatype == SR_T_RATIONAL_VOLT + || srci->datatype == SR_T_RATIONAL_VOLT_PER_DIV) { printf(" %s", srci->id); if (maybe_config_get(driver, sdi, channel_group, key, &gvar) == SR_OK) { @@ -668,8 +669,12 @@ void show_dev_detail(void) g_variant_unref(gvar); if (srci->datatype == SR_T_RATIONAL_PERIOD) s = sr_period_string(p, q); - else + else if (srci->datatype == SR_T_RATIONAL_VOLT) s = sr_voltage_string(p, q); + else if (srci->datatype == SR_T_RATIONAL_VOLT_PER_DIV) + s = sr_voltage_per_div_string(p, q); + else + s = g_strdup("Invalid datatype"); printf(" %s", s); g_free(s); if (p == cur_p && q == cur_q)