[aravis] camera: revert trigger source to string parameter.
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aravis] camera: revert trigger source to string parameter.
- Date: Wed, 19 May 2010 20:35:44 +0000 (UTC)
commit 09e9afd4559e47e1117b071cf521aa0bbe912571
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Wed May 19 22:35:03 2010 +0200
camera: revert trigger source to string parameter.
src/arvcamera.c | 13 +++++--------
src/arvcamera.h | 2 +-
src/arvcameratest.c | 2 +-
src/arvenums.c | 19 -------------------
src/arvenums.h | 9 ---------
test/arv-camera-test.js | 1 +
6 files changed, 8 insertions(+), 38 deletions(-)
---
diff --git a/src/arvcamera.c b/src/arvcamera.c
index 8611028..aeb95bc 100644
--- a/src/arvcamera.c
+++ b/src/arvcamera.c
@@ -226,13 +226,10 @@ arv_camera_set_fixed_frame_rate (ArvCamera *camera, double frame_rate)
}
void
-arv_camera_set_trigger (ArvCamera *camera, ArvTriggerSource source)
+arv_camera_set_trigger (ArvCamera *camera, const char *source)
{
- const char *string;
-
g_return_if_fail (ARV_IS_CAMERA (camera));
-
- string = arv_trigger_source_to_string (source);
+ g_return_if_fail (source != NULL);
switch (camera->priv->vendor) {
case ARV_CAMERA_VENDOR_BASLER:
@@ -243,7 +240,7 @@ arv_camera_set_trigger (ArvCamera *camera, ArvTriggerSource source)
arv_device_set_string_feature_value (camera->priv->device, "TriggerMode", "On");
arv_device_set_string_feature_value (camera->priv->device, "TriggerActivation",
"RisingEdge");
- arv_device_set_string_feature_value (camera->priv->device, "TriggerSource", string);
+ arv_device_set_string_feature_value (camera->priv->device, "TriggerSource", source);
break;
case ARV_CAMERA_VENDOR_PROSILICA:
arv_device_set_string_feature_value (camera->priv->device, "TriggerSelector",
@@ -253,7 +250,7 @@ arv_camera_set_trigger (ArvCamera *camera, ArvTriggerSource source)
arv_device_set_string_feature_value (camera->priv->device, "TriggerMode", "On");
arv_device_set_string_feature_value (camera->priv->device, "TriggerActivation",
"RisingEdge");
- arv_device_set_string_feature_value (camera->priv->device, "TriggerSource", string);
+ arv_device_set_string_feature_value (camera->priv->device, "TriggerSource", source);
break;
case ARV_CAMERA_VENDOR_UNKNOWN:
arv_device_set_string_feature_value (camera->priv->device, "TriggerSelector",
@@ -263,7 +260,7 @@ arv_camera_set_trigger (ArvCamera *camera, ArvTriggerSource source)
arv_device_set_string_feature_value (camera->priv->device, "TriggerMode", "On");
arv_device_set_string_feature_value (camera->priv->device, "TriggerActivation",
"RisingEdge");
- arv_device_set_string_feature_value (camera->priv->device, "TriggerSource", string);
+ arv_device_set_string_feature_value (camera->priv->device, "TriggerSource", source);
break;
}
}
diff --git a/src/arvcamera.h b/src/arvcamera.h
index c444e37..ec8b495 100644
--- a/src/arvcamera.h
+++ b/src/arvcamera.h
@@ -85,7 +85,7 @@ void arv_camera_set_acquisition_mode (ArvCamera *camera, ArvAcquisitionMode v
ArvAcquisitionMode arv_camera_get_acquisition_mode (ArvCamera *camera);
void arv_camera_set_fixed_frame_rate (ArvCamera *camera, double frame_rate);
-void arv_camera_set_trigger (ArvCamera *camera, ArvTriggerSource source);
+void arv_camera_set_trigger (ArvCamera *camera, const char *source);
void arv_camera_set_exposure_time (ArvCamera *camera, double exposure_time_us);
double arv_camera_get_exposure_time (ArvCamera *camera);
diff --git a/src/arvcameratest.c b/src/arvcameratest.c
index 43bf6d4..5f2db65 100644
--- a/src/arvcameratest.c
+++ b/src/arvcameratest.c
@@ -119,7 +119,7 @@ main (int argc, char **argv)
arv_camera_set_fixed_frame_rate (camera, arv_option_frequency);
if (arv_option_trigger != NULL)
- arv_camera_set_trigger (camera, arv_trigger_source_from_string (arv_option_trigger));
+ arv_camera_set_trigger (camera, arv_option_trigger);
arv_camera_start_acquisition (camera);
diff --git a/src/arvenums.c b/src/arvenums.c
index c8fb9c5..d607cc2 100644
--- a/src/arvenums.c
+++ b/src/arvenums.c
@@ -54,22 +54,3 @@ arv_acquisition_mode_from_string (const char *string)
return _from_string (string, arv_acquisition_mode_strings,
G_N_ELEMENTS (arv_acquisition_mode_strings));
}
-
-static const char *arv_trigger_source_strings[] = {
- "Line0",
- "Line1",
- "Line2"
-};
-
-const char *
-arv_trigger_source_to_string (ArvTriggerSource value)
-{
- return arv_trigger_source_strings[CLAMP (value, 0, ARV_TRIGGER_SOURCE_LINE_2)];
-}
-
-ArvTriggerSource
-arv_trigger_source_from_string (const char *string)
-{
- return _from_string (string, arv_trigger_source_strings,
- G_N_ELEMENTS (arv_trigger_source_strings));
-}
diff --git a/src/arvenums.h b/src/arvenums.h
index 2158f49..27e93b0 100644
--- a/src/arvenums.h
+++ b/src/arvenums.h
@@ -51,12 +51,6 @@ typedef enum {
} ArvAcquisitionMode;
typedef enum {
- ARV_TRIGGER_SOURCE_LINE_0,
- ARV_TRIGGER_SOURCE_LINE_1,
- ARV_TRIGGER_SOURCE_LINE_2
-} ArvTriggerSource;
-
-typedef enum {
ARV_PIXEL_FORMAT_MONO_8 = 0x01080001,
ARV_PIXEL_FORMAT_MONO_10 = 0x01100003,
ARV_PIXEL_FORMAT_MONO_12 = 0x01100005,
@@ -99,9 +93,6 @@ typedef enum {
const char * arv_acquisition_mode_to_string (ArvAcquisitionMode value);
ArvAcquisitionMode arv_acquisition_mode_from_string (const char *string);
-const char * arv_trigger_source_to_string (ArvTriggerSource value);
-ArvTriggerSource arv_trigger_source_from_string (const char *string);
-
G_END_DECLS
#endif
diff --git a/test/arv-camera-test.js b/test/arv-camera-test.js
index edb90ef..756c45e 100755
--- a/test/arv-camera-test.js
+++ b/test/arv-camera-test.js
@@ -29,6 +29,7 @@ let camera = Aravis.Camera.new ("Fake_1");
camera.set_region (0,0,128,128);
camera.set_pixel_format (Aravis.PixelFormat.MONO_8);
+camera.set_trigger ("Line1");
let [x,y,width,height] = camera.get_region ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]