summaryrefslogtreecommitdiffstats
path: root/plugins/dexela
diff options
context:
space:
mode:
authorMihael Koep <koep@schneide.com>2014-09-09 16:53:17 +0200
committerMihael Koep <koep@schneide.com>2014-09-17 09:45:13 +0200
commit9acde9b885637f3a6be2dbd2b3f14f0d1d211c9b (patch)
tree35db0acacb85532c926ead7ec0bfcf3f8bd855cb /plugins/dexela
parent718cb1e5d2059b5d88bfe34d8c8bcca6a4550249 (diff)
downloadlibuca-9acde9b885637f3a6be2dbd2b3f14f0d1d211c9b.tar.gz
libuca-9acde9b885637f3a6be2dbd2b3f14f0d1d211c9b.tar.bz2
libuca-9acde9b885637f3a6be2dbd2b3f14f0d1d211c9b.tar.xz
libuca-9acde9b885637f3a6be2dbd2b3f14f0d1d211c9b.zip
Define minimun exposure time and enforce it
Diffstat (limited to 'plugins/dexela')
-rw-r--r--plugins/dexela/uca-dexela-camera.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/dexela/uca-dexela-camera.c b/plugins/dexela/uca-dexela-camera.c
index 5b9c524..cefd228 100644
--- a/plugins/dexela/uca-dexela-camera.c
+++ b/plugins/dexela/uca-dexela-camera.c
@@ -18,6 +18,7 @@
#include <string.h>
#include <gio/gio.h>
#include <gmodule.h>
+#include <math.h>
#include "uca-dexela-camera.h"
#include "dexela/dexela_api.h"
#include "software-roi.h"
@@ -69,6 +70,7 @@ static gint base_overrideables[] = {
static GParamSpec *dexela_properties[N_PROPERTIES] = { NULL, };
static const gdouble MICROS_TO_SECONDS_FACTOR = 1e6d;
+static const gdouble MINIMUM_EXPOSURE_TIME_IN_SECONDS = 0.017d; // 17ms as per documentation
struct _UcaDexelaCameraPrivate {
GValueArray *binnings;
@@ -257,7 +259,7 @@ static void uca_dexela_camera_set_property(GObject *object, guint property_id, c
switch (property_id) {
case PROP_EXPOSURE_TIME:
{
- const gdouble exposureTimeInSeconds = g_value_get_double(value);
+ const gdouble exposureTimeInSeconds = fmax(MINIMUM_EXPOSURE_TIME_IN_SECONDS, g_value_get_double(value));
dexela_set_exposure_time_micros((gint) (exposureTimeInSeconds * MICROS_TO_SECONDS_FACTOR));
break;
}