summaryrefslogtreecommitdiffstats
path: root/plugins/ufo
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2013-04-17 10:21:16 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2013-04-17 10:21:43 +0200
commit9df1fc45927e13b17c75a4295ac2d639c90d243b (patch)
tree1a185165c7c0255a7d15afd8adf906e8a3b01c87 /plugins/ufo
parentdefa90316ceedc82e306839dc2e50038ecb7bdb5 (diff)
downloadlibuca-9df1fc45927e13b17c75a4295ac2d639c90d243b.tar.gz
libuca-9df1fc45927e13b17c75a4295ac2d639c90d243b.tar.bz2
libuca-9df1fc45927e13b17c75a4295ac2d639c90d243b.tar.xz
libuca-9df1fc45927e13b17c75a4295ac2d639c90d243b.zip
Fix exposure time calculation
Diffstat (limited to 'plugins/ufo')
-rw-r--r--plugins/ufo/uca-ufo-camera.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/ufo/uca-ufo-camera.c b/plugins/ufo/uca-ufo-camera.c
index c413278..f09d03a 100644
--- a/plugins/ufo/uca-ufo-camera.c
+++ b/plugins/ufo/uca-ufo-camera.c
@@ -410,7 +410,8 @@ uca_ufo_camera_set_property(GObject *object, guint property_id, const GValue *va
case PROP_EXPOSURE_TIME:
{
const guint frequency = priv->frequency == FPGA_40MHZ ? 40 : 48;
- pcilib_register_value_t reg_value = (pcilib_register_value_t) 129 / frequency * 1000 * 1000 * g_value_get_double(value);
+ const gdouble user_exposure_time = g_value_get_double(value);
+ pcilib_register_value_t reg_value = (pcilib_register_value_t) (10e6 * user_exposure_time) / (129 * frequency);
pcilib_write_register(priv->handle, NULL, "cmosis_exp_time", reg_value);
}
break;
@@ -491,7 +492,7 @@ uca_ufo_camera_get_property(GObject *object, guint property_id, GValue *value, G
case PROP_EXPOSURE_TIME:
{
const gdouble frequency = priv->frequency == FPGA_40MHZ ? 40.0 : 48.0;
- g_value_set_double (value, read_register_value (priv->handle, "cmosis_exp_time") * 129 / frequency / 1000 / 1000 );
+ g_value_set_double (value, read_register_value (priv->handle, "cmosis_exp_time") * 129 * frequency / 10e6);
}
break;
case PROP_HAS_STREAMING: