From 3b99dc78787ddfda9eca72333eff8e522e7b0a72 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Wed, 17 Apr 2013 11:10:58 +0200 Subject: Fix calculation once more --- plugins/ufo/uca-ufo-camera.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') 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: -- cgit v1.2.3