From 435855dffba54084c9df5c3521cb0b41fd5086df Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Tue, 17 Apr 2012 16:26:32 +0200 Subject: Make exposure time writeable --- src/cameras/uca-ufo-camera.c | 9 +++++++++ src/uca-camera.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/cameras/uca-ufo-camera.c b/src/cameras/uca-ufo-camera.c index 97e4271..e642605 100644 --- a/src/cameras/uca-ufo-camera.c +++ b/src/cameras/uca-ufo-camera.c @@ -181,7 +181,16 @@ static void uca_ufo_camera_grab(UcaCamera *camera, gpointer *data, GError **erro static void uca_ufo_camera_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { + UcaUfoCameraPrivate *priv = UCA_UFO_CAMERA_GET_PRIVATE(object); + switch (property_id) { + case PROP_EXPOSURE_TIME: + { + pcilib_register_value_t reg_value = (pcilib_register_value_t) 2.67e6 * g_value_get_double(value); + pcilib_write_register(priv->handle, NULL, "exp_time", reg_value); + } + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); return; diff --git a/src/uca-camera.c b/src/uca-camera.c index 1e35dc7..98e5f49 100644 --- a/src/uca-camera.c +++ b/src/uca-camera.c @@ -234,7 +234,7 @@ static void uca_camera_class_init(UcaCameraClass *klass) "Exposure time in seconds", "Exposure time in seconds", 0.0, G_MAXDOUBLE, 1.0, - G_PARAM_READABLE); + G_PARAM_READWRITE); camera_properties[PROP_SENSOR_MAX_FRAME_RATE] = g_param_spec_float("max-frame-rate", -- cgit v1.2.3