summaryrefslogtreecommitdiffstats
path: root/src/cameras
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-07-13 16:07:56 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-07-13 16:07:56 +0200
commit0e538d602504ee2aef7a707bb36f4765b220a654 (patch)
tree9523cd6e37beccae89e15511db72ac49feee2ea8 /src/cameras
parenteb26267fd5acaad3a8b89d72320267a93b4003aa (diff)
downloaduca-0e538d602504ee2aef7a707bb36f4765b220a654.tar.gz
uca-0e538d602504ee2aef7a707bb36f4765b220a654.tar.bz2
uca-0e538d602504ee2aef7a707bb36f4765b220a654.tar.xz
uca-0e538d602504ee2aef7a707bb36f4765b220a654.zip
Read number of bits from camera
Diffstat (limited to 'src/cameras')
-rw-r--r--src/cameras/uca-ufo-camera.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/cameras/uca-ufo-camera.c b/src/cameras/uca-ufo-camera.c
index 269da9d..6c8872e 100644
--- a/src/cameras/uca-ufo-camera.c
+++ b/src/cameras/uca-ufo-camera.c
@@ -294,7 +294,17 @@ static void uca_ufo_camera_set_property(GObject *object, guint property_id, cons
}
}
-static void uca_ufo_camera_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
+static guint
+read_register_value (UcaUfoCameraPrivate *priv, const gchar *name)
+{
+ pcilib_register_value_t reg_value;
+
+ pcilib_read_register(priv->handle, NULL, name, &reg_value);
+ return (guint) reg_value;
+}
+
+static void
+uca_ufo_camera_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
{
UcaUfoCameraPrivate *priv = UCA_UFO_CAMERA_GET_PRIVATE(object);
@@ -306,7 +316,7 @@ static void uca_ufo_camera_get_property(GObject *object, guint property_id, GVal
g_value_set_uint(value, SENSOR_HEIGHT);
break;
case PROP_SENSOR_BITDEPTH:
- g_value_set_uint(value, 10);
+ g_value_set_uint(value, read_register_value (priv, "bit_mode"));
break;
case PROP_SENSOR_HORIZONTAL_BINNING:
g_value_set_uint(value, 1);
@@ -318,11 +328,7 @@ static void uca_ufo_camera_get_property(GObject *object, guint property_id, GVal
g_value_set_float(value, 340.0);
break;
case PROP_EXPOSURE_TIME:
- {
- pcilib_register_value_t reg_value;
- pcilib_read_register(priv->handle, NULL, "exp_time", &reg_value);
- g_value_set_double(value, reg_value / EXPOSURE_TIME_SCALE);
- }
+ g_value_set_double (value, read_register_value (priv, "exp_time") / EXPOSURE_TIME_SCALE);
break;
case PROP_HAS_STREAMING:
g_value_set_boolean(value, TRUE);