summaryrefslogtreecommitdiffstats
path: root/src/cameras/uca-pco-camera.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-05-29 14:35:58 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-05-29 14:35:58 +0200
commitdad66ab92335f3d7ef7b7c5184b29b6abbde9cda (patch)
treed4b9ffa5bc2bcbfaa6aa4bb30522229e44dbec97 /src/cameras/uca-pco-camera.c
parentbfaf9c9bf082974876be0562792b80706f916701 (diff)
downloaduca-dad66ab92335f3d7ef7b7c5184b29b6abbde9cda.tar.gz
uca-dad66ab92335f3d7ef7b7c5184b29b6abbde9cda.tar.bz2
uca-dad66ab92335f3d7ef7b7c5184b29b6abbde9cda.tar.xz
uca-dad66ab92335f3d7ef7b7c5184b29b6abbde9cda.zip
Allow zero delay time
Diffstat (limited to 'src/cameras/uca-pco-camera.c')
-rw-r--r--src/cameras/uca-pco-camera.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/cameras/uca-pco-camera.c b/src/cameras/uca-pco-camera.c
index c168c01..c4fa4a1 100644
--- a/src/cameras/uca-pco-camera.c
+++ b/src/cameras/uca-pco-camera.c
@@ -560,13 +560,13 @@ static void uca_pco_camera_set_property(GObject *object, guint property_id, cons
if (suitable_timebase != priv->exposure_timebase) {
priv->exposure_timebase = suitable_timebase;
if (pco_set_timebase(priv->pco, priv->delay_timebase, suitable_timebase) != PCO_NOERROR)
- g_warning("Could not set timebase via libpco");
+ g_warning("Cannot set exposure time base");
}
gdouble timebase = convert_timebase(suitable_timebase);
guint32 timesteps = time / timebase;
if (pco_set_exposure_time(priv->pco, timesteps) != PCO_NOERROR)
- g_warning("Could not set exposure time via libpco");
+ g_warning("Cannot set exposure time");
}
}
break;
@@ -585,17 +585,29 @@ static void uca_pco_camera_set_property(GObject *object, guint property_id, cons
guint16 suitable_timebase = get_suitable_timebase(time);
if (suitable_timebase == TIMEBASE_INVALID) {
- g_warning("Cannot set such a small exposure time");
+ if (time == 0.0) {
+ /*
+ * If we want to suppress any pre-exposure delays, we
+ * can set the 0 seconds in whatever time base that is
+ * currently active.
+ */
+ if (pco_set_delay_time(priv->pco, 0) != PCO_NOERROR)
+ g_warning("Cannot set zero delay time");
+ }
+ else
+ g_warning("Cannot set such a small exposure time");
}
else {
if (suitable_timebase != priv->delay_timebase) {
priv->delay_timebase = suitable_timebase;
- pco_set_timebase(priv->pco, suitable_timebase, priv->exposure_timebase);
+ if (pco_set_timebase(priv->pco, suitable_timebase, priv->exposure_timebase) != PCO_NOERROR)
+ g_warning("Cannot set delay time base");
}
gdouble timebase = convert_timebase(suitable_timebase);
guint32 timesteps = time / timebase;
- pco_set_delay_time(priv->pco, timesteps);
+ if (pco_set_delay_time(priv->pco, timesteps) != PCO_NOERROR)
+ g_warning("Cannot set delay time");
}
}
break;