diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2015-03-31 12:02:11 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2015-03-31 12:02:11 +0200 |
commit | 1217923dbc0b907410642f611fdb5b13236cf850 (patch) | |
tree | 351ed1f7305b77a479e87c6f214416a81937aaea /plugins | |
parent | 67f433437efdfd7fa7a087603f38663574ea9146 (diff) | |
download | uca-1217923dbc0b907410642f611fdb5b13236cf850.tar.gz uca-1217923dbc0b907410642f611fdb5b13236cf850.tar.bz2 uca-1217923dbc0b907410642f611fdb5b13236cf850.tar.xz uca-1217923dbc0b907410642f611fdb5b13236cf850.zip |
Switch to trigger source/type semantics
This change makes the naming more consistent but will break client and plugin
code. The main idea is to specify a trigger source (AUTO being a virtual source)
which denotes how causes a trigger and a trigger type which denotes when
triggering happens (edge or level).
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/pco/uca-pco-camera.c | 22 | ||||
-rw-r--r-- | plugins/ufo/uca-ufo-camera.c | 16 |
2 files changed, 19 insertions, 19 deletions
diff --git a/plugins/pco/uca-pco-camera.c b/plugins/pco/uca-pco-camera.c index 2942ce9..4972b2c 100644 --- a/plugins/pco/uca-pco-camera.c +++ b/plugins/pco/uca-pco-camera.c @@ -154,7 +154,7 @@ static gint base_overrideables[] = { PROP_SENSOR_VERTICAL_BINNINGS, PROP_EXPOSURE_TIME, PROP_FRAMES_PER_SECOND, - PROP_TRIGGER_MODE, + PROP_TRIGGER_SOURCE, PROP_ROI_X, PROP_ROI_Y, PROP_ROI_WIDTH, @@ -913,18 +913,18 @@ uca_pco_camera_set_property(GObject *object, guint property_id, const GValue *va } break; - case PROP_TRIGGER_MODE: + case PROP_TRIGGER_SOURCE: { - UcaCameraTrigger trigger_mode = (UcaCameraTrigger) g_value_get_enum(value); + UcaCameraTriggerSource trigger_source = g_value_get_enum (value); - switch (trigger_mode) { - case UCA_CAMERA_TRIGGER_AUTO: + switch (trigger_source) { + case UCA_CAMERA_TRIGGER_SOURCE_AUTO: err = pco_set_trigger_mode(priv->pco, TRIGGER_MODE_AUTOTRIGGER); break; - case UCA_CAMERA_TRIGGER_SOFTWARE: + case UCA_CAMERA_TRIGGER_SOURCE_SOFTWARE: err = pco_set_trigger_mode(priv->pco, TRIGGER_MODE_SOFTWARETRIGGER); break; - case UCA_CAMERA_TRIGGER_EXTERNAL: + case UCA_CAMERA_TRIGGER_SOURCE_EXTERNAL: err = pco_set_trigger_mode(priv->pco, TRIGGER_MODE_EXTERNALTRIGGER); break; } @@ -1240,20 +1240,20 @@ uca_pco_camera_get_property (GObject *object, guint property_id, GValue *value, } break; - case PROP_TRIGGER_MODE: + case PROP_TRIGGER_SOURCE: { guint16 mode; err = pco_get_trigger_mode(priv->pco, &mode); switch (mode) { case TRIGGER_MODE_AUTOTRIGGER: - g_value_set_enum(value, UCA_CAMERA_TRIGGER_AUTO); + g_value_set_enum(value, UCA_CAMERA_TRIGGER_SOURCE_AUTO); break; case TRIGGER_MODE_SOFTWARETRIGGER: - g_value_set_enum(value, UCA_CAMERA_TRIGGER_SOFTWARE); + g_value_set_enum(value, UCA_CAMERA_TRIGGER_SOURCE_SOFTWARE); break; case TRIGGER_MODE_EXTERNALTRIGGER: - g_value_set_enum(value, UCA_CAMERA_TRIGGER_EXTERNAL); + g_value_set_enum(value, UCA_CAMERA_TRIGGER_SOURCE_EXTERNAL); break; default: g_warning("pco trigger mode not handled"); diff --git a/plugins/ufo/uca-ufo-camera.c b/plugins/ufo/uca-ufo-camera.c index 99a8c2f..1c0fd35 100644 --- a/plugins/ufo/uca-ufo-camera.c +++ b/plugins/ufo/uca-ufo-camera.c @@ -284,7 +284,7 @@ set_control_bit (UcaUfoCameraPrivate *priv, guint bit, gboolean set) else flags = flags & ~mask; - err = pcilib_write_register(priv->handle, NULL, name, flags); + err = pcilib_write_register (priv->handle, NULL, name, flags); PCILIB_WARN_ON_ERROR (err); } @@ -314,7 +314,7 @@ static void uca_ufo_camera_start_recording(UcaCamera *camera, GError **error) { UcaUfoCameraPrivate *priv; - UcaCameraTrigger trigger; + UcaCameraTriggerSource trigger_source; gdouble exposure_time; gboolean transfer_async; @@ -325,11 +325,11 @@ uca_ufo_camera_start_recording(UcaCamera *camera, GError **error) g_object_get (G_OBJECT(camera), "transfer-asynchronously", &transfer_async, "exposure-time", &exposure_time, - "trigger-mode", &trigger, + "trigger-source", &trigger_source, NULL); - set_external_trigger_bit (priv, trigger == UCA_CAMERA_TRIGGER_EXTERNAL); - set_streaming_bit (priv, trigger == UCA_CAMERA_TRIGGER_AUTO); + set_external_trigger_bit (priv, trigger == UCA_CAMERA_TRIGGER_SOURCE_EXTERNAL); + set_streaming_bit (priv, trigger_mode == UCA_CAMERA_TRIGGER_SOURCE_AUTO); priv->timeout = ((pcilib_timeout_t) (exposure_time * 1000 + 50.0) * 1000); @@ -341,13 +341,13 @@ static void uca_ufo_camera_stop_recording(UcaCamera *camera, GError **error) { UcaUfoCameraPrivate *priv; - UcaCameraTrigger trigger; + UcaCameraTriggerSource trigger_source; g_return_if_fail(UCA_IS_UFO_CAMERA(camera)); priv = UCA_UFO_CAMERA_GET_PRIVATE(camera); set_external_trigger_bit (priv, FALSE); - g_object_get (G_OBJECT (camera), "trigger-mode", &trigger, NULL); + g_object_get (G_OBJECT (camera), "trigger-source", &trigger_source, NULL); if (priv->async_thread) { int err = pcilib_stop(priv->handle, PCILIB_EVENT_FLAG_STOP_ONLY); @@ -356,7 +356,7 @@ uca_ufo_camera_stop_recording(UcaCamera *camera, GError **error) priv->async_thread = NULL; } - set_streaming_bit (priv, trigger != UCA_CAMERA_TRIGGER_AUTO); + set_streaming_bit (priv, trigger_mode != UCA_CAMERA_TRIGGER_SOURCE_AUTO); } static void |