summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2015-03-30 17:11:22 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2015-03-30 17:11:22 +0200
commit124c5be21330e82fe023956eea7ea5c2e5f04e3c (patch)
tree2c092c5f9eae20642a1cd214ddde7b18c02482ea /plugins
parentbf8ba2795bbf35f247c04656b2860d7ba4b9d660 (diff)
downloaduca-124c5be21330e82fe023956eea7ea5c2e5f04e3c.tar.gz
uca-124c5be21330e82fe023956eea7ea5c2e5f04e3c.tar.bz2
uca-124c5be21330e82fe023956eea7ea5c2e5f04e3c.tar.xz
uca-124c5be21330e82fe023956eea7ea5c2e5f04e3c.zip
Revert "ufo: fix readout timeouts ..."
This reverts commit 378770200967f6e5b10152c9b094b835b4216c92.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ufo/uca-ufo-camera.c51
1 files changed, 23 insertions, 28 deletions
diff --git a/plugins/ufo/uca-ufo-camera.c b/plugins/ufo/uca-ufo-camera.c
index 5c20517..53cb160 100644
--- a/plugins/ufo/uca-ufo-camera.c
+++ b/plugins/ufo/uca-ufo-camera.c
@@ -163,33 +163,6 @@ event_callback(pcilib_event_id_t event_id, pcilib_event_info_t *info, void *user
return PCILIB_STREAMING_CONTINUE;
}
-static gdouble
-total_readout_time (UcaUfoCamera *camera)
-{
- gdouble clock_period_ns;
- gdouble exposure_time;
- gdouble readout_time;
- gdouble overhead_time;
- guint output_mode;
- guint roi_height;
- guint num_outputs;
-
- g_object_get (G_OBJECT (camera),
- "exposure-time", &exposure_time,
- "ufo-cmosis-output-mode", &output_mode,
- "roi-height", &roi_height,
- NULL);
-
- num_outputs = camera->priv->n_bits == 10 ? 16 : 4; /* what about 11? */
- clock_period_ns = camera->priv->frequency == FPGA_40MHZ ? 1 / 40.0 * 1000 : 1 / 48.0 * 1000;
- exposure_time *= 1000 * 1000; /* convert to nanoseconds */
-
- readout_time = (129 * clock_period_ns * 16 / num_outputs) * roi_height;
- overhead_time = (7 /* reg73 */ + 2 * (16 / num_outputs)) * 129 * clock_period_ns;
-
- return exposure_time + (overhead_time + readout_time) / 1000 / 1000;
-}
-
static guint
update_properties (UcaUfoCameraPrivate *priv)
{
@@ -352,7 +325,7 @@ uca_ufo_camera_start_recording(UcaCamera *camera, GError **error)
set_streaming (priv, trigger == UCA_CAMERA_TRIGGER_AUTO);
- priv->timeout = (pcilib_timeout_t) (total_readout_time (UCA_UFO_CAMERA (camera)) * 1000 * 1000);
+ priv->timeout = ((pcilib_timeout_t) (exposure_time * 1000 + 50.0) * 1000);
if (transfer_async)
priv->async_thread = g_thread_create ((GThreadFunc) stream_async, camera, TRUE, error);
@@ -445,6 +418,28 @@ uca_ufo_camera_trigger (UcaCamera *camera, GError **error)
PCILIB_SET_ERROR (err, UCA_UFO_CAMERA_ERROR_TRIGGER);
}
+static gdouble
+total_readout_time (UcaUfoCamera *camera)
+{
+ gdouble clock_period, foo;
+ gdouble exposure_time, image_readout_time, overhead_time;
+ guint output_mode;
+ guint roi_height;
+
+ g_object_get (G_OBJECT (camera),
+ "exposure-time", &exposure_time,
+ "ufo-cmosis-output-mode", &output_mode,
+ "roi-height", &roi_height,
+ NULL);
+
+ clock_period = camera->priv->frequency == FPGA_40MHZ ? 1 / 40.0 : 1 / 48.0;
+ foo = pow (2, output_mode);
+ image_readout_time = (129 * clock_period * foo) * roi_height;
+ overhead_time = (10 /* reg73 */ + 2 * foo) * 129 * clock_period;
+
+ return exposure_time + (overhead_time + image_readout_time) / 1000 / 1000;
+}
+
static void
uca_ufo_camera_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
{