[aravis] tool: fix display of string register and enumeration values.
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aravis] tool: fix display of string register and enumeration values.
- Date: Mon, 18 Jun 2012 08:50:14 +0000 (UTC)
commit db3a659985576e41e241ad302e9da99ec75119b6
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Mon Jun 18 10:48:46 2012 +0200
tool: fix display of string register and enumeration values.
As enumeration and string register immlement the integer interface,
we have to hanlde the string case before integer and float in
order to correctly display the string information.
src/arvtool.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/arvtool.c b/src/arvtool.c
index 0212fe6..db65937 100644
--- a/src/arvtool.c
+++ b/src/arvtool.c
@@ -143,7 +143,15 @@ arv_tool_execute_command (int argc, char **argv, const char *device_name)
arv_gc_feature_node_set_value_from_string (ARV_GC_FEATURE_NODE (feature),
tokens[1], NULL);
- if (ARV_IS_GC_INTEGER (feature))
+ if (ARV_IS_GC_STRING (feature))
+ printf ("%s = %s\n", tokens[0],
+ arv_gc_string_get_value (ARV_GC_STRING (feature), NULL));
+ else if (ARV_IS_GC_FLOAT (feature))
+ printf ("%s = %g (min:%g-max:%g)\n", tokens[0],
+ arv_gc_float_get_value (ARV_GC_FLOAT (feature), NULL),
+ arv_gc_float_get_min (ARV_GC_FLOAT (feature), NULL),
+ arv_gc_float_get_max (ARV_GC_FLOAT (feature), NULL));
+ else if (ARV_IS_GC_INTEGER (feature))
printf ("%s = %" G_GINT64_FORMAT
" (min:%" G_GINT64_FORMAT
"-max:%" G_GINT64_FORMAT
@@ -151,11 +159,6 @@ arv_tool_execute_command (int argc, char **argv, const char *device_name)
arv_gc_integer_get_value (ARV_GC_INTEGER (feature), NULL),
arv_gc_integer_get_min (ARV_GC_INTEGER (feature), NULL),
arv_gc_integer_get_max (ARV_GC_INTEGER (feature), NULL));
- else if (ARV_IS_GC_FLOAT (feature))
- printf ("%s = %g (min:%g-max:%g)\n", tokens[0],
- arv_gc_float_get_value (ARV_GC_FLOAT (feature), NULL),
- arv_gc_float_get_min (ARV_GC_FLOAT (feature), NULL),
- arv_gc_float_get_max (ARV_GC_FLOAT (feature), NULL));
else
printf ("%s = %s\n", tokens[0],
arv_gc_feature_node_get_value_as_string (ARV_GC_FEATURE_NODE (feature),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]