From fb8cd3a6a49f7591cc504c0a78035ac1ef4467d8 Mon Sep 17 00:00:00 2001 From: Mihael Koep Date: Tue, 29 Jul 2014 13:19:50 +0200 Subject: Minor reformatting in pylon plugin build script --- plugins/pylon/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/pylon/CMakeLists.txt b/plugins/pylon/CMakeLists.txt index 5864b84..1265e8c 100644 --- a/plugins/pylon/CMakeLists.txt +++ b/plugins/pylon/CMakeLists.txt @@ -30,9 +30,7 @@ if (PYLON_FOUND) uca-pylon-camera.c uca-pylon-enums.c) - target_link_libraries(ucapylon - ${UCA_DEPS} - ${LIBPYLONCAM_LIBRARIES}) + target_link_libraries(ucapylon ${UCA_DEPS} ${LIBPYLONCAM_LIBRARIES}) install(TARGETS ucapylon LIBRARY DESTINATION ${UCA_PLUGINDIR} -- cgit v1.2.3 From 6f73f9daa1f9d1ac6054dec6e06b93e040a011f2 Mon Sep 17 00:00:00 2001 From: Mihael Koep Date: Thu, 31 Jul 2014 16:09:17 +0200 Subject: Update pylon-plugin to libpyloncam 0.4 --- plugins/pylon/CMakeLists.txt | 4 ++-- plugins/pylon/changelog.txt | 3 +++ plugins/pylon/uca-pylon-camera.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/pylon/CMakeLists.txt b/plugins/pylon/CMakeLists.txt index 1265e8c..02f65c9 100644 --- a/plugins/pylon/CMakeLists.txt +++ b/plugins/pylon/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 2.6) project(ucapylon C) -set(VERSION "1.1.1") +set(VERSION "1.2.0") find_package(Pylon) @@ -11,7 +11,7 @@ if (PYLON_FOUND) set(PLUGIN_SUMMARY "Pylon plugin for libuca") set(PLUGIN_CHANGELOG "${CMAKE_CURRENT_SOURCE_DIR}/changelog.txt") set(PLUGIN_DESCRIPTION "Plugin for the Basler GigE CCD Camera.") - set(PLUGIN_REQUIRES "libuca >= 1.3.0, libpyloncam >= 0.3.0") + set(PLUGIN_REQUIRES "libuca >= 1.3.0, libpyloncam >= 0.4.0") set(PLUGIN_VENDOR "ANKA Computing Group") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../package-plugin.sh.in diff --git a/plugins/pylon/changelog.txt b/plugins/pylon/changelog.txt index adfa95b..5a004cf 100644 --- a/plugins/pylon/changelog.txt +++ b/plugins/pylon/changelog.txt @@ -1,3 +1,6 @@ +* Thu Jul 31 2014 Mihael Koep 1.2.0-1 +- require libpyloncam 0.4.0 +- update to modified libpyloncam API * Wed Apr 9 2014 Mihael Koep 1.1.1-1 - remove unneeded memory allocation - require libpyloncam 0.3.0 diff --git a/plugins/pylon/uca-pylon-camera.c b/plugins/pylon/uca-pylon-camera.c index 134dda3..bac9684 100644 --- a/plugins/pylon/uca-pylon-camera.c +++ b/plugins/pylon/uca-pylon-camera.c @@ -364,7 +364,7 @@ static gboolean uca_pylon_camera_initable_init(GInitable *initable, GCancellable g_error("no environment variable PYLON_CAMERA_IP found"); } - pylon_camera_new("/usr/local/lib64", pylon_camera_ip, error); + pylon_camera_new(pylon_camera_ip, error); if (*error != NULL) { return FALSE; } -- cgit v1.2.3 From 8e98707648406e2c7a6831c2f3366a2c34eba617 Mon Sep 17 00:00:00 2001 From: Mihael Koep Date: Thu, 11 Sep 2014 11:39:11 +0200 Subject: Improve robustness of roi setting for pylon plugin --- plugins/pylon/CMakeLists.txt | 2 +- plugins/pylon/changelog.txt | 2 + plugins/pylon/uca-pylon-camera.c | 115 +++++++++++++++++++-------------------- 3 files changed, 60 insertions(+), 59 deletions(-) (limited to 'plugins') diff --git a/plugins/pylon/CMakeLists.txt b/plugins/pylon/CMakeLists.txt index 02f65c9..7ae3288 100644 --- a/plugins/pylon/CMakeLists.txt +++ b/plugins/pylon/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 2.6) project(ucapylon C) -set(VERSION "1.2.0") +set(VERSION "1.2.1") find_package(Pylon) diff --git a/plugins/pylon/changelog.txt b/plugins/pylon/changelog.txt index 5a004cf..9e1584c 100644 --- a/plugins/pylon/changelog.txt +++ b/plugins/pylon/changelog.txt @@ -1,3 +1,5 @@ +* Thu Sep 11 2014 Mihael Koep 1.2.1-1 +- improve robustness of roi setting * Thu Jul 31 2014 Mihael Koep 1.2.0-1 - require libpyloncam 0.4.0 - update to modified libpyloncam API diff --git a/plugins/pylon/uca-pylon-camera.c b/plugins/pylon/uca-pylon-camera.c index bac9684..1c3a759 100644 --- a/plugins/pylon/uca-pylon-camera.c +++ b/plugins/pylon/uca-pylon-camera.c @@ -89,8 +89,10 @@ struct _UcaPylonCameraPrivate { guint width; guint height; - guint16 roi_x, roi_y; - guint16 roi_width, roi_height; + guint16 roi_x; + guint16 roi_y; + guint16 roi_width; + guint16 roi_height; GValueArray *binnings; }; @@ -136,65 +138,62 @@ static void uca_pylon_camera_set_property(GObject *object, guint property_id, co GError* error = NULL; switch (property_id) { - case PROP_SENSOR_HORIZONTAL_BINNING: - /* intentional fall-through*/ - case PROP_SENSOR_VERTICAL_BINNING: - /* intentional fall-through*/ - case PROP_TRIGGER_MODE: - break; - case PROP_BALANCE_WHITE_AUTO: - { - pylon_camera_set_int_attribute("BalanceWhiteAuto", g_value_get_enum(value), &error); - } - break; - - case PROP_ROI_X: - { - priv->roi_x = g_value_get_uint(value); - pylon_set_roi(object, &error); - } - break; - - case PROP_ROI_Y: - { - priv->roi_y = g_value_get_uint(value); - pylon_set_roi(object, &error); - } - break; - - case PROP_ROI_WIDTH: - { - priv->roi_width = g_value_get_uint(value); - pylon_set_roi(object, &error); - } - break; - - case PROP_ROI_HEIGHT: - { - priv->roi_height = g_value_get_uint(value); - pylon_set_roi(object, &error); - } - break; - - case PROP_EXPOSURE_TIME: - pylon_camera_set_exposure_time(g_value_get_double(value), &error); - break; - - case PROP_GAIN: - pylon_camera_set_gain(g_value_get_int(value), &error); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); - return; + case PROP_SENSOR_HORIZONTAL_BINNING: + /* intentional fall-through*/ + case PROP_SENSOR_VERTICAL_BINNING: + /* intentional fall-through*/ + case PROP_TRIGGER_MODE: + break; + case PROP_BALANCE_WHITE_AUTO: + { + pylon_camera_set_int_attribute("BalanceWhiteAuto", g_value_get_enum(value), &error); + break; + } + case PROP_ROI_X: + { + priv->roi_x = g_value_get_uint(value); + gint max_roi_width = priv->width - priv->roi_x; + priv->roi_width = MIN(priv->roi_width, max_roi_width); + pylon_set_roi(object, &error); + break; + } + case PROP_ROI_Y: + { + priv->roi_y = g_value_get_uint(value); + gint max_roi_height = priv->height - priv->roi_y; + priv->roi_height = MIN(priv->roi_height, max_roi_height); + pylon_set_roi(object, &error); + break; + } + case PROP_ROI_WIDTH: + { + priv->roi_width = g_value_get_uint(value); + pylon_set_roi(object, &error); + break; + } + case PROP_ROI_HEIGHT: + { + priv->roi_height = g_value_get_uint(value); + pylon_set_roi(object, &error); + break; + } + case PROP_EXPOSURE_TIME: + pylon_camera_set_exposure_time(g_value_get_double(value), &error); + break; + case PROP_GAIN: + pylon_camera_set_gain(g_value_get_int(value), &error); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); + return; } if (error) { - if(error->message) { - g_warning("failed to set property %d: %s", property_id, error->message); - } else { - g_warning("failed to set property %d", property_id); - } + if (error->message) { + g_warning("failed to set property %d: %s", property_id, error->message); + } else { + g_warning("failed to set property %d", property_id); + } } } -- cgit v1.2.3 From f2394f593a552f1c3d29ce894b5cd28914b884b7 Mon Sep 17 00:00:00 2001 From: Mihael Koep Date: Tue, 7 Oct 2014 12:22:52 +0200 Subject: Implement auto exposure property for pylon plugin Conflicts: plugins/pylon/CMakeLists.txt plugins/pylon/changelog.txt plugins/pylon/uca-pylon-camera.c --- plugins/pylon/CMakeLists.txt | 4 ++-- plugins/pylon/changelog.txt | 2 ++ plugins/pylon/uca-pylon-camera.c | 14 ++++++++++++++ plugins/pylon/uca-pylon-camera.h | 6 ++++++ 4 files changed, 24 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/pylon/CMakeLists.txt b/plugins/pylon/CMakeLists.txt index 7ae3288..69f668d 100644 --- a/plugins/pylon/CMakeLists.txt +++ b/plugins/pylon/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 2.6) project(ucapylon C) -set(VERSION "1.2.1") +set(VERSION "1.3.0") find_package(Pylon) @@ -11,7 +11,7 @@ if (PYLON_FOUND) set(PLUGIN_SUMMARY "Pylon plugin for libuca") set(PLUGIN_CHANGELOG "${CMAKE_CURRENT_SOURCE_DIR}/changelog.txt") set(PLUGIN_DESCRIPTION "Plugin for the Basler GigE CCD Camera.") - set(PLUGIN_REQUIRES "libuca >= 1.3.0, libpyloncam >= 0.4.0") + set(PLUGIN_REQUIRES "libuca >= 1.3.0, libpyloncam >= 0.5.0") set(PLUGIN_VENDOR "ANKA Computing Group") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../package-plugin.sh.in diff --git a/plugins/pylon/changelog.txt b/plugins/pylon/changelog.txt index 9e1584c..7ce5fa8 100644 --- a/plugins/pylon/changelog.txt +++ b/plugins/pylon/changelog.txt @@ -1,3 +1,5 @@ +* Tue Oct 7 2014 Mihael Koep 1.3.0-1 +- require libpyloncam 0.5.0 because of new auto exposure feature * Thu Sep 11 2014 Mihael Koep 1.2.1-1 - improve robustness of roi setting * Thu Jul 31 2014 Mihael Koep 1.2.0-1 diff --git a/plugins/pylon/uca-pylon-camera.c b/plugins/pylon/uca-pylon-camera.c index 1c3a759..f8c284a 100644 --- a/plugins/pylon/uca-pylon-camera.c +++ b/plugins/pylon/uca-pylon-camera.c @@ -55,6 +55,7 @@ enum { PROP_ROI_HEIGHT_DEFAULT, PROP_GAIN, PROP_BALANCE_WHITE_AUTO, + PROP_EXPOSURE_AUTO, N_PROPERTIES }; @@ -149,6 +150,11 @@ static void uca_pylon_camera_set_property(GObject *object, guint property_id, co pylon_camera_set_int_attribute("BalanceWhiteAuto", g_value_get_enum(value), &error); break; } + case PROP_EXPOSURE_AUTO: + { + pylon_camera_set_int_attribute("ExposureAuto", g_value_get_enum(value), &error); + break; + } case PROP_ROI_X: { priv->roi_x = g_value_get_uint(value); @@ -211,6 +217,14 @@ static void uca_pylon_camera_get_property(GObject *object, guint property_id, GV g_value_set_enum(value, mode); break; } + case PROP_EXPOSURE_AUTO: + { + gint enum_value = UCA_CAMERA_EXPOSURE_AUTO_OFF; + pylon_camera_get_int_attribute("ExposureAuto", &enum_value, &error); + UcaCameraExposureAuto mode = enum_value; + g_value_set_enum(value, mode); + break; + } case PROP_SENSOR_WIDTH: pylon_camera_get_sensor_size(&priv->width, &priv->height, &error); g_value_set_uint(value, priv->width); diff --git a/plugins/pylon/uca-pylon-camera.h b/plugins/pylon/uca-pylon-camera.h index f3d7bb5..621c8da 100644 --- a/plugins/pylon/uca-pylon-camera.h +++ b/plugins/pylon/uca-pylon-camera.h @@ -43,6 +43,12 @@ typedef enum { UCA_CAMERA_BALANCE_WHITE_CONTINUOUSLY } UcaCameraBalanceWhiteAuto; +typedef enum { + UCA_CAMERA_EXPOSURE_AUTO_OFF, + UCA_CAMERA_EXPOSURE_AUTO_ONCE, + UCA_CAMERA_EXPOSURE_AUTO_CONTINUOUSLY +} UcaCameraExposureAuto; + typedef struct _UcaPylonCamera UcaPylonCamera; typedef struct _UcaPylonCameraClass UcaPylonCameraClass; typedef struct _UcaPylonCameraPrivate UcaPylonCameraPrivate; -- cgit v1.2.3 From efb97e000e66125453f3f07caa74b324a3205a4a Mon Sep 17 00:00:00 2001 From: Mihael Koep Date: Tue, 7 Oct 2014 13:20:41 +0200 Subject: Add missing property specification for exposure-auto --- plugins/pylon/uca-pylon-camera.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins') diff --git a/plugins/pylon/uca-pylon-camera.c b/plugins/pylon/uca-pylon-camera.c index f8c284a..4420d58 100644 --- a/plugins/pylon/uca-pylon-camera.c +++ b/plugins/pylon/uca-pylon-camera.c @@ -443,6 +443,12 @@ static void uca_pylon_camera_class_init(UcaPylonCameraClass *klass) "White balance mode (0: Off, 1: Once, 2: Continuous)", UCA_TYPE_CAMERA_BALANCE_WHITE_AUTO, UCA_CAMERA_BALANCE_WHITE_OFF, G_PARAM_READWRITE); + pylon_properties[PROP_EXPOSURE_AUTO] = + g_param_spec_enum("exposure-auto", + "Exposure Auto mode", + "Exposure auto mode (0: Off, 1: Once, 2: Continuous)", + UCA_TYPE_CAMERA_EXPOSURE_AUTO, UCA_CAMERA_EXPOSURE_AUTO_OFF, + G_PARAM_READWRITE); for (guint id = N_BASE_PROPERTIES; id < N_PROPERTIES; id++) g_object_class_install_property(gobject_class, id, pylon_properties[id]); -- cgit v1.2.3