summaryrefslogtreecommitdiffstats
path: root/plugins/ufo/uca-ufo-camera.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2014-02-20 16:18:21 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2014-02-20 16:18:21 +0100
commit3f68356bb6fb57f18eb64d946d1698905a1dd663 (patch)
tree41c73999e81958f51fd529df4f7a450259a519d5 /plugins/ufo/uca-ufo-camera.c
parent501a9e0270afefea7b4f790e4efc291b2d2bcedd (diff)
downloaduca-3f68356bb6fb57f18eb64d946d1698905a1dd663.tar.gz
uca-3f68356bb6fb57f18eb64d946d1698905a1dd663.tar.bz2
uca-3f68356bb6fb57f18eb64d946d1698905a1dd663.tar.xz
uca-3f68356bb6fb57f18eb64d946d1698905a1dd663.zip
ufo: Set frame rate accordingly
Diffstat (limited to 'plugins/ufo/uca-ufo-camera.c')
-rw-r--r--plugins/ufo/uca-ufo-camera.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/plugins/ufo/uca-ufo-camera.c b/plugins/ufo/uca-ufo-camera.c
index 42c915e..f353356 100644
--- a/plugins/ufo/uca-ufo-camera.c
+++ b/plugins/ufo/uca-ufo-camera.c
@@ -489,21 +489,30 @@ uca_ufo_camera_get_property(GObject *object, guint property_id, GValue *value, G
break;
case PROP_FRAMES_PER_SECOND:
{
+ const gdouble clock_period = priv->frequency == FPGA_40MHZ ? 1 / 40.0 : 1 / 48.0;
gdouble exposure_time;
- gdouble fps;
+ gdouble readout_time, image_readout_time;
+ gdouble overhead_time, delay_time;
+ gdouble framerate;
+ gdouble foo;
+ guint output_mode;
guint trigger_period;
guint roi_height;
g_object_get (object,
"exposure-time", &exposure_time,
- "ufo-trigger-period", &trigger_period,
+ "ufo-cmosis-output-mode", &output_mode,
"roi-height", &roi_height,
+ "ufo-trigger-period", &trigger_period,
NULL);
- fps = 1. / (exposure_time +
- (roi_height / 1088. * 2924. * 1e-6)+
- (trigger_period * 8. * 1e-9));
- g_value_set_double(value, fps);
+ foo = pow(2, output_mode);
+ image_readout_time = (129 * clock_period * foo) * roi_height;
+ overhead_time = (10 /* reg73 */ + 2 * foo) * 129 * clock_period;
+ readout_time = exposure_time + overhead_time + image_readout_time;
+ delay_time = trigger_period * 8.0 * 1e-9;
+ framerate = 1.0 / (readout_time + delay_time);
+ g_value_set_double(value, framerate);
}
break;
case PROP_HAS_STREAMING: