summaryrefslogtreecommitdiffstats
path: root/plugins/ufo/uca-ufo-camera.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2013-04-17 11:10:58 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2013-04-17 11:11:39 +0200
commit3b99dc78787ddfda9eca72333eff8e522e7b0a72 (patch)
treeb929b5c3977b72f8a4204fd9f8edf2175b2eb671 /plugins/ufo/uca-ufo-camera.c
parent9df1fc45927e13b17c75a4295ac2d639c90d243b (diff)
downloadlibuca-3b99dc78787ddfda9eca72333eff8e522e7b0a72.tar.gz
libuca-3b99dc78787ddfda9eca72333eff8e522e7b0a72.tar.bz2
libuca-3b99dc78787ddfda9eca72333eff8e522e7b0a72.tar.xz
libuca-3b99dc78787ddfda9eca72333eff8e522e7b0a72.zip
Fix calculation once more
Diffstat (limited to 'plugins/ufo/uca-ufo-camera.c')
-rw-r--r--plugins/ufo/uca-ufo-camera.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/ufo/uca-ufo-camera.c b/plugins/ufo/uca-ufo-camera.c
index f09d03a..551e5f0 100644
--- a/plugins/ufo/uca-ufo-camera.c
+++ b/plugins/ufo/uca-ufo-camera.c
@@ -411,7 +411,7 @@ uca_ufo_camera_set_property(GObject *object, guint property_id, const GValue *va
{
const guint frequency = priv->frequency == FPGA_40MHZ ? 40 : 48;
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_register_value_t reg_value = (pcilib_register_value_t) ((1e6 * user_exposure_time * frequency) / 129.0);
pcilib_write_register(priv->handle, NULL, "cmosis_exp_time", reg_value);
}
break;
@@ -492,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 / 10e6);
+ g_value_set_double (value, read_register_value (priv->handle, "cmosis_exp_time") * 129.0 / frequency / 1e6);
}
break;
case PROP_HAS_STREAMING: