Skip to content

Commit

Permalink
Support printing Volts per division (V/div) units (used for
Browse files Browse the repository at this point in the history
the vertical scale).

Signed-off-by: Guido Trentalancia <[email protected]>
---
 show.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
  • Loading branch information
gtrentalancia committed Nov 21, 2018
1 parent bc9dc2a commit be365fa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions show.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
Expand Down

0 comments on commit be365fa

Please sign in to comment.