diff options
author | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2012-04-27 10:23:00 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2012-04-27 10:23:00 +0200 |
commit | a602804ee7363cecef07b5ee64f73ef790704f0d (patch) | |
tree | f9c6cc96233778eaac6105c20bf2e5c02d8aa422 /src/cameras/uca-pco-camera.c | |
parent | b37cf7c689193940830b3e01f45771c97f9e5729 (diff) | |
download | libuca-a602804ee7363cecef07b5ee64f73ef790704f0d.tar.gz libuca-a602804ee7363cecef07b5ee64f73ef790704f0d.tar.bz2 libuca-a602804ee7363cecef07b5ee64f73ef790704f0d.tar.xz libuca-a602804ee7363cecef07b5ee64f73ef790704f0d.zip |
pco: read/write number of ADCs
Diffstat (limited to 'src/cameras/uca-pco-camera.c')
-rw-r--r-- | src/cameras/uca-pco-camera.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/cameras/uca-pco-camera.c b/src/cameras/uca-pco-camera.c index 2ea31fd..76ccb27 100644 --- a/src/cameras/uca-pco-camera.c +++ b/src/cameras/uca-pco-camera.c @@ -72,6 +72,7 @@ GQuark uca_pco_camera_error_quark() enum { PROP_NAME = N_BASE_PROPERTIES, PROP_SENSOR_TEMPERATURE, + PROP_SENSOR_ADCS, PROP_DELAY_TIME, PROP_COOLING_POINT, N_PROPERTIES @@ -455,7 +456,7 @@ static void uca_pco_camera_set_property(GObject *object, guint property_id, cons switch (property_id) { case PROP_EXPOSURE_TIME: { - gdouble time = g_value_get_double(value); + const gdouble time = g_value_get_double(value); if (priv->exposure_timebase == TIMEBASE_INVALID) read_timebase(priv); @@ -484,7 +485,7 @@ static void uca_pco_camera_set_property(GObject *object, guint property_id, cons case PROP_DELAY_TIME: { - gdouble time = g_value_get_double(value); + const gdouble time = g_value_get_double(value); if (priv->delay_timebase == TIMEBASE_INVALID) read_timebase(priv); @@ -511,6 +512,13 @@ static void uca_pco_camera_set_property(GObject *object, guint property_id, cons } break; + case PROP_SENSOR_ADCS: + { + const guint num_adcs = g_value_get_uint(value); + pco_set_adc_mode(priv->pco, num_adcs); + } + break; + case PROP_COOLING_POINT: { int16_t temperature = (int16_t) g_value_get_int(value); @@ -597,6 +605,18 @@ static void uca_pco_camera_get_property(GObject *object, guint property_id, GVal } break; + case PROP_SENSOR_ADCS: + { + /* + * Up to now, the ADC mode corresponds directly to the number of + * ADCs in use. + */ + pco_adc_mode mode; + pco_get_adc_mode(priv->pco, &mode); + g_value_set_uint(value, mode); + } + break; + case PROP_EXPOSURE_TIME: { uint32_t exposure_time; @@ -757,6 +777,13 @@ static void uca_pco_camera_class_init(UcaPcoCameraClass *klass) "Temperature of the sensor in degree Celsius", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READABLE); + + pco_properties[PROP_SENSOR_ADCS] = + g_param_spec_uint("sensor-adcs", + "Number of ADCs to use", + "Number of ADCs to use", + 1, 2, 1, + G_PARAM_READWRITE); pco_properties[PROP_DELAY_TIME] = g_param_spec_double("delay-time", |