diff options
author | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2012-07-13 16:07:56 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2012-07-13 16:07:56 +0200 |
commit | 0e538d602504ee2aef7a707bb36f4765b220a654 (patch) | |
tree | 9523cd6e37beccae89e15511db72ac49feee2ea8 /src/cameras/uca-ufo-camera.c | |
parent | eb26267fd5acaad3a8b89d72320267a93b4003aa (diff) | |
download | uca-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/uca-ufo-camera.c')
-rw-r--r-- | src/cameras/uca-ufo-camera.c | 20 |
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, ®_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", ®_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); |