From 4784c2e457649d6452817f134aba33dff668b028 Mon Sep 17 00:00:00 2001
From: Matthias Vogelgesang <matthias.vogelgesang@kit.edu>
Date: Wed, 24 Apr 2013 11:00:16 +0200
Subject: Convert to correct frames per second

---
 plugins/ufo/uca-ufo-camera.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

(limited to 'plugins')

diff --git a/plugins/ufo/uca-ufo-camera.c b/plugins/ufo/uca-ufo-camera.c
index 551e5f0..3f6d42c 100644
--- a/plugins/ufo/uca-ufo-camera.c
+++ b/plugins/ufo/uca-ufo-camera.c
@@ -86,6 +86,7 @@ static gint base_overrideables[] = {
     PROP_SENSOR_MAX_FRAME_RATE,
     PROP_SENSOR_BITDEPTH,
     PROP_EXPOSURE_TIME,
+    PROP_FRAMES_PER_SECOND,
     PROP_ROI_X,
     PROP_ROI_Y,
     PROP_ROI_WIDTH,
@@ -495,6 +496,25 @@ uca_ufo_camera_get_property(GObject *object, guint property_id, GValue *value, G
                 g_value_set_double (value, read_register_value (priv->handle, "cmosis_exp_time") * 129.0 / frequency / 1e6);
             }
             break;
+        case PROP_FRAMES_PER_SECOND:
+            {
+                gdouble exposure_time;
+                gdouble fps;
+                guint trigger_period;
+                guint roi_height;
+
+                g_object_get (object,
+                              "exposure-time", &exposure_time,
+                              "ufo-trigger-period", &trigger_period,
+                              "roi-height", &roi_height,
+                              NULL);
+
+                fps = 1. / (exposure_time + 
+                            (roi_height / 1088. * 2924. * 1e-6)+
+                            (trigger_period * 8. * 1e-9));
+                g_value_set_double(value, fps);
+            }
+            break;
         case PROP_HAS_STREAMING:
             g_value_set_boolean(value, TRUE);
             break;
-- 
cgit v1.2.3