[aravis] introspection: 2 more gjs scripts.



commit 24a277edfd2e9bd65e0dd1c36e3062c412fe1a1c
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Fri May 21 11:26:46 2010 +0200

    introspection: 2 more gjs scripts.

 test/arv-evaluator-test.js |   51 ++++++++++++++++++++++++++++++++++++++++++++
 test/arv-fake-test.js      |   47 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 98 insertions(+), 0 deletions(-)
---
diff --git a/test/arv-evaluator-test.js b/test/arv-evaluator-test.js
new file mode 100755
index 0000000..a4fef59
--- /dev/null
+++ b/test/arv-evaluator-test.js
@@ -0,0 +1,51 @@
+#!/usr/bin/env gjs
+
+/* Aravis - Digital camera library
+ *
+ * Copyright © 2009-2010 Emmanuel Pacaud
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Emmanuel Pacaud <emmanuel gnome org>
+ */
+
+/*
+   If you have installed aravis in a non standard location, you may need
+   to make GI_TYPELIB_PATH point to the correct location. For example:
+
+   export GI_TYPELIB_PATH=$GI_TYPELIB_PATH:/opt/bin/lib/girepositry-1.0/
+
+   You may also have to give the path to libaravis.so, using LD_PRELOAD or
+   LD_LIBRARY_PATH.
+ */
+
+const GLib = imports.gi.GLib;
+const Aravis = imports.gi.Aravis;
+
+let evaluator = Aravis.Evaluator.new ("1+2*4.4");
+
+let int_result = evaluator.evaluate_as_int64 ();
+let dbl_result = evaluator.evaluate_as_double ();
+
+log (int_result);
+log (dbl_result);
+
+evaluator.set_expression ("VAR+10");
+evaluator.set_double_variable ("VAR", 1.2);
+
+let dbl_result = evaluator.evaluate_as_double ();
+
+log (dbl_result);
diff --git a/test/arv-fake-test.js b/test/arv-fake-test.js
new file mode 100755
index 0000000..47f7b5c
--- /dev/null
+++ b/test/arv-fake-test.js
@@ -0,0 +1,47 @@
+#!/usr/bin/env gjs
+
+/* Aravis - Digital camera library
+ *
+ * Copyright © 2009-2010 Emmanuel Pacaud
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Emmanuel Pacaud <emmanuel gnome org>
+ */
+
+/*
+   If you have installed aravis in a non standard location, you may need
+   to make GI_TYPELIB_PATH point to the correct location. For example:
+
+   export GI_TYPELIB_PATH=$GI_TYPELIB_PATH:/opt/bin/lib/girepositry-1.0/
+
+   You may also have to give the path to libaravis.so, using LD_PRELOAD or
+   LD_LIBRARY_PATH.
+ */
+
+const GLib = imports.gi.GLib;
+const Aravis = imports.gi.Aravis;
+
+let device = Aravis.FakeDevice.new ("TEST0");
+let genicam = device.get_genicam ();
+
+let payload = genicam.get_node ("PayloadSize").get_value ();
+let width = genicam.get_node ("SensorWidth").get_value ();
+let height = genicam.get_node ("SensorHeight").get_value ();
+
+log (payload);
+log (width);
+log (height);



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