[aravis] camera: new function for device informations.



commit 7db0bd5e39aca29dc8e7961de1bad417d320eec8
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Wed Apr 7 14:53:41 2010 +0200

    camera: new function for device informations.

 src/arvcamera.c     |   25 +++++++++++++++++++++++++
 src/arvcamera.h     |    3 +++
 src/arvcameratest.c |    5 ++++-
 3 files changed, 32 insertions(+), 1 deletions(-)
---
diff --git a/src/arvcamera.c b/src/arvcamera.c
index 0ca4d6e..00d15ef 100644
--- a/src/arvcamera.c
+++ b/src/arvcamera.c
@@ -26,6 +26,7 @@
 #include <arvgccommand.h>
 #include <arvgcinteger.h>
 #include <arvgcfloat.h>
+#include <arvgcstring.h>
 #include <arvgc.h>
 #include <arvdevice.h>
 
@@ -44,6 +45,30 @@ arv_camera_new_stream (ArvCamera *camera)
 	return arv_device_new_stream (camera->priv->device);
 }
 
+const char *
+arv_camera_get_vendor_name (ArvCamera *camera)
+{
+	g_return_val_if_fail (ARV_IS_CAMERA (camera), NULL);
+
+	return arv_gc_string_get_value (ARV_GC_STRING (arv_gc_get_node (camera->priv->genicam, "DeviceVendorName")));
+}
+
+const char *
+arv_camera_get_model_name (ArvCamera *camera)
+{
+	g_return_val_if_fail (ARV_IS_CAMERA (camera), NULL);
+
+	return arv_gc_string_get_value (ARV_GC_STRING (arv_gc_get_node (camera->priv->genicam, "DeviceModelName")));
+}
+
+const char *
+arv_camera_get_device_id (ArvCamera *camera)
+{
+	g_return_val_if_fail (ARV_IS_CAMERA (camera), NULL);
+
+	return arv_gc_string_get_value (ARV_GC_STRING (arv_gc_get_node (camera->priv->genicam, "DeviceID")));
+}
+
 void
 arv_camera_start_acquisition (ArvCamera *camera)
 {
diff --git a/src/arvcamera.h b/src/arvcamera.h
index f9c9d85..6b84bfe 100644
--- a/src/arvcamera.h
+++ b/src/arvcamera.h
@@ -51,6 +51,9 @@ GType arv_camera_get_type (void);
 
 ArvCamera *	arv_camera_new			(const char *name);
 ArvStream *	arv_camera_new_stream		(ArvCamera *camera);
+const char *	arv_camera_get_vendor_name	(ArvCamera *camera);
+const char *	arv_camera_get_model_name	(ArvCamera *camera);
+const char *	arv_camera_get_device_id	(ArvCamera *camera);
 void		arv_camera_start_acquisition	(ArvCamera *camera);
 void		arv_camera_stop_acquisition	(ArvCamera *camera);
 guint		arv_camera_get_payload		(ArvCamera *camera);
diff --git a/src/arvcameratest.c b/src/arvcameratest.c
index d50461d..f6732f7 100644
--- a/src/arvcameratest.c
+++ b/src/arvcameratest.c
@@ -89,11 +89,14 @@ main (int argc, char **argv)
 		exposure = arv_camera_get_exposure_time (camera);
 		payload = arv_camera_get_payload (camera);
 
+		g_print ("vendor name         = %s\n", arv_camera_get_vendor_name (camera));
+		g_print ("model name          = %s\n", arv_camera_get_model_name (camera));
+		g_print ("device id           = %s\n", arv_camera_get_device_id (camera));
 		g_print ("image width         = %d\n", width);
 		g_print ("image height        = %d\n", height);
 		g_print ("horizontal binning  = %d\n", dx);
 		g_print ("vertical binning    = %d\n", dy);
-		g_print ("exposure            = %g µs\n", exposure);
+		g_print ("exposure            = %g us\n", exposure);
 
 		stream = arv_camera_new_stream (camera);
 		if (arv_option_auto_buffer)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]